zxc_compress.c:rapidhash_withSeed:
  487|  1.39k|RAPIDHASH_INLINE_CONSTEXPR uint64_t rapidhash_withSeed(const void *key, size_t len, uint64_t seed) RAPIDHASH_NOEXCEPT {
  488|  1.39k|  return rapidhash_internal(key, len, seed, rapid_secret);
  489|  1.39k|}
zxc_compress.c:rapidhash_internal:
  244|  1.39k|RAPIDHASH_INLINE_CONSTEXPR uint64_t rapidhash_internal(const void *key, size_t len, uint64_t seed, const uint64_t* secret) RAPIDHASH_NOEXCEPT {
  245|  1.39k|  const uint8_t *p=(const uint8_t *)key;
  246|  1.39k|  seed ^= rapid_mix(seed ^ secret[2], secret[1]);
  247|  1.39k|  uint64_t a=0, b=0;
  248|  1.39k|  size_t i = len;
  249|  1.39k|  if (_likely_(len <= 16)) {
  ------------------
  |  |  107|  1.39k| # define _likely_(x)  __builtin_expect(x,1)
  |  |  ------------------
  |  |  |  Branch (107:24): [True: 93, False: 1.30k]
  |  |  ------------------
  ------------------
  250|     93|    if (len >= 4) {
  ------------------
  |  Branch (250:9): [True: 57, False: 36]
  ------------------
  251|     57|      seed ^= len;
  252|     57|      if (len >= 8) {
  ------------------
  |  Branch (252:11): [True: 52, False: 5]
  ------------------
  253|     52|        const uint8_t* plast = p + len - 8;
  254|     52|        a = rapid_read64(p);
  255|     52|        b = rapid_read64(plast);
  256|     52|      } else {
  257|      5|        const uint8_t* plast = p + len - 4;
  258|      5|        a = rapid_read32(p);
  259|      5|        b = rapid_read32(plast);
  260|      5|      }
  261|     57|    } else if (len > 0) {
  ------------------
  |  Branch (261:16): [True: 36, False: 0]
  ------------------
  262|     36|      a = (((uint64_t)p[0])<<45)|p[len-1];
  263|     36|      b = p[len>>1];
  264|     36|    } else
  265|      0|      a = b = 0;
  266|  1.30k|  } else {
  267|  1.30k|    if (len > 112) {
  ------------------
  |  Branch (267:9): [True: 1.03k, False: 269]
  ------------------
  268|  1.03k|      uint64_t see1 = seed, see2 = seed;
  269|  1.03k|      uint64_t see3 = seed, see4 = seed;
  270|  1.03k|      uint64_t see5 = seed, see6 = seed;
  271|  1.03k|#ifdef RAPIDHASH_COMPACT
  272|  1.09M|      do {
  273|  1.09M|        seed = rapid_mix(rapid_read64(p) ^ secret[0], rapid_read64(p + 8) ^ seed);
  274|  1.09M|        see1 = rapid_mix(rapid_read64(p + 16) ^ secret[1], rapid_read64(p + 24) ^ see1);
  275|  1.09M|        see2 = rapid_mix(rapid_read64(p + 32) ^ secret[2], rapid_read64(p + 40) ^ see2);
  276|  1.09M|        see3 = rapid_mix(rapid_read64(p + 48) ^ secret[3], rapid_read64(p + 56) ^ see3);
  277|  1.09M|        see4 = rapid_mix(rapid_read64(p + 64) ^ secret[4], rapid_read64(p + 72) ^ see4);
  278|  1.09M|        see5 = rapid_mix(rapid_read64(p + 80) ^ secret[5], rapid_read64(p + 88) ^ see5);
  279|  1.09M|        see6 = rapid_mix(rapid_read64(p + 96) ^ secret[6], rapid_read64(p + 104) ^ see6);
  280|  1.09M|        p += 112;
  281|  1.09M|        i -= 112;
  282|  1.09M|      } while(i > 112);
  ------------------
  |  Branch (282:15): [True: 1.08M, False: 1.03k]
  ------------------
  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|  1.03k|      seed ^= see1;
  315|  1.03k|      see2 ^= see3;
  316|  1.03k|      see4 ^= see5;
  317|  1.03k|      seed ^= see6;
  318|  1.03k|      see2 ^= see4;
  319|  1.03k|      seed ^= see2;
  320|  1.03k|    }
  321|  1.30k|    if (i > 16) {
  ------------------
  |  Branch (321:9): [True: 1.03k, False: 265]
  ------------------
  322|  1.03k|      seed = rapid_mix(rapid_read64(p) ^ secret[2], rapid_read64(p + 8) ^ seed);
  323|  1.03k|      if (i > 32) {
  ------------------
  |  Branch (323:11): [True: 796, False: 240]
  ------------------
  324|    796|          seed = rapid_mix(rapid_read64(p + 16) ^ secret[2], rapid_read64(p + 24) ^ seed);
  325|    796|          if (i > 48) {
  ------------------
  |  Branch (325:15): [True: 670, False: 126]
  ------------------
  326|    670|              seed = rapid_mix(rapid_read64(p + 32) ^ secret[1], rapid_read64(p + 40) ^ seed);
  327|    670|              if (i > 64) {
  ------------------
  |  Branch (327:19): [True: 490, False: 180]
  ------------------
  328|    490|                  seed = rapid_mix(rapid_read64(p + 48) ^ secret[1], rapid_read64(p + 56) ^ seed);
  329|    490|                  if (i > 80) {
  ------------------
  |  Branch (329:23): [True: 335, False: 155]
  ------------------
  330|    335|                      seed = rapid_mix(rapid_read64(p + 64) ^ secret[2], rapid_read64(p + 72) ^ seed);
  331|    335|                      if (i > 96) {
  ------------------
  |  Branch (331:27): [True: 138, False: 197]
  ------------------
  332|    138|                          seed = rapid_mix(rapid_read64(p + 80) ^ secret[1], rapid_read64(p + 88) ^ seed);
  333|    138|                      }
  334|    335|                  }
  335|    490|              }
  336|    670|          }
  337|    796|      }
  338|  1.03k|    }
  339|  1.30k|    a=rapid_read64(p+i-16) ^ i;  b=rapid_read64(p+i-8);
  340|  1.30k|  }
  341|  1.39k|  a ^= secret[1];
  342|  1.39k|  b ^= seed;
  343|  1.39k|  rapid_mum(&a, &b);
  344|  1.39k|  return rapid_mix(a ^ secret[7], b ^ secret[1] ^ i);
  345|  1.39k|}
zxc_compress.c:rapid_mix:
  209|  7.64M|  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|  15.2M| 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|     10| 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|  7.64M| RAPIDHASH_INLINE_CONSTEXPR void rapid_mum(uint64_t *A, uint64_t *B) RAPIDHASH_NOEXCEPT {
  158|  7.64M| #if defined(__SIZEOF_INT128__)
  159|  7.64M|   __uint128_t r=*A; r*=*B;
  160|       |   #ifdef RAPIDHASH_PROTECTED
  161|       |   *A^=(uint64_t)r; *B^=(uint64_t)(r>>64);
  162|       |   #else
  163|  7.64M|   *A=(uint64_t)r; *B=(uint64_t)(r>>64);
  164|  7.64M|   #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|  7.64M| }
zxc_decompress.c:rapidhash_withSeed:
  487|  1.39k|RAPIDHASH_INLINE_CONSTEXPR uint64_t rapidhash_withSeed(const void *key, size_t len, uint64_t seed) RAPIDHASH_NOEXCEPT {
  488|  1.39k|  return rapidhash_internal(key, len, seed, rapid_secret);
  489|  1.39k|}
zxc_decompress.c:rapidhash_internal:
  244|  1.39k|RAPIDHASH_INLINE_CONSTEXPR uint64_t rapidhash_internal(const void *key, size_t len, uint64_t seed, const uint64_t* secret) RAPIDHASH_NOEXCEPT {
  245|  1.39k|  const uint8_t *p=(const uint8_t *)key;
  246|  1.39k|  seed ^= rapid_mix(seed ^ secret[2], secret[1]);
  247|  1.39k|  uint64_t a=0, b=0;
  248|  1.39k|  size_t i = len;
  249|  1.39k|  if (_likely_(len <= 16)) {
  ------------------
  |  |  107|  1.39k| # define _likely_(x)  __builtin_expect(x,1)
  |  |  ------------------
  |  |  |  Branch (107:24): [True: 93, False: 1.30k]
  |  |  ------------------
  ------------------
  250|     93|    if (len >= 4) {
  ------------------
  |  Branch (250:9): [True: 57, False: 36]
  ------------------
  251|     57|      seed ^= len;
  252|     57|      if (len >= 8) {
  ------------------
  |  Branch (252:11): [True: 52, False: 5]
  ------------------
  253|     52|        const uint8_t* plast = p + len - 8;
  254|     52|        a = rapid_read64(p);
  255|     52|        b = rapid_read64(plast);
  256|     52|      } else {
  257|      5|        const uint8_t* plast = p + len - 4;
  258|      5|        a = rapid_read32(p);
  259|      5|        b = rapid_read32(plast);
  260|      5|      }
  261|     57|    } else if (len > 0) {
  ------------------
  |  Branch (261:16): [True: 36, False: 0]
  ------------------
  262|     36|      a = (((uint64_t)p[0])<<45)|p[len-1];
  263|     36|      b = p[len>>1];
  264|     36|    } else
  265|      0|      a = b = 0;
  266|  1.30k|  } else {
  267|  1.30k|    if (len > 112) {
  ------------------
  |  Branch (267:9): [True: 1.03k, False: 269]
  ------------------
  268|  1.03k|      uint64_t see1 = seed, see2 = seed;
  269|  1.03k|      uint64_t see3 = seed, see4 = seed;
  270|  1.03k|      uint64_t see5 = seed, see6 = seed;
  271|  1.03k|#ifdef RAPIDHASH_COMPACT
  272|  1.09M|      do {
  273|  1.09M|        seed = rapid_mix(rapid_read64(p) ^ secret[0], rapid_read64(p + 8) ^ seed);
  274|  1.09M|        see1 = rapid_mix(rapid_read64(p + 16) ^ secret[1], rapid_read64(p + 24) ^ see1);
  275|  1.09M|        see2 = rapid_mix(rapid_read64(p + 32) ^ secret[2], rapid_read64(p + 40) ^ see2);
  276|  1.09M|        see3 = rapid_mix(rapid_read64(p + 48) ^ secret[3], rapid_read64(p + 56) ^ see3);
  277|  1.09M|        see4 = rapid_mix(rapid_read64(p + 64) ^ secret[4], rapid_read64(p + 72) ^ see4);
  278|  1.09M|        see5 = rapid_mix(rapid_read64(p + 80) ^ secret[5], rapid_read64(p + 88) ^ see5);
  279|  1.09M|        see6 = rapid_mix(rapid_read64(p + 96) ^ secret[6], rapid_read64(p + 104) ^ see6);
  280|  1.09M|        p += 112;
  281|  1.09M|        i -= 112;
  282|  1.09M|      } while(i > 112);
  ------------------
  |  Branch (282:15): [True: 1.08M, False: 1.03k]
  ------------------
  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|  1.03k|      seed ^= see1;
  315|  1.03k|      see2 ^= see3;
  316|  1.03k|      see4 ^= see5;
  317|  1.03k|      seed ^= see6;
  318|  1.03k|      see2 ^= see4;
  319|  1.03k|      seed ^= see2;
  320|  1.03k|    }
  321|  1.30k|    if (i > 16) {
  ------------------
  |  Branch (321:9): [True: 1.03k, False: 265]
  ------------------
  322|  1.03k|      seed = rapid_mix(rapid_read64(p) ^ secret[2], rapid_read64(p + 8) ^ seed);
  323|  1.03k|      if (i > 32) {
  ------------------
  |  Branch (323:11): [True: 796, False: 240]
  ------------------
  324|    796|          seed = rapid_mix(rapid_read64(p + 16) ^ secret[2], rapid_read64(p + 24) ^ seed);
  325|    796|          if (i > 48) {
  ------------------
  |  Branch (325:15): [True: 670, False: 126]
  ------------------
  326|    670|              seed = rapid_mix(rapid_read64(p + 32) ^ secret[1], rapid_read64(p + 40) ^ seed);
  327|    670|              if (i > 64) {
  ------------------
  |  Branch (327:19): [True: 490, False: 180]
  ------------------
  328|    490|                  seed = rapid_mix(rapid_read64(p + 48) ^ secret[1], rapid_read64(p + 56) ^ seed);
  329|    490|                  if (i > 80) {
  ------------------
  |  Branch (329:23): [True: 335, False: 155]
  ------------------
  330|    335|                      seed = rapid_mix(rapid_read64(p + 64) ^ secret[2], rapid_read64(p + 72) ^ seed);
  331|    335|                      if (i > 96) {
  ------------------
  |  Branch (331:27): [True: 138, False: 197]
  ------------------
  332|    138|                          seed = rapid_mix(rapid_read64(p + 80) ^ secret[1], rapid_read64(p + 88) ^ seed);
  333|    138|                      }
  334|    335|                  }
  335|    490|              }
  336|    670|          }
  337|    796|      }
  338|  1.03k|    }
  339|  1.30k|    a=rapid_read64(p+i-16) ^ i;  b=rapid_read64(p+i-8);
  340|  1.30k|  }
  341|  1.39k|  a ^= secret[1];
  342|  1.39k|  b ^= seed;
  343|  1.39k|  rapid_mum(&a, &b);
  344|  1.39k|  return rapid_mix(a ^ secret[7], b ^ secret[1] ^ i);
  345|  1.39k|}
zxc_decompress.c:rapid_mix:
  209|  7.64M|  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|  15.2M| 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|     10| 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|  7.64M| RAPIDHASH_INLINE_CONSTEXPR void rapid_mum(uint64_t *A, uint64_t *B) RAPIDHASH_NOEXCEPT {
  158|  7.64M| #if defined(__SIZEOF_INT128__)
  159|  7.64M|   __uint128_t r=*A; r*=*B;
  160|       |   #ifdef RAPIDHASH_PROTECTED
  161|       |   *A^=(uint64_t)r; *B^=(uint64_t)(r>>64);
  162|       |   #else
  163|  7.64M|   *A=(uint64_t)r; *B=(uint64_t)(r>>64);
  164|  7.64M|   #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|  7.64M| }

zxc_cctx_init_in_workspace:
  243|  25.1k|                               const int defer_entropy_scratch) {
  244|  25.1k|    if (UNLIKELY(!ctx || !workspace || chunk_size == 0)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|   100k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 25.1k]
  |  |  |  Branch (154:42): [True: 0, False: 25.1k]
  |  |  |  Branch (154:42): [True: 0, False: 25.1k]
  |  |  |  Branch (154:42): [True: 0, False: 25.1k]
  |  |  ------------------
  ------------------
  245|       |
  246|  25.1k|    const zxc_cctx_layout_t layout =
  247|  25.1k|        compute_cctx_layout(chunk_size, mode, level, dict_size, defer_entropy_scratch);
  248|  25.1k|    if (UNLIKELY(workspace_size < layout.total)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  25.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 25.1k]
  |  |  ------------------
  ------------------
  249|       |
  250|  25.1k|    ZXC_MEMSET(ctx, 0, sizeof(zxc_cctx_t));
  ------------------
  |  |  175|  25.1k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  251|  25.1k|    ctx->checksum_enabled = checksum_enabled;
  252|  25.1k|    ctx->chunk_size = chunk_size;
  253|  25.1k|    const uint32_t offset_bits = zxc_log2_u32((uint32_t)chunk_size);
  254|  25.1k|    ctx->offset_bits = offset_bits;
  255|  25.1k|    ctx->offset_mask = (uint32_t)((1ULL << offset_bits) - 1);
  256|  25.1k|    ctx->max_epoch = (uint32_t)(1ULL << (32 - offset_bits));
  257|       |
  258|       |    // memory_block stays NULL on the static-init path so zxc_cctx_free does
  259|       |    // not try to free the caller's workspace.  Sub-buffer pointers carry the
  260|       |    // partition; ownership is implicit (the caller owns @p workspace).
  261|  25.1k|    uint8_t* const mem = (uint8_t*)workspace;
  262|       |
  263|       |    // Dictionary concat scratch (both modes); init owns dict_size now so callers
  264|       |    // no longer assign ctx->dict_size after init.
  265|  25.1k|    ctx->dict_size = dict_size;
  266|  25.1k|    if (dict_size > 0) {
  ------------------
  |  Branch (266:9): [True: 0, False: 25.1k]
  ------------------
  267|      0|        ctx->dict_buffer = mem + layout.off_dict;
  268|      0|        ctx->dict_buffer_cap = layout.sz_dict;
  269|      0|        ctx->dict_huf = (zxc_dict_huf_state_t*)(void*)(mem + layout.off_dict_huf);
  270|      0|    }
  271|       |
  272|  25.1k|    if (mode == 0) {
  ------------------
  |  Branch (272:9): [True: 15.6k, False: 9.47k]
  ------------------
  273|  15.6k|        ctx->work_buf = mem + layout.off_work;
  274|  15.6k|        ctx->work_buf_cap = chunk_size + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  361|  15.6k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|  15.6k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|  15.6k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|  15.6k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|  15.6k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|  15.6k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  15.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 */
  |  |  ------------------
  |  |  |  |  331|  15.6k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  275|  15.6k|        ctx->lit_buffer = mem + layout.off_lit_dctx;
  276|  15.6k|        ctx->lit_buffer_cap = chunk_size + ZXC_PAD_SIZE;
  ------------------
  |  |  331|  15.6k|#define ZXC_PAD_SIZE 32
  ------------------
  277|  15.6k|        if (layout.sz_pivco_dctx) {
  ------------------
  |  Branch (277:13): [True: 0, False: 15.6k]
  ------------------
  278|      0|            ctx->tok_buffer = mem + layout.off_tok_dctx;
  279|      0|            ctx->tok_buffer_cap = layout.sz_tok_dctx;
  280|      0|            ctx->pivco_scratch = mem + layout.off_pivco_dctx;
  281|      0|            ctx->pivco_scratch_cap = layout.sz_pivco_dctx;
  282|      0|        }
  283|  15.6k|        return ZXC_OK;
  284|  15.6k|    }
  285|       |
  286|  9.47k|    ctx->hash_table = (uint32_t*)(mem + layout.off_hash_pos);
  287|  9.47k|    ctx->hash_tags = mem + layout.off_hash_tags;
  288|  9.47k|    ctx->chain_table = (uint16_t*)(mem + layout.off_chain);
  289|  9.47k|    ctx->buf_sequences = (uint32_t*)(mem + layout.off_seq_union);
  290|  9.47k|    ctx->buf_offsets = (uint16_t*)(mem + layout.off_seq_union);
  291|  9.47k|    ctx->buf_tokens = mem + layout.off_seq_union + layout.max_seq * sizeof(uint16_t);
  292|  9.47k|    ctx->buf_split = ctx->buf_tokens + layout.max_seq;
  293|  9.47k|    ctx->buf_split_hist = (zxc_spl_match_split_hist_t*)(void*)(mem + layout.off_split_hist);
  294|  9.47k|    ctx->buf_extras = mem + layout.off_extras;
  295|  9.47k|    ctx->literals = mem + layout.off_lit_cctx;
  296|  9.47k|    if (layout.sz_opt) {
  ------------------
  |  Branch (296:9): [True: 0, False: 9.47k]
  ------------------
  297|      0|        ctx->opt_scratch = mem + layout.off_opt;
  298|      0|        ctx->opt_scratch_cap = layout.sz_opt;
  299|      0|    }
  300|       |
  301|  9.47k|    ctx->compression_level = level;
  302|  9.47k|    ctx->epoch = 1;
  303|       |
  304|  9.47k|    ZXC_MEMSET(ctx->hash_table, 0, layout.sz_hash_pos);
  ------------------
  |  |  175|  9.47k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  305|  9.47k|    ZXC_MEMSET(ctx->hash_tags, 0, layout.sz_hash_tags);
  ------------------
  |  |  175|  9.47k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  306|  9.47k|    return ZXC_OK;
  307|  25.1k|}
zxc_cctx_init:
  320|  25.1k|                  const int level, const int checksum_enabled, const size_t dict_size) {
  321|  25.1k|    if (UNLIKELY(chunk_size == 0)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|  25.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 25.1k]
  |  |  ------------------
  ------------------
  322|       |    // Heap contexts defer the decode-side entropy scratch to the first entropy
  323|       |    // section; static workspaces must have it already, they may never allocate.
  324|  25.1k|    const int defer_entropy = (mode == 0);
  325|  25.1k|    const size_t total =
  326|  25.1k|        compute_cctx_layout(chunk_size, mode, level, dict_size, defer_entropy).total;
  327|  25.1k|    if (UNLIKELY(total == 0)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|  25.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 25.1k]
  |  |  ------------------
  ------------------
  328|       |
  329|  25.1k|    uint8_t* const mem = (uint8_t*)ZXC_ALIGNED_MALLOC(total, ZXC_CACHE_LINE_SIZE);
  ------------------
  |  |  134|  25.1k|#define ZXC_ALIGNED_MALLOC(size, alignment) zxc_aligned_malloc(size, alignment)
  ------------------
  330|  25.1k|    if (UNLIKELY(!mem)) return ZXC_ERROR_MEMORY;
  ------------------
  |  |  154|  25.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 25.1k]
  |  |  ------------------
  ------------------
  331|       |
  332|  25.1k|    const int rc = zxc_cctx_init_in_workspace(ctx, mem, total, chunk_size, mode, level,
  333|  25.1k|                                              checksum_enabled, dict_size, defer_entropy);
  334|  25.1k|    if (UNLIKELY(rc != ZXC_OK)) {
  ------------------
  |  |  154|  25.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 25.1k]
  |  |  ------------------
  ------------------
  335|       |        // LCOV_EXCL_START
  336|      0|        ZXC_ALIGNED_FREE(mem);
  ------------------
  |  |  137|      0|#define ZXC_ALIGNED_FREE(ptr) zxc_aligned_free(ptr)
  ------------------
  337|      0|        return rc;
  338|       |        // LCOV_EXCL_STOP
  339|      0|    }
  340|       |    // Library-owned buffer: record the allocation so zxc_cctx_free frees it.
  341|  25.1k|    ctx->memory_block = mem;
  342|  25.1k|    return ZXC_OK;
  343|  25.1k|}
zxc_cctx_alloc_entropy_scratch:
  353|  2.22k|int zxc_cctx_alloc_entropy_scratch(zxc_cctx_t* ctx) {
  354|  2.22k|    if (LIKELY(ctx->pivco_scratch)) return ZXC_OK;
  ------------------
  |  |  148|  2.22k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 0, False: 2.22k]
  |  |  ------------------
  ------------------
  355|       |
  356|       |    // Sized for the block the context was carved for, not chunk_size: a reader
  357|       |    // over frames of several block sizes lowers chunk_size per block.
  358|  2.22k|    size_t sz_tok = 0;
  359|  2.22k|    size_t sz_pivco = 0;
  360|  2.22k|    zxc_dctx_entropy_sizes(ctx->work_buf_cap - ZXC_DECOMPRESS_TAIL_PAD, &sz_tok, &sz_pivco);
  ------------------
  |  |  361|  2.22k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|  2.22k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|  2.22k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|  2.22k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|  2.22k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|  2.22k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  2.22k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|  2.22k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  361|  2.22k|    const size_t total = ZXC_ALIGN_CL(sz_tok) + ZXC_ALIGN_CL(sz_pivco);
  ------------------
  |  |  373|  2.22k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  2.22k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  2.22k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  2.22k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  2.22k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  const size_t total = ZXC_ALIGN_CL(sz_tok) + ZXC_ALIGN_CL(sz_pivco);
  ------------------
  |  |  373|  2.22k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  2.22k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  2.22k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  2.22k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  2.22k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  362|       |
  363|  2.22k|    uint8_t* const mem = (uint8_t*)ZXC_ALIGNED_MALLOC(total, ZXC_CACHE_LINE_SIZE);
  ------------------
  |  |  134|  2.22k|#define ZXC_ALIGNED_MALLOC(size, alignment) zxc_aligned_malloc(size, alignment)
  ------------------
  364|  2.22k|    if (UNLIKELY(!mem)) return ZXC_ERROR_MEMORY;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  2.22k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 2.22k]
  |  |  ------------------
  ------------------
  365|       |
  366|  2.22k|    ctx->entropy_block = mem;
  367|  2.22k|    ctx->tok_buffer = mem;
  368|  2.22k|    ctx->tok_buffer_cap = sz_tok;
  369|  2.22k|    ctx->pivco_scratch = mem + ZXC_ALIGN_CL(sz_tok);
  ------------------
  |  |  373|  2.22k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  2.22k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  2.22k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  2.22k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  2.22k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  370|  2.22k|    ctx->pivco_scratch_cap = sz_pivco;
  371|  2.22k|    return ZXC_OK;
  372|  2.22k|}
zxc_cctx_free:
  380|  25.1k|void zxc_cctx_free(zxc_cctx_t* ctx) {
  381|  25.1k|    if (ctx->memory_block) {
  ------------------
  |  Branch (381:9): [True: 25.1k, False: 0]
  ------------------
  382|  25.1k|        ZXC_ALIGNED_FREE(ctx->memory_block);
  ------------------
  |  |  137|  25.1k|#define ZXC_ALIGNED_FREE(ptr) zxc_aligned_free(ptr)
  ------------------
  383|  25.1k|        ctx->memory_block = NULL;
  384|  25.1k|    }
  385|  25.1k|    if (ctx->entropy_block) {
  ------------------
  |  Branch (385:9): [True: 2.22k, False: 22.8k]
  ------------------
  386|  2.22k|        ZXC_ALIGNED_FREE(ctx->entropy_block);
  ------------------
  |  |  137|  2.22k|#define ZXC_ALIGNED_FREE(ptr) zxc_aligned_free(ptr)
  ------------------
  387|  2.22k|        ctx->entropy_block = NULL;
  388|  2.22k|    }
  389|       |
  390|  25.1k|    ctx->lit_buffer = NULL;
  391|  25.1k|    ctx->hash_table = NULL;
  392|  25.1k|    ctx->hash_tags = NULL;
  393|  25.1k|    ctx->chain_table = NULL;
  394|  25.1k|    ctx->buf_sequences = NULL;
  395|  25.1k|    ctx->buf_tokens = NULL;
  396|  25.1k|    ctx->buf_offsets = NULL;
  397|  25.1k|    ctx->buf_extras = NULL;
  398|  25.1k|    ctx->buf_split = NULL;
  399|  25.1k|    ctx->buf_split_hist = NULL;
  400|  25.1k|    ctx->literals = NULL;
  401|  25.1k|    ctx->work_buf = NULL;
  402|  25.1k|    ctx->tok_buffer = NULL;
  403|  25.1k|    ctx->pivco_scratch = NULL;
  404|  25.1k|    ctx->opt_scratch = NULL;
  405|  25.1k|    ctx->dict_buffer = NULL;
  406|  25.1k|    ctx->dict_huf = NULL;
  407|       |
  408|  25.1k|    ctx->epoch = 0;
  409|  25.1k|    ctx->lit_buffer_cap = 0;
  410|  25.1k|    ctx->work_buf_cap = 0;
  411|  25.1k|    ctx->tok_buffer_cap = 0;
  412|  25.1k|    ctx->pivco_scratch_cap = 0;
  413|  25.1k|    ctx->opt_scratch_cap = 0;
  414|  25.1k|    ctx->dict_buffer_cap = 0;
  415|  25.1k|    ctx->dict_size = 0;
  416|  25.1k|    ctx->dict_huf_tree_ok = 0;
  417|       |    ctx->lit_freq_acc = NULL;
  418|  25.1k|}
zxc_write_file_header:
  467|  9.47k|                          const int has_checksum, const uint32_t dict_id, const int has_seek) {
  468|  9.47k|    if (UNLIKELY(dst_capacity < ZXC_FILE_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  469|       |
  470|  9.47k|    zxc_store_le32(dst, ZXC_MAGIC_WORD);
  ------------------
  |  |  117|  9.47k|#define ZXC_MAGIC_WORD 0x9CB02EF5U
  ------------------
  471|  9.47k|    dst[4] = ZXC_FILE_FORMAT_VERSION;
  ------------------
  |  |  328|  9.47k|#define ZXC_FILE_FORMAT_VERSION 9
  ------------------
  472|       |
  473|       |    // Block size stored as log2 exponent (e.g. 18 = 256 KB)
  474|  9.47k|    dst[5] = (uint8_t)zxc_log2_u32((uint32_t)chunk_size);
  475|       |
  476|  9.47k|    uint8_t flags = has_checksum ? (ZXC_FILE_FLAG_HAS_CHECKSUM | ZXC_CHECKSUM_RAPIDHASH) : 0;
  ------------------
  |  |  385|  1.31k|#define ZXC_FILE_FLAG_HAS_CHECKSUM 0x80U
  ------------------
                  uint8_t flags = has_checksum ? (ZXC_FILE_FLAG_HAS_CHECKSUM | ZXC_CHECKSUM_RAPIDHASH) : 0;
  ------------------
  |  |  452|  1.31k|#define ZXC_CHECKSUM_RAPIDHASH 0
  ------------------
  |  Branch (476:21): [True: 1.31k, False: 8.15k]
  ------------------
  477|  9.47k|    if (dict_id != 0) flags |= ZXC_FILE_FLAG_HAS_DICTIONARY;
  ------------------
  |  |  387|      0|#define ZXC_FILE_FLAG_HAS_DICTIONARY 0x40U
  ------------------
  |  Branch (477:9): [True: 0, False: 9.47k]
  ------------------
  478|  9.47k|    if (has_seek) flags |= ZXC_FILE_FLAG_HAS_SEEK_TABLE;
  ------------------
  |  |  390|      0|#define ZXC_FILE_FLAG_HAS_SEEK_TABLE 0x20U
  ------------------
  |  Branch (478:9): [True: 0, False: 9.47k]
  ------------------
  479|  9.47k|    dst[6] = flags;
  480|       |
  481|       |    // Bytes 7-13: Reserved / Dictionary ID
  482|  9.47k|    ZXC_MEMSET(dst + 7, 0, 7);
  ------------------
  |  |  175|  9.47k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  483|  9.47k|    if (dict_id != 0) zxc_store_le32(dst + 7, dict_id);
  ------------------
  |  Branch (483:9): [True: 0, False: 9.47k]
  ------------------
  484|       |
  485|       |    // Bytes 14-15: Header Checksum (16-bit)
  486|  9.47k|    zxc_file_header_sign(dst);
  487|       |
  488|  9.47k|    return ZXC_FILE_HEADER_SIZE;
  ------------------
  |  |  120|  9.47k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  489|  9.47k|}
zxc_read_file_header:
  498|  19.4k|                         uint32_t* RESTRICT out_dict_id, int* RESTRICT out_has_seek) {
  499|  19.4k|    if (UNLIKELY(src_size < ZXC_FILE_HEADER_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|  19.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 19.4k]
  |  |  ------------------
  ------------------
  500|  19.4k|    if (UNLIKELY(zxc_le32(src) != ZXC_MAGIC_WORD)) return ZXC_ERROR_BAD_MAGIC;
  ------------------
  |  |  154|  19.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 2.78k, False: 16.6k]
  |  |  ------------------
  ------------------
  501|  16.6k|    if (UNLIKELY(src[4] != ZXC_FILE_FORMAT_VERSION)) return ZXC_ERROR_BAD_VERSION;
  ------------------
  |  |  154|  16.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 51, False: 16.5k]
  |  |  ------------------
  ------------------
  502|       |
  503|  16.5k|    uint8_t temp[ZXC_FILE_HEADER_SIZE];
  504|  16.5k|    ZXC_MEMCPY(temp, src, ZXC_FILE_HEADER_SIZE);
  ------------------
  |  |  170|  16.5k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  505|       |    // Zero out checksum bytes (14-15) before hash check
  506|  16.5k|    temp[14] = 0;
  507|  16.5k|    temp[15] = 0;
  508|       |    // Header checksum (integrity), then the checksum-algorithm id in flags bits 0-3
  509|       |    // (only 0 = RapidHash is defined). It is checked first via short-circuit.
  510|  16.5k|    if (UNLIKELY(zxc_le16(src + 14) != zxc_hash16(temp) ||
  ------------------
  |  |  154|  32.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 189, False: 16.3k]
  |  |  |  Branch (154:42): [True: 185, False: 16.3k]
  |  |  |  Branch (154:42): [True: 4, False: 16.3k]
  |  |  ------------------
  ------------------
  511|  16.5k|                 (src[6] & ZXC_FILE_CHECKSUM_ALGO_MASK) != ZXC_CHECKSUM_RAPIDHASH))
  512|    189|        return ZXC_ERROR_BAD_HEADER;
  513|       |    // Reserved: flag bit 4, bytes 7-13 minus the dict_id (7-10).
  514|  16.3k|    if (UNLIKELY(src[6] & ZXC_FILE_FLAG_RESERVED)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|  16.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1, False: 16.3k]
  |  |  ------------------
  ------------------
  515|  16.3k|    uint8_t rsv = 0;
  516|   130k|    for (size_t i = (src[6] & ZXC_FILE_FLAG_HAS_DICTIONARY) ? 11 : 7; i < 14; i++) rsv |= src[i];
  ------------------
  |  |  387|  16.3k|#define ZXC_FILE_FLAG_HAS_DICTIONARY 0x40U
  ------------------
  |  Branch (516:21): [True: 1, False: 16.3k]
  |  Branch (516:71): [True: 114k, False: 16.3k]
  ------------------
  517|  16.3k|    if (UNLIKELY(rsv != 0)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|  16.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 164, False: 16.2k]
  |  |  ------------------
  ------------------
  518|       |
  519|  16.2k|    if (out_block_size) {
  ------------------
  |  Branch (519:9): [True: 16.2k, False: 0]
  ------------------
  520|  16.2k|        const uint8_t code = src[5];
  521|  16.2k|        if (UNLIKELY(code < ZXC_BLOCK_SIZE_MIN_LOG2 || code > ZXC_BLOCK_SIZE_MAX_LOG2))
  ------------------
  |  |  154|  32.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1, False: 16.2k]
  |  |  |  Branch (154:42): [True: 0, False: 16.2k]
  |  |  |  Branch (154:42): [True: 1, False: 16.2k]
  |  |  ------------------
  ------------------
  522|      1|            return ZXC_ERROR_BAD_BLOCK_SIZE;
  523|       |        // Exponent encoding: block_size = 2^code  (4 KB - 2 MB)
  524|  16.2k|        *out_block_size = (size_t)1U << code;
  525|  16.2k|    }
  526|  16.2k|    if (out_has_checksum) *out_has_checksum = (src[6] & ZXC_FILE_FLAG_HAS_CHECKSUM) ? 1 : 0;
  ------------------
  |  |  385|  16.2k|#define ZXC_FILE_FLAG_HAS_CHECKSUM 0x80U
  ------------------
  |  Branch (526:9): [True: 16.2k, False: 0]
  |  Branch (526:47): [True: 1.31k, False: 14.8k]
  ------------------
  527|  16.2k|    if (out_dict_id) *out_dict_id = (src[6] & ZXC_FILE_FLAG_HAS_DICTIONARY) ? zxc_le32(src + 7) : 0;
  ------------------
  |  |  387|  16.2k|#define ZXC_FILE_FLAG_HAS_DICTIONARY 0x40U
  ------------------
  |  Branch (527:9): [True: 16.2k, False: 0]
  |  Branch (527:37): [True: 0, False: 16.2k]
  ------------------
  528|  16.2k|    if (out_has_seek) *out_has_seek = (src[6] & ZXC_FILE_FLAG_HAS_SEEK_TABLE) ? 1 : 0;
  ------------------
  |  |  390|  16.2k|#define ZXC_FILE_FLAG_HAS_SEEK_TABLE 0x20U
  ------------------
  |  Branch (528:9): [True: 16.2k, False: 0]
  |  Branch (528:39): [True: 0, False: 16.2k]
  ------------------
  529|       |
  530|  16.2k|    return ZXC_OK;
  531|  16.2k|}
zxc_write_block_header:
  670|  31.8k|                           const zxc_block_header_t* RESTRICT bh) {
  671|  31.8k|    if (UNLIKELY(dst_capacity < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  31.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 31.8k]
  |  |  ------------------
  ------------------
  672|       |
  673|  31.8k|    dst[0] = bh->block_type;
  674|  31.8k|    dst[1] = 0;  // Flags not used currently
  675|  31.8k|    dst[2] = 0;  // Reserved
  676|  31.8k|    zxc_store_le32(dst + 3, bh->comp_size);
  677|  31.8k|    dst[7] = 0;               // Zero before hashing
  678|  31.8k|    dst[7] = zxc_hash8(dst);  // Checksum at the end
  679|       |
  680|  31.8k|    return ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  31.8k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  681|  31.8k|}
zxc_read_block_header:
  689|  27.4k|                          zxc_block_header_t* RESTRICT bh) {
  690|  27.4k|    if (UNLIKELY(src_size < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|  27.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 27.4k]
  |  |  ------------------
  ------------------
  691|       |
  692|  27.4k|    uint8_t temp[ZXC_BLOCK_HEADER_SIZE];
  693|  27.4k|    ZXC_MEMCPY(temp, src, ZXC_BLOCK_HEADER_SIZE);
  ------------------
  |  |  170|  27.4k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  694|  27.4k|    temp[7] = 0;  // Zero out checksum byte before hashing
  695|  27.4k|    if (UNLIKELY(src[7] != zxc_hash8(temp))) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|  27.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 200, False: 27.2k]
  |  |  ------------------
  ------------------
  696|  27.2k|    if (UNLIKELY((src[1] | src[2]) != 0)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|  27.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 8, False: 27.2k]
  |  |  ------------------
  ------------------
  697|       |
  698|  27.2k|    bh->block_type = src[0];
  699|  27.2k|    bh->block_flags = src[1];
  700|  27.2k|    bh->reserved = src[2];
  701|  27.2k|    bh->comp_size = zxc_le32(src + 3);
  702|  27.2k|    bh->header_checksum = src[7];
  703|       |
  704|  27.2k|    return ZXC_OK;
  705|  27.2k|}
zxc_check_eof_header:
  734|  9.34k|int zxc_check_eof_header(const uint8_t* hdr) {
  735|  9.34k|    const zxc_block_header_t eof = {
  736|  9.34k|        .block_type = ZXC_BLOCK_EOF, .block_flags = 0, .reserved = 0, .comp_size = 0};
  737|  9.34k|    uint8_t want[ZXC_BLOCK_HEADER_SIZE];
  738|  9.34k|    if (UNLIKELY(zxc_write_block_header(want, sizeof(want), &eof) < 0))
  ------------------
  |  |  154|  9.34k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.34k]
  |  |  ------------------
  ------------------
  739|      0|        return ZXC_ERROR_BAD_HEADER;  // LCOV_EXCL_LINE
  740|  9.34k|    return memcmp(hdr, want, sizeof(want)) == 0 ? ZXC_OK : ZXC_ERROR_BAD_HEADER;
  ------------------
  |  Branch (740:12): [True: 9.31k, False: 31]
  ------------------
  741|  9.34k|}
zxc_write_file_footer:
  820|  9.47k|                          const int checksum_enabled) {
  821|  9.47k|    const zxc_footer_layout_t l = zxc_footer_layout(prefix, src_size, checksum_enabled);
  822|  9.47k|    if (UNLIKELY(dst_capacity < l.len)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  823|  9.47k|    zxc_encode_footer(dst, &l, src_size, digest);
  824|  9.47k|    return (int)l.len;
  825|  9.47k|}
zxc_check_file_footer:
  834|  10.2k|                          const uint64_t src_size, uint64_t* digest) {
  835|  10.2k|    uint8_t want[ZXC_FOOTER_MAX_SIZE_WITH_DIGEST];
  836|  10.2k|    zxc_encode_footer(want, l, src_size, 0);
  837|  10.2k|    const size_t n = avail < l->len ? avail : l->len;
  ------------------
  |  Branch (837:22): [True: 1.13k, False: 9.15k]
  ------------------
  838|  10.2k|    if (n > l->skip && memcmp(footer + l->skip, want + l->skip, n - l->skip) != 0)
  ------------------
  |  Branch (838:9): [True: 9.86k, False: 423]
  |  Branch (838:24): [True: 79, False: 9.78k]
  ------------------
  839|     79|        return ZXC_ERROR_CORRUPT_DATA;
  840|  10.2k|    if (avail < l->len) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  Branch (840:9): [True: 1.09k, False: 9.11k]
  ------------------
  841|  9.11k|    if (digest) *digest = l->skip ? zxc_le64(footer) : 0;
  ------------------
  |  Branch (841:9): [True: 0, False: 9.11k]
  |  Branch (841:27): [True: 0, False: 0]
  ------------------
  842|  9.11k|    return ZXC_OK;
  843|  10.2k|}
zxc_read_spl_header_and_desc:
  953|  9.49k|                                 uint32_t* RESTRICT tok_comp) {
  954|  9.49k|    if (UNLIKELY(len < ZXC_SPL_HEADER_BINARY_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|  9.49k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 6, False: 9.48k]
  |  |  ------------------
  ------------------
  955|       |
  956|  9.48k|    zxc_read_gnr_header(src, gh);
  957|       |
  958|  9.48k|    const size_t desc_sz = zxc_spl_desc_size(gh->enc_lit, gh->enc_tok);
  959|  9.48k|    const size_t needed = ZXC_SPL_HEADER_BINARY_SIZE + desc_sz;
  ------------------
  |  |  432|  9.48k|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
  960|  9.48k|    if (UNLIKELY(len < needed)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|  9.48k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 5, False: 9.47k]
  |  |  ------------------
  ------------------
  961|       |
  962|  9.47k|    const uint8_t* p = src + ZXC_SPL_HEADER_BINARY_SIZE;
  ------------------
  |  |  432|  9.47k|#define ZXC_SPL_HEADER_BINARY_SIZE 12
  ------------------
  963|       |
  964|  9.47k|    if (gh->enc_lit != ZXC_SECTION_ENCODING_RAW) {
  ------------------
  |  Branch (964:9): [True: 2.47k, False: 7.00k]
  ------------------
  965|  2.47k|        *lit_comp = zxc_le32(p);
  966|  2.47k|        p += sizeof(uint32_t);
  967|  7.00k|    } else {
  968|  7.00k|        *lit_comp = gh->n_literals;
  969|  7.00k|    }
  970|  9.47k|    *tok_comp = (gh->enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) ? zxc_le32(p) : gh->n_sequences;
  ------------------
  |  Branch (970:17): [True: 5.12k, False: 4.35k]
  ------------------
  971|       |
  972|  9.47k|    return (int)needed;
  973|  9.48k|}
zxc_write_pak_header:
  984|  9.64k|                         const zxc_gnr_header_t* RESTRICT gh) {
  985|  9.64k|    if (UNLIKELY(rem < ZXC_PAK_HEADER_BINARY_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
  986|       |
  987|  9.64k|    zxc_write_gnr_header(dst, gh);
  988|  9.64k|    return ZXC_PAK_HEADER_BINARY_SIZE;
  ------------------
  |  |  434|  9.64k|#define ZXC_PAK_HEADER_BINARY_SIZE 12
  ------------------
  989|  9.64k|}
zxc_read_pak_header:
  995|  6.72k|                        zxc_gnr_header_t* RESTRICT gh) {
  996|  6.72k|    if (UNLIKELY(len < ZXC_PAK_HEADER_BINARY_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|  6.72k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 3, False: 6.72k]
  |  |  ------------------
  ------------------
  997|       |
  998|  6.72k|    zxc_read_gnr_header(src, gh);
  999|  6.72k|    return ZXC_OK;
 1000|  6.72k|}
zxc_compress_bound:
 1015|  9.47k|size_t zxc_compress_bound(const size_t input_size) {
 1016|       |    // n <= 2^52 even for a 64-bit size_t, so the overhead sum fits a uint64.
 1017|  9.47k|    uint64_t n = (uint64_t)input_size / ZXC_BLOCK_SIZE_MIN + (input_size % ZXC_BLOCK_SIZE_MIN != 0);
  ------------------
  |  |   73|  9.47k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  9.47k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
                  uint64_t n = (uint64_t)input_size / ZXC_BLOCK_SIZE_MIN + (input_size % ZXC_BLOCK_SIZE_MIN != 0);
  ------------------
  |  |   73|  9.47k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  9.47k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
 1018|  9.47k|    if (n == 0) n = 1;
  ------------------
  |  Branch (1018:9): [True: 0, False: 9.47k]
  ------------------
 1019|  9.47k|    const uint64_t overhead =
 1020|  9.47k|        ZXC_FILE_HEADER_SIZE +
  ------------------
  |  |  120|  9.47k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
 1021|  9.47k|        (n * (ZXC_BLOCK_HEADER_SIZE + ZXC_BLOCK_CHECKSUM_SIZE + ZXC_BLOCK_FORMAT_OVERHEAD)) +
  ------------------
  |  |  428|  9.47k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                      (n * (ZXC_BLOCK_HEADER_SIZE + ZXC_BLOCK_CHECKSUM_SIZE + ZXC_BLOCK_FORMAT_OVERHEAD)) +
  ------------------
  |  |  430|  9.47k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
                      (n * (ZXC_BLOCK_HEADER_SIZE + ZXC_BLOCK_CHECKSUM_SIZE + ZXC_BLOCK_FORMAT_OVERHEAD)) +
  ------------------
  |  |  446|  9.47k|#define ZXC_BLOCK_FORMAT_OVERHEAD 68
  ------------------
 1022|  9.47k|        ZXC_BLOCK_HEADER_SIZE +          /* EOF block */
  ------------------
  |  |  428|  9.47k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1023|  9.47k|        ZXC_BLOCK_HEADER_SIZE +          /* SEK block header (seekable) */
  ------------------
  |  |  428|  9.47k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1024|  9.47k|        zxc_seek_table_bytes(n) +        /* SEK groups (seekable) */
 1025|  9.47k|        ZXC_FOOTER_MAX_SIZE_WITH_DIGEST; /* optional digest + footer */
  ------------------
  |  | 2445|  9.47k|#define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  127|  9.47k|#define ZXC_FILE_DIGEST_SIZE 8
  |  |  ------------------
  |  |               #define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  125|  9.47k|#define ZXC_FILE_FOOTER_MAX_SIZE 17
  |  |  ------------------
  ------------------
 1026|       |    // The bound is a buffer size: input + overhead must fit a size_t.
 1027|  9.47k|    if (UNLIKELY(overhead > (uint64_t)(SIZE_MAX - input_size))) return 0;
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
 1028|  9.47k|    return input_size + (size_t)overhead;
 1029|  9.47k|}
zxc_compress_block_bound:
 1034|  25.2k|size_t zxc_compress_block_bound(const size_t input_size) {
 1035|       |    // Mirrors the Block API contract: outside [1, ZXC_BLOCK_SIZE_MAX] the call
 1036|       |    // would fail anyway, so the bound is undefined and 0 says "unusable". The cap
 1037|       |    // also makes the addition below trivially overflow-free.
 1038|  25.2k|    if (UNLIKELY(input_size == 0 || input_size > ZXC_BLOCK_SIZE_MAX)) return 0;
  ------------------
  |  |  154|  50.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 25.2k]
  |  |  |  Branch (154:42): [True: 0, False: 25.2k]
  |  |  |  Branch (154:42): [True: 0, False: 25.2k]
  |  |  ------------------
  ------------------
 1039|       |    // Outer block header + payload (worst case: incompressible, raw bytes)
 1040|       |    // + inner format overhead + optional checksum.
 1041|  25.2k|    return ZXC_BLOCK_HEADER_SIZE + input_size + ZXC_BLOCK_FORMAT_OVERHEAD + ZXC_BLOCK_CHECKSUM_SIZE;
  ------------------
  |  |  428|  25.2k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                  return ZXC_BLOCK_HEADER_SIZE + input_size + ZXC_BLOCK_FORMAT_OVERHEAD + ZXC_BLOCK_CHECKSUM_SIZE;
  ------------------
  |  |  446|  25.2k|#define ZXC_BLOCK_FORMAT_OVERHEAD 68
  ------------------
                  return ZXC_BLOCK_HEADER_SIZE + input_size + ZXC_BLOCK_FORMAT_OVERHEAD + ZXC_BLOCK_CHECKSUM_SIZE;
  ------------------
  |  |  430|  25.2k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
 1042|  25.2k|}
zxc_common.c:compute_cctx_layout:
  122|  50.2k|                                             const int defer_entropy_scratch) {
  123|  50.2k|    zxc_cctx_layout_t layout = {0};
  124|       |
  125|  50.2k|    const size_t max_seq = zxc_cctx_max_seq(chunk_size);
  126|       |
  127|  50.2k|    if (mode == 0) {
  ------------------
  |  Branch (127:9): [True: 31.2k, False: 18.9k]
  ------------------
  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|  31.2k|        const size_t sz_work = chunk_size + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  361|  31.2k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|  31.2k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|  31.2k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|  31.2k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|  31.2k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|  31.2k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  31.2k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|  31.2k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  132|  31.2k|        const size_t sz_lit = chunk_size + ZXC_PAD_SIZE;
  ------------------
  |  |  331|  31.2k|#define ZXC_PAD_SIZE 32
  ------------------
  133|       |
  134|  31.2k|        layout.off_work = layout.total;
  135|  31.2k|        layout.total += ZXC_ALIGN_CL(sz_work);
  ------------------
  |  |  373|  31.2k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  31.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  31.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  31.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  31.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  136|  31.2k|        layout.off_lit_dctx = layout.total;
  137|  31.2k|        layout.total += ZXC_ALIGN_CL(sz_lit);
  ------------------
  |  |  373|  31.2k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  31.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  31.2k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  31.2k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  31.2k|#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|  31.2k|        if (!defer_entropy_scratch) {
  ------------------
  |  Branch (143:13): [True: 0, False: 31.2k]
  ------------------
  144|      0|            size_t sz_tok = 0;
  145|      0|            size_t sz_pivco = 0;
  146|      0|            zxc_dctx_entropy_sizes(chunk_size, &sz_tok, &sz_pivco);
  147|      0|            layout.sz_tok_dctx = sz_tok;
  148|      0|            layout.off_tok_dctx = layout.total;
  149|      0|            layout.total += ZXC_ALIGN_CL(layout.sz_tok_dctx);
  ------------------
  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|      0|            layout.sz_pivco_dctx = sz_pivco;
  151|      0|            layout.off_pivco_dctx = layout.total;
  152|      0|            layout.total += ZXC_ALIGN_CL(layout.sz_pivco_dctx);
  ------------------
  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|      0|        }
  154|  31.2k|    } else {
  155|       |        // Compress: 7 partitions + optional opt_scratch at level >= ZXC_LEVEL_DENSITY.
  156|  18.9k|        const uint32_t offset_bits = zxc_log2_u32((uint32_t)chunk_size);
  157|  18.9k|        layout.max_seq = max_seq;
  158|  18.9k|        layout.sz_hash_pos = ZXC_LZ_HASH_SIZE * sizeof(uint32_t);
  ------------------
  |  |  569|  18.9k|#define ZXC_LZ_HASH_SIZE (1U << ZXC_LZ_HASH_BITS)
  |  |  ------------------
  |  |  |  |  567|  18.9k|#define ZXC_LZ_HASH_BITS 15
  |  |  ------------------
  ------------------
  159|  18.9k|        layout.sz_hash_tags = ZXC_LZ_HASH_SIZE * sizeof(uint8_t);
  ------------------
  |  |  569|  18.9k|#define ZXC_LZ_HASH_SIZE (1U << ZXC_LZ_HASH_BITS)
  |  |  ------------------
  |  |  |  |  567|  18.9k|#define ZXC_LZ_HASH_BITS 15
  |  |  ------------------
  ------------------
  160|  18.9k|        const size_t sz_chain = ZXC_LZ_WINDOW_SIZE * sizeof(uint16_t);
  ------------------
  |  |  571|  18.9k|#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|  18.9k|        const size_t sz_seq_union = layout.max_seq * sizeof(uint32_t);
  164|  18.9k|        const size_t vbyte_len = (offset_bits + 6) / 7;
  165|  18.9k|        const size_t sz_extras = layout.max_seq * 2 * vbyte_len;
  166|  18.9k|        const size_t sz_lit = chunk_size + ZXC_PAD_SIZE;
  ------------------
  |  |  331|  18.9k|#define ZXC_PAD_SIZE 32
  ------------------
  167|       |
  168|       |        // opt_scratch (level >= ZXC_LEVEL_DENSITY): the optimal parser's DP arrays,
  169|       |        // reused transiently by the code-length builder and its nudge, so sized to
  170|       |        // the larger demand. Keep in sync with zxc_estimate_cctx_size() and its
  171|       |        // consumer in zxc_compress.c.
  172|  18.9k|        if (level >= ZXC_LEVEL_DENSITY) {
  ------------------
  |  Branch (172:13): [True: 0, False: 18.9k]
  ------------------
  173|      0|            size_t sz_dp;
  174|      0|            size_t sz_pl;
  175|      0|            size_t sz_po;
  176|      0|            size_t sz_bm;
  177|      0|            zxc_opt_dp_sizes(chunk_size, &sz_dp, &sz_pl, &sz_po, &sz_bm);
  178|      0|            const size_t dp_needed = sz_dp + sz_pl + sz_po + sz_bm;
  179|      0|            layout.sz_opt =
  180|      0|                (dp_needed > ZXC_HUF_NUDGE_SCRATCH_SIZE) ? dp_needed : ZXC_HUF_NUDGE_SCRATCH_SIZE;
  ------------------
  |  | 1091|      0|#define ZXC_HUF_NUDGE_SCRATCH_SIZE (ZXC_HUF_NUDGE_SCRATCH_OFF + sizeof(zxc_huf_nudge_ws_t))
  |  |  ------------------
  |  |  |  | 1089|      0|#define ZXC_HUF_NUDGE_SCRATCH_OFF ZXC_ALIGN_CL(ZXC_HUF_BUILD_SCRATCH_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              (dp_needed > ZXC_HUF_NUDGE_SCRATCH_SIZE) ? dp_needed : ZXC_HUF_NUDGE_SCRATCH_SIZE;
  ------------------
  |  | 1091|      0|#define ZXC_HUF_NUDGE_SCRATCH_SIZE (ZXC_HUF_NUDGE_SCRATCH_OFF + sizeof(zxc_huf_nudge_ws_t))
  |  |  ------------------
  |  |  |  | 1089|      0|#define ZXC_HUF_NUDGE_SCRATCH_OFF ZXC_ALIGN_CL(ZXC_HUF_BUILD_SCRATCH_SIZE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (180:17): [True: 0, False: 0]
  ------------------
  181|      0|        }
  182|       |
  183|  18.9k|        layout.off_hash_pos = layout.total;
  184|  18.9k|        layout.total += ZXC_ALIGN_CL(layout.sz_hash_pos);
  ------------------
  |  |  373|  18.9k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  185|  18.9k|        layout.off_hash_tags = layout.total;
  186|  18.9k|        layout.total += ZXC_ALIGN_CL(layout.sz_hash_tags);
  ------------------
  |  |  373|  18.9k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  187|  18.9k|        layout.off_chain = layout.total;
  188|  18.9k|        layout.total += ZXC_ALIGN_CL(sz_chain);
  ------------------
  |  |  373|  18.9k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  189|  18.9k|        layout.off_seq_union = layout.total;
  190|  18.9k|        layout.total += ZXC_ALIGN_CL(sz_seq_union);
  ------------------
  |  |  373|  18.9k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|  18.9k|        layout.off_split_hist = layout.total;
  192|  18.9k|        layout.total += ZXC_ALIGN_CL(sizeof(zxc_spl_match_split_hist_t));
  ------------------
  |  |  373|  18.9k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  193|  18.9k|        layout.off_extras = layout.total;
  194|  18.9k|        layout.total += ZXC_ALIGN_CL(sz_extras);
  ------------------
  |  |  373|  18.9k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  18.9k|        layout.off_lit_cctx = layout.total;
  196|  18.9k|        layout.total += ZXC_ALIGN_CL(sz_lit);
  ------------------
  |  |  373|  18.9k|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|  18.9k|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|  18.9k|#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|  18.9k|        if (layout.sz_opt) {
  ------------------
  |  Branch (199:13): [True: 0, False: 18.9k]
  ------------------
  200|      0|            layout.off_opt = layout.total;
  201|      0|            layout.total += ZXC_ALIGN_CL(layout.sz_opt);
  ------------------
  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  202|      0|        }
  203|  18.9k|    }
  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|  50.2k|    if (dict_size > 0) {
  ------------------
  |  Branch (207:9): [True: 0, False: 50.2k]
  ------------------
  208|      0|        layout.sz_dict = (mode == 1) ? (chunk_size + ZXC_DECOMPRESS_TAIL_PAD)
  ------------------
  |  |  361|      0|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|      0|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|      0|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|      0|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|      0|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  |  Branch (208:26): [True: 0, False: 0]
  ------------------
  209|      0|                                     : (dict_size + chunk_size + ZXC_DECOMPRESS_TAIL_PAD);
  ------------------
  |  |  361|      0|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|      0|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|      0|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|      0|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|      0|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  210|      0|        layout.off_dict = layout.total;
  211|      0|        layout.total += ZXC_ALIGN_CL(layout.sz_dict);
  ------------------
  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|      0|        layout.off_dict_huf = layout.total;
  213|      0|        layout.total += ZXC_ALIGN_CL(sizeof(zxc_dict_huf_state_t));
  ------------------
  |  |  373|      0|#define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_ALIGN_CL(x) (((x) + ZXC_ALIGNMENT_MASK) & ~(size_t)ZXC_ALIGNMENT_MASK)
  |  |  ------------------
  |  |  |  |  371|      0|#define ZXC_ALIGNMENT_MASK ((size_t)ZXC_CACHE_LINE_SIZE - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  369|      0|#define ZXC_CACHE_LINE_SIZE 64
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  214|      0|    }
  215|  50.2k|    return layout;
  216|  50.2k|}
zxc_common.c:zxc_cctx_max_seq:
   74|  52.4k|static ZXC_ALWAYS_INLINE size_t zxc_cctx_max_seq(const size_t chunk_size) {
   75|  52.4k|    return chunk_size / ZXC_LZ_MIN_MATCH_LEN + 16;
  ------------------
  |  |  575|  52.4k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
   76|  52.4k|}
zxc_common.c:zxc_dctx_entropy_sizes:
   86|  2.22k|                                   size_t* RESTRICT sz_pivco) {
   87|  2.22k|    *sz_tok = zxc_cctx_max_seq(chunk_size) + ZXC_PAD_SIZE;
  ------------------
  |  |  331|  2.22k|#define ZXC_PAD_SIZE 32
  ------------------
   88|  2.22k|    *sz_pivco = chunk_size + ZXC_PIVCO_SCRATCH_PAD;
  ------------------
  |  | 1879|  2.22k|#define ZXC_PIVCO_SCRATCH_PAD 32
  ------------------
   89|  2.22k|}
zxc_common.c:zxc_encode_footer:
  805|  19.7k|                              const uint64_t digest) {
  806|  19.7k|    if (l->skip) zxc_store_le64(dst, digest);
  ------------------
  |  Branch (806:9): [True: 2.23k, False: 17.5k]
  ------------------
  807|  19.7k|    uint8_t* p = dst + l->skip;
  808|  19.7k|    zxc_store_le_n(p, src_size, l->nd);
  809|  19.7k|    p += l->nd;
  810|  19.7k|    zxc_store_le_n(p, l->compressed_size, l->nf);
  811|  19.7k|    p[l->nf] = (uint8_t)((l->nd - 1) | (l->nf - 1) << 4);
  812|  19.7k|}
zxc_common.c:zxc_store_le_n:
  792|  39.5k|static void zxc_store_le_n(uint8_t* dst, uint64_t v, const size_t n) {
  793|   103k|    for (size_t i = 0; i < n; i++, v >>= 8) dst[i] = (uint8_t)v;
  ------------------
  |  Branch (793:24): [True: 63.4k, False: 39.5k]
  ------------------
  794|  39.5k|}
zxc_common.c:zxc_spl_desc_size:
  912|  9.48k|static ZXC_ALWAYS_INLINE size_t zxc_spl_desc_size(const uint8_t enc_lit, const uint8_t enc_tok) {
  913|  9.48k|    return ((enc_lit != ZXC_SECTION_ENCODING_RAW) ? sizeof(uint32_t) : 0) +
  ------------------
  |  Branch (913:13): [True: 2.47k, False: 7.00k]
  ------------------
  914|  9.48k|           ((enc_tok == ZXC_SECTION_ENCODING_HUFFMAN) ? sizeof(uint32_t) : 0);
  ------------------
  |  Branch (914:13): [True: 5.12k, False: 4.35k]
  ------------------
  915|  9.48k|}
zxc_common.c:zxc_write_gnr_header:
  880|  9.64k|                                                   const zxc_gnr_header_t* RESTRICT gh) {
  881|  9.64k|    zxc_store_le32(dst, gh->n_sequences);
  882|  9.64k|    zxc_store_le32(dst + 4, gh->n_literals);
  883|       |
  884|  9.64k|    dst[8] = gh->enc_lit;
  885|  9.64k|    dst[9] = gh->enc_tok;
  886|  9.64k|    dst[10] = gh->enc_mlen;
  887|  9.64k|    dst[11] = gh->enc_off;
  888|  9.64k|}
zxc_common.c:zxc_read_gnr_header:
  897|  16.2k|                                                  zxc_gnr_header_t* RESTRICT gh) {
  898|  16.2k|    gh->n_sequences = zxc_le32(src);
  899|  16.2k|    gh->n_literals = zxc_le32(src + 4);
  900|  16.2k|    gh->enc_lit = src[8];
  901|  16.2k|    gh->enc_tok = src[9];
  902|  16.2k|    gh->enc_mlen = src[10];
  903|  16.2k|    gh->enc_off = src[11];
  904|  16.2k|}

zxc_compress_chunk_wrapper_default:
 2221|  9.64k|                               const uint64_t block_index) {
 2222|  9.64k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 2223|       |
 2224|  9.64k|    const size_t dict_sz = ctx->dict_size;
 2225|  9.64k|    const size_t block_sz = src_sz - dict_sz;
 2226|  9.64k|    const uint8_t* block_data = chunk + dict_sz;
 2227|  9.64k|    size_t w = 0;
 2228|  9.64k|    int res = ZXC_OK;
 2229|       |
 2230|  9.64k|    if (ctx->compression_level <= 2)
  ------------------
  |  Branch (2230:9): [True: 9.64k, False: 0]
  ------------------
 2231|  9.64k|        res = zxc_encode_block_pak(ctx, chunk, src_sz, dst, dst_cap, &w);
 2232|      0|    else
 2233|      0|        res = zxc_encode_block_spl(ctx, chunk, src_sz, dst, dst_cap, &w);
 2234|       |
 2235|       |    // Check expansion against block data size (excluding dict prefix).
 2236|  9.64k|    if (UNLIKELY(res != ZXC_OK || w >= block_sz)) {
  ------------------
  |  |  154|  19.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 3.38k, False: 6.25k]
  |  |  |  Branch (154:42): [True: 0, False: 9.64k]
  |  |  |  Branch (154:42): [True: 3.38k, False: 6.25k]
  |  |  ------------------
  ------------------
 2237|  3.38k|        res = zxc_encode_block_raw(block_data, block_sz, dst, dst_cap, &w);
 2238|  3.38k|        if (UNLIKELY(res != ZXC_OK)) return res;
  ------------------
  |  |  154|  3.38k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 3.38k]
  |  |  ------------------
  ------------------
 2239|  3.38k|    }
 2240|       |
 2241|  9.64k|    if (ctx->checksum_enabled) {
  ------------------
  |  Branch (2241:9): [True: 1.39k, False: 8.24k]
  ------------------
 2242|  1.39k|        if (UNLIKELY(w + ZXC_BLOCK_CHECKSUM_SIZE > dst_cap)) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|  1.39k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 1.39k]
  |  |  ------------------
  ------------------
 2243|       |
 2244|  1.39k|        zxc_store_le32(dst + w,
 2245|  1.39k|                       zxc_checksum(block_data, block_sz, block_index, ZXC_CHECKSUM_RAPIDHASH));
  ------------------
  |  |  452|  1.39k|#define ZXC_CHECKSUM_RAPIDHASH 0
  ------------------
 2246|  1.39k|        w += ZXC_BLOCK_CHECKSUM_SIZE;
  ------------------
  |  |  430|  1.39k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
 2247|  1.39k|    }
 2248|       |
 2249|  9.64k|    return (int)w;
 2250|  9.64k|}
zxc_compress.c:zxc_encode_block_pak:
 2021|  9.64k|                                size_t* RESTRICT const out_sz) {
 2022|  9.64k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 2023|       |
 2024|  9.64k|    const int level = ctx->compression_level;
 2025|  9.64k|    const size_t dict_sz = ctx->dict_size;
 2026|       |
 2027|  9.64k|    zxc_lz77_params_t lzp = zxc_get_lz77_params(level);
 2028|       |    // The floor is a candidate until the block itself clears it.
 2029|  9.64k|    if (lzp.min_offset > 1 && zxc_block_is_short_dist_bound(src + dict_sz, src_sz - dict_sz))
  ------------------
  |  Branch (2029:9): [True: 9.64k, False: 0]
  |  Branch (2029:31): [True: 7.81k, False: 1.82k]
  ------------------
 2030|  7.81k|        lzp.min_offset = 1;
 2031|       |
 2032|  9.64k|    ctx->epoch++;
 2033|  9.64k|    if (UNLIKELY(ctx->epoch >= ctx->max_epoch)) {
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 2034|      0|        ZXC_MEMSET(ctx->hash_table, 0, ZXC_LZ_HASH_SIZE * sizeof(uint32_t));
  ------------------
  |  |  175|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2035|      0|        ZXC_MEMSET(ctx->hash_tags, 0, ZXC_LZ_HASH_SIZE * sizeof(uint8_t));
  ------------------
  |  |  175|      0|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2036|      0|        ctx->epoch = 1;
 2037|      0|    }
 2038|  9.64k|    const uint32_t offset_bits = ctx->offset_bits;
 2039|  9.64k|    const uint32_t offset_mask = ctx->offset_mask;
 2040|  9.64k|    const uint32_t epoch_mark = ctx->epoch << offset_bits;
 2041|       |
 2042|  9.64k|    if (dict_sz > 0)
  ------------------
  |  Branch (2042:9): [True: 0, False: 9.64k]
  ------------------
 2043|      0|        zxc_lz_seed_dict(src, dict_sz, ctx->hash_table, ctx->hash_tags, ctx->chain_table,
 2044|      0|                         epoch_mark, offset_mask, level);
 2045|       |
 2046|  9.64k|    const uint8_t* ip = src + dict_sz;
 2047|  9.64k|    const uint8_t* iend = src + src_sz;
 2048|  9.64k|    const uint8_t* anchor = ip;
 2049|  9.64k|    const uint8_t* search_limit = iend - ZXC_LZ_SEARCH_MARGIN;
  ------------------
  |  |  717|  9.64k|#define ZXC_LZ_SEARCH_MARGIN (sizeof(uint64_t))
  ------------------
 2050|       |
 2051|  9.64k|    uint32_t* const hash_table = ctx->hash_table;
 2052|  9.64k|    uint8_t* const hash_tags = ctx->hash_tags;
 2053|  9.64k|    uint8_t* const buf_extras = ctx->buf_extras;
 2054|  9.64k|    uint16_t* const chain_table = ctx->chain_table;
 2055|  9.64k|    uint8_t* const literals = ctx->literals;
 2056|  9.64k|    uint32_t* const buf_sequences = ctx->buf_sequences;
 2057|       |
 2058|  9.64k|    uint32_t seq_c = 0;
 2059|  9.64k|    size_t extras_c = 0;
 2060|  9.64k|    size_t lit_c = 0;
 2061|       |
 2062|  8.98M|    while (LIKELY(ip < search_limit)) {
  ------------------
  |  |  148|  8.98M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 8.97M, False: 9.64k]
  |  |  ------------------
  ------------------
 2063|  8.97M|        size_t dist = (size_t)(ip - anchor);
 2064|  8.97M|        size_t step = lzp.step_base + (dist >> lzp.step_shift);
 2065|  8.97M|        if (UNLIKELY(ip + step >= search_limit)) step = 1;
  ------------------
  |  |  154|  8.97M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1.38M, False: 7.58M]
  |  |  ------------------
  ------------------
 2066|       |
 2067|  8.97M|        ZXC_PREFETCH_READ(ip + step * 4 + ZXC_CACHE_LINE_SIZE);
  ------------------
  |  |  165|  8.97M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 2068|       |
 2069|  8.97M|        if (LIKELY(ip + step + sizeof(uint64_t) <= iend)) {
  ------------------
  |  |  148|  8.97M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 8.97M, False: 0]
  |  |  ------------------
  ------------------
 2070|  8.97M|            const uint64_t v_next = zxc_le64(ip + step);
 2071|       |            // cppcheck-suppress unreadVariable
 2072|  8.97M|            const uint32_t h_next = zxc_hash_func(v_next, 0);
 2073|  8.97M|            ZXC_PREFETCH_READ(&hash_tags[h_next]);
  ------------------
  |  |  165|  8.97M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 2074|  8.97M|            ZXC_PREFETCH_READ(&hash_table[h_next]);
  ------------------
  |  |  165|  8.97M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
 2075|  8.97M|        }
 2076|       |
 2077|  8.97M|        const zxc_match_t m =
 2078|  8.97M|            zxc_lz77_find_best_match(src, ip, iend, search_limit, anchor, hash_table, hash_tags,
 2079|  8.97M|                                     chain_table, epoch_mark, offset_mask, level, lzp,
 2080|  8.97M|                                     /*last_off=*/0U);
 2081|       |
 2082|  8.97M|        if (m.ref) {
  ------------------
  |  Branch (2082:13): [True: 2.49M, False: 6.48M]
  ------------------
 2083|  2.49M|            ip -= m.backtrack;
 2084|  2.49M|            const uint32_t ll = (uint32_t)(ip - anchor);
 2085|  2.49M|            const uint32_t ml = m.len - ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  2.49M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 2086|  2.49M|            const uint32_t off = (uint32_t)(ip - m.ref);
 2087|       |
 2088|  2.49M|            if (ll > 0) zxc_flush_literals(literals, &lit_c, anchor, ll, iend);
  ------------------
  |  Branch (2088:17): [True: 1.01M, False: 1.47M]
  ------------------
 2089|       |
 2090|  2.49M|            const uint32_t ll_write = (ll >= ZXC_SEQ_LL_MASK) ? ZXC_SEQ_LL_MASK : ll;
  ------------------
  |  |  528|  2.49M|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  522|  2.49M|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
                          const uint32_t ll_write = (ll >= ZXC_SEQ_LL_MASK) ? ZXC_SEQ_LL_MASK : ll;
  ------------------
  |  |  528|  29.4k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  522|  29.4k|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
  |  Branch (2090:39): [True: 29.4k, False: 2.46M]
  ------------------
 2091|  2.49M|            const uint32_t ml_write = (ml >= ZXC_SEQ_ML_MASK) ? ZXC_SEQ_ML_MASK : ml;
  ------------------
  |  |  530|  2.49M|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  524|  2.49M|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
                          const uint32_t ml_write = (ml >= ZXC_SEQ_ML_MASK) ? ZXC_SEQ_ML_MASK : ml;
  ------------------
  |  |  530|  67.3k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  524|  67.3k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
  |  Branch (2091:39): [True: 67.3k, False: 2.42M]
  ------------------
 2092|  2.49M|            const uint32_t seq_val = (ll_write << ZXC_SEQ_LL_SHIFT) |
  ------------------
  |  |  534|  2.49M|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  524|  2.49M|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  526|  2.49M|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 2093|  2.49M|                                     (ml_write << ZXC_SEQ_ML_SHIFT) |
  ------------------
  |  |  536|  2.49M|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  526|  2.49M|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 2094|  2.49M|                                     ((off - ZXC_LZ_OFFSET_BIAS) & ZXC_SEQ_OFF_MASK);
  ------------------
  |  |  676|  2.49M|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
                                                   ((off - ZXC_LZ_OFFSET_BIAS) & ZXC_SEQ_OFF_MASK);
  ------------------
  |  |  532|  2.49M|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  526|  2.49M|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 2095|  2.49M|            buf_sequences[seq_c] = seq_val;
 2096|  2.49M|            seq_c++;
 2097|       |
 2098|  2.49M|            if (UNLIKELY(!zxc_emit_extra(buf_extras, &extras_c, ll, ZXC_SEQ_LL_MASK) ||
  ------------------
  |  |  154|  4.98M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 2.49M]
  |  |  |  Branch (154:42): [True: 0, False: 2.49M]
  |  |  |  Branch (154:42): [True: 0, False: 2.49M]
  |  |  ------------------
  ------------------
 2099|  2.49M|                         !zxc_emit_extra(buf_extras, &extras_c, ml, ZXC_SEQ_ML_MASK)))
 2100|      0|                return ZXC_ERROR_OVERFLOW;
 2101|       |
 2102|  2.49M|            ip += m.len;
 2103|  2.49M|            anchor = ip;
 2104|  6.48M|        } else {
 2105|  6.48M|            ip += step;
 2106|  6.48M|        }
 2107|  8.97M|    }
 2108|       |
 2109|  9.64k|    const size_t last_lits = (size_t)(iend - anchor);
 2110|  9.64k|    if (last_lits > 0) {
  ------------------
  |  Branch (2110:9): [True: 8.89k, False: 747]
  ------------------
 2111|  8.89k|        ZXC_MEMCPY(literals + lit_c, anchor, last_lits);
  ------------------
  |  |  170|  8.89k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2112|  8.89k|        lit_c += last_lits;
 2113|  8.89k|    }
 2114|       |
 2115|  9.64k|    zxc_block_header_t bh = {.block_type = ZXC_BLOCK_PAK};
 2116|  9.64k|    uint8_t* const p = dst + ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  9.64k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2117|  9.64k|    size_t rem = dst_cap - ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  9.64k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2118|       |
 2119|  9.64k|    const zxc_gnr_header_t gh = {.n_sequences = seq_c,
 2120|  9.64k|                                 .n_literals = (uint32_t)lit_c,
 2121|  9.64k|                                 .enc_lit = ZXC_SECTION_ENCODING_RAW,
 2122|  9.64k|                                 .enc_tok = 0,
 2123|  9.64k|                                 .enc_mlen = 0,
 2124|  9.64k|                                 .enc_off = 0};
 2125|       |
 2126|  9.64k|    const int ghs = zxc_write_pak_header(p, rem, &gh);
 2127|  9.64k|    if (UNLIKELY(ghs < 0)) return ghs;
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 2128|       |
 2129|  9.64k|    uint8_t* p_curr = p + ghs;
 2130|  9.64k|    rem -= (size_t)ghs;
 2131|       |
 2132|  9.64k|    const size_t sz_lit = lit_c;
 2133|  9.64k|    const size_t sz_seq = seq_c * sizeof(uint32_t);
 2134|  9.64k|    const size_t sz_ext = extras_c;
 2135|       |
 2136|       |    // See the SPL twin. PAK literals are always RAW, so the slack always
 2137|       |    // matters here.
 2138|  9.64k|    const size_t behind_lit = sz_seq + sz_ext;
 2139|  9.64k|    const size_t pad = (behind_lit < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind_lit : 0;
  ------------------
  |  |  345|  9.64k|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
                  const size_t pad = (behind_lit < ZXC_BLOCK_LIT_SLACK) ? ZXC_BLOCK_LIT_SLACK - behind_lit : 0;
  ------------------
  |  |  345|  4.64k|#define ZXC_BLOCK_LIT_SLACK 32
  ------------------
  |  Branch (2139:24): [True: 4.64k, False: 4.99k]
  ------------------
 2140|       |
 2141|  9.64k|    if (UNLIKELY(rem < sz_lit + sz_seq + sz_ext + pad)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 2142|       |
 2143|  9.64k|    ZXC_MEMCPY(p_curr, literals, lit_c);
  ------------------
  |  |  170|  9.64k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2144|  9.64k|    p_curr += lit_c;
 2145|       |
 2146|       |    // Write sequences in little-endian order
 2147|       |#ifdef ZXC_BIG_ENDIAN
 2148|       |    for (uint32_t i = 0; i < seq_c; i++) {
 2149|       |        zxc_store_le32(p_curr, buf_sequences[i]);
 2150|       |        p_curr += sizeof(uint32_t);
 2151|       |    }
 2152|       |#else
 2153|  9.64k|    ZXC_MEMCPY(p_curr, buf_sequences, sz_seq);
  ------------------
  |  |  170|  9.64k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2154|  9.64k|    p_curr += sz_seq;
 2155|  9.64k|#endif
 2156|       |
 2157|       |    // --- WRITE EXTRAS ---
 2158|  9.64k|    ZXC_MEMCPY(p_curr, buf_extras, sz_ext);
  ------------------
  |  |  170|  9.64k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2159|  9.64k|    p_curr += sz_ext;
 2160|       |
 2161|  9.64k|    ZXC_MEMSET(p_curr, 0, pad);
  ------------------
  |  |  175|  9.64k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
 2162|  9.64k|    p_curr += pad;
 2163|       |
 2164|  9.64k|    bh.comp_size = (uint32_t)(p_curr - (dst + ZXC_BLOCK_HEADER_SIZE));
  ------------------
  |  |  428|  9.64k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2165|  9.64k|    const int hw = zxc_write_block_header(dst, dst_cap, &bh);
 2166|  9.64k|    if (UNLIKELY(hw < 0)) return hw;
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 2167|       |
 2168|       |    // Checksum will be appended by the wrapper
 2169|  9.64k|    *out_sz = ZXC_BLOCK_HEADER_SIZE + bh.comp_size;
  ------------------
  |  |  428|  9.64k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2170|  9.64k|    return ZXC_OK;
 2171|  9.64k|}
zxc_compress.c:zxc_hash_tag:
   61|  8.97M|static ZXC_ALWAYS_INLINE uint8_t zxc_hash_tag(const uint32_t val4) {
   62|  8.97M|    return (uint8_t)(val4 ^ (val4 >> 16));
   63|  8.97M|}
zxc_compress.c:zxc_epoch_pos:
   72|  3.80M|                                                const uint32_t epoch_mark) {
   73|  3.80M|    return ((head & ~offset_mask) == epoch_mark) ? (head & offset_mask) : 0;
  ------------------
  |  Branch (73:12): [True: 3.12M, False: 686k]
  ------------------
   74|  3.80M|}
zxc_compress.c:zxc_chain_delta:
   82|  8.97M|static ZXC_ALWAYS_INLINE uint16_t zxc_chain_delta(const uint32_t cur_pos, const uint32_t prev_idx) {
   83|  8.97M|    const uint32_t dist = cur_pos - prev_idx;
   84|       |    // cppcheck-suppress bitwiseOnBoolean
   85|  8.97M|    const uint32_t valid = 0U - (uint32_t)((prev_idx != 0) & (dist < ZXC_LZ_WINDOW_SIZE));
  ------------------
  |  |  571|  8.97M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  ------------------
   86|  8.97M|    return (uint16_t)(dist & valid);
   87|  8.97M|}
zxc_compress.c:zxc_hash_func:
   45|  17.9M|static ZXC_ALWAYS_INLINE uint32_t zxc_hash_func(const uint64_t val, const int use_hash5) {
   46|  17.9M|    if (use_hash5) {
  ------------------
  |  Branch (46:9): [True: 0, False: 17.9M]
  ------------------
   47|      0|        const uint64_t v5 = val & 0xFFFFFFFFFFULL;
   48|      0|        return (uint32_t)((v5 * ZXC_HASH_XORSHIFT64) >> (64 - ZXC_LZ_HASH_BITS));
  ------------------
  |  |  751|      0|#define ZXC_HASH_XORSHIFT64 0x2545F4914F6CDD1DULL
  ------------------
                      return (uint32_t)((v5 * ZXC_HASH_XORSHIFT64) >> (64 - ZXC_LZ_HASH_BITS));
  ------------------
  |  |  567|      0|#define ZXC_LZ_HASH_BITS 15
  ------------------
   49|  17.9M|    } else {
   50|  17.9M|        const uint64_t v4 = val ^ (val >> 15);
   51|  17.9M|        return ((uint32_t)v4 * ZXC_HASH_MULT32) >> (32 - ZXC_LZ_HASH_BITS);
  ------------------
  |  |  753|  17.9M|#define ZXC_HASH_MULT32 0x2D35182DU
  ------------------
                      return ((uint32_t)v4 * ZXC_HASH_MULT32) >> (32 - ZXC_LZ_HASH_BITS);
  ------------------
  |  |  567|  17.9M|#define ZXC_LZ_HASH_BITS 15
  ------------------
   52|  17.9M|    }
   53|  17.9M|}
zxc_compress.c:zxc_lz77_find_best_match:
  572|  8.97M|    const int level, const zxc_lz77_params_t p, const uint32_t last_off) {
  573|  8.97M|    const int use_hash5 = (level >= ZXC_LEVEL_DEFAULT);
  574|       |    // Sentinel length just below the minimum, so any valid match replaces it.
  575|  8.97M|    zxc_match_t best = (zxc_match_t){NULL, ZXC_LZ_MIN_MATCH_LEN - 1, 0};
  ------------------
  |  |  575|  8.97M|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
  576|       |
  577|  8.97M|    uint64_t cur_val8 = zxc_le64(ip);
  578|  8.97M|    uint32_t cur_val = (uint32_t)cur_val8;
  579|  8.97M|    uint32_t h = zxc_hash_func(cur_val8, use_hash5);
  580|       |
  581|       |    // 8-bit tag: XOR fold of first 4 bytes for fast rejection
  582|  8.97M|    const uint8_t cur_tag = zxc_hash_tag(cur_val);
  583|       |
  584|  8.97M|    const uint32_t cur_pos = (uint32_t)(ip - src);
  585|       |
  586|       |    // Tag-first filter on fast levels.
  587|  8.97M|    const uint8_t stored_tag = hash_tags[h];
  588|  8.97M|    uint32_t match_idx;
  589|  8.97M|    if (level <= ZXC_LEVEL_FAST && stored_tag != cur_tag) {
  ------------------
  |  Branch (589:9): [True: 8.97M, False: 0]
  |  Branch (589:36): [True: 5.16M, False: 3.80M]
  ------------------
  590|  5.16M|        match_idx = 0;
  591|  5.16M|    } else {
  592|  3.80M|        match_idx = zxc_epoch_pos(hash_table[h], offset_mask, epoch_mark);
  593|  3.80M|    }
  594|       |
  595|       |    // skip_head still drives the chain walk on level >= 3 (advances past the
  596|       |    // mismatched head without comparing). On level <= 2 it is always 0 here:
  597|       |    // either match_idx == 0 (filter-skip) or stored_tag == cur_tag.
  598|       |    // cppcheck-suppress bitwiseOnBoolean
  599|  8.97M|    const int skip_head = (match_idx != 0) & (stored_tag != cur_tag);
  600|       |
  601|       |    // Split table writes
  602|  8.97M|    hash_table[h] = epoch_mark | cur_pos;
  603|  8.97M|    hash_tags[h] = cur_tag;
  604|       |
  605|  8.97M|    chain_table[cur_pos & ZXC_LZ_WINDOW_MASK] = zxc_chain_delta(cur_pos, match_idx);
  ------------------
  |  |  573|  8.97M|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  571|  8.97M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  606|       |
  607|  8.97M|    int attempts = p.search_depth;
  608|       |
  609|       |    // Repeat-offset seed (level-6 parser passes last_off; others pass 0).
  610|       |    // Probing the previous offset first often finds the longest match right
  611|       |    // away, speeding up the chain walk. It only raises best.len, never lowers
  612|       |    // it, so the result is unchanged - this is purely a speed optimization.
  613|  8.97M|    if (last_off != 0U && last_off >= p.min_offset && last_off <= (uint32_t)ZXC_LZ_MAX_DIST &&
  ------------------
  |  |  678|  8.97M|#define ZXC_LZ_MAX_DIST (ZXC_LZ_WINDOW_SIZE - 1)
  |  |  ------------------
  |  |  |  |  571|      0|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  |  Branch (613:9): [True: 0, False: 8.97M]
  |  Branch (613:27): [True: 0, False: 0]
  |  Branch (613:55): [True: 0, False: 0]
  ------------------
  614|      0|        last_off <= cur_pos) {
  ------------------
  |  Branch (614:9): [True: 0, False: 0]
  ------------------
  615|      0|        const uint8_t* const rep_ref = src + (cur_pos - last_off);
  616|      0|        if (zxc_le32(rep_ref) == cur_val) {
  ------------------
  |  Branch (616:13): [True: 0, False: 0]
  ------------------
  617|      0|            uint32_t mlen = sizeof(uint32_t);
  618|      0|            const uint8_t* const limit_8 = iend - sizeof(uint64_t);
  619|      0|            while (ip + mlen < limit_8) {
  ------------------
  |  Branch (619:20): [True: 0, False: 0]
  ------------------
  620|      0|                const uint64_t diff = zxc_le64(ip + mlen) ^ zxc_le64(rep_ref + mlen);
  621|      0|                if (diff == 0) {
  ------------------
  |  Branch (621:21): [True: 0, False: 0]
  ------------------
  622|      0|                    mlen += sizeof(uint64_t);
  623|      0|                } else {
  624|      0|                    mlen += (uint32_t)(zxc_ctz64(diff) >> 3);
  625|      0|                    goto _rep_done;
  626|      0|                }
  627|      0|            }
  628|      0|            while (ip + mlen < iend && rep_ref[mlen] == ip[mlen]) mlen++;
  ------------------
  |  Branch (628:20): [True: 0, False: 0]
  |  Branch (628:40): [True: 0, False: 0]
  ------------------
  629|      0|        _rep_done:;
  630|      0|            best.len = mlen;
  631|      0|            best.ref = rep_ref;
  632|      0|            if (UNLIKELY(best.len >= (uint32_t)p.sufficient_len || ip + best.len >= iend))
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  633|      0|                goto _finalize_match;
  634|      0|        }
  635|      0|    }
  636|       |
  637|  8.97M|    if (match_idx == 0) goto _finalize_match;
  ------------------
  |  Branch (637:9): [True: 5.84M, False: 3.12M]
  ------------------
  638|       |
  639|       |    // Optimization: If head tag doesn't match, advance immediately without loading the first
  640|       |    // mismatch.
  641|  3.12M|    if (skip_head) {
  ------------------
  |  Branch (641:9): [True: 0, False: 3.12M]
  ------------------
  642|      0|        const uint16_t delta = chain_table[match_idx & ZXC_LZ_WINDOW_MASK];
  ------------------
  |  |  573|      0|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  571|      0|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  643|      0|        const uint32_t next_idx = match_idx - delta;
  644|      0|        match_idx = (delta != 0) ? next_idx : 0;
  ------------------
  |  Branch (644:21): [True: 0, False: 0]
  ------------------
  645|      0|        attempts--;
  646|      0|    }
  647|       |
  648|  10.4M|    while (match_idx > 0) {
  ------------------
  |  Branch (648:12): [True: 10.1M, False: 298k]
  ------------------
  649|  10.1M|        if (UNLIKELY(attempts-- < 0 || cur_pos - match_idx > ZXC_LZ_MAX_DIST)) break;
  ------------------
  |  |  154|  18.6M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 2.05M, False: 8.07M]
  |  |  |  Branch (154:42): [True: 1.60M, False: 8.53M]
  |  |  |  Branch (154:42): [True: 452k, False: 8.07M]
  |  |  ------------------
  ------------------
  650|  8.07M|        const uint8_t* ref = src + match_idx;
  651|       |
  652|       |        // Load the next chain link early (before the compare) so its address
  653|       |        // resolves while we prefetch. The prefetch aims at the next gate for
  654|       |        // the current best.len; a longer match found here moves that gate.
  655|  8.07M|        const uint16_t delta = chain_table[match_idx & ZXC_LZ_WINDOW_MASK];
  ------------------
  |  |  573|  8.07M|#define ZXC_LZ_WINDOW_MASK (ZXC_LZ_WINDOW_SIZE - 1U)
  |  |  ------------------
  |  |  |  |  571|  8.07M|#define ZXC_LZ_WINDOW_SIZE (1U << 16)
  |  |  ------------------
  ------------------
  656|  8.07M|        const uint32_t next_idx = match_idx - delta;
  657|  8.07M|        ZXC_PREFETCH_READ(src + next_idx + best.len - 3);
  ------------------
  |  |  165|  8.07M|#define ZXC_PREFETCH_READ(ptr) __builtin_prefetch((const void*)(ptr), 0, 3)
  ------------------
  658|       |
  659|       |        // Gate first: most candidates share the head and fail on bytes
  660|       |        // [best.len-3, best.len], which a longer match must also cover.
  661|  8.07M|        const int should_compare = (cur_pos - match_idx) >= p.min_offset &&
  ------------------
  |  Branch (661:36): [True: 7.45M, False: 624k]
  ------------------
  662|  7.45M|                                   zxc_le32(ref + best.len - 3) == zxc_le32(ip + best.len - 3) &&
  ------------------
  |  Branch (662:36): [True: 3.47M, False: 3.97M]
  ------------------
  663|  3.47M|                                   zxc_le32(ref) == cur_val;
  ------------------
  |  Branch (663:36): [True: 3.47M, False: 1.51k]
  ------------------
  664|       |
  665|  8.07M|        if (should_compare) {
  ------------------
  |  Branch (665:13): [True: 3.47M, False: 4.60M]
  ------------------
  666|  3.47M|            uint32_t mlen = sizeof(uint32_t);  // We already know the first 4 bytes match
  667|       |
  668|       |            // Fast path: Scalar 64-bit comparison for short matches (=< 64 bytes)
  669|       |            // Most matches are short, so this avoids SIMD overhead for common cases
  670|  3.47M|            const uint8_t* limit_8 = iend - sizeof(uint64_t);
  671|  3.47M|            const uint8_t* scalar_limit = ip + mlen + 64;
  672|  3.47M|            if (scalar_limit > limit_8) scalar_limit = limit_8;
  ------------------
  |  Branch (672:17): [True: 15.9k, False: 3.45M]
  ------------------
  673|       |
  674|  6.75M|            while (ip + mlen < scalar_limit) {
  ------------------
  |  Branch (674:20): [True: 6.58M, False: 170k]
  ------------------
  675|  6.58M|                uint64_t diff = zxc_le64(ip + mlen) ^ zxc_le64(ref + mlen);
  676|  6.58M|                if (diff == 0)
  ------------------
  |  Branch (676:21): [True: 3.28M, False: 3.30M]
  ------------------
  677|  3.28M|                    mlen += sizeof(uint64_t);
  678|  3.30M|                else {
  679|  3.30M|                    mlen += (uint32_t)zxc_ctz64(diff) >> 3;
  680|  3.30M|                    goto _match_len_done;
  681|  3.30M|                }
  682|  6.58M|            }
  683|       |
  684|       |            // Long match path: Use SIMD for matches exceeding 64 bytes
  685|       |#if defined(ZXC_USE_AVX512)
  686|       |            const uint8_t* limit_64 = iend - 64;
  687|       |            while (ip + mlen < limit_64) {
  688|       |                const __m512i v_src = _mm512_loadu_si512((const void*)(ip + mlen));
  689|       |                const __m512i v_ref = _mm512_loadu_si512((const void*)(ref + mlen));
  690|       |                const __mmask64 mask = _mm512_cmpeq_epi8_mask(v_src, v_ref);
  691|       |                if (mask == 0xFFFFFFFFFFFFFFFF)
  692|       |                    mlen += 64;
  693|       |                else {
  694|       |                    mlen += (uint32_t)zxc_ctz64(~mask);
  695|       |                    goto _match_len_done;
  696|       |                }
  697|       |            }
  698|       |#elif defined(ZXC_USE_AVX2)
  699|       |            const uint8_t* limit_32 = iend - 32;
  700|       |            while (ip + mlen < limit_32) {
  701|       |                const __m256i v_src = _mm256_loadu_si256((const __m256i*)(ip + mlen));
  702|       |                const __m256i v_ref = _mm256_loadu_si256((const __m256i*)(ref + mlen));
  703|       |                const __m256i v_cmp = _mm256_cmpeq_epi8(v_src, v_ref);
  704|       |                const uint32_t mask = (uint32_t)_mm256_movemask_epi8(v_cmp);
  705|       |                if (mask == 0xFFFFFFFF)
  706|       |                    mlen += 32;
  707|       |                else {
  708|       |                    mlen += (uint32_t)zxc_ctz32(~mask);
  709|       |                    goto _match_len_done;
  710|       |                }
  711|       |            }
  712|       |#elif defined(ZXC_USE_SSE2)
  713|   170k|            const uint8_t* limit_16 = iend - 16;
  714|  7.09M|            while (ip + mlen < limit_16) {
  ------------------
  |  Branch (714:20): [True: 7.09M, False: 2.94k]
  ------------------
  715|  7.09M|                const __m128i v_src = _mm_loadu_si128((const __m128i*)(ip + mlen));
  716|  7.09M|                const __m128i v_ref = _mm_loadu_si128((const __m128i*)(ref + mlen));
  717|  7.09M|                const __m128i v_cmp = _mm_cmpeq_epi8(v_src, v_ref);
  718|  7.09M|                const uint32_t mask = (uint32_t)_mm_movemask_epi8(v_cmp);
  719|  7.09M|                if (mask == 0xFFFFU)
  ------------------
  |  Branch (719:21): [True: 6.92M, False: 167k]
  ------------------
  720|  6.92M|                    mlen += 16;
  721|   167k|                else {
  722|       |                    // mask != 0xFFFF => a differing byte exists in bits 0..15,
  723|       |                    // so the lowest set bit of ~mask lies in that range.
  724|   167k|                    mlen += (uint32_t)zxc_ctz32(~mask);
  725|   167k|                    goto _match_len_done;
  726|   167k|                }
  727|  7.09M|            }
  728|       |#elif defined(ZXC_USE_NEON64)
  729|       |            {
  730|       |                const uint8_t* limit_32 = iend - 32;
  731|       |                while (ip + mlen < limit_32) {
  732|       |                    const uint8x16_t s0 = vld1q_u8(ip + mlen);
  733|       |                    const uint8x16_t r0 = vld1q_u8(ref + mlen);
  734|       |                    const uint8x16_t c0 = vceqq_u8(s0, r0);
  735|       |                    const uint64_t m0 = vget_lane_u64(
  736|       |                        vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(c0), 4)), 0);
  737|       |                    if (UNLIKELY(m0 != ~(uint64_t)0)) {
  738|       |                        mlen += (uint32_t)(zxc_ctz64(~m0) >> 2);
  739|       |                        goto _match_len_done;
  740|       |                    }
  741|       |                    const uint8x16_t s1 = vld1q_u8(ip + mlen + 16);
  742|       |                    const uint8x16_t r1 = vld1q_u8(ref + mlen + 16);
  743|       |                    const uint8x16_t c1 = vceqq_u8(s1, r1);
  744|       |                    const uint64_t m1 = vget_lane_u64(
  745|       |                        vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(c1), 4)), 0);
  746|       |                    if (UNLIKELY(m1 != ~(uint64_t)0)) {
  747|       |                        mlen += 16 + (uint32_t)(zxc_ctz64(~m1) >> 2);
  748|       |                        goto _match_len_done;
  749|       |                    }
  750|       |                    mlen += 32;
  751|       |                }
  752|       |                if (ip + mlen < iend - 16) {
  753|       |                    const uint8x16_t v_src = vld1q_u8(ip + mlen);
  754|       |                    const uint8x16_t v_ref = vld1q_u8(ref + mlen);
  755|       |                    const uint8x16_t v_cmp = vceqq_u8(v_src, v_ref);
  756|       |                    const uint64_t mask = vget_lane_u64(
  757|       |                        vreinterpret_u64_u8(vshrn_n_u16(vreinterpretq_u16_u8(v_cmp), 4)), 0);
  758|       |                    if (LIKELY(mask == ~(uint64_t)0))
  759|       |                        mlen += 16;
  760|       |                    else {
  761|       |                        mlen += (uint32_t)(zxc_ctz64(~mask) >> 2);
  762|       |                        goto _match_len_done;
  763|       |                    }
  764|       |                }
  765|       |            }
  766|       |#elif defined(ZXC_USE_NEON32)
  767|       |            {
  768|       |                const uint8_t* limit_16 = iend - 16;
  769|       |                while (ip + mlen < limit_16) {
  770|       |                    const uint8x16_t v_src = vld1q_u8(ip + mlen);
  771|       |                    const uint8x16_t v_ref = vld1q_u8(ref + mlen);
  772|       |                    const uint8x16_t v_cmp = vceqq_u8(v_src, v_ref);
  773|       |                    uint8x8_t p1 = vpmin_u8(vget_low_u8(v_cmp), vget_high_u8(v_cmp));
  774|       |                    uint8x8_t p2 = vpmin_u8(p1, p1);
  775|       |                    uint8x8_t p3 = vpmin_u8(p2, p2);
  776|       |                    uint8x8_t p4 = vpmin_u8(p3, p3);
  777|       |                    uint8_t min_val = vget_lane_u8(p4, 0);
  778|       |                    if (min_val == 0xFF)
  779|       |                        mlen += 16;
  780|       |                    else {
  781|       |                        uint8x16_t v_diff = vmvnq_u8(v_cmp);
  782|       |                        uint64_t lo =
  783|       |                            (uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 0) |
  784|       |                            ((uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 1) << 32);
  785|       |                        if (lo != 0)
  786|       |                            mlen += (zxc_ctz64(lo) >> 3);
  787|       |                        else
  788|       |                            mlen +=
  789|       |                                8 + (zxc_ctz64(
  790|       |                                         (uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 2) |
  791|       |                                         ((uint64_t)vgetq_lane_u32(vreinterpretq_u32_u8(v_diff), 3)
  792|       |                                          << 32)) >>
  793|       |                                     3);
  794|       |                        goto _match_len_done;
  795|       |                    }
  796|       |                }
  797|       |            }
  798|       |#endif
  799|  3.07k|            while (ip + mlen < limit_8) {
  ------------------
  |  Branch (799:20): [True: 284, False: 2.79k]
  ------------------
  800|    284|                const uint64_t diff = zxc_le64(ip + mlen) ^ zxc_le64(ref + mlen);
  801|    284|                if (diff == 0)
  ------------------
  |  Branch (801:21): [True: 130, False: 154]
  ------------------
  802|    130|                    mlen += sizeof(uint64_t);
  803|    154|                else {
  804|    154|                    mlen += (uint32_t)zxc_ctz64(diff) >> 3;
  805|    154|                    goto _match_len_done;
  806|    154|                }
  807|    284|            }
  808|  12.1k|            while (ip + mlen < iend && ref[mlen] == ip[mlen]) mlen++;
  ------------------
  |  Branch (808:20): [True: 11.4k, False: 747]
  |  Branch (808:40): [True: 9.36k, False: 2.04k]
  ------------------
  809|       |
  810|  3.47M|        _match_len_done:;
  811|  3.47M|            const int better = (mlen > best.len);
  812|  3.47M|            best.len = better ? mlen : best.len;
  ------------------
  |  Branch (812:24): [True: 3.41M, False: 56.1k]
  ------------------
  813|  3.47M|            best.ref = better ? ref : best.ref;
  ------------------
  |  Branch (813:24): [True: 3.41M, False: 56.1k]
  ------------------
  814|       |
  815|  3.47M|            if (UNLIKELY(best.len >= (uint32_t)p.sufficient_len || ip + best.len >= iend)) break;
  ------------------
  |  |  154|  6.18M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 770k, False: 2.70M]
  |  |  |  Branch (154:42): [True: 770k, False: 2.70M]
  |  |  |  Branch (154:42): [True: 312, False: 2.70M]
  |  |  ------------------
  ------------------
  816|  3.47M|        }
  817|       |
  818|  7.30M|        match_idx = (delta != 0) ? next_idx : 0;
  ------------------
  |  Branch (818:21): [True: 7.00M, False: 298k]
  ------------------
  819|  7.30M|    }
  820|       |
  821|  8.97M|_finalize_match:
  822|  8.97M|    if (best.ref) {
  ------------------
  |  Branch (822:9): [True: 2.49M, False: 6.48M]
  ------------------
  823|       |        // Backtrack to extend match backwards
  824|  2.49M|        const uint8_t* b_ip = ip;
  825|  2.49M|        const uint8_t* b_ref = best.ref;
  826|  4.46M|        while (b_ip > anchor && b_ref > src && b_ip[-1] == b_ref[-1]) {
  ------------------
  |  Branch (826:16): [True: 2.98M, False: 1.47M]
  |  Branch (826:33): [True: 2.98M, False: 735]
  |  Branch (826:48): [True: 1.97M, False: 1.01M]
  ------------------
  827|  1.97M|            b_ip--;
  828|  1.97M|            b_ref--;
  829|  1.97M|            best.len++;
  830|  1.97M|            best.backtrack++;
  831|  1.97M|        }
  832|  2.49M|        best.ref = b_ref;
  833|  2.49M|    }
  834|       |
  835|       |    // Lazy: a match two bytes longer at ip+1, or from level 4 three bytes longer
  836|       |    // at ip+2, cancels this one.
  837|  8.97M|    if (p.use_lazy && best.ref && best.len < (uint32_t)p.lazy_len_threshold &&
  ------------------
  |  Branch (837:9): [True: 0, False: 8.97M]
  |  Branch (837:23): [True: 0, False: 0]
  |  Branch (837:35): [True: 0, False: 0]
  ------------------
  838|      0|        ip + 1 < search_limit) {
  ------------------
  |  Branch (838:9): [True: 0, False: 0]
  ------------------
  839|      0|        if (zxc_lazy_probe(src, ip + 1, iend, best.len + 2, hash_table, hash_tags, chain_table,
  ------------------
  |  Branch (839:13): [True: 0, False: 0]
  ------------------
  840|      0|                           epoch_mark, offset_mask, use_hash5, p) ||
  841|      0|            (level >= ZXC_LEVEL_BALANCED && ip + 2 < search_limit &&
  ------------------
  |  Branch (841:14): [True: 0, False: 0]
  |  Branch (841:45): [True: 0, False: 0]
  ------------------
  842|      0|             zxc_lazy_probe(src, ip + 2, iend, best.len + 3, hash_table, hash_tags, chain_table,
  ------------------
  |  Branch (842:14): [True: 0, False: 0]
  ------------------
  843|      0|                            epoch_mark, offset_mask, use_hash5, p)))
  844|      0|            best.ref = NULL;
  845|      0|    }
  846|       |
  847|  8.97M|    return best;
  848|  3.12M|}
zxc_compress.c:zxc_flush_literals:
  445|  1.01M|                                                 const uint8_t* iend) {
  446|  1.01M|    if (LIKELY(anchor + ZXC_PAD_SIZE <= iend)) {
  ------------------
  |  |  148|  1.01M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 1.01M, False: 1.66k]
  |  |  ------------------
  ------------------
  447|  1.01M|        zxc_copy32(literals + *lit_c, anchor);
  448|  1.01M|        if (UNLIKELY(ll > ZXC_PAD_SIZE))
  ------------------
  |  |  154|  1.01M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 164k, False: 846k]
  |  |  ------------------
  ------------------
  449|   164k|            ZXC_MEMCPY(literals + *lit_c + ZXC_PAD_SIZE, anchor + ZXC_PAD_SIZE, ll - ZXC_PAD_SIZE);
  ------------------
  |  |  170|   164k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  450|  1.01M|    } else {
  451|  1.66k|        ZXC_MEMCPY(literals + *lit_c, anchor, ll);
  ------------------
  |  |  170|  1.66k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  452|  1.66k|    }
  453|  1.01M|    *lit_c += ll;
  454|  1.01M|}
zxc_compress.c:zxc_emit_extra:
  234|  4.98M|                                            const uint32_t val, const uint32_t mask) {
  235|  4.98M|    if (LIKELY(val < mask)) return 1;
  ------------------
  |  |  148|  4.98M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 4.88M, False: 96.7k]
  |  |  ------------------
  ------------------
  236|  96.7k|    const size_t n = zxc_write_varint(extras + *used, val - mask);
  237|  96.7k|    if (UNLIKELY(n == 0)) return 0;
  ------------------
  |  |  154|  96.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 96.7k]
  |  |  ------------------
  ------------------
  238|  96.7k|    *used += n;
  239|  96.7k|    return 1;
  240|  96.7k|}
zxc_compress.c:zxc_write_varint:
  198|  96.7k|static ZXC_ALWAYS_INLINE size_t zxc_write_varint(uint8_t* RESTRICT dst, const uint32_t val) {
  199|       |    // Values above ZXC_MAX_VARINT_VALUE are out-of-spec and the decoder would
  200|       |    // reject them. Unreachable from the Block API, so this is defence in depth;
  201|       |    // callers must treat a return of 0 as an encoding error.
  202|  96.7k|    if (UNLIKELY(val > ZXC_MAX_VARINT_VALUE)) {
  ------------------
  |  |  154|  96.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 96.7k]
  |  |  ------------------
  ------------------
  203|      0|        return 0;
  204|      0|    }
  205|       |
  206|       |    // 1 byte: 0xxxxxxx (7 bits)
  207|  96.7k|    if (LIKELY(val < ZXC_VARINT_1B_LIMIT)) {
  ------------------
  |  |  148|  96.7k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 38.4k, False: 58.2k]
  |  |  ------------------
  ------------------
  208|  38.4k|        dst[0] = (uint8_t)val;
  209|  38.4k|        return 1;
  210|  38.4k|    }
  211|       |
  212|       |    // 2 bytes: 10xxxxxx xxxxxxxx (14 bits)
  213|  58.2k|    if (LIKELY(val < ZXC_VARINT_2B_LIMIT)) {
  ------------------
  |  |  148|  58.2k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 56.1k, False: 2.10k]
  |  |  ------------------
  ------------------
  214|  56.1k|        dst[0] = (uint8_t)(0x80 | (val & 0x3F));
  215|  56.1k|        dst[1] = (uint8_t)(val >> 6);
  216|  56.1k|        return 2;
  217|  56.1k|    }
  218|       |
  219|       |    // 3 bytes: 110xxxxx xxxxxxxx xxxxxxxx (21 bits) -> max emittable value,
  220|       |    // matching ZXC_MAX_VARINT_VALUE = ZXC_BLOCK_SIZE_MAX - 1.
  221|  2.10k|    dst[0] = (uint8_t)(0xC0 | (val & 0x1F));
  222|  2.10k|    dst[1] = (uint8_t)(val >> 5);
  223|  2.10k|    dst[2] = (uint8_t)(val >> 13);
  224|  2.10k|    return 3;
  225|  58.2k|}
zxc_compress.c:zxc_encode_block_raw:
 2190|  3.38k|                                size_t* RESTRICT const out_sz) {
 2191|  3.38k|    if (UNLIKELY(dst_cap < ZXC_BLOCK_HEADER_SIZE + src_sz)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  3.38k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 3.38k]
  |  |  ------------------
  ------------------
 2192|       |
 2193|  3.38k|    zxc_block_header_t bh;
 2194|  3.38k|    bh.block_type = ZXC_BLOCK_RAW;
 2195|  3.38k|    bh.block_flags = 0;  // Checksum flag moved to file header
 2196|  3.38k|    bh.reserved = 0;
 2197|  3.38k|    bh.comp_size = (uint32_t)src_sz;
 2198|       |
 2199|  3.38k|    const int hw = zxc_write_block_header(dst, dst_cap, &bh);
 2200|  3.38k|    if (UNLIKELY(hw < 0)) return hw;
  ------------------
  |  |  154|  3.38k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 3.38k]
  |  |  ------------------
  ------------------
 2201|       |
 2202|  3.38k|    ZXC_MEMCPY(dst + ZXC_BLOCK_HEADER_SIZE, src, src_sz);
  ------------------
  |  |  170|  3.38k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2203|       |
 2204|       |    // Checksum will be appended by the wrapper
 2205|  3.38k|    *out_sz = ZXC_BLOCK_HEADER_SIZE + src_sz;
  ------------------
  |  |  428|  3.38k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 2206|  3.38k|    return ZXC_OK;
 2207|  3.38k|}

zxc_decompress_chunk_wrapper_default:
 1654|  17.7k|                                 const uint64_t block_index) {
 1655|  17.7k|    return zxc_decompress_chunk_wrapper_body(ctx, src, src_sz, dst, dst_cap, block_index, 0, 0);
 1656|  17.7k|}
zxc_decompress.c:zxc_decompress_chunk_wrapper_body:
 1588|  17.7k|    const int safe) {
 1589|  17.7k|    if (UNLIKELY(src_sz < ZXC_BLOCK_HEADER_SIZE)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|  17.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 17.7k]
  |  |  ------------------
  ------------------
 1590|       |
 1591|  17.7k|    const uint8_t type = src[0];
 1592|  17.7k|    const uint32_t comp_sz = zxc_le32(src + 3);
 1593|  17.7k|    const int has_checksum = ctx->checksum_enabled;
 1594|       |
 1595|       |    // A block never compresses past its own content size
 1596|  17.7k|    if (UNLIKELY((uint64_t)comp_sz > (uint64_t)ctx->chunk_size)) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  154|  17.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 17.7k]
  |  |  ------------------
  ------------------
 1597|       |
 1598|       |    // Check bounds: Header + Body + Checksum(if any)
 1599|  17.7k|    const size_t expected_sz =
 1600|  17.7k|        (size_t)ZXC_BLOCK_HEADER_SIZE + comp_sz + (has_checksum ? ZXC_BLOCK_CHECKSUM_SIZE : 0);
  ------------------
  |  |  428|  17.7k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
                      (size_t)ZXC_BLOCK_HEADER_SIZE + comp_sz + (has_checksum ? ZXC_BLOCK_CHECKSUM_SIZE : 0);
  ------------------
  |  |  430|  1.39k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
  |  Branch (1600:52): [True: 1.39k, False: 16.3k]
  ------------------
 1601|  17.7k|    if (UNLIKELY(src_sz < expected_sz)) return ZXC_ERROR_SRC_TOO_SMALL;
  ------------------
  |  |  154|  17.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 17.7k]
  |  |  ------------------
  ------------------
 1602|       |
 1603|  17.7k|    const uint8_t* data = src + ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  17.7k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1604|       |
 1605|  17.7k|    int decoded_sz = ZXC_ERROR_BAD_BLOCK_TYPE;
 1606|       |
 1607|  17.7k|    switch (type) {
 1608|  6.92k|        case ZXC_BLOCK_SPL:
  ------------------
  |  Branch (1608:9): [True: 6.92k, False: 10.8k]
  ------------------
 1609|  6.92k|            decoded_sz = safe       ? zxc_decode_block_spl_safe(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1609:26): [True: 0, False: 6.92k]
  ------------------
 1610|  6.92k|                         : has_dict ? zxc_decode_block_spl_dict(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1610:28): [True: 0, False: 6.92k]
  ------------------
 1611|  6.92k|                                    : zxc_decode_block_spl(ctx, data, comp_sz, dst, dst_cap);
 1612|  6.92k|            break;
 1613|  6.72k|        case ZXC_BLOCK_PAK:
  ------------------
  |  Branch (1613:9): [True: 6.72k, False: 11.0k]
  ------------------
 1614|  6.72k|            decoded_sz = safe       ? zxc_decode_block_pak_safe(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1614:26): [True: 0, False: 6.72k]
  ------------------
 1615|  6.72k|                         : has_dict ? zxc_decode_block_pak_dict(ctx, data, comp_sz, dst, dst_cap)
  ------------------
  |  Branch (1615:28): [True: 0, False: 6.72k]
  ------------------
 1616|  6.72k|                                    : zxc_decode_block_pak(ctx, data, comp_sz, dst, dst_cap);
 1617|  6.72k|            break;
 1618|  4.10k|        case ZXC_BLOCK_RAW:
  ------------------
  |  Branch (1618:9): [True: 4.10k, False: 13.6k]
  ------------------
 1619|       |            // For RAW blocks, comp_sz == raw_sz (uncompressed data stored as-is)
 1620|  4.10k|            if (UNLIKELY(comp_sz > dst_cap)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  4.10k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 4.10k]
  |  |  ------------------
  ------------------
 1621|  4.10k|            ZXC_MEMCPY(dst, data, comp_sz);
  ------------------
  |  |  170|  4.10k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1622|  4.10k|            decoded_sz = (int)comp_sz;
 1623|  4.10k|            break;
 1624|      0|        case ZXC_BLOCK_EOF:
  ------------------
  |  Branch (1624:9): [True: 0, False: 17.7k]
  ------------------
 1625|       |            // EOF should be handled by the dispatcher, not here
 1626|      0|            return ZXC_ERROR_CORRUPT_DATA;
 1627|      4|        default:
  ------------------
  |  Branch (1627:9): [True: 4, False: 17.7k]
  ------------------
 1628|      4|            return ZXC_ERROR_BAD_BLOCK_TYPE;
 1629|  17.7k|    }
 1630|       |
 1631|       |    // dst_cap includes the wild-copy margin: bound the block itself
 1632|  17.7k|    if (UNLIKELY(decoded_sz > 0 && (size_t)decoded_sz > ctx->chunk_size))
  ------------------
  |  |  154|  29.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 25, False: 17.7k]
  |  |  |  Branch (154:42): [True: 11.8k, False: 5.88k]
  |  |  |  Branch (154:42): [True: 25, False: 11.8k]
  |  |  ------------------
  ------------------
 1633|     25|        return ZXC_ERROR_BAD_BLOCK_SIZE;
 1634|       |
 1635|  17.7k|    if (has_checksum && LIKELY(decoded_sz >= 0)) {
  ------------------
  |  |  148|  1.39k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 1.39k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1635:9): [True: 1.39k, False: 16.3k]
  ------------------
 1636|  1.39k|        const uint32_t stored = zxc_le32(data + comp_sz);
 1637|  1.39k|        if (UNLIKELY(stored !=
  ------------------
  |  |  154|  1.39k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 1.39k]
  |  |  ------------------
  ------------------
 1638|  1.39k|                     zxc_checksum(dst, (size_t)decoded_sz, block_index, ZXC_CHECKSUM_RAPIDHASH)))
 1639|      0|            return ZXC_ERROR_BAD_CHECKSUM;
 1640|  1.39k|    }
 1641|       |
 1642|  17.7k|    return decoded_sz;
 1643|  17.7k|}
zxc_decompress.c:zxc_decode_block_spl_impl:
  796|  9.49k|                                                       const int has_dict, const int tok_entropy) {
  797|  9.49k|    zxc_gnr_header_t gh;
  798|       |
  799|       |    // Constant 0 when !has_dict, so `d_floor` folds to `dst`.
  800|  9.49k|    const size_t dict_size = has_dict ? ctx->dict_size : 0;
  ------------------
  |  Branch (800:30): [True: 0, False: 9.49k]
  ------------------
  801|  9.49k|    uint32_t lit_comp;
  802|  9.49k|    uint32_t tok_comp;
  803|       |
  804|  9.49k|    const int hdr_sz = zxc_read_spl_header_and_desc(src, src_size, &gh, &lit_comp, &tok_comp);
  805|  9.49k|    if (UNLIKELY(hdr_sz < 0)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|  9.49k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 11, False: 9.47k]
  |  |  ------------------
  ------------------
  806|       |
  807|       |    // Only 0 and 1 are defined widths.
  808|  9.47k|    if (UNLIKELY(gh.enc_off > 1)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 22, False: 9.45k]
  |  |  ------------------
  ------------------
  809|       |
  810|       |    // Entropy-coded tokens (level 7): tail-call the dedicated instantiation
  811|       |    // before any section work - it restarts from the header, so only the parse
  812|       |    // above is duplicated. Flags are constant per instantiation, so exactly one
  813|       |    // call survives and t_ptr keeps a single provenance below.
  814|  9.45k|    if (!tok_entropy && UNLIKELY(gh.enc_tok == ZXC_SECTION_ENCODING_HUFFMAN)) {
  ------------------
  |  |  154|  6.89k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 2.56k, False: 4.33k]
  |  |  ------------------
  ------------------
  |  Branch (814:9): [True: 6.89k, False: 2.56k]
  ------------------
  815|  2.56k|        if (safe) return zxc_decode_block_spl_entropy_safe(ctx, src, src_size, dst, dst_capacity);
  ------------------
  |  Branch (815:13): [True: 0, False: 2.56k]
  ------------------
  816|  2.56k|        if (has_dict)
  ------------------
  |  Branch (816:13): [True: 0, False: 2.56k]
  ------------------
  817|      0|            return zxc_decode_block_spl_entropy_dict(ctx, src, src_size, dst, dst_capacity);
  818|  2.56k|        return zxc_decode_block_spl_entropy(ctx, src, src_size, dst, dst_capacity);
  819|  2.56k|    }
  820|       |
  821|  6.89k|    const uint8_t* p_data = src + (size_t)hdr_sz;
  822|  6.89k|    const uint8_t* p_curr = p_data;
  823|       |
  824|       |    // --- Literal Stream Setup ---
  825|  6.89k|    const uint8_t* l_ptr;
  826|  6.89k|    const uint8_t* l_end;
  827|  6.89k|    uint8_t* rle_buf = NULL;
  828|       |
  829|  6.89k|    size_t lit_stream_size = lit_comp;
  830|       |    // Decoded size of an encoded literal section (RAW ignores it).
  831|  6.89k|    const size_t required_size = gh.n_literals;
  832|       |
  833|  6.89k|    if (gh.enc_lit == ZXC_SECTION_ENCODING_HUFFMAN ||
  ------------------
  |  Branch (833:9): [True: 439, False: 6.45k]
  ------------------
  834|  6.45k|        gh.enc_lit == ZXC_SECTION_ENCODING_HUFFMAN_DICT) {
  ------------------
  |  Branch (834:9): [True: 118, False: 6.33k]
  ------------------
  835|    557|        if (UNLIKELY(lit_stream_size > (size_t)(src + src_size - p_curr)))
  ------------------
  |  |  154|    557|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 57, False: 500]
  |  |  ------------------
  ------------------
  836|     57|            return ZXC_ERROR_CORRUPT_DATA;
  837|    500|        if (required_size == 0) {
  ------------------
  |  Branch (837:13): [True: 85, False: 415]
  ------------------
  838|     85|            l_ptr = p_curr;
  839|     85|            l_end = p_curr;
  840|    415|        } else {
  841|    415|            if (UNLIKELY(required_size > dst_capacity || required_size > SIZE_MAX - ZXC_PAD_SIZE))
  ------------------
  |  |  154|    726|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 104, False: 311]
  |  |  |  Branch (154:42): [True: 104, False: 311]
  |  |  |  Branch (154:42): [True: 0, False: 311]
  |  |  ------------------
  ------------------
  842|    104|                return ZXC_ERROR_DST_TOO_SMALL;
  843|    311|            const int rc =
  844|    311|                (gh.enc_lit == ZXC_SECTION_ENCODING_HUFFMAN)
  ------------------
  |  Branch (844:17): [True: 297, False: 14]
  ------------------
  845|    311|                    ? zxc_decode_lit_pivco(ctx, p_curr, lit_stream_size, required_size)
  846|    311|                    : zxc_decode_lit_pivco_dict(ctx, p_curr, lit_stream_size, required_size);
  847|    311|            if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|    311|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 97, False: 214]
  |  |  ------------------
  ------------------
  848|    214|            l_ptr = ctx->lit_buffer;
  849|    214|            l_end = ctx->lit_buffer + required_size;
  850|    214|        }
  851|  6.33k|    } else if (gh.enc_lit == ZXC_SECTION_ENCODING_RLE) {
  ------------------
  |  Branch (851:16): [True: 1.37k, False: 4.96k]
  ------------------
  852|  1.37k|        if (required_size > 0) {
  ------------------
  |  Branch (852:13): [True: 1.25k, False: 118]
  ------------------
  853|  1.25k|            if (UNLIKELY(required_size > dst_capacity || required_size > SIZE_MAX - ZXC_PAD_SIZE))
  ------------------
  |  |  154|  2.44k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 74, False: 1.18k]
  |  |  |  Branch (154:42): [True: 74, False: 1.18k]
  |  |  |  Branch (154:42): [True: 0, False: 1.18k]
  |  |  ------------------
  ------------------
  854|     74|                return ZXC_ERROR_DST_TOO_SMALL;
  855|  1.18k|            const size_t alloc_size = required_size + ZXC_PAD_SIZE;
  ------------------
  |  |  331|  1.18k|#define ZXC_PAD_SIZE 32
  ------------------
  856|       |
  857|       |            // lit_buffer is pre-allocated to chunk_size + ZXC_PAD_SIZE by
  858|       |            // zxc_cctx_init (mode == 0).
  859|  1.18k|            if (UNLIKELY(ctx->lit_buffer_cap < alloc_size)) return ZXC_ERROR_DST_TOO_SMALL;
  ------------------
  |  |  154|  1.18k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 20, False: 1.16k]
  |  |  ------------------
  ------------------
  860|       |
  861|  1.16k|            rle_buf = ctx->lit_buffer;
  862|  1.16k|            if (UNLIKELY(!rle_buf || lit_stream_size > (size_t)(src + src_size - p_curr)))
  ------------------
  |  |  154|  2.32k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 64, False: 1.10k]
  |  |  |  Branch (154:42): [True: 0, False: 1.16k]
  |  |  |  Branch (154:42): [True: 64, False: 1.10k]
  |  |  ------------------
  ------------------
  863|     64|                return ZXC_ERROR_CORRUPT_DATA;
  864|       |
  865|  1.10k|            const uint8_t* r_ptr = p_curr;
  866|  1.10k|            const uint8_t* r_end = r_ptr + lit_stream_size;
  867|  1.10k|            uint8_t* w_ptr = rle_buf;
  868|  1.10k|            const uint8_t* const w_end = rle_buf + required_size;
  869|       |
  870|  42.8k|            while (r_ptr < r_end && w_ptr < w_end) {
  ------------------
  |  Branch (870:20): [True: 41.8k, False: 988]
  |  Branch (870:37): [True: 41.8k, False: 4]
  ------------------
  871|  41.8k|                uint8_t token = *r_ptr++;
  872|  41.8k|                if (LIKELY(!(token & ZXC_LIT_RLE_FLAG))) {
  ------------------
  |  |  148|  41.8k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 28.8k, False: 13.0k]
  |  |  ------------------
  ------------------
  873|       |                    // Raw copy (most common path): 32-byte wild copies (zxc_copy32 width)
  874|       |                    // token is 7-bit (0-127), so len is 1-128 bytes
  875|  28.8k|                    const uint32_t len = (uint32_t)token + 1;
  876|  28.8k|                    if (UNLIKELY(w_ptr + len > w_end || r_ptr + len > r_end))
  ------------------
  |  |  154|  57.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 90, False: 28.7k]
  |  |  |  Branch (154:42): [True: 5, False: 28.8k]
  |  |  |  Branch (154:42): [True: 85, False: 28.7k]
  |  |  ------------------
  ------------------
  877|     90|                        return ZXC_ERROR_CORRUPT_DATA;
  878|       |
  879|       |                    // Destination has ZXC_PAD_SIZE bytes of safe overrun space.
  880|       |                    // Source may not - check before wild copy.
  881|       |                    // Fast path: source holds a full zxc_copy32 read (most common)
  882|  28.7k|                    if (LIKELY(r_ptr + 32 <= r_end)) {
  ------------------
  |  |  148|  28.7k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 18.4k, False: 10.2k]
  |  |  ------------------
  ------------------
  883|       |                        // Single copy covers len <= 32 (most tokens)
  884|  18.4k|                        zxc_copy32(w_ptr, r_ptr);
  885|       |
  886|  18.4k|                        if (UNLIKELY(len > 32)) {
  ------------------
  |  |  154|  18.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 2.07k, False: 16.4k]
  |  |  ------------------
  ------------------
  887|       |                            // Unroll: max len=128, so max 4 copies total. The last
  888|       |                            // copy is placed to end exactly on len, overlapping the
  889|       |                            // previous one - unconditional stores beat branches here.
  890|  2.07k|                            if (len <= 64) {
  ------------------
  |  Branch (890:33): [True: 733, False: 1.33k]
  ------------------
  891|    733|                                zxc_copy32(w_ptr + len - 32, r_ptr + len - 32);
  892|  1.33k|                            } else if (len <= 96) {
  ------------------
  |  Branch (892:40): [True: 681, False: 658]
  ------------------
  893|    681|                                zxc_copy32(w_ptr + 32, r_ptr + 32);
  894|    681|                                zxc_copy32(w_ptr + len - 32, r_ptr + len - 32);
  895|    681|                            } else {
  896|    658|                                zxc_copy32(w_ptr + 32, r_ptr + 32);
  897|    658|                                zxc_copy32(w_ptr + 64, r_ptr + 64);
  898|    658|                                zxc_copy32(w_ptr + len - 32, r_ptr + len - 32);
  899|    658|                            }
  900|  2.07k|                        }
  901|  18.4k|                    } else {
  902|       |                        // Near end of source: safe copy (rare cold path)
  903|  10.2k|                        ZXC_MEMCPY(w_ptr, r_ptr, len);
  ------------------
  |  |  170|  10.2k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  904|  10.2k|                    }
  905|       |
  906|  28.7k|                    w_ptr += len;
  907|  28.7k|                    r_ptr += len;
  908|  28.7k|                } else {
  909|       |                    // RLE run: fill with single byte
  910|  13.0k|                    const uint32_t len = (token & ZXC_LIT_LEN_MASK) + ZXC_LIT_RLE_RUN_MIN;
  ------------------
  |  |  546|  13.0k|#define ZXC_LIT_LEN_MASK (ZXC_LIT_RLE_FLAG - 1)
  |  |  ------------------
  |  |  |  |  544|  13.0k|#define ZXC_LIT_RLE_FLAG 0x80U
  |  |  ------------------
  ------------------
                                  const uint32_t len = (token & ZXC_LIT_LEN_MASK) + ZXC_LIT_RLE_RUN_MIN;
  ------------------
  |  |  550|  13.0k|#define ZXC_LIT_RLE_RUN_MIN 4U
  ------------------
  911|  13.0k|                    if (UNLIKELY(w_ptr + len > w_end || r_ptr >= r_end))
  ------------------
  |  |  154|  26.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 18, False: 12.9k]
  |  |  |  Branch (154:42): [True: 10, False: 13.0k]
  |  |  |  Branch (154:42): [True: 8, False: 12.9k]
  |  |  ------------------
  ------------------
  912|     18|                        return ZXC_ERROR_CORRUPT_DATA;
  913|  12.9k|                    ZXC_MEMSET(w_ptr, *r_ptr++, len);
  ------------------
  |  |  175|  12.9k|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  914|  12.9k|                    w_ptr += len;
  915|  12.9k|                }
  916|  41.8k|            }
  917|    992|            if (UNLIKELY(w_ptr != w_end || r_ptr != r_end)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  1.95k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 29, False: 963]
  |  |  |  Branch (154:42): [True: 25, False: 967]
  |  |  |  Branch (154:42): [True: 4, False: 963]
  |  |  ------------------
  ------------------
  918|    963|            l_ptr = rle_buf;
  919|    963|            l_end = rle_buf + required_size;
  920|    963|        } else {
  921|    118|            if (UNLIKELY(lit_stream_size != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|    118|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 76, False: 42]
  |  |  ------------------
  ------------------
  922|     42|            l_ptr = p_curr;
  923|     42|            l_end = p_curr;
  924|     42|        }
  925|  4.96k|    } else if (gh.enc_lit == ZXC_SECTION_ENCODING_RAW) {
  ------------------
  |  Branch (925:16): [True: 4.93k, False: 29]
  ------------------
  926|  4.93k|        if (UNLIKELY(lit_stream_size > (size_t)(src + src_size - p_curr)))
  ------------------
  |  |  154|  4.93k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 60, False: 4.87k]
  |  |  ------------------
  ------------------
  927|     60|            return ZXC_ERROR_CORRUPT_DATA;
  928|  4.87k|        l_ptr = p_curr;
  929|  4.87k|        l_end = p_curr + lit_stream_size;
  930|  4.87k|    } else {
  931|     29|        return ZXC_ERROR_CORRUPT_DATA;
  932|     29|    }
  933|       |
  934|  6.17k|    p_curr += lit_stream_size;
  935|       |
  936|       |    // --- Stream Pointers & Validation ---
  937|       |    // Only the literal and token sizes are on the wire; offsets follow from the
  938|       |    // sequence count and width, and extras take the payload residue.
  939|  6.17k|    const size_t sz_tokens = tok_comp;
  940|  6.17k|    const uint64_t sz_offsets = SPL_OFF8 ? (uint64_t)gh.n_sequences : (uint64_t)gh.n_sequences * 2;
  ------------------
  |  |  553|  6.17k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (553:18): [True: 3.23k, False: 2.94k]
  |  |  ------------------
  ------------------
  941|       |
  942|  6.17k|    const size_t payload_avail = (size_t)(src + src_size - p_data);
  943|  6.17k|    const uint64_t consumed = (uint64_t)lit_stream_size + (uint64_t)sz_tokens + sz_offsets;
  944|  6.17k|    if (UNLIKELY(consumed > (uint64_t)payload_avail)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  6.17k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 124, False: 6.05k]
  |  |  ------------------
  ------------------
  945|  6.05k|    const size_t sz_extras = payload_avail - (size_t)consumed; /* slack padding included */
  946|       |
  947|       |    // RAW literals point into the caller's buffer and the wild copy overshoots,
  948|       |    // so it needs ZXC_BLOCK_LIT_SLACK readable bytes behind it. v7 staged short
  949|       |    // streams into a padded scratch here; v8 rejects instead. No underflow:
  950|       |    // lit_stream_size <= consumed <= payload_avail.
  951|  6.05k|    if (UNLIKELY(payload_avail - lit_stream_size < ZXC_BLOCK_LIT_SLACK))
  ------------------
  |  |  154|  6.05k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 8, False: 6.04k]
  |  |  ------------------
  ------------------
  952|      8|        return ZXC_ERROR_CORRUPT_DATA;
  953|       |
  954|       |    // Offsets/extras follow the on-disk token SECTION; sz_tokens is its size
  955|       |    // (== n_sequences when RAW, the Huffman payload size when enc_tok set).
  956|  6.04k|    const uint8_t* o_ptr = p_curr + sz_tokens;
  957|  6.04k|    const uint8_t* e_ptr = o_ptr + (size_t)sz_offsets;
  958|  6.04k|    const uint8_t* const e_end = e_ptr + sz_extras;
  959|       |
  960|  6.04k|    const uint8_t* RESTRICT t_ptr;
  961|  6.04k|    if (!tok_entropy) {
  ------------------
  |  Branch (961:9): [True: 3.86k, False: 2.17k]
  ------------------
  962|       |        // enc_tok == 2 was re-routed right after the header parse; any other
  963|       |        // value would have mis-sized the section descriptors above.
  964|  3.86k|        if (UNLIKELY(gh.enc_tok != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  3.86k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 4, False: 3.86k]
  |  |  ------------------
  ------------------
  965|  3.86k|        t_ptr = p_curr;
  966|  3.86k|    } else {
  967|  2.17k|        if (UNLIKELY(gh.enc_tok != ZXC_SECTION_ENCODING_HUFFMAN)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  2.17k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 2.17k]
  |  |  ------------------
  ------------------
  968|  2.17k|        const int rc = zxc_decode_tok_pivco(ctx, p_curr, sz_tokens, gh.n_sequences);
  969|  2.17k|        if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  2.17k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 61, False: 2.11k]
  |  |  ------------------
  ------------------
  970|  2.11k|        t_ptr = ctx->tok_buffer;
  971|  2.11k|    }
  972|       |
  973|  5.97k|    uint8_t* d_ptr = dst;
  974|  5.97k|    const uint8_t* const d_end = dst + dst_capacity;
  975|       |    // Lowest address a match may reach: the dictionary prefix if any, else dst.
  976|  5.97k|    const uint8_t* const d_floor = dst - dict_size;
  977|       |    // 4x loop margin: four sequences without a varint, the wild-copy overshoot, 4 of safety.
  978|  5.97k|    const size_t d_margin_4x = 4 * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE + 4;
  ------------------
  |  |  663|  5.97k|#define ZXC_SPL_MAX_INLINE_OUT_PER_SEQ ((ZXC_TOKEN_LL_MASK - 1U) + ZXC_SPL_MAX_INLINE_ML) /* 33 */
  |  |  ------------------
  |  |  |  |  511|  5.97k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  507|  5.97k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_SPL_MAX_INLINE_OUT_PER_SEQ ((ZXC_TOKEN_LL_MASK - 1U) + ZXC_SPL_MAX_INLINE_ML) /* 33 */
  |  |  ------------------
  |  |  |  |  672|  5.97k|#define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  666|  5.97k|#define ZXC_SPL_INLINE_ML_CODE (ZXC_TOKEN_ML_MASK - 1U) /* 14 */
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  513|  5.97k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  509|  5.97k|#define ZXC_TOKEN_ML_BITS 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define ZXC_SPL_MAX_INLINE_ML (ZXC_SPL_INLINE_ML_CODE + ZXC_LZ_MIN_MATCH_LEN) /* 19 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  5.97k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  const size_t d_margin_4x = 4 * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE + 4;
  ------------------
  |  |  331|  5.97k|#define ZXC_PAD_SIZE 32
  ------------------
  979|  5.97k|    const uint8_t* const d_end_safe = (dst_capacity > d_margin_4x) ? d_end - d_margin_4x : dst;
  ------------------
  |  Branch (979:39): [True: 5.97k, False: 0]
  ------------------
  980|       |
  981|       |    // Literal margin for the 4x loops: without a varint, ll <= 14 per sequence,
  982|       |    // so 4 * 14 = 56. Past that margin only the cold varint path checks l_ptr.
  983|  5.97k|    const size_t spl_sz_lit = (size_t)(l_end - l_ptr);
  984|  5.97k|    const size_t spl_margin_4x = 4 * (ZXC_TOKEN_LL_MASK - 1);  // 56
  ------------------
  |  |  511|  5.97k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  507|  5.97k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
  985|  5.97k|    const size_t spl_margin_1x = ZXC_TOKEN_LL_MASK - 1;        // 14
  ------------------
  |  |  511|  5.97k|#define ZXC_TOKEN_LL_MASK ((1U << ZXC_TOKEN_LIT_BITS) - 1)
  |  |  ------------------
  |  |  |  |  507|  5.97k|#define ZXC_TOKEN_LIT_BITS 4
  |  |  ------------------
  ------------------
  986|  5.97k|    const uint8_t* const l_end_safe_4x =
  987|  5.97k|        (spl_sz_lit > spl_margin_4x) ? l_end - spl_margin_4x : l_ptr;
  ------------------
  |  Branch (987:9): [True: 4.83k, False: 1.14k]
  ------------------
  988|  5.97k|    const uint8_t* const l_end_safe_1x =
  989|  5.97k|        (spl_sz_lit > spl_margin_1x) ? l_end - spl_margin_1x : l_ptr;
  ------------------
  |  Branch (989:9): [True: 4.94k, False: 1.03k]
  ------------------
  990|       |
  991|  5.97k|    uint32_t n_seq = gh.n_sequences;
  992|       |
  993|       |    // Offsets only need checking until the output is wider than the widest offset
  994|       |    // the format can encode (256 for 1-byte offsets, 65536 for 2-byte); past that
  995|       |    // none can reach below d_floor. A dictionary counts as already written, so a
  996|       |    // large one puts d_bounds at dst and skips the SAFE loop.
  997|  5.97k|    const size_t off_span = SPL_OFF8 ? (1U << 8) : (1U << 16);
  ------------------
  |  |  553|  5.97k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (553:18): [True: 3.13k, False: 2.84k]
  |  |  ------------------
  ------------------
  998|  5.97k|    const size_t span = (dict_size >= off_span) ? 0 : off_span - dict_size;
  ------------------
  |  Branch (998:25): [True: 0, False: 5.97k]
  ------------------
  999|  5.97k|    const uint8_t* const d_bounds = (span >= dst_capacity) ? d_end : dst + span;
  ------------------
  |  Branch (999:37): [True: 0, False: 5.97k]
  ------------------
 1000|       |
 1001|       |    // --- SAFE Loop: offset validation until d_bounds (4x unroll) ---
 1002|  5.97k|    if (safe) {
  ------------------
  |  Branch (1002:9): [True: 0, False: 5.97k]
  ------------------
 1003|       |        // SAFE variant: save per-batch state so overflow can rollback.
 1004|      0|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1004:16): [True: 0, False: 0]
  |  Branch (1004:30): [True: 0, False: 0]
  |  Branch (1004:52): [True: 0, False: 0]
  |  Branch (1004:77): [True: 0, False: 0]
  ------------------
 1005|      0|            const uint8_t* const t_save = t_ptr;
 1006|      0|            const uint8_t* const o_save = o_ptr;
 1007|      0|            const uint8_t* const e_save = e_ptr;
 1008|      0|            uint8_t* const d_save = d_ptr;
 1009|      0|            const uint8_t* const l_save = l_ptr;
 1010|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  ------------------
  |  |  611|      0|    do {                                                                                           \
  |  |  612|      0|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  613|      0|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  614|      0|        uint64_t offs;                                                                             \
  |  |  615|      0|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  553|      0|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (553:18): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  616|      0|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  617|      0|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  618|      0|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  619|      0|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  620|      0|        } else {                                                                                   \
  |  |  621|      0|            offs = zxc_le64(o_ptr);                                                                \
  |  |  622|      0|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  623|      0|        }                                                                                          \
  |  |  624|      0|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1010|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  625|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  626|      0|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  627|      0|                       DECODE, ON_FAIL);                                                           \
  |  |  628|      0|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1010|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  629|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  630|      0|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  631|      0|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1010|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  632|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  633|      0|                       DECODE, ON_FAIL);                                                           \
  |  |  634|      0|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1010|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  635|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  636|      0|        n_seq -= 4;                                                                                \
  |  |  637|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (637:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1011|      0|            continue;
 1012|       |
 1013|      0|        rollback_safe_4x:
 1014|      0|            t_ptr = t_save;
 1015|      0|            o_ptr = o_save;
 1016|      0|            e_ptr = e_save;
 1017|      0|            d_ptr = d_save;
 1018|      0|            l_ptr = l_save;
 1019|      0|            break;
 1020|      0|        }
 1021|  5.97k|    } else {
 1022|  52.3k|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1022:16): [True: 51.0k, False: 1.26k]
  |  Branch (1022:30): [True: 51.0k, False: 13]
  |  Branch (1022:52): [True: 50.2k, False: 793]
  |  Branch (1022:77): [True: 47.2k, False: 2.98k]
  ------------------
 1023|  47.2k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  ------------------
  |  |  611|  47.2k|    do {                                                                                           \
  |  |  612|  47.2k|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  613|  47.2k|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  614|  47.2k|        uint64_t offs;                                                                             \
  |  |  615|  47.2k|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  553|  47.2k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (553:18): [True: 7.16k, False: 40.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  616|  7.16k|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  617|  7.16k|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  618|  7.16k|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  619|  7.16k|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  620|  40.0k|        } else {                                                                                   \
  |  |  621|  40.0k|            offs = zxc_le64(o_ptr);                                                                \
  |  |  622|  40.0k|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  623|  40.0k|        }                                                                                          \
  |  |  624|  47.2k|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  569|  47.2k|    do {                                                                                        \
  |  |  |  |  570|  47.2k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  47.2k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  47.2k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  47.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 5.91k, False: 41.3k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  5.91k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  5.91k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  5.91k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  5.91k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  5.91k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  5.91k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  11.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 74, False: 5.84k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 74, False: 5.84k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 5.84k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  5.91k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  5.91k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  5.91k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  5.91k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  5.91k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  41.3k|        } else {                                                                                \
  |  |  |  |  585|  41.3k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  41.3k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  41.3k|        }                                                                                       \
  |  |  |  |  588|  47.2k|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  47.1k|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  47.1k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  47.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 19.9k, False: 27.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|  19.9k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|  19.9k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|  19.9k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  19.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 73, False: 19.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|  19.9k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|  19.9k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|  19.9k|                ON_FAIL;                                                                        \
  |  |  |  |  597|  19.9k|        }                                                                                       \
  |  |  |  |  598|  47.1k|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  47.1k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  47.1k|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1023|  47.1k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|  47.1k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|  47.1k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|  47.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 79, False: 47.0k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|  47.1k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|  47.0k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|  47.0k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 47.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  47.1k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 47.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  625|  47.2k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  626|  47.2k|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  627|  47.2k|                       DECODE, ON_FAIL);                                                           \
  |  |  628|  47.2k|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  569|  47.0k|    do {                                                                                        \
  |  |  |  |  570|  47.0k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  47.0k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  47.0k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  47.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 6.12k, False: 40.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  6.12k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  6.12k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  6.12k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  6.12k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  6.12k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  6.12k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  12.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 103, False: 6.02k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 90, False: 6.03k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 13, False: 6.02k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  6.12k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  6.12k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  6.12k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  6.12k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  6.12k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  40.8k|        } else {                                                                                \
  |  |  |  |  585|  40.8k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  40.8k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  40.8k|        }                                                                                       \
  |  |  |  |  588|  47.0k|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  46.9k|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  46.9k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  46.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 20.9k, False: 25.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|  20.9k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|  20.9k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|  20.9k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  20.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 90, False: 20.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|  20.9k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|  20.9k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|  20.9k|                ON_FAIL;                                                                        \
  |  |  |  |  597|  20.9k|        }                                                                                       \
  |  |  |  |  598|  46.9k|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  46.8k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  46.8k|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1023|  46.8k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|  46.8k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|  46.8k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|  46.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 37, False: 46.7k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|  46.8k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|  46.7k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|  46.7k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 46.7k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  46.8k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 46.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  629|  47.0k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  630|  47.0k|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  631|  47.0k|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  569|  46.7k|    do {                                                                                        \
  |  |  |  |  570|  46.7k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  46.7k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  46.7k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  46.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 4.92k, False: 41.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  4.92k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  4.92k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  4.92k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  4.92k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  4.92k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  4.92k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  9.76k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 97, False: 4.82k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 85, False: 4.84k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 12, False: 4.82k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  4.92k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  4.92k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  4.92k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  4.92k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  4.92k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  41.8k|        } else {                                                                                \
  |  |  |  |  585|  41.8k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  41.8k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  41.8k|        }                                                                                       \
  |  |  |  |  588|  46.7k|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  46.6k|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  46.6k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  46.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 19.5k, False: 27.1k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|  19.5k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|  19.5k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|  19.5k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  19.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 76, False: 19.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|  19.5k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|  19.5k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|  19.5k|                ON_FAIL;                                                                        \
  |  |  |  |  597|  19.5k|        }                                                                                       \
  |  |  |  |  598|  46.6k|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  46.6k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  46.6k|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1023|  46.6k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|  46.6k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|  46.6k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|  46.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 41, False: 46.5k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|  46.6k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|  46.5k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|  46.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 46.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  46.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 46.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  632|  46.7k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  633|  46.7k|                       DECODE, ON_FAIL);                                                           \
  |  |  634|  46.7k|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  569|  46.5k|    do {                                                                                        \
  |  |  |  |  570|  46.5k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  46.5k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  46.5k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  46.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 4.89k, False: 41.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  4.89k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  4.89k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  4.89k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  4.89k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  4.89k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  4.89k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  9.68k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 125, False: 4.77k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 107, False: 4.78k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 18, False: 4.77k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  4.89k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  4.89k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  4.89k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  4.89k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  4.89k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  41.6k|        } else {                                                                                \
  |  |  |  |  585|  41.6k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  41.6k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  41.6k|        }                                                                                       \
  |  |  |  |  588|  46.5k|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  46.4k|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  46.4k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  46.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 19.7k, False: 26.7k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|  19.7k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|  19.7k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|  19.7k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  19.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 86, False: 19.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|  19.7k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|  19.7k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|  19.7k|                ON_FAIL;                                                                        \
  |  |  |  |  597|  19.7k|        }                                                                                       \
  |  |  |  |  598|  46.4k|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  46.3k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  46.3k|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1023|  46.3k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|  46.3k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|  46.3k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|  46.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 39, False: 46.3k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|  46.3k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|  46.3k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|  46.3k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 46.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  46.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 46.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  635|  46.5k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  636|  46.5k|        n_seq -= 4;                                                                                \
  |  |  637|  46.3k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (637:14): [Folded, False: 46.3k]
  |  |  ------------------
  ------------------
 1024|  47.2k|        }
 1025|  5.97k|    }
 1026|       |
 1027|       |    // --- FAST Loop: After threshold, no offset validation needed (4x unroll) ---
 1028|  5.05k|    if (safe) {
  ------------------
  |  Branch (1028:9): [True: 0, False: 5.05k]
  ------------------
 1029|      0|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1029:16): [True: 0, False: 0]
  |  Branch (1029:30): [True: 0, False: 0]
  |  Branch (1029:52): [True: 0, False: 0]
  ------------------
 1030|      0|            const uint8_t* const t_save = t_ptr;
 1031|      0|            const uint8_t* const o_save = o_ptr;
 1032|      0|            const uint8_t* const e_save = e_ptr;
 1033|      0|            uint8_t* const d_save = d_ptr;
 1034|      0|            const uint8_t* const l_save = l_ptr;
 1035|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  ------------------
  |  |  611|      0|    do {                                                                                           \
  |  |  612|      0|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  613|      0|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  614|      0|        uint64_t offs;                                                                             \
  |  |  615|      0|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  553|      0|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (553:18): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  616|      0|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  617|      0|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  618|      0|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  619|      0|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  620|      0|        } else {                                                                                   \
  |  |  621|      0|            offs = zxc_le64(o_ptr);                                                                \
  |  |  622|      0|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  623|      0|        }                                                                                          \
  |  |  624|      0|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1035|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  625|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  626|      0|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  627|      0|                       DECODE, ON_FAIL);                                                           \
  |  |  628|      0|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1035|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  629|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  630|      0|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  631|      0|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1035|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  632|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  633|      0|                       DECODE, ON_FAIL);                                                           \
  |  |  634|      0|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  569|      0|    do {                                                                                        \
  |  |  |  |  570|      0|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|      0|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|      0|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|      0|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|      0|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|      0|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|      0|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|      0|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|      0|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|      0|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|      0|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|      0|                ON_FAIL;                                                                        \
  |  |  |  |  583|      0|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|      0|        } else {                                                                                \
  |  |  |  |  585|      0|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|      0|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|      0|        }                                                                                       \
  |  |  |  |  588|      0|        l_ptr += ll;                                                                            \
  |  |  |  |  589|      0|        d_ptr += ll;                                                                            \
  |  |  |  |  590|      0|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|      0|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|      0|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|      0|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|      0|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|      0|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|      0|                ON_FAIL;                                                                        \
  |  |  |  |  597|      0|        }                                                                                       \
  |  |  |  |  598|      0|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|      0|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1035|      0|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  635|      0|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  636|      0|        n_seq -= 4;                                                                                \
  |  |  637|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (637:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1036|      0|            continue;
 1037|       |
 1038|      0|        rollback_fast_4x:
 1039|      0|            t_ptr = t_save;
 1040|      0|            o_ptr = o_save;
 1041|      0|            e_ptr = e_save;
 1042|      0|            d_ptr = d_save;
 1043|      0|            l_ptr = l_save;
 1044|      0|            break;
 1045|      0|        }
 1046|  5.05k|    } else {
 1047|  71.7k|        while (n_seq >= 4 && d_ptr < d_end_safe && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1047:16): [True: 69.6k, False: 2.11k]
  |  Branch (1047:30): [True: 69.5k, False: 56]
  |  Branch (1047:52): [True: 67.8k, False: 1.72k]
  ------------------
 1048|  67.8k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  ------------------
  |  |  611|  67.8k|    do {                                                                                           \
  |  |  612|  67.8k|        uint32_t tokens = zxc_le32(t_ptr);                                                         \
  |  |  613|  67.8k|        t_ptr += sizeof(uint32_t);                                                                 \
  |  |  614|  67.8k|        uint64_t offs;                                                                             \
  |  |  615|  67.8k|        if (SPL_OFF8) {                                                                            \
  |  |  ------------------
  |  |  |  |  553|  67.8k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (553:18): [True: 54.8k, False: 12.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  616|  54.8k|            uint64_t x = zxc_le32(o_ptr);                                                          \
  |  |  617|  54.8k|            o_ptr += sizeof(uint32_t);                                                             \
  |  |  618|  54.8k|            x = (x | (x << 16)) & 0x0000FFFF0000FFFFULL;                                           \
  |  |  619|  54.8k|            offs = (x | (x << 8)) & 0x00FF00FF00FF00FFULL;                                         \
  |  |  620|  54.8k|        } else {                                                                                   \
  |  |  621|  12.9k|            offs = zxc_le64(o_ptr);                                                                \
  |  |  622|  12.9k|            o_ptr += sizeof(uint64_t);                                                             \
  |  |  623|  12.9k|        }                                                                                          \
  |  |  624|  67.8k|        DECODE_SPL_SEQ((tokens & 0x0F0) >> 4, (tokens & 0x00F),                                    \
  |  |  ------------------
  |  |  |  |  569|  67.8k|    do {                                                                                        \
  |  |  |  |  570|  67.8k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  67.8k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  67.8k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  67.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 6.55k, False: 61.2k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  6.55k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  6.55k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  6.55k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  6.55k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  6.55k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  6.55k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  13.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 109, False: 6.44k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 94, False: 6.46k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 15, False: 6.44k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  6.55k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  6.55k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  6.55k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  6.55k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  6.55k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  61.2k|        } else {                                                                                \
  |  |  |  |  585|  61.2k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  61.2k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  61.2k|        }                                                                                       \
  |  |  |  |  588|  67.8k|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  67.7k|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  67.7k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  67.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 30.6k, False: 37.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|  30.6k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|  30.6k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|  30.6k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  30.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 189, False: 30.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|  30.6k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|  30.6k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|  30.6k|                ON_FAIL;                                                                        \
  |  |  |  |  597|  30.6k|        }                                                                                       \
  |  |  |  |  598|  67.7k|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  67.5k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  67.5k|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1048|  67.5k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  67.5k|    do {                                 \
  |  |  |  |  |  |  |  |  538|  67.5k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|  67.5k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|  67.5k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 67.5k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  67.5k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 67.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  625|  67.8k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs & 0xFFFF),                             \
  |  |  626|  67.8k|                       ((tokens >> 12) & 0xF) + ((tokens >> 20) & 0xF) + (tokens >> 28), 3U,       \
  |  |  627|  67.8k|                       DECODE, ON_FAIL);                                                           \
  |  |  628|  67.8k|        DECODE_SPL_SEQ((tokens & 0x0F000) >> 12, (tokens & 0x00F00) >> 8,                          \
  |  |  ------------------
  |  |  |  |  569|  67.5k|    do {                                                                                        \
  |  |  |  |  570|  67.5k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  67.5k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  67.5k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  67.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 6.45k, False: 61.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  6.45k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  6.45k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  6.45k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  6.45k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  6.45k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  6.45k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  12.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 112, False: 6.34k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 97, False: 6.35k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 15, False: 6.34k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  6.45k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  6.45k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  6.45k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  6.45k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  6.45k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  61.0k|        } else {                                                                                \
  |  |  |  |  585|  61.0k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  61.0k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  61.0k|        }                                                                                       \
  |  |  |  |  588|  67.5k|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  67.4k|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  67.4k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  67.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 30.8k, False: 36.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|  30.8k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|  30.8k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|  30.8k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  30.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 133, False: 30.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|  30.8k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|  30.8k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|  30.8k|                ON_FAIL;                                                                        \
  |  |  |  |  597|  30.8k|        }                                                                                       \
  |  |  |  |  598|  67.4k|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  67.3k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  67.3k|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1048|  67.3k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  67.3k|    do {                                 \
  |  |  |  |  |  |  |  |  538|  67.3k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|  67.3k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|  67.3k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 67.3k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  67.3k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 67.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  629|  67.5k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 16) & 0xFFFF),                     \
  |  |  630|  67.5k|                       ((tokens >> 20) & 0xF) + (tokens >> 28), 2U, DECODE, ON_FAIL);              \
  |  |  631|  67.5k|        DECODE_SPL_SEQ((tokens & 0x0F00000) >> 20, (tokens & 0x00F0000) >> 16,                     \
  |  |  ------------------
  |  |  |  |  569|  67.3k|    do {                                                                                        \
  |  |  |  |  570|  67.3k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  67.3k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  67.3k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  67.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 5.31k, False: 61.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  5.31k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  5.31k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  5.31k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  5.31k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  5.31k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  5.31k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  10.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 132, False: 5.18k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 105, False: 5.21k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 27, False: 5.18k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  5.31k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  5.31k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  5.31k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  5.31k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  5.31k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  61.9k|        } else {                                                                                \
  |  |  |  |  585|  61.9k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  61.9k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  61.9k|        }                                                                                       \
  |  |  |  |  588|  67.3k|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  67.1k|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  67.1k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  67.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 29.5k, False: 37.5k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|  29.5k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|  29.5k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|  29.5k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  29.5k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 160, False: 29.4k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|  29.5k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|  29.5k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|  29.5k|                ON_FAIL;                                                                        \
  |  |  |  |  597|  29.5k|        }                                                                                       \
  |  |  |  |  598|  67.1k|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  67.0k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  67.0k|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1048|  67.0k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  67.0k|    do {                                 \
  |  |  |  |  |  |  |  |  538|  67.0k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|  67.0k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|  67.0k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 67.0k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  67.0k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 67.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  632|  67.3k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)((offs >> 32) & 0xFFFF), (tokens >> 28), 1U, \
  |  |  633|  67.3k|                       DECODE, ON_FAIL);                                                           \
  |  |  634|  67.3k|        DECODE_SPL_SEQ((tokens >> 28), (tokens >> 24) & 0x0F,                                      \
  |  |  ------------------
  |  |  |  |  569|  67.0k|    do {                                                                                        \
  |  |  |  |  570|  67.0k|        uint64_t ll = (LL);                                                                     \
  |  |  |  |  571|  67.0k|        uint64_t ml = (ML);                                                                     \
  |  |  |  |  572|  67.0k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  67.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 6.09k, False: 60.9k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  573|  6.09k|            ll += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  574|  6.09k|            const uint64_t reserve = (RESERVE);                                                 \
  |  |  |  |  575|  6.09k|            /* An extended ll eats the batch's destination budget, so reserve                   \
  |  |  |  |  576|  6.09k|             * this sequence's match and the remaining ones too. ml is still                    \
  |  |  |  |  577|  6.09k|             * the raw nibble here; an escaped one re-checks itself below. */                   \
  |  |  |  |  578|  6.09k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                              \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  12.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 147, False: 5.94k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 123, False: 5.97k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 24, False: 5.94k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  579|  6.09k|                         ll + ml + ZXC_LZ_MIN_MATCH_LEN +                                       \
  |  |  |  |  580|  6.09k|                                 (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE >      \
  |  |  |  |  581|  6.09k|                             (size_t)(d_end - d_ptr)))                                          \
  |  |  |  |  582|  6.09k|                ON_FAIL;                                                                        \
  |  |  |  |  583|  6.09k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                         \
  |  |  |  |  584|  60.9k|        } else {                                                                                \
  |  |  |  |  585|  60.9k|            /* ll <= 14 here, so one 16-byte store covers it. */                                \
  |  |  |  |  586|  60.9k|            zxc_copy16(d_ptr, l_ptr);                                                           \
  |  |  |  |  587|  60.9k|        }                                                                                       \
  |  |  |  |  588|  67.0k|        l_ptr += ll;                                                                            \
  |  |  |  |  589|  66.8k|        d_ptr += ll;                                                                            \
  |  |  |  |  590|  66.8k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) {                                                \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  66.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 30.1k, False: 36.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  591|  30.1k|            ml += zxc_read_varint(&e_ptr, e_end);                                               \
  |  |  |  |  592|  30.1k|            /* d_ptr already carries the literals, hence no `ll +` term here. */                \
  |  |  |  |  593|  30.1k|            if (UNLIKELY(ml + ZXC_LZ_MIN_MATCH_LEN + (N_REM) * ZXC_SPL_MAX_INLINE_OUT_PER_SEQ + \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  30.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 187, False: 30.0k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  594|  30.1k|                             ZXC_PAD_SIZE >                                                     \
  |  |  |  |  595|  30.1k|                         (size_t)(d_end - d_ptr)))                                              \
  |  |  |  |  596|  30.1k|                ON_FAIL;                                                                        \
  |  |  |  |  597|  30.1k|        }                                                                                       \
  |  |  |  |  598|  66.8k|        ml += ZXC_LZ_MIN_MATCH_LEN;                                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  66.6k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  599|  66.6k|        DECODE(ml, OFF, zxc_decode_copy_match_spl);                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1048|  66.6k|            DECODE_SPL_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|  66.6k|    do {                                 \
  |  |  |  |  |  |  |  |  538|  66.6k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|  66.6k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|  66.6k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 66.6k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  600|  66.6k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (600:14): [Folded, False: 66.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  635|  67.0k|                       ZXC_LZ_OFFSET_BIAS + (uint32_t)(offs >> 48), 0, 0U, DECODE, ON_FAIL);       \
  |  |  636|  67.0k|        n_seq -= 4;                                                                                \
  |  |  637|  66.6k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (637:14): [Folded, False: 66.6k]
  |  |  ------------------
  ------------------
 1049|  67.8k|        }
 1050|  5.05k|    }
 1051|       |
 1052|       |    // --- Remaining 1 sequence (Fast Path) ---
 1053|  33.0k|    while (n_seq > 0 && d_ptr < d_end_safe && l_ptr < l_end_safe_1x) {
  ------------------
  |  Branch (1053:12): [True: 30.6k, False: 2.37k]
  |  Branch (1053:25): [True: 30.5k, False: 62]
  |  Branch (1053:47): [True: 29.8k, False: 777]
  ------------------
 1054|       |        // Save pointers before reading (in case we need to fall back to Safe Path)
 1055|  29.8k|        const uint8_t* t_save = t_ptr;
 1056|  29.8k|        const uint8_t* o_save = o_ptr;
 1057|  29.8k|        const uint8_t* e_save = e_ptr;
 1058|       |
 1059|  29.8k|        uint8_t token = *t_ptr++;
 1060|  29.8k|        uint64_t ll = token >> ZXC_TOKEN_LIT_BITS;
  ------------------
  |  |  507|  29.8k|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
 1061|  29.8k|        uint64_t ml = token & ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  513|  29.8k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|  29.8k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
 1062|  29.8k|        uint32_t offset = ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  676|  29.8k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1063|  29.8k|        if (SPL_OFF8) {
  ------------------
  |  |  553|  29.8k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (553:18): [True: 21.8k, False: 7.93k]
  |  |  ------------------
  ------------------
 1064|  21.8k|            offset += *o_ptr++;  // 1-byte offset (biased)
 1065|  21.8k|        } else {
 1066|  7.93k|            offset += zxc_le16(o_ptr);  // 2-byte offset (biased)
 1067|  7.93k|            o_ptr += sizeof(uint16_t);
 1068|  7.93k|        }
 1069|       |
 1070|  29.8k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) {
  ------------------
  |  |  154|  29.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1.46k, False: 28.3k]
  |  |  ------------------
  ------------------
 1071|  1.46k|            ll += zxc_read_varint(&e_ptr, e_end);
 1072|  1.46k|            if (UNLIKELY(ll > (size_t)(l_end - l_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|  1.46k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 209, False: 1.25k]
  |  |  ------------------
  ------------------
 1073|  1.46k|        }
 1074|  29.6k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) ml += zxc_read_varint(&e_ptr, e_end);
  ------------------
  |  |  154|  29.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 14.6k, False: 14.9k]
  |  |  ------------------
  ------------------
 1075|  29.6k|        ml += ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  29.6k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1076|       |
 1077|       |        // Check bounds before wild copies - if too close to end, fall back to Safe Path
 1078|  29.6k|        if (UNLIKELY(ll + ml + ZXC_PAD_SIZE > (size_t)(d_end - d_ptr))) {
  ------------------
  |  |  154|  29.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 409, False: 29.1k]
  |  |  ------------------
  ------------------
 1079|    409|            t_ptr = t_save;
 1080|    409|            o_ptr = o_save;
 1081|    409|            e_ptr = e_save;
 1082|    409|            break;
 1083|    409|        }
 1084|       |
 1085|       |        // Unlike the 4x batch the copy cannot sit in the varint branch's else -
 1086|       |        // the rollback above must run first - so re-test ll instead. Exact:
 1087|       |        // the escape leaves ll >= ZXC_TOKEN_LL_MASK.
 1088|  29.1k|        if (LIKELY(ll < ZXC_TOKEN_LL_MASK)) {
  ------------------
  |  |  148|  29.1k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 27.9k, False: 1.24k]
  |  |  ------------------
  ------------------
 1089|  27.9k|            zxc_copy16(d_ptr, l_ptr);
 1090|  27.9k|        } else {
 1091|  1.24k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);
 1092|  1.24k|        }
 1093|  29.1k|        l_ptr += ll;
 1094|  29.1k|        d_ptr += ll;
 1095|       |
 1096|  29.1k|        if (UNLIKELY(d_ptr < d_bounds && (size_t)(d_ptr - d_floor) < offset))
  ------------------
  |  |  154|  32.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 55, False: 29.1k]
  |  |  |  Branch (154:42): [True: 3.44k, False: 25.7k]
  |  |  |  Branch (154:42): [True: 55, False: 3.38k]
  |  |  ------------------
  ------------------
 1097|     55|            return ZXC_ERROR_BAD_OFFSET;
 1098|       |
 1099|       |        // The loop entry check guarantees ll + ml + ZXC_PAD_SIZE bytes of
 1100|       |        // headroom, so the wild-copy ladder (incl. overlap/fill runs) is safe.
 1101|  29.1k|        zxc_decode_copy_match_spl(d_ptr, offset, ml);
 1102|  29.1k|        d_ptr += ml;
 1103|  29.1k|        n_seq--;
 1104|  29.1k|    }
 1105|       |
 1106|       |    // --- Safe Path for Remaining Sequences ---
 1107|  11.9k|    while (n_seq > 0) {
  ------------------
  |  Branch (1107:12): [True: 9.52k, False: 2.45k]
  ------------------
 1108|  9.52k|        uint8_t token = *t_ptr++;
 1109|  9.52k|        uint64_t ll = token >> ZXC_TOKEN_LIT_BITS;
  ------------------
  |  |  507|  9.52k|#define ZXC_TOKEN_LIT_BITS 4
  ------------------
 1110|  9.52k|        uint64_t ml = token & ZXC_TOKEN_ML_MASK;
  ------------------
  |  |  513|  9.52k|#define ZXC_TOKEN_ML_MASK ((1U << ZXC_TOKEN_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  509|  9.52k|#define ZXC_TOKEN_ML_BITS 4
  |  |  ------------------
  ------------------
 1111|  9.52k|        uint32_t offset = ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  676|  9.52k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1112|  9.52k|        if (SPL_OFF8) {
  ------------------
  |  |  553|  9.52k|#define SPL_OFF8 (gh.enc_off == 1)
  |  |  ------------------
  |  |  |  Branch (553:18): [True: 7.06k, False: 2.46k]
  |  |  ------------------
  ------------------
 1113|  7.06k|            offset += *o_ptr++;  // 1-byte offset (biased)
 1114|  7.06k|        } else {
 1115|  2.46k|            offset += zxc_le16(o_ptr);  // 2-byte offset (biased)
 1116|  2.46k|            o_ptr += sizeof(uint16_t);
 1117|  2.46k|        }
 1118|       |
 1119|  9.52k|        if (UNLIKELY(ll == ZXC_TOKEN_LL_MASK)) ll += zxc_read_varint(&e_ptr, e_end);
  ------------------
  |  |  154|  9.52k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 301, False: 9.22k]
  |  |  ------------------
  ------------------
 1120|  9.52k|        if (UNLIKELY(ml == ZXC_TOKEN_ML_MASK)) ml += zxc_read_varint(&e_ptr, e_end);
  ------------------
  |  |  154|  9.52k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 5.14k, False: 4.38k]
  |  |  ------------------
  ------------------
 1121|  9.52k|        ml += ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  9.52k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1122|       |
 1123|  9.52k|        if (UNLIKELY(ll + ml > (size_t)(d_end - d_ptr) || ll > (size_t)(l_end - l_ptr)))
  ------------------
  |  |  154|  18.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1.15k, False: 8.37k]
  |  |  |  Branch (154:42): [True: 575, False: 8.95k]
  |  |  |  Branch (154:42): [True: 575, False: 8.37k]
  |  |  ------------------
  ------------------
 1124|  1.15k|            return ZXC_ERROR_OVERFLOW;
 1125|  8.37k|        ZXC_MEMCPY(d_ptr, l_ptr, ll);
  ------------------
  |  |  170|  8.37k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1126|  8.37k|        l_ptr += ll;
 1127|  8.37k|        d_ptr += ll;
 1128|       |
 1129|  8.37k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < offset)) return ZXC_ERROR_BAD_OFFSET;
  ------------------
  |  |  154|  8.37k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 17, False: 8.36k]
  |  |  ------------------
  ------------------
 1130|  8.36k|        const uint8_t* match_src = d_ptr - offset;
 1131|       |
 1132|  8.36k|        zxc_decode_copy_match_exact(d_ptr, match_src, offset, ml);
 1133|  8.36k|        d_ptr += ml;
 1134|  8.36k|        n_seq--;
 1135|  8.36k|    }
 1136|       |
 1137|       |    // --- Trailing Literals ---
 1138|       |    // Copy remaining literals from source stream (literal exhaustion)
 1139|  2.45k|    if (UNLIKELY(l_ptr > l_end)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  2.45k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 2.45k]
  |  |  ------------------
  ------------------
 1140|  2.45k|    if (UNLIKELY(d_ptr > d_end)) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|  2.45k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 2.45k]
  |  |  ------------------
  ------------------
 1141|       |
 1142|  2.45k|    const size_t remaining_literals = (size_t)(l_end - l_ptr);
 1143|  2.45k|    if (UNLIKELY(remaining_literals > (size_t)(d_end - d_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|  2.45k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 20, False: 2.43k]
  |  |  ------------------
  ------------------
 1144|  2.43k|    ZXC_MEMCPY(d_ptr, l_ptr, remaining_literals);
  ------------------
  |  |  170|  2.43k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1145|  2.43k|    d_ptr += remaining_literals;
 1146|       |
 1147|  2.43k|    return (int)(d_ptr - dst);
 1148|  2.45k|}
zxc_decompress.c:zxc_decode_block_spl_entropy:
 1417|  2.56k|                                                     const size_t dst_capacity) {
 1418|  2.56k|    return zxc_decode_block_spl_impl(ctx, src, src_size, dst, dst_capacity, 0, 0, 1);
 1419|  2.56k|}
zxc_decompress.c:zxc_decode_lit_pivco:
  717|    297|                                                      const size_t required_size) {
  718|    297|    const int arc = zxc_ensure_entropy_scratch(ctx);
  719|    297|    if (UNLIKELY(arc != ZXC_OK)) return arc;
  ------------------
  |  |  154|    297|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 297]
  |  |  ------------------
  ------------------
  720|    297|    if (UNLIKELY(ctx->lit_buffer_cap < required_size + ZXC_PAD_SIZE ||
  ------------------
  |  |  154|    582|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 12, False: 285]
  |  |  |  Branch (154:42): [True: 12, False: 285]
  |  |  |  Branch (154:42): [True: 0, False: 285]
  |  |  ------------------
  ------------------
  721|    297|                 ctx->pivco_scratch_cap < required_size + ZXC_PIVCO_SCRATCH_PAD))
  722|     12|        return ZXC_ERROR_DST_TOO_SMALL;
  723|    285|    return zxc_huf_decode_section(payload, psize, ctx->lit_buffer, required_size,
  ------------------
  |  |   29|    285|#define zxc_huf_decode_section ZXC_CAT(zxc_huf_decode_section, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   23|    285|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    285|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  724|    285|                                  ctx->pivco_scratch);
  725|    297|}
zxc_decompress.c:zxc_ensure_entropy_scratch:
  709|  2.47k|static ZXC_NOINLINE ZXC_COLD int zxc_ensure_entropy_scratch(const zxc_cctx_t* RESTRICT ctx) {
  710|  2.47k|    if (LIKELY(ctx->pivco_scratch)) return ZXC_OK;
  ------------------
  |  |  148|  2.47k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 252, False: 2.22k]
  |  |  ------------------
  ------------------
  711|  2.22k|    return zxc_cctx_alloc_entropy_scratch((zxc_cctx_t*)(uintptr_t)ctx);
  712|  2.47k|}
zxc_decompress.c:zxc_decode_lit_pivco_dict:
  730|     14|                                                           const size_t required_size) {
  731|     14|    if (UNLIKELY(!ctx->dict_huf_tree_ok)) return ZXC_ERROR_DICT_REQUIRED;
  ------------------
  |  |  154|     14|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 14, False: 0]
  |  |  ------------------
  ------------------
  732|      0|    const int arc = zxc_ensure_entropy_scratch(ctx);
  733|      0|    if (UNLIKELY(arc != ZXC_OK)) return arc;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  734|      0|    if (UNLIKELY(ctx->lit_buffer_cap < required_size + ZXC_PAD_SIZE ||
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  735|      0|                 ctx->pivco_scratch_cap < required_size + ZXC_PIVCO_SCRATCH_PAD))
  736|      0|        return ZXC_ERROR_DST_TOO_SMALL;
  737|      0|    return zxc_huf_decode_section_dict(payload, psize, ctx->lit_buffer, required_size,
  ------------------
  |  |   30|      0|#define zxc_huf_decode_section_dict ZXC_CAT(zxc_huf_decode_section_dict, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   23|      0|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      0|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|      0|                                       &ctx->dict_huf->tree, ctx->pivco_scratch);
  739|      0|}
zxc_decompress.c:zxc_decode_tok_pivco:
  743|  2.17k|                                                      const size_t psize, const size_t n_tok) {
  744|  2.17k|    const int arc = zxc_ensure_entropy_scratch(ctx);
  745|  2.17k|    if (UNLIKELY(arc != ZXC_OK)) return arc;
  ------------------
  |  |  154|  2.17k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 2.17k]
  |  |  ------------------
  ------------------
  746|  2.17k|    if (UNLIKELY(n_tok + ZXC_PAD_SIZE > ctx->tok_buffer_cap ||
  ------------------
  |  |  154|  4.35k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1, False: 2.17k]
  |  |  |  Branch (154:42): [True: 1, False: 2.17k]
  |  |  |  Branch (154:42): [True: 0, False: 2.17k]
  |  |  ------------------
  ------------------
  747|  2.17k|                 n_tok + ZXC_PIVCO_SCRATCH_PAD > ctx->pivco_scratch_cap))
  748|      1|        return ZXC_ERROR_DST_TOO_SMALL;
  749|  2.17k|    return zxc_huf_decode_section(payload, psize, ctx->tok_buffer, n_tok, ctx->pivco_scratch);
  ------------------
  |  |   29|  2.17k|#define zxc_huf_decode_section ZXC_CAT(zxc_huf_decode_section, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   23|  2.17k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  2.17k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  750|  2.17k|}
zxc_decompress.c:zxc_decode_copy_literals:
  405|  2.42M|                                                       const uint64_t ll) {
  406|  2.42M|    zxc_wild_copy32(dst, src, ll);
  407|  2.42M|}
zxc_decompress.c:zxc_wild_copy32:
  372|  4.50M|static ZXC_ALWAYS_INLINE void zxc_wild_copy32(uint8_t* dst, const uint8_t* src, const size_t len) {
  373|  4.50M|    zxc_copy32(dst, src);
  374|  4.50M|    if (UNLIKELY(len > 32)) {
  ------------------
  |  |  154|  4.50M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 552k, False: 3.95M]
  |  |  ------------------
  ------------------
  375|   552k|        size_t rem = len - 32;
  376|   552k|        dst += 32;
  377|   552k|        src += 32;
  378|  8.23M|        while (rem > 32) {
  ------------------
  |  Branch (378:16): [True: 7.68M, False: 552k]
  ------------------
  379|  7.68M|            zxc_copy32(dst, src);
  380|  7.68M|            dst += 32;
  381|  7.68M|            src += 32;
  382|  7.68M|            rem -= 32;
  383|  7.68M|        }
  384|   552k|        zxc_copy32(dst, src);
  385|   552k|    }
  386|  4.50M|}
zxc_decompress.c:zxc_decode_copy_match_spl:
  479|   484k|                                                        const uint64_t ml) {
  480|   484k|    if (LIKELY(ml <= ZXC_SPL_MAX_INLINE_ML)) {
  ------------------
  |  |  148|   484k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 269k, False: 214k]
  |  |  ------------------
  ------------------
  481|   269k|        zxc_decode_copy_match_short(d_ptr, off, ml);
  482|   269k|    } else {
  483|   214k|        zxc_decode_copy_match(d_ptr, off, ml);
  484|   214k|    }
  485|   484k|}
zxc_decompress.c:zxc_decode_copy_match_short:
  460|   269k|                                                          const uint32_t off, const uint64_t ml) {
  461|   269k|    const uint8_t* match_src = d_ptr - off;
  462|   269k|    if (LIKELY(off >= 32)) {
  ------------------
  |  |  148|   269k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 84.1k, False: 185k]
  |  |  ------------------
  ------------------
  463|  84.1k|        zxc_copy32(d_ptr, match_src);
  464|   185k|    } else if (off == 1) {
  ------------------
  |  Branch (464:16): [True: 140k, False: 45.0k]
  ------------------
  465|   140k|        zxc_decode_fill_run(d_ptr, match_src[0], ml);
  466|   140k|    } else {
  467|  45.0k|        zxc_decode_copy_overlap_short(d_ptr, off, ml);
  468|  45.0k|    }
  469|   269k|}
zxc_decompress.c:zxc_decode_fill_run:
  310|   238k|                                                  const uint64_t ml) {
  311|       |#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
  312|       |    const __m256i v = _mm256_set1_epi8((char)byte);
  313|       |    _mm256_storeu_si256((__m256i*)dst, v);
  314|       |    if (UNLIKELY(ml > 32)) {
  315|       |        uint8_t* p = dst;
  316|       |        const uint8_t* const last = dst + ml - 32;
  317|       |        do {
  318|       |            p += 32;
  319|       |            _mm256_storeu_si256((__m256i*)p, v);
  320|       |        } while (p < last);
  321|       |    }
  322|       |#elif defined(ZXC_USE_SSE2)
  323|       |    const __m128i v = _mm_set1_epi8((char)byte);
  324|   238k|    _mm_storeu_si128((__m128i*)dst, v);
  325|   238k|    _mm_storeu_si128((__m128i*)(dst + 16), v);
  326|   238k|    if (UNLIKELY(ml > 32)) {
  ------------------
  |  |  154|   238k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 47.7k, False: 191k]
  |  |  ------------------
  ------------------
  327|  47.7k|        uint8_t* p = dst;
  328|  47.7k|        const uint8_t* const last = dst + ml - 32;
  329|  3.68M|        do {
  330|  3.68M|            p += 32;
  331|  3.68M|            _mm_storeu_si128((__m128i*)p, v);
  332|  3.68M|            _mm_storeu_si128((__m128i*)(p + 16), v);
  333|  3.68M|        } while (p < last);
  ------------------
  |  Branch (333:18): [True: 3.63M, False: 47.7k]
  ------------------
  334|  47.7k|    }
  335|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
  336|       |    const uint8x16_t v = vdupq_n_u8(byte);
  337|       |    vst1q_u8(dst, v);
  338|       |    vst1q_u8(dst + 16, v);
  339|       |    if (UNLIKELY(ml > 32)) {
  340|       |        uint8_t* p = dst;
  341|       |        const uint8_t* const last = dst + ml - 32;
  342|       |        do {
  343|       |            p += 32;
  344|       |            vst1q_u8(p, v);
  345|       |            vst1q_u8(p + 16, v);
  346|       |        } while (p < last);
  347|       |    }
  348|       |#else
  349|       |    ZXC_MEMSET(dst, byte, ml);
  350|       |#endif
  351|   238k|}
zxc_decompress.c:zxc_decode_copy_overlap_short:
  239|  45.0k|                                                            const uint64_t ml) {
  240|       |#if defined(ZXC_USE_NEON64)
  241|       |    const uint8x16_t s0 = vld1q_u8(dst - off);
  242|       |    vst1q_u8(dst, vqtbl1q_u8(s0, vld1q_u8(zxc_overlap_masks32[off])));
  243|       |    if (UNLIKELY(ml > 16)) {
  244|       |        uint8x16x2_t tbl;
  245|       |        tbl.val[0] = s0;
  246|       |        tbl.val[1] = vld1q_u8(dst - off + 16);
  247|       |        vst1q_u8(dst + 16, vqtbl2q_u8(tbl, vld1q_u8(zxc_overlap_masks32[off] + 16)));
  248|       |    }
  249|       |
  250|       |#elif defined(ZXC_USE_NEON32)
  251|       |    uint8x8x2_t lo_tbl;
  252|       |    lo_tbl.val[0] = vld1_u8(dst - off);
  253|       |    lo_tbl.val[1] = vld1_u8(dst - off + 8);
  254|       |    const uint8_t* const m = zxc_overlap_masks32[off];
  255|       |    vst1_u8(dst, vtbl2_u8(lo_tbl, vld1_u8(m)));
  256|       |    vst1_u8(dst + 8, vtbl2_u8(lo_tbl, vld1_u8(m + 8)));
  257|       |    if (UNLIKELY(ml > 16)) {
  258|       |        uint8x8x4_t tbl;
  259|       |        tbl.val[0] = lo_tbl.val[0];
  260|       |        tbl.val[1] = lo_tbl.val[1];
  261|       |        tbl.val[2] = vld1_u8(dst - off + 16);
  262|       |        tbl.val[3] = vld1_u8(dst - off + 24);
  263|       |        vst1_u8(dst + 16, vtbl4_u8(tbl, vld1_u8(m + 16)));
  264|       |        vst1_u8(dst + 24, vtbl4_u8(tbl, vld1_u8(m + 24)));
  265|       |    }
  266|       |
  267|       |#elif defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
  268|       |    // pshufb reaches 16 bytes, so only the upper half needs two tables: shuffle
  269|       |    // both and pick per byte on bit 4 of the index.
  270|       |    const __m128i t0 = _mm_loadu_si128((const __m128i*)(dst - off));
  271|       |    _mm_storeu_si128(
  272|       |        (__m128i*)dst,
  273|       |        _mm_shuffle_epi8(t0, _mm_load_si128((const __m128i*)zxc_overlap_masks32[off])));
  274|       |    if (UNLIKELY(ml > 16)) {
  275|       |        const __m128i t1 = _mm_loadu_si128((const __m128i*)(dst - off + 16));
  276|       |        const __m128i m_hi = _mm_load_si128((const __m128i*)(zxc_overlap_masks32[off] + 16));
  277|       |        _mm_storeu_si128(
  278|       |            (__m128i*)(dst + 16),
  279|       |            _mm_blendv_epi8(_mm_shuffle_epi8(t0, m_hi),
  280|       |                            _mm_shuffle_epi8(t1, _mm_sub_epi8(m_hi, _mm_set1_epi8(16))),
  281|       |                            _mm_slli_epi16(m_hi, 3)));
  282|       |    }
  283|       |
  284|       |#else
  285|  45.0k|    const uint8_t* src = dst - off;
  286|  45.0k|    const size_t n = (ml > 16) ? 32 : 16;
  ------------------
  |  Branch (286:22): [True: 10.3k, False: 34.7k]
  ------------------
  287|  45.0k|    uint32_t k = 0;
  288|   931k|    for (size_t i = 0; i < n; i++) {
  ------------------
  |  Branch (288:24): [True: 886k, False: 45.0k]
  ------------------
  289|   886k|        dst[i] = src[k];
  290|   886k|        if (++k == off) k = 0;
  ------------------
  |  Branch (290:13): [True: 157k, False: 728k]
  ------------------
  291|   886k|    }
  292|  45.0k|#endif
  293|  45.0k|}
zxc_decompress.c:zxc_decode_copy_match:
  433|  2.59M|                                                    const uint64_t ml) {
  434|  2.59M|    const uint8_t* match_src = d_ptr - off;
  435|  2.59M|    if (LIKELY(off >= 32)) {
  ------------------
  |  |  148|  2.59M|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 2.07M, False: 512k]
  |  |  ------------------
  ------------------
  436|  2.07M|        zxc_wild_copy32(d_ptr, match_src, ml);
  437|  2.07M|    } else if (off == 1) {
  ------------------
  |  Branch (437:16): [True: 98.0k, False: 414k]
  ------------------
  438|  98.0k|        zxc_decode_fill_run(d_ptr, match_src[0], ml);
  439|   414k|    } else {
  440|   414k|        zxc_decode_copy_overlap_run32(d_ptr, off, ml);
  441|   414k|    }
  442|  2.59M|}
zxc_decompress.c:zxc_decode_copy_overlap_run32:
  144|   414k|                                                            const uint64_t ml) {
  145|   414k|    const size_t stride = zxc_overlap_strides32[off];
  146|   414k|    size_t copied = 0;
  147|       |#if defined(ZXC_USE_NEON64)
  148|       |    uint8x16x2_t tbl;
  149|       |    tbl.val[0] = vld1q_u8(dst - off);
  150|       |    tbl.val[1] = vld1q_u8(dst - off + 16);
  151|       |    const uint8x16_t pat_lo = vqtbl2q_u8(tbl, vld1q_u8(zxc_overlap_masks32[off]));
  152|       |    const uint8x16_t pat_hi = vqtbl2q_u8(tbl, vld1q_u8(zxc_overlap_masks32[off] + 16));
  153|       |    do {
  154|       |        vst1q_u8(dst + copied, pat_lo);
  155|       |        vst1q_u8(dst + copied + 16, pat_hi);
  156|       |        copied += stride;
  157|       |    } while (copied < ml);
  158|       |
  159|       |#elif defined(ZXC_USE_NEON32)
  160|       |    // VTBL reaches 8 bytes per lookup from a 4-register (32-byte) table, so the
  161|       |    // pattern takes four lookups instead of NEON64's two.
  162|       |    uint8x8x4_t tbl;
  163|       |    tbl.val[0] = vld1_u8(dst - off);
  164|       |    tbl.val[1] = vld1_u8(dst - off + 8);
  165|       |    tbl.val[2] = vld1_u8(dst - off + 16);
  166|       |    tbl.val[3] = vld1_u8(dst - off + 24);
  167|       |    const uint8_t* const m = zxc_overlap_masks32[off];
  168|       |    const uint8x8_t p0 = vtbl4_u8(tbl, vld1_u8(m));
  169|       |    const uint8x8_t p1 = vtbl4_u8(tbl, vld1_u8(m + 8));
  170|       |    const uint8x8_t p2 = vtbl4_u8(tbl, vld1_u8(m + 16));
  171|       |    const uint8x8_t p3 = vtbl4_u8(tbl, vld1_u8(m + 24));
  172|       |    do {
  173|       |        vst1_u8(dst + copied, p0);
  174|       |        vst1_u8(dst + copied + 8, p1);
  175|       |        vst1_u8(dst + copied + 16, p2);
  176|       |        vst1_u8(dst + copied + 24, p3);
  177|       |        copied += stride;
  178|       |    } while (copied < ml);
  179|       |
  180|       |#elif defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
  181|       |    // pshufb only reaches 16 bytes per lane, so the 32-byte table is emulated:
  182|       |    // shuffle both halves, then pick per byte on bit 4 of the index.
  183|       |    const __m128i t0 = _mm_loadu_si128((const __m128i*)(dst - off));
  184|       |    const __m128i t1 = _mm_loadu_si128((const __m128i*)(dst - off + 16));
  185|       |    const __m128i sixteen = _mm_set1_epi8(16);
  186|       |    const __m128i m_lo = _mm_load_si128((const __m128i*)zxc_overlap_masks32[off]);
  187|       |    const __m128i m_hi = _mm_load_si128((const __m128i*)(zxc_overlap_masks32[off] + 16));
  188|       |    const __m128i pat_lo =
  189|       |        _mm_blendv_epi8(_mm_shuffle_epi8(t0, m_lo),
  190|       |                        _mm_shuffle_epi8(t1, _mm_sub_epi8(m_lo, sixteen)), _mm_slli_epi16(m_lo, 3));
  191|       |    const __m128i pat_hi =
  192|       |        _mm_blendv_epi8(_mm_shuffle_epi8(t0, m_hi),
  193|       |                        _mm_shuffle_epi8(t1, _mm_sub_epi8(m_hi, sixteen)), _mm_slli_epi16(m_hi, 3));
  194|       |    do {
  195|       |        _mm_storeu_si128((__m128i*)(dst + copied), pat_lo);
  196|       |        _mm_storeu_si128((__m128i*)(dst + copied + 16), pat_hi);
  197|       |        copied += stride;
  198|       |    } while (copied < ml);
  199|       |
  200|       |#else
  201|       |    // SSE2 (no PSHUFB) and non-SIMD tiers: build the 32-byte pattern with a
  202|       |    // wrap counter (no per-byte modulo), then store it as two 16-byte halves.
  203|   414k|    const uint8_t* src = dst - off;
  204|   414k|    uint8_t pat[32];
  205|   414k|    uint32_t k = 0;
  206|  13.6M|    for (size_t i = 0; i < 32; i++) {
  ------------------
  |  Branch (206:24): [True: 13.2M, False: 414k]
  ------------------
  207|  13.2M|        pat[i] = src[k];
  208|  13.2M|        if (++k == off) k = 0;
  ------------------
  |  Branch (208:13): [True: 1.00M, False: 12.2M]
  ------------------
  209|  13.2M|    }
  210|  1.36M|    do {
  211|  1.36M|        zxc_copy16(dst + copied, pat);
  212|  1.36M|        zxc_copy16(dst + copied + 16, pat + 16);
  213|  1.36M|        copied += stride;
  214|  1.36M|    } while (copied < ml);
  ------------------
  |  Branch (214:14): [True: 948k, False: 414k]
  ------------------
  215|   414k|#endif
  216|   414k|}
zxc_decompress.c:zxc_decode_copy_match_exact:
  504|   119k|                                                     const size_t off, const size_t ml) {
  505|   119k|    if (off >= ml) {
  ------------------
  |  Branch (505:9): [True: 108k, False: 11.1k]
  ------------------
  506|   108k|        ZXC_MEMCPY(d_ptr, match_src, ml);
  ------------------
  |  |  170|   108k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  507|   108k|    } else if (ml < 16) {
  ------------------
  |  Branch (507:16): [True: 3.33k, False: 7.77k]
  ------------------
  508|  33.6k|        for (size_t i = 0; i < ml; i++) d_ptr[i] = match_src[i];
  ------------------
  |  Branch (508:28): [True: 30.3k, False: 3.33k]
  ------------------
  509|  7.77k|    } else {
  510|  7.77k|        size_t n = off;
  511|  7.77k|        ZXC_MEMCPY(d_ptr, match_src, n);
  ------------------
  |  |  170|  7.77k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  512|  34.5k|        while (n <= ml - n) {
  ------------------
  |  Branch (512:16): [True: 26.7k, False: 7.77k]
  ------------------
  513|  26.7k|            ZXC_MEMCPY(d_ptr + n, d_ptr, n);
  ------------------
  |  |  170|  26.7k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  514|  26.7k|            n <<= 1;
  515|  26.7k|        }
  516|  7.77k|        ZXC_MEMCPY(d_ptr + n, d_ptr, ml - n);
  ------------------
  |  |  170|  7.77k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  517|  7.77k|    }
  518|   119k|}
zxc_decompress.c:zxc_decode_block_spl:
 1452|  6.92k|                                const size_t dst_capacity) {
 1453|  6.92k|    return zxc_decode_block_spl_impl(ctx, src, src_size, dst, dst_capacity, 0, 0, 0);
 1454|  6.92k|}
zxc_decompress.c:zxc_decode_block_pak_impl:
 1174|  6.72k|                                                       const int has_dict) {
 1175|  6.72k|    zxc_gnr_header_t gh;
 1176|       |
 1177|       |    // 0 when !has_dict (safe path) -> folds `d_floor` to `dst`.
 1178|  6.72k|    const size_t dict_size = has_dict ? ctx->dict_size : 0;
  ------------------
  |  Branch (1178:30): [True: 0, False: 6.72k]
  ------------------
 1179|       |
 1180|  6.72k|    if (UNLIKELY(zxc_read_pak_header(src, src_size, &gh) != ZXC_OK)) return ZXC_ERROR_BAD_HEADER;
  ------------------
  |  |  154|  6.72k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 3, False: 6.72k]
  |  |  ------------------
  ------------------
 1181|  6.72k|    if (UNLIKELY(gh.enc_lit != ZXC_SECTION_ENCODING_RAW || gh.enc_tok != 0))
  ------------------
  |  |  154|  13.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 4, False: 6.71k]
  |  |  |  Branch (154:42): [True: 2, False: 6.72k]
  |  |  |  Branch (154:42): [True: 2, False: 6.71k]
  |  |  ------------------
  ------------------
 1182|      4|        return ZXC_ERROR_CORRUPT_DATA;
 1183|       |
 1184|  6.71k|    const uint8_t* const p_data = src + ZXC_PAK_HEADER_BINARY_SIZE;
  ------------------
  |  |  434|  6.71k|#define ZXC_PAK_HEADER_BINARY_SIZE 12
  ------------------
 1185|  6.71k|    const uint8_t* p_curr = p_data;
 1186|       |
 1187|       |    // --- Stream Pointers & Validation ---
 1188|       |    // PAK carries no section descriptors: literals are always RAW, the sequence
 1189|       |    // stream is four bytes per sequence, and extras run to the payload end.
 1190|  6.71k|    const size_t sz_lit = gh.n_literals;
 1191|  6.71k|    const uint64_t sz_seqs = (uint64_t)gh.n_sequences * sizeof(uint32_t);
 1192|       |
 1193|  6.71k|    const size_t payload_avail = (size_t)(src + src_size - p_data);
 1194|  6.71k|    const uint64_t consumed = (uint64_t)sz_lit + sz_seqs;
 1195|  6.71k|    if (UNLIKELY(consumed > (uint64_t)payload_avail)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  6.71k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 45, False: 6.67k]
  |  |  ------------------
  ------------------
 1196|  6.67k|    const size_t sz_exts = payload_avail - (size_t)consumed; /* slack padding included */
 1197|       |
 1198|       |    // PAK literals are always RAW, so the slack is always load-bearing here.
 1199|       |    // No underflow: sz_lit <= consumed <= payload_avail.
 1200|  6.67k|    if (UNLIKELY(payload_avail - sz_lit < ZXC_BLOCK_LIT_SLACK)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  6.67k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1, False: 6.67k]
  |  |  ------------------
  ------------------
 1201|       |
 1202|  6.67k|    const uint8_t* l_ptr = p_curr;
 1203|  6.67k|    const uint8_t* l_end = l_ptr + sz_lit;
 1204|  6.67k|    p_curr += sz_lit;
 1205|       |
 1206|  6.67k|    const uint8_t* seq_ptr = p_curr;
 1207|  6.67k|    const uint8_t* extras_ptr = p_curr + (size_t)sz_seqs;
 1208|  6.67k|    const uint8_t* const extras_end = extras_ptr + sz_exts;
 1209|       |
 1210|  6.67k|    uint8_t* d_ptr = dst;
 1211|  6.67k|    const uint8_t* const d_end = dst + dst_capacity;
 1212|       |    // Lowest address a match may reach: the dictionary prefix if any, else dst.
 1213|  6.67k|    const uint8_t* const d_floor = dst - dict_size;
 1214|  6.67k|    const uint8_t* const d_end_safe =
 1215|  6.67k|        (dst_capacity > ZXC_PAD_SIZE * 4) ? d_end - (ZXC_PAD_SIZE * 4) : dst;  // 128
  ------------------
  |  |  331|  6.67k|#define ZXC_PAD_SIZE 32
  ------------------
                      (dst_capacity > ZXC_PAD_SIZE * 4) ? d_end - (ZXC_PAD_SIZE * 4) : dst;  // 128
  ------------------
  |  |  331|  6.67k|#define ZXC_PAD_SIZE 32
  ------------------
  |  Branch (1215:9): [True: 6.67k, False: 0]
  ------------------
 1216|       |    // 4x loop margin: four sequences of inline output (ll <= 254, ml <= 254 + 5,
 1217|       |    // longer ones escape and check themselves) plus the wild-copy overshoot:
 1218|       |    // 4 x 513 + 32 = 2084, all of ZXC_DECOMPRESS_TAIL_PAD.
 1219|  6.67k|    const uint8_t* const d_end_fast =
 1220|  6.67k|        (dst_capacity > ZXC_DECOMPRESS_TAIL_PAD) ? d_end - ZXC_DECOMPRESS_TAIL_PAD : dst;
  ------------------
  |  |  361|  6.67k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|  6.67k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|  6.67k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|  6.67k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|  6.67k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|  6.67k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  6.67k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|  6.67k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
                      (dst_capacity > ZXC_DECOMPRESS_TAIL_PAD) ? d_end - ZXC_DECOMPRESS_TAIL_PAD : dst;
  ------------------
  |  |  361|  6.67k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|  6.67k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|  6.67k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|  6.67k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|  6.67k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|  6.67k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  6.67k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  331|  6.67k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  |  Branch (1220:9): [True: 6.67k, False: 0]
  ------------------
 1221|       |
 1222|       |    // Literal margin for the PAK loops: without a varint, ll <= 254 per sequence,
 1223|       |    // so 4 * 254 = 1016. Past that only the cold varint path checks l_ptr.
 1224|  6.67k|    const size_t pak_margin_4x = 4 * (ZXC_SEQ_LL_MASK - 1);  // 1016
  ------------------
  |  |  528|  6.67k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  522|  6.67k|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
 1225|  6.67k|    const size_t pak_margin_1x = ZXC_SEQ_LL_MASK - 1;        // 254
  ------------------
  |  |  528|  6.67k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  ------------------
  |  |  |  |  522|  6.67k|#define ZXC_SEQ_LL_BITS 8
  |  |  ------------------
  ------------------
 1226|  6.67k|    const uint8_t* const l_end_safe_4x = (sz_lit > pak_margin_4x) ? l_end - pak_margin_4x : l_ptr;
  ------------------
  |  Branch (1226:42): [True: 2.78k, False: 3.88k]
  ------------------
 1227|  6.67k|    const uint8_t* const l_end_safe_1x = (sz_lit > pak_margin_1x) ? l_end - pak_margin_1x : l_ptr;
  ------------------
  |  Branch (1227:42): [True: 4.02k, False: 2.64k]
  ------------------
 1228|       |
 1229|  6.67k|    uint32_t n_seq = gh.n_sequences;
 1230|       |
 1231|       |    // Same handover as SPL, but the PAK offset is inline in the sequence word and
 1232|       |    // always 16 bits -- enc_off is not a width here, so the span is fixed.
 1233|  6.67k|    const size_t off_span = 1U << 16;
 1234|  6.67k|    const size_t span = (dict_size >= off_span) ? 0 : off_span - dict_size;
  ------------------
  |  Branch (1234:25): [True: 0, False: 6.67k]
  ------------------
 1235|  6.67k|    const uint8_t* const d_bounds = (span >= dst_capacity) ? d_end : dst + span;
  ------------------
  |  Branch (1235:37): [True: 0, False: 6.67k]
  ------------------
 1236|       |
 1237|       |    // --- SAFE loop: validate offsets until d_bounds (4x unroll) ---
 1238|  6.67k|    if (safe) {
  ------------------
  |  Branch (1238:9): [True: 0, False: 6.67k]
  ------------------
 1239|       |        // SAFE variant: save per-batch state so an OVERFLOW can rollback and
 1240|       |        // hand over to the 1x loop / Safe Path. Wild writes already committed
 1241|       |        // are deterministically overwritten when the 1x loop replays.
 1242|      0|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1242:16): [True: 0, False: 0]
  |  Branch (1242:30): [True: 0, False: 0]
  |  Branch (1242:52): [True: 0, False: 0]
  |  Branch (1242:77): [True: 0, False: 0]
  ------------------
 1243|      0|            const uint8_t* const t_save = seq_ptr;
 1244|      0|            const uint8_t* const e_save = extras_ptr;
 1245|      0|            uint8_t* const d_save = d_ptr;
 1246|      0|            const uint8_t* const l_save = l_ptr;
 1247|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  ------------------
  |  |  678|      0|    do {                                                                                        \
  |  |  679|      0|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  680|      0|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  681|      0|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  682|      0|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  683|      0|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  684|      0|        PREFETCH;                                                                               \
  |  |  685|      0|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1247|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  686|      0|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  687|      0|            3U, DECODE, ON_FAIL);                                                               \
  |  |  688|      0|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1247|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  689|      0|                       ON_FAIL);                                                                \
  |  |  690|      0|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1247|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  691|      0|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1247|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, goto rollback_safe_4x, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|      0|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|      0|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|      0|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|      0|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|      0|        n_seq -= 4;                                                                             \
  |  |  693|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (693:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1248|      0|            continue;
 1249|       |
 1250|      0|        rollback_safe_4x:
 1251|      0|            seq_ptr = t_save;
 1252|      0|            extras_ptr = e_save;
 1253|      0|            d_ptr = d_save;
 1254|      0|            l_ptr = l_save;
 1255|      0|            break;
 1256|      0|        }
 1257|  6.67k|    } else {
 1258|   356k|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x && d_ptr < d_bounds) {
  ------------------
  |  Branch (1258:16): [True: 355k, False: 1.42k]
  |  Branch (1258:30): [True: 355k, False: 0]
  |  Branch (1258:52): [True: 351k, False: 4.14k]
  |  Branch (1258:77): [True: 350k, False: 1.10k]
  ------------------
 1259|   350k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  ------------------
  |  |  678|   350k|    do {                                                                                        \
  |  |  679|   350k|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  680|   350k|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  681|   350k|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  682|   350k|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  683|   350k|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  684|   350k|        PREFETCH;                                                                               \
  |  |  685|   350k|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  645|   350k|    do {                                                                                     \
  |  |  |  |  646|   350k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   350k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   350k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   350k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   350k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   350k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   350k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   350k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   350k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   350k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 3.96k, False: 346k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  3.96k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  3.96k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  3.96k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  3.96k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  7.93k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 3.96k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.96k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.96k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  3.96k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  3.96k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  3.96k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  3.96k|        }                                                                                    \
  |  |  |  |  658|   350k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 8.95k, False: 341k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  8.95k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  8.95k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  8.95k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 8.95k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  8.95k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  8.95k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  8.95k|        }                                                                                    \
  |  |  |  |  664|   350k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   350k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   350k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   350k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   350k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   350k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   350k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   350k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1259|   350k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|   350k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|   350k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 350k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|   350k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|   350k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|   350k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 350k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   350k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 350k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  686|   350k|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  687|   350k|            3U, DECODE, ON_FAIL);                                                               \
  |  |  688|   350k|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  645|   350k|    do {                                                                                     \
  |  |  |  |  646|   350k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   350k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   350k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   350k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   350k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   350k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   350k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   350k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   350k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   350k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 3.88k, False: 346k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  3.88k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  3.88k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  3.88k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  3.88k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  7.76k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 3.88k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.88k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.88k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  3.88k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  3.88k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  3.88k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  3.88k|        }                                                                                    \
  |  |  |  |  658|   350k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 9.21k, False: 340k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  9.21k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  9.21k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  9.21k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 9.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  9.21k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  9.21k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  9.21k|        }                                                                                    \
  |  |  |  |  664|   350k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   350k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   350k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   350k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   350k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   350k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   350k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   350k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1259|   350k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|   350k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|   350k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 350k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|   350k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|   350k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|   350k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 350k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   350k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 350k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  689|   350k|                       ON_FAIL);                                                                \
  |  |  690|   350k|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  645|   350k|    do {                                                                                     \
  |  |  |  |  646|   350k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   350k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   350k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   350k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   350k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   350k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   350k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   350k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   350k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   350k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 3.72k, False: 346k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  3.72k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  3.72k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  3.72k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  3.72k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  7.45k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 3.72k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.72k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.72k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  3.72k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  3.72k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  3.72k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  3.72k|        }                                                                                    \
  |  |  |  |  658|   350k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 9.48k, False: 340k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  9.48k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  9.48k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  9.48k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 9.48k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  9.48k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  9.48k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  9.48k|        }                                                                                    \
  |  |  |  |  664|   350k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   350k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   350k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   350k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   350k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   350k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   350k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   350k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1259|   350k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|   350k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|   350k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 350k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|   350k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|   350k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|   350k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 350k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   350k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 350k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  691|   350k|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  645|   350k|    do {                                                                                     \
  |  |  |  |  646|   350k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   350k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   350k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   350k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   350k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   350k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   350k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   350k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   350k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   350k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 3.87k, False: 346k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  3.87k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  3.87k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  3.87k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  3.87k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  7.74k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 3.87k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.87k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.87k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  3.87k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  3.87k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  3.87k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  3.87k|        }                                                                                    \
  |  |  |  |  658|   350k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 9.21k, False: 340k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  9.21k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  9.21k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  9.21k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 9.21k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  9.21k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  9.21k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  9.21k|        }                                                                                    \
  |  |  |  |  664|   350k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   350k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   350k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   350k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   350k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   350k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   350k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   350k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   350k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1259|   350k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_SAFE, return ZXC_ERROR_OVERFLOW, (void)0);
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  528|   350k|    do {                                                                              \
  |  |  |  |  |  |  |  |  529|   350k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  154|   350k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 350k]
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  530|   350k|        COPY(d_ptr, off, ml);                                                         \
  |  |  |  |  |  |  |  |  531|   350k|        d_ptr += ml;                                                                  \
  |  |  |  |  |  |  |  |  532|   350k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (532:14): [Folded, False: 350k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   350k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 350k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|   350k|        n_seq -= 4;                                                                             \
  |  |  693|   350k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (693:14): [Folded, False: 350k]
  |  |  ------------------
  ------------------
 1260|   350k|        }
 1261|  6.67k|    }
 1262|       |
 1263|       |    // --- SAFE Loop tail: remaining sequences with offset validation (1x) ---
 1264|   163k|    while (n_seq > 0 && d_ptr < d_end_safe && d_ptr < d_bounds) {
  ------------------
  |  Branch (1264:12): [True: 158k, False: 5.06k]
  |  Branch (1264:25): [True: 158k, False: 4]
  |  Branch (1264:47): [True: 156k, False: 1.46k]
  ------------------
 1265|   156k|        uint32_t seq = zxc_le32(seq_ptr);
 1266|   156k|        seq_ptr += sizeof(uint32_t);
 1267|       |
 1268|   156k|        uint64_t ll = seq >> ZXC_SEQ_LL_SHIFT;
  ------------------
  |  |  534|   156k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  524|   156k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  526|   156k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 1269|   156k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) ll += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  154|   156k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 690, False: 156k]
  |  |  ------------------
  ------------------
 1270|       |
 1271|   156k|        uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  536|   156k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  526|   156k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  530|   156k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  524|   156k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
 1272|   156k|        uint64_t ml = m_bits + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|   156k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1273|   156k|        if (UNLIKELY(m_bits == ZXC_SEQ_ML_MASK)) ml += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  154|   156k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 5.50k, False: 151k]
  |  |  ------------------
  ------------------
 1274|       |
 1275|   156k|        uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  532|   156k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  526|   156k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  676|   156k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1276|       |
 1277|       |        // Strict bounds check: sequence must fit, AND wild copies must not overshoot
 1278|       |        // Check both destination (d_ptr) and source literal stream (l_ptr)
 1279|   156k|        if (UNLIKELY(ll + ml + ZXC_PAD_SIZE > (size_t)(d_end - d_ptr) ||
  ------------------
  |  |  154|   313k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 19.5k, False: 137k]
  |  |  |  Branch (154:42): [True: 60, False: 156k]
  |  |  |  Branch (154:42): [True: 19.5k, False: 137k]
  |  |  ------------------
  ------------------
 1280|   156k|                     ll + ZXC_PAD_SIZE > (size_t)(l_end - l_ptr))) {
 1281|       |            // Fallback to exact copy (slow but safe)
 1282|  19.5k|            if (UNLIKELY(ll + ml > (size_t)(d_end - d_ptr) || ll > (size_t)(l_end - l_ptr)))
  ------------------
  |  |  154|  39.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 103, False: 19.4k]
  |  |  |  Branch (154:42): [True: 54, False: 19.5k]
  |  |  |  Branch (154:42): [True: 49, False: 19.4k]
  |  |  ------------------
  ------------------
 1283|    103|                return ZXC_ERROR_OVERFLOW;
 1284|  19.4k|            ZXC_MEMCPY(d_ptr, l_ptr, ll);
  ------------------
  |  |  170|  19.4k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1285|  19.4k|            l_ptr += ll;
 1286|  19.4k|            d_ptr += ll;
 1287|       |
 1288|  19.4k|            if (UNLIKELY((size_t)(d_ptr - d_floor) < offset)) return ZXC_ERROR_BAD_OFFSET;
  ------------------
  |  |  154|  19.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 12, False: 19.4k]
  |  |  ------------------
  ------------------
 1289|  19.4k|            const uint8_t* match_src = d_ptr - offset;
 1290|       |
 1291|  19.4k|            zxc_decode_copy_match_exact(d_ptr, match_src, offset, ml);
 1292|  19.4k|            d_ptr += ml;
 1293|   137k|        } else {
 1294|   137k|            zxc_decode_copy_literals(d_ptr, l_ptr, ll);
 1295|   137k|            l_ptr += ll;
 1296|   137k|            d_ptr += ll;
 1297|   137k|            DECODE_MATCH_SAFE(ml, offset, zxc_decode_copy_match);
  ------------------
  |  |  528|   137k|    do {                                                                              \
  |  |  529|   137k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < (off))) return ZXC_ERROR_BAD_OFFSET; \
  |  |  ------------------
  |  |  |  |  154|   137k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (154:21): [True: 26, False: 137k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  530|   137k|        COPY(d_ptr, off, ml);                                                         \
  |  |  531|   137k|        d_ptr += ml;                                                                  \
  |  |  532|   137k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (532:14): [Folded, False: 137k]
  |  |  ------------------
  ------------------
 1298|   137k|        }
 1299|   156k|        n_seq--;
 1300|   156k|    }
 1301|       |
 1302|       |    // --- FAST Loop: After threshold, check large margin to avoid individual bounds checks ---
 1303|  6.53k|    if (safe) {
  ------------------
  |  Branch (1303:9): [True: 0, False: 6.53k]
  ------------------
 1304|      0|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1304:16): [True: 0, False: 0]
  |  Branch (1304:30): [True: 0, False: 0]
  |  Branch (1304:52): [True: 0, False: 0]
  ------------------
 1305|      0|            const uint8_t* const t_save = seq_ptr;
 1306|      0|            const uint8_t* const e_save = extras_ptr;
 1307|      0|            uint8_t* const d_save = d_ptr;
 1308|      0|            const uint8_t* const l_save = l_ptr;
 1309|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  ------------------
  |  |  678|      0|    do {                                                                                        \
  |  |  679|      0|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  680|      0|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  681|      0|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  682|      0|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  683|      0|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  684|      0|        PREFETCH;                                                                               \
  |  |  685|      0|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  686|      0|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  687|      0|            3U, DECODE, ON_FAIL);                                                               \
  |  |  688|      0|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  689|      0|                       ON_FAIL);                                                                \
  |  |  690|      0|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  691|      0|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  645|      0|    do {                                                                                     \
  |  |  |  |  646|      0|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|      0|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|      0|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|      0|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|      0|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|      0|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|      0|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|      0|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|      0|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|      0|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|      0|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|      0|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|      0|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|      0|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|      0|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|      0|                ON_FAIL;                                                                     \
  |  |  |  |  657|      0|        }                                                                                    \
  |  |  |  |  658|      0|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|      0|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|      0|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|      0|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|      0|                ON_FAIL;                                                                     \
  |  |  |  |  663|      0|        }                                                                                    \
  |  |  |  |  664|      0|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|      0|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|      0|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|      0|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|      0|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|      0|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|      0|        l_ptr += ll;                                                                         \
  |  |  |  |  668|      0|        d_ptr += ll;                                                                         \
  |  |  |  |  669|      0|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1309|      0|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, goto rollback_fast_4x,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|      0|    do {                                 \
  |  |  |  |  |  |  |  |  538|      0|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|      0|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|      0|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 0]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|      0|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|      0|        n_seq -= 4;                                                                             \
  |  |  693|      0|    } while (0)
  |  |  ------------------
  |  |  |  Branch (693:14): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1310|      0|                                ZXC_PREFETCH_READ(l_ptr + ZXC_CACHE_LINE_SIZE));
 1311|      0|            continue;
 1312|       |
 1313|      0|        rollback_fast_4x:
 1314|      0|            seq_ptr = t_save;
 1315|      0|            extras_ptr = e_save;
 1316|      0|            d_ptr = d_save;
 1317|      0|            l_ptr = l_save;
 1318|      0|            break;
 1319|      0|        }
 1320|  6.53k|    } else {
 1321|   190k|        while (n_seq >= 4 && d_ptr < d_end_fast && l_ptr < l_end_safe_4x) {
  ------------------
  |  Branch (1321:16): [True: 184k, False: 5.86k]
  |  Branch (1321:30): [True: 184k, False: 27]
  |  Branch (1321:52): [True: 183k, False: 644]
  ------------------
 1322|   183k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  ------------------
  |  |  678|   183k|    do {                                                                                        \
  |  |  679|   183k|        uint32_t s1 = zxc_le32(seq_ptr);                                                        \
  |  |  680|   183k|        uint32_t s2 = zxc_le32(seq_ptr + sizeof(uint32_t));                                     \
  |  |  681|   183k|        uint32_t s3 = zxc_le32(seq_ptr + 2 * sizeof(uint32_t));                                 \
  |  |  682|   183k|        uint32_t s4 = zxc_le32(seq_ptr + 3 * sizeof(uint32_t));                                 \
  |  |  683|   183k|        seq_ptr += 4 * sizeof(uint32_t);                                                        \
  |  |  684|   183k|        PREFETCH;                                                                               \
  |  |  685|   183k|        DECODE_PAK_SEQ(                                                                         \
  |  |  ------------------
  |  |  |  |  645|   183k|    do {                                                                                     \
  |  |  |  |  646|   183k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   183k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   183k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   183k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   183k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   183k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   183k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   183k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   183k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   183k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   183k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 3.20k, False: 180k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  3.20k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  3.20k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  3.20k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  3.20k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  6.40k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 3.20k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.20k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  3.20k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  3.20k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  3.20k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  3.20k|        }                                                                                    \
  |  |  |  |  658|   183k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   183k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 5.42k, False: 178k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  5.42k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  5.42k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  5.42k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 5.42k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  5.42k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  5.42k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  5.42k|        }                                                                                    \
  |  |  |  |  664|   183k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   183k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   183k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   183k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   183k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   183k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   183k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   183k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|   183k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   183k|    do {                                 \
  |  |  |  |  |  |  |  |  538|   183k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|   183k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|   183k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 183k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   183k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 183k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  686|   183k|            s1, (s2 >> ZXC_SEQ_LL_SHIFT) + (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), \
  |  |  687|   183k|            3U, DECODE, ON_FAIL);                                                               \
  |  |  688|   183k|        DECODE_PAK_SEQ(s2, (s3 >> ZXC_SEQ_LL_SHIFT) + (s4 >> ZXC_SEQ_LL_SHIFT), 2U, DECODE,     \
  |  |  ------------------
  |  |  |  |  645|   183k|    do {                                                                                     \
  |  |  |  |  646|   183k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   183k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   183k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   183k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   183k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   183k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   183k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   183k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   183k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   183k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   183k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 3.19k, False: 180k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  3.19k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  3.19k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  3.19k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  3.19k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  6.39k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 3.19k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.19k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.19k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  3.19k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  3.19k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  3.19k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  3.19k|        }                                                                                    \
  |  |  |  |  658|   183k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   183k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 5.55k, False: 178k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  5.55k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  5.55k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  5.55k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 5.55k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  5.55k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  5.55k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  5.55k|        }                                                                                    \
  |  |  |  |  664|   183k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   183k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   183k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   183k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   183k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   183k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   183k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   183k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|   183k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   183k|    do {                                 \
  |  |  |  |  |  |  |  |  538|   183k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|   183k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|   183k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 183k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   183k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 183k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  689|   183k|                       ON_FAIL);                                                                \
  |  |  690|   183k|        DECODE_PAK_SEQ(s3, (s4 >> ZXC_SEQ_LL_SHIFT), 1U, DECODE, ON_FAIL);                      \
  |  |  ------------------
  |  |  |  |  645|   183k|    do {                                                                                     \
  |  |  |  |  646|   183k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   183k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   183k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   183k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   183k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   183k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   183k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   183k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   183k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   183k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   183k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 3.17k, False: 180k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  3.17k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  3.17k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  3.17k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  3.17k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  6.34k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 3.17k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.17k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.17k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  3.17k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  3.17k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  3.17k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  3.17k|        }                                                                                    \
  |  |  |  |  658|   183k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   183k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 5.51k, False: 178k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  5.51k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  5.51k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  5.51k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 5.51k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  5.51k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  5.51k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  5.51k|        }                                                                                    \
  |  |  |  |  664|   183k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   183k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   183k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   183k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   183k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   183k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   183k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   183k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|   183k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   183k|    do {                                 \
  |  |  |  |  |  |  |  |  538|   183k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|   183k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|   183k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 183k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   183k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 183k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  691|   183k|        DECODE_PAK_SEQ(s4, 0, 0U, DECODE, ON_FAIL);                                             \
  |  |  ------------------
  |  |  |  |  645|   183k|    do {                                                                                     \
  |  |  |  |  646|   183k|        uint64_t ll = (S) >> ZXC_SEQ_LL_SHIFT;                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  534|   183k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   183k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  647|   183k|        const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  536|   183k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t mb = ((S) >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;                     \
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|   183k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|   183k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  648|   183k|        uint64_t ml = mb + ZXC_LZ_MIN_MATCH_LEN;                                             \
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|   183k|#define ZXC_LZ_MIN_MATCH_LEN 5
  |  |  |  |  ------------------
  |  |  |  |  649|   183k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   183k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 3.20k, False: 180k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  650|  3.20k|            ll += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  651|  3.20k|            const uint64_t reserve = (RESERVE);                                              \
  |  |  |  |  652|  3.20k|            /* Same reservation as the SPL twin; PAK's inline ml reaches 259. */             \
  |  |  |  |  653|  3.20k|            if (UNLIKELY(ll + reserve > (size_t)(l_end - l_ptr) ||                           \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  6.40k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 3.20k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.20k]
  |  |  |  |  |  |  |  Branch (154:42): [True: 0, False: 3.20k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  654|  3.20k|                         ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  655|  3.20k|                             (size_t)(d_end - d_ptr)))                                       \
  |  |  |  |  656|  3.20k|                ON_FAIL;                                                                     \
  |  |  |  |  657|  3.20k|        }                                                                                    \
  |  |  |  |  658|   183k|        if (UNLIKELY(mb == ZXC_SEQ_ML_MASK)) {                                               \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|   183k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 5.41k, False: 178k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  659|  5.41k|            ml += zxc_read_varint(&extras_ptr, extras_end);                                  \
  |  |  |  |  660|  5.41k|            if (UNLIKELY(ll + ml + (N_REM) * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE > \
  |  |  |  |  ------------------
  |  |  |  |  |  |  154|  5.41k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (154:21): [True: 0, False: 5.41k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  661|  5.41k|                         (size_t)(d_end - d_ptr)))                                           \
  |  |  |  |  662|  5.41k|                ON_FAIL;                                                                     \
  |  |  |  |  663|  5.41k|        }                                                                                    \
  |  |  |  |  664|   183k|        const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  532|   183k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  526|   183k|#define ZXC_SEQ_OFF_BITS 16
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                       const uint32_t off = ((S) & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;                  \
  |  |  |  |  ------------------
  |  |  |  |  |  |  676|   183k|#define ZXC_LZ_OFFSET_BIAS 1
  |  |  |  |  ------------------
  |  |  |  |  665|   183k|        /* PAK keeps the ladder: its inline ll reaches 254. */                               \
  |  |  |  |  666|   183k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);                                          \
  |  |  |  |  667|   183k|        l_ptr += ll;                                                                         \
  |  |  |  |  668|   183k|        d_ptr += ll;                                                                         \
  |  |  |  |  669|   183k|        DECODE(ml, off, zxc_decode_copy_match);                                              \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1322|   183k|            DECODE_PAK_BATCH_4X(DECODE_MATCH_FAST, return ZXC_ERROR_OVERFLOW,
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  537|   183k|    do {                                 \
  |  |  |  |  |  |  |  |  538|   183k|        COPY(d_ptr, off, ml);            \
  |  |  |  |  |  |  |  |  539|   183k|        d_ptr += ml;                     \
  |  |  |  |  |  |  |  |  540|   183k|    } while (0)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  Branch (540:14): [Folded, False: 183k]
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  670|   183k|    } while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (670:14): [Folded, False: 183k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  692|   183k|        n_seq -= 4;                                                                             \
  |  |  693|   183k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (693:14): [Folded, False: 183k]
  |  |  ------------------
  ------------------
 1323|   183k|                                ZXC_PREFETCH_READ(l_ptr + ZXC_CACHE_LINE_SIZE));
 1324|   183k|        }
 1325|  6.53k|    }
 1326|       |
 1327|       |    // --- Remaining 1 sequence (Fast Path) ---
 1328|   110k|    while (n_seq > 0 && d_ptr < d_end_safe && l_ptr < l_end_safe_1x) {
  ------------------
  |  Branch (1328:12): [True: 104k, False: 5.52k]
  |  Branch (1328:25): [True: 104k, False: 9]
  |  Branch (1328:47): [True: 104k, False: 725]
  ------------------
 1329|       |        // Save state for fallback
 1330|   104k|        const uint8_t* seq_save = seq_ptr;
 1331|   104k|        const uint8_t* ext_save = extras_ptr;
 1332|       |
 1333|   104k|        const uint32_t seq = zxc_le32(seq_ptr);
 1334|   104k|        seq_ptr += sizeof(uint32_t);
 1335|       |
 1336|   104k|        uint64_t ll = seq >> ZXC_SEQ_LL_SHIFT;
  ------------------
  |  |  534|   104k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  524|   104k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  526|   104k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 1337|   104k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) {
  ------------------
  |  |  154|   104k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 462, False: 103k]
  |  |  ------------------
  ------------------
 1338|    462|            ll += zxc_read_varint(&extras_ptr, extras_end);
 1339|    462|            if (UNLIKELY(ll > (size_t)(l_end - l_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|    462|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 24, False: 438]
  |  |  ------------------
  ------------------
 1340|    462|        }
 1341|       |
 1342|   104k|        uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  536|   104k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  526|   104k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  530|   104k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  524|   104k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
 1343|   104k|        uint64_t ml = m_bits + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|   104k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1344|   104k|        if (UNLIKELY(m_bits == ZXC_SEQ_ML_MASK)) ml += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  154|   104k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1.63k, False: 102k]
  |  |  ------------------
  ------------------
 1345|       |
 1346|       |        // Strict bounds checks (including wild copy overrun safety)
 1347|   104k|        if (UNLIKELY(ll + ml + ZXC_PAD_SIZE > (size_t)(d_end - d_ptr) ||
  ------------------
  |  |  154|   208k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 245, False: 103k]
  |  |  |  Branch (154:42): [True: 17, False: 104k]
  |  |  |  Branch (154:42): [True: 228, False: 103k]
  |  |  ------------------
  ------------------
 1348|   104k|                     ll + ZXC_PAD_SIZE > (size_t)(l_end - l_ptr))) {
 1349|    245|            seq_ptr = seq_save;
 1350|    245|            extras_ptr = ext_save;
 1351|    245|            break;
 1352|    245|        }
 1353|   103k|        uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  532|   103k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  526|   103k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  676|   103k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1354|       |
 1355|   103k|        zxc_decode_copy_literals(d_ptr, l_ptr, ll);
 1356|   103k|        l_ptr += ll;
 1357|   103k|        d_ptr += ll;
 1358|       |
 1359|   103k|        if (UNLIKELY(d_ptr < d_bounds && (size_t)(d_ptr - d_floor) < offset))
  ------------------
  |  |  154|   103k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 103k]
  |  |  |  Branch (154:42): [True: 0, False: 103k]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1360|      0|            return ZXC_ERROR_BAD_OFFSET;
 1361|       |
 1362|       |        // The loop entry check guarantees ll + ml + ZXC_PAD_SIZE bytes of
 1363|       |        // headroom, so the wild-copy ladder (incl. overlap/fill runs) is safe.
 1364|   103k|        zxc_decode_copy_match(d_ptr, offset, ml);
 1365|   103k|        d_ptr += ml;
 1366|   103k|        n_seq--;
 1367|   103k|    }
 1368|       |
 1369|       |    // --- Safe Path for Remaining Sequences ---
 1370|  97.8k|    while (n_seq > 0) {
  ------------------
  |  Branch (1370:12): [True: 91.4k, False: 6.35k]
  ------------------
 1371|  91.4k|        uint32_t seq = zxc_le32(seq_ptr);
 1372|  91.4k|        seq_ptr += sizeof(uint32_t);
 1373|       |
 1374|  91.4k|        uint64_t ll = seq >> ZXC_SEQ_LL_SHIFT;
  ------------------
  |  |  534|  91.4k|#define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  524|  91.4k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  |  |               #define ZXC_SEQ_LL_SHIFT (ZXC_SEQ_ML_BITS + ZXC_SEQ_OFF_BITS)
  |  |  ------------------
  |  |  |  |  526|  91.4k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
 1375|  91.4k|        if (UNLIKELY(ll == ZXC_SEQ_LL_MASK)) ll += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  154|  91.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 278, False: 91.2k]
  |  |  ------------------
  ------------------
 1376|       |
 1377|  91.4k|        uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  536|  91.4k|#define ZXC_SEQ_ML_SHIFT ZXC_SEQ_OFF_BITS
  |  |  ------------------
  |  |  |  |  526|  91.4k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t m_bits = (seq >> ZXC_SEQ_ML_SHIFT) & ZXC_SEQ_ML_MASK;
  ------------------
  |  |  530|  91.4k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  ------------------
  |  |  |  |  524|  91.4k|#define ZXC_SEQ_ML_BITS 8
  |  |  ------------------
  ------------------
 1378|  91.4k|        uint64_t ml = m_bits + ZXC_LZ_MIN_MATCH_LEN;
  ------------------
  |  |  575|  91.4k|#define ZXC_LZ_MIN_MATCH_LEN 5
  ------------------
 1379|  91.4k|        if (UNLIKELY(m_bits == ZXC_SEQ_ML_MASK)) ml += zxc_read_varint(&extras_ptr, extras_end);
  ------------------
  |  |  154|  91.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 2.84k, False: 88.6k]
  |  |  ------------------
  ------------------
 1380|  91.4k|        uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  532|  91.4k|#define ZXC_SEQ_OFF_MASK ((1U << ZXC_SEQ_OFF_BITS) - 1)
  |  |  ------------------
  |  |  |  |  526|  91.4k|#define ZXC_SEQ_OFF_BITS 16
  |  |  ------------------
  ------------------
                      uint32_t offset = (seq & ZXC_SEQ_OFF_MASK) + ZXC_LZ_OFFSET_BIAS;
  ------------------
  |  |  676|  91.4k|#define ZXC_LZ_OFFSET_BIAS 1
  ------------------
 1381|       |
 1382|  91.4k|        if (UNLIKELY(ll + ml > (size_t)(d_end - d_ptr) || ll > (size_t)(l_end - l_ptr)))
  ------------------
  |  |  154|   182k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 151, False: 91.3k]
  |  |  |  Branch (154:42): [True: 86, False: 91.3k]
  |  |  |  Branch (154:42): [True: 65, False: 91.3k]
  |  |  ------------------
  ------------------
 1383|    151|            return ZXC_ERROR_OVERFLOW;
 1384|  91.3k|        ZXC_MEMCPY(d_ptr, l_ptr, ll);
  ------------------
  |  |  170|  91.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1385|  91.3k|        l_ptr += ll;
 1386|  91.3k|        d_ptr += ll;
 1387|       |
 1388|  91.3k|        if (UNLIKELY((size_t)(d_ptr - d_floor) < offset)) return ZXC_ERROR_BAD_OFFSET;
  ------------------
  |  |  154|  91.3k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 91.3k]
  |  |  ------------------
  ------------------
 1389|  91.3k|        const uint8_t* match_src = d_ptr - offset;
 1390|       |
 1391|  91.3k|        zxc_decode_copy_match_exact(d_ptr, match_src, offset, ml);
 1392|  91.3k|        d_ptr += ml;
 1393|  91.3k|        n_seq--;
 1394|  91.3k|    }
 1395|       |
 1396|       |    // --- Trailing Literals ---
 1397|       |    // Copy remaining literals from source stream (literal exhaustion)
 1398|  6.35k|    if (UNLIKELY(l_ptr > l_end)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  6.35k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 6.35k]
  |  |  ------------------
  ------------------
 1399|  6.35k|    if (UNLIKELY(d_ptr > d_end)) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|  6.35k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 6.35k]
  |  |  ------------------
  ------------------
 1400|       |
 1401|  6.35k|    const size_t remaining_literals = (size_t)(l_end - l_ptr);
 1402|  6.35k|    if (UNLIKELY(remaining_literals > (size_t)(d_end - d_ptr))) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|  6.35k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1, False: 6.35k]
  |  |  ------------------
  ------------------
 1403|  6.35k|    ZXC_MEMCPY(d_ptr, l_ptr, remaining_literals);
  ------------------
  |  |  170|  6.35k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1404|  6.35k|    d_ptr += remaining_literals;
 1405|       |
 1406|  6.35k|    return (int)(d_ptr - dst);
 1407|  6.35k|}
zxc_decompress.c:zxc_decode_block_pak:
 1470|  6.72k|                                const size_t dst_capacity) {
 1471|  6.72k|    return zxc_decode_block_pak_impl(ctx, src, src_size, dst, dst_capacity, 0, 0);
 1472|  6.72k|}

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

zxc_decompress_chunk_wrapper:
  436|  17.7k|                                 const uint64_t block_index) {
  437|       |    // dict_size is constant for a stream; this per-block branch (outside the decode
  438|       |    // loop) routes to the dict variant only when a dictionary is active, so the
  439|       |    // no-dict path runs the dict-free chunk wrapper (identical codegen to main).
  440|  17.7k|    const zxc_variant_set_t* v = zxc_variants();
  441|  17.7k|    return (ctx->dict_size ? v->decompress_dict : v->decompress)(ctx, src, src_sz, dst, dst_cap,
  ------------------
  |  Branch (441:13): [True: 0, False: 17.7k]
  ------------------
  442|  17.7k|                                                                 block_index);
  443|  17.7k|}
zxc_compress_chunk_wrapper:
  467|  9.64k|                               const uint64_t block_index) {
  468|  9.64k|    return zxc_variants()->compress(ctx, src, src_sz, dst, dst_cap, block_index);
  469|  9.64k|}
zxc_create_cctx:
 1007|  18.9k|zxc_cctx* zxc_create_cctx(void) {
 1008|  18.9k|    zxc_cctx* const cctx = (zxc_cctx*)ZXC_CALLOC(1, sizeof(zxc_cctx));
  ------------------
  |  |   74|  18.9k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
 1009|  18.9k|    if (UNLIKELY(!cctx)) return NULL;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  18.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.9k]
  |  |  ------------------
  ------------------
 1010|  18.9k|    cctx->params = zxc_cparams_defaults();
 1011|  18.9k|    cctx->init_level = ZXC_LEVEL_DEFAULT;
 1012|  18.9k|    return cctx;
 1013|  18.9k|}
zxc_cctx_params:
 1015|  9.47k|const zxc_cparams_t* zxc_cctx_params(const zxc_cctx* cctx) { return &cctx->params; }
zxc_cparam_bounds:
 1017|  18.9k|int zxc_cparam_bounds(const zxc_cparam_t param, int64_t* min, int64_t* max) {
 1018|  18.9k|    int64_t lo, hi;
 1019|  18.9k|    switch (param) {
 1020|  9.47k|        case ZXC_C_LEVEL:
  ------------------
  |  Branch (1020:9): [True: 9.47k, False: 9.47k]
  ------------------
 1021|  9.47k|            lo = ZXC_LEVEL_FASTEST;
 1022|  9.47k|            hi = ZXC_LEVEL_ULTRA;
 1023|  9.47k|            break;
 1024|      0|        case ZXC_C_BLOCK_SIZE:
  ------------------
  |  Branch (1024:9): [True: 0, False: 18.9k]
  ------------------
 1025|      0|            lo = ZXC_BLOCK_SIZE_MIN;
  ------------------
  |  |   73|      0|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|      0|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
 1026|      0|            hi = 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
  |  |  ------------------
  ------------------
 1027|      0|            break;
 1028|      0|        case ZXC_C_THREADS:
  ------------------
  |  Branch (1028:9): [True: 0, False: 18.9k]
  ------------------
 1029|      0|            lo = 0;
 1030|      0|            hi = ZXC_MAX_THREADS;
  ------------------
  |  |  107|      0|#define ZXC_MAX_THREADS 512
  ------------------
 1031|      0|            break;
 1032|  9.47k|        case ZXC_C_CHECKSUM:
  ------------------
  |  Branch (1032:9): [True: 9.47k, False: 9.47k]
  ------------------
 1033|  9.47k|        case ZXC_C_SEEKABLE:
  ------------------
  |  Branch (1033:9): [True: 0, False: 18.9k]
  ------------------
 1034|  9.47k|            lo = 0;
 1035|  9.47k|            hi = 1;
 1036|  9.47k|            break;
 1037|      0|        default:
  ------------------
  |  Branch (1037:9): [True: 0, False: 18.9k]
  ------------------
 1038|      0|            return ZXC_ERROR_BAD_PARAM;
 1039|  18.9k|    }
 1040|  18.9k|    if (min) *min = lo;
  ------------------
  |  Branch (1040:9): [True: 18.9k, False: 0]
  ------------------
 1041|  18.9k|    if (max) *max = hi;
  ------------------
  |  Branch (1041:9): [True: 18.9k, False: 0]
  ------------------
 1042|  18.9k|    return ZXC_OK;
 1043|  18.9k|}
zxc_cctx_set_param:
 1052|  18.9k|int zxc_cctx_set_param(zxc_cctx* cctx, const zxc_cparam_t param, const int64_t value) {
 1053|  18.9k|    if (UNLIKELY(!cctx)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|  18.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.9k]
  |  |  ------------------
  ------------------
 1054|  18.9k|    int64_t lo, hi;
 1055|  18.9k|    const int rc = zxc_cparam_bounds(param, &lo, &hi);
 1056|  18.9k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  18.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.9k]
  |  |  ------------------
  ------------------
 1057|  18.9k|    if (value != 0 && (value < lo || value > hi)) {
  ------------------
  |  Branch (1057:9): [True: 10.7k, False: 8.15k]
  |  Branch (1057:24): [True: 0, False: 10.7k]
  |  Branch (1057:38): [True: 0, False: 10.7k]
  ------------------
 1058|      0|        if (param == ZXC_C_LEVEL) return ZXC_ERROR_BAD_LEVEL;
  ------------------
  |  Branch (1058:13): [True: 0, False: 0]
  ------------------
 1059|      0|        return param == ZXC_C_BLOCK_SIZE ? ZXC_ERROR_BAD_BLOCK_SIZE : ZXC_ERROR_BAD_PARAM;
  ------------------
  |  Branch (1059:16): [True: 0, False: 0]
  ------------------
 1060|      0|    }
 1061|       |
 1062|  18.9k|    zxc_cparams_t* const p = &cctx->params;
 1063|  18.9k|    switch (param) {
 1064|  9.47k|        case ZXC_C_LEVEL: {
  ------------------
  |  Branch (1064:9): [True: 9.47k, False: 9.47k]
  ------------------
 1065|       |            // 0 restores the default: on a static workspace, the pinned level.
 1066|  9.47k|            const int level = value != 0             ? (int)value
  ------------------
  |  Branch (1066:31): [True: 9.47k, False: 0]
  ------------------
 1067|  9.47k|                              : cctx->owns_workspace ? cctx->init_level
  ------------------
  |  Branch (1067:33): [True: 0, False: 0]
  ------------------
 1068|      0|                                                     : ZXC_LEVEL_DEFAULT;
 1069|       |            // A static workspace carved below the optimal-parser tier cannot grow into it.
 1070|  9.47k|            if (UNLIKELY(cctx->owns_workspace && level >= ZXC_LEVEL_DENSITY &&
  ------------------
  |  |  154|  18.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  |  Branch (154:42): [True: 0, False: 9.47k]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1071|  9.47k|                         !cctx->inner.opt_scratch))
 1072|      0|                return ZXC_ERROR_BAD_LEVEL;
 1073|  9.47k|            p->level = level;
 1074|  9.47k|            break;
 1075|  9.47k|        }
 1076|      0|        case ZXC_C_BLOCK_SIZE: {
  ------------------
  |  Branch (1076:9): [True: 0, False: 18.9k]
  ------------------
 1077|      0|            const size_t block_size = value != 0             ? (size_t)value
  ------------------
  |  Branch (1077:39): [True: 0, False: 0]
  ------------------
 1078|      0|                                      : cctx->owns_workspace ? cctx->last_block_size
  ------------------
  |  Branch (1078:41): [True: 0, False: 0]
  ------------------
 1079|      0|                                                             : ZXC_BLOCK_SIZE_DEFAULT;
  ------------------
  |  |   71|      0|#define ZXC_BLOCK_SIZE_DEFAULT (512 * 1024)
  ------------------
 1080|      0|            if (UNLIKELY(!zxc_validate_block_size(block_size))) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1081|      0|            if (UNLIKELY(cctx->owns_workspace && block_size != cctx->last_block_size))
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1082|      0|                return ZXC_ERROR_BAD_BLOCK_SIZE;
 1083|      0|            p->block_size = block_size;
 1084|      0|            break;
 1085|      0|        }
 1086|      0|        case ZXC_C_THREADS:
  ------------------
  |  Branch (1086:9): [True: 0, False: 18.9k]
  ------------------
 1087|      0|            p->n_threads = (int)value;
 1088|      0|            break;
 1089|  9.47k|        case ZXC_C_CHECKSUM:
  ------------------
  |  Branch (1089:9): [True: 9.47k, False: 9.47k]
  ------------------
 1090|  9.47k|            p->checksum_enabled = (int)value;
 1091|  9.47k|            break;
 1092|      0|        case ZXC_C_SEEKABLE:
  ------------------
  |  Branch (1092:9): [True: 0, False: 18.9k]
  ------------------
 1093|      0|            p->seekable = (int)value;
 1094|      0|            break;
 1095|      0|        default:
  ------------------
  |  Branch (1095:9): [True: 0, False: 18.9k]
  ------------------
 1096|      0|            return ZXC_ERROR_BAD_PARAM;  // LCOV_EXCL_LINE: bounds already refused it
 1097|  18.9k|    }
 1098|  18.9k|    return ZXC_OK;
 1099|  18.9k|}
zxc_free_cctx:
 1165|  18.9k|void zxc_free_cctx(zxc_cctx* cctx) {
 1166|  18.9k|    if (UNLIKELY(!cctx)) return;
  ------------------
  |  |  154|  18.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.9k]
  |  |  ------------------
  ------------------
 1167|       |    // Static cctx: handle + inner buffers live inside the caller's workspace,
 1168|       |    // which we do not own. Free is a no-op; the caller owns the workspace.
 1169|  18.9k|    if (cctx->owns_workspace) return;
  ------------------
  |  Branch (1169:9): [True: 0, False: 18.9k]
  ------------------
 1170|  18.9k|    if (cctx->initialized) zxc_cctx_free(&cctx->inner);
  ------------------
  |  Branch (1170:9): [True: 9.47k, False: 9.47k]
  ------------------
 1171|  18.9k|    ZXC_FREE(cctx->dict_copy.data);
  ------------------
  |  |   86|  18.9k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
 1172|  18.9k|    ZXC_FREE(cctx);
  ------------------
  |  |   86|  18.9k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
 1173|  18.9k|}
zxc_create_dctx:
 1331|  18.9k|zxc_dctx* zxc_create_dctx(void) {
 1332|  18.9k|    zxc_dctx* const dctx = (zxc_dctx*)ZXC_CALLOC(1, sizeof(zxc_dctx));
  ------------------
  |  |   74|  18.9k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
 1333|  18.9k|    return dctx;
 1334|  18.9k|}
zxc_dctx_params:
 1336|  18.9k|const zxc_dparams_t* zxc_dctx_params(const zxc_dctx* dctx) { return &dctx->params; }
zxc_dparam_bounds:
 1338|  18.9k|int zxc_dparam_bounds(const zxc_dparam_t param, int64_t* min, int64_t* max) {
 1339|  18.9k|    int64_t lo, hi;
 1340|  18.9k|    switch (param) {
 1341|      0|        case ZXC_D_THREADS:
  ------------------
  |  Branch (1341:9): [True: 0, False: 18.9k]
  ------------------
 1342|      0|            lo = 0;
 1343|      0|            hi = ZXC_MAX_THREADS;
  ------------------
  |  |  107|      0|#define ZXC_MAX_THREADS 512
  ------------------
 1344|      0|            break;
 1345|  18.9k|        case ZXC_D_CHECKSUM:
  ------------------
  |  Branch (1345:9): [True: 18.9k, False: 0]
  ------------------
 1346|  18.9k|            lo = 0;
 1347|  18.9k|            hi = 1;
 1348|  18.9k|            break;
 1349|      0|        default:
  ------------------
  |  Branch (1349:9): [True: 0, False: 18.9k]
  ------------------
 1350|      0|            return ZXC_ERROR_BAD_PARAM;
 1351|  18.9k|    }
 1352|  18.9k|    if (min) *min = lo;
  ------------------
  |  Branch (1352:9): [True: 18.9k, False: 0]
  ------------------
 1353|  18.9k|    if (max) *max = hi;
  ------------------
  |  Branch (1353:9): [True: 18.9k, False: 0]
  ------------------
 1354|  18.9k|    return ZXC_OK;
 1355|  18.9k|}
zxc_dctx_set_param:
 1357|  18.9k|int zxc_dctx_set_param(zxc_dctx* dctx, const zxc_dparam_t param, const int64_t value) {
 1358|  18.9k|    if (UNLIKELY(!dctx)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|  18.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.9k]
  |  |  ------------------
  ------------------
 1359|  18.9k|    int64_t lo, hi;
 1360|  18.9k|    const int rc = zxc_dparam_bounds(param, &lo, &hi);
 1361|  18.9k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  18.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.9k]
  |  |  ------------------
  ------------------
 1362|  18.9k|    if (value != 0 && (value < lo || value > hi)) return ZXC_ERROR_BAD_PARAM;
  ------------------
  |  Branch (1362:9): [True: 2.63k, False: 16.3k]
  |  Branch (1362:24): [True: 0, False: 2.63k]
  |  Branch (1362:38): [True: 0, False: 2.63k]
  ------------------
 1363|  18.9k|    switch (param) {
 1364|      0|        case ZXC_D_THREADS:
  ------------------
  |  Branch (1364:9): [True: 0, False: 18.9k]
  ------------------
 1365|      0|            dctx->params.n_threads = (int)value;
 1366|      0|            break;
 1367|  18.9k|        case ZXC_D_CHECKSUM:
  ------------------
  |  Branch (1367:9): [True: 18.9k, False: 0]
  ------------------
 1368|  18.9k|            dctx->params.checksum_enabled = (int)value;
 1369|  18.9k|            break;
 1370|      0|        default:
  ------------------
  |  Branch (1370:9): [True: 0, False: 18.9k]
  ------------------
 1371|      0|            return ZXC_ERROR_BAD_PARAM;  // LCOV_EXCL_LINE: bounds already refused it
 1372|  18.9k|    }
 1373|  18.9k|    return ZXC_OK;
 1374|  18.9k|}
zxc_free_dctx:
 1423|  18.9k|void zxc_free_dctx(zxc_dctx* dctx) {
 1424|  18.9k|    if (UNLIKELY(!dctx)) return;
  ------------------
  |  |  154|  18.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.9k]
  |  |  ------------------
  ------------------
 1425|       |    // Static dctx: handle + inner buffers live inside the caller's workspace,
 1426|       |    // which we do not own. Free is a no-op; the caller owns the workspace.
 1427|  18.9k|    if (dctx->owns_workspace) return;
  ------------------
  |  Branch (1427:9): [True: 0, False: 18.9k]
  ------------------
 1428|  18.9k|    if (dctx->initialized) zxc_cctx_free(&dctx->inner);
  ------------------
  |  Branch (1428:9): [True: 0, False: 18.9k]
  ------------------
 1429|  18.9k|    ZXC_FREE(dctx->dict_copy.data);
  ------------------
  |  |   86|  18.9k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
 1430|  18.9k|    ZXC_FREE(dctx);
  ------------------
  |  |   86|  18.9k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
 1431|  18.9k|}
zxc_compress_block_at:
 1806|  9.64k|                              const zxc_cparams_t* opts, const uint64_t block_index) {
 1807|  9.64k|    if (UNLIKELY(!cctx || !src || !dst || src_size == 0 || dst_capacity == 0))
  ------------------
  |  |  154|  77.1k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  |  Branch (154:42): [True: 0, False: 9.64k]
  |  |  |  Branch (154:42): [True: 0, False: 9.64k]
  |  |  |  Branch (154:42): [True: 0, False: 9.64k]
  |  |  |  Branch (154:42): [True: 0, False: 9.64k]
  |  |  |  Branch (154:42): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 1808|      0|        return ZXC_ERROR_NULL_INPUT;
 1809|  9.64k|    if (UNLIKELY(src_size > ZXC_BLOCK_SIZE_MAX)) return ZXC_ERROR_BAD_BLOCK_SIZE;
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 1810|       |
 1811|  9.64k|    const zxc_cparams_t* const cp = opts ? opts : &cctx->params;
  ------------------
  |  Branch (1811:37): [True: 9.64k, False: 0]
  ------------------
 1812|  9.64k|    zxc_cctx_opts_t o = zxc_cparams_resolve(cp);
 1813|       |    // Carve for the source if block_size is smaller; remember block_size as asked.
 1814|  9.64k|    zxc_cctx_opts_t carve = o;
 1815|  9.64k|    const size_t min_bs = zxc_block_size_ceil(src_size);
 1816|  9.64k|    if (carve.block_size < min_bs) carve.block_size = min_bs;
  ------------------
  |  Branch (1816:9): [True: 0, False: 9.64k]
  ------------------
 1817|       |
 1818|  9.64k|    return zxc_compress_block_resolved(cctx, src, src_size, dst, dst_capacity, carve, cp,
 1819|  9.64k|                                       block_index);
 1820|  9.64k|}
zxc_dispatch.c:zxc_variants:
  335|  27.4k|static ZXC_ALWAYS_INLINE const zxc_variant_set_t* zxc_variants(void) {
  336|  27.4k|    return &zxc_variants_default;
  337|  27.4k|}
zxc_dispatch.c:zxc_cparams_defaults:
 1003|  18.9k|static zxc_cparams_t zxc_cparams_defaults(void) {
 1004|  18.9k|    return (zxc_cparams_t){.level = ZXC_LEVEL_DEFAULT, .block_size = ZXC_BLOCK_SIZE_DEFAULT};
  ------------------
  |  |   71|  18.9k|#define ZXC_BLOCK_SIZE_DEFAULT (512 * 1024)
  ------------------
 1005|  18.9k|}
zxc_dispatch.c:zxc_cparams_resolve:
  995|  9.64k|static zxc_cctx_opts_t zxc_cparams_resolve(const zxc_cparams_t* p) {
  996|  9.64k|    return (zxc_cctx_opts_t){.level = p->level,
  997|  9.64k|                             .checksum = p->checksum_enabled,
  998|  9.64k|                             .seekable = p->seekable,
  999|  9.64k|                             .block_size = p->block_size};
 1000|  9.64k|}
zxc_dispatch.c:zxc_compress_block_resolved:
 1732|  9.64k|                                           const zxc_cparams_t* opts, const uint64_t block_index) {
 1733|       |    // When a dictionary is active, offset_bits must accommodate dict + block.
 1734|  9.64k|    const uint8_t* b_dict = opts ? (const uint8_t*)opts->dict : NULL;
  ------------------
  |  Branch (1734:29): [True: 9.64k, False: 0]
  ------------------
 1735|  9.64k|    const size_t b_dict_size = ZXC_OPTS_DICT_SIZE(opts);
  ------------------
  |  |  988|  9.64k|#define ZXC_OPTS_DICT_SIZE(o) (((o) && (o)->dict) ? (o)->dict_size : (size_t)0)
  |  |  ------------------
  |  |  |  Branch (988:33): [True: 9.64k, False: 0]
  |  |  |  Branch (988:40): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 1736|  9.64k|    const size_t effective_block_size =
 1737|  9.64k|        b_dict_size > 0 ? zxc_block_size_ceil(b_dict_size + o.block_size) : o.block_size;
  ------------------
  |  Branch (1737:9): [True: 0, False: 9.64k]
  ------------------
 1738|       |
 1739|       |    // Static cctx: the setters already refuse a dictionary, another block size
 1740|       |    // and a level raise, but a source larger than the pinned block would still
 1741|       |    // force a re-carve the workspace cannot hold.
 1742|  9.64k|    if (UNLIKELY(cctx->owns_workspace && effective_block_size != cctx->last_block_size))
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  |  Branch (154:42): [True: 0, False: 9.64k]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1743|      0|        return ZXC_ERROR_BAD_BLOCK_SIZE;
 1744|       |
 1745|       |    // Re-init when [dict | block] outgrows the workspace (a larger one encodes
 1746|       |    // the same, so a smaller block keeps it), a level raise needs the
 1747|       |    // optimal-parser scratch, or a dictionary meets a context carved without it.
 1748|  9.64k|    if (UNLIKELY(!cctx->initialized || cctx->last_block_size < effective_block_size ||
  ------------------
  |  |  154|  29.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 9.47k, False: 170]
  |  |  |  Branch (154:42): [True: 9.47k, False: 170]
  |  |  |  Branch (154:42): [True: 0, False: 170]
  |  |  |  Branch (154:42): [True: 0, False: 170]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 170]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1749|  9.64k|                 (o.level >= ZXC_LEVEL_DENSITY && !cctx->inner.opt_scratch) ||
 1750|  9.64k|                 (b_dict_size > 0 && !cctx->inner.dict_buffer))) {
 1751|  9.47k|        if (cctx->initialized) {
  ------------------
  |  Branch (1751:13): [True: 0, False: 9.47k]
  ------------------
 1752|       |            // LCOV_EXCL_START
 1753|      0|            zxc_cctx_free(&cctx->inner);
 1754|      0|            cctx->initialized = 0;
 1755|       |            // LCOV_EXCL_STOP
 1756|      0|        }
 1757|       |        // LCOV_EXCL_START
 1758|  9.47k|        if (UNLIKELY(zxc_cctx_init(&cctx->inner, effective_block_size, 1, o.level, o.checksum,
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
 1759|  9.47k|                                   b_dict_size) != ZXC_OK))
 1760|      0|            return ZXC_ERROR_MEMORY;
 1761|       |        // LCOV_EXCL_STOP
 1762|  9.47k|        cctx->last_block_size = effective_block_size;
 1763|  9.47k|        cctx->initialized = 1;
 1764|  9.47k|        cctx->huf_cached = 0;
 1765|  9.47k|    } else {
 1766|    170|        cctx->inner.compression_level = o.level;
 1767|    170|        cctx->inner.checksum_enabled = o.checksum;
 1768|    170|    }
 1769|       |
 1770|  9.64k|    cctx->inner.dict_size = b_dict_size;
 1771|  9.64k|    if (UNLIKELY(zxc_ctx_sync_dict_huf(&cctx->inner, cctx->huf_cache, &cctx->huf_cached,
  ------------------
  |  |  154|  48.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  |  Branch (154:42): [True: 9.64k, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 9.64k]
  |  |  |  Branch (154:42): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1772|  9.64k|                                       ZXC_OPTS_DICT_HUF(opts)) != ZXC_OK))
 1773|      0|        return ZXC_ERROR_CORRUPT_DATA;  // LCOV_EXCL_LINE
 1774|       |
 1775|  9.64k|    int res;
 1776|  9.64k|    if (b_dict && b_dict_size > 0) {
  ------------------
  |  Branch (1776:9): [True: 0, False: 9.64k]
  |  Branch (1776:19): [True: 0, False: 0]
  ------------------
 1777|       |        // [dict | block] assembled in the cctx-owned dict_buffer
 1778|      0|        uint8_t* const combined = cctx->inner.dict_buffer;
 1779|      0|        ZXC_MEMCPY(combined, b_dict, b_dict_size);
  ------------------
  |  |  170|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1780|      0|        ZXC_MEMCPY(combined + b_dict_size, src, src_size);
  ------------------
  |  |  170|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1781|      0|        res = zxc_compress_chunk_wrapper(&cctx->inner, combined, b_dict_size + src_size,
 1782|      0|                                         (uint8_t*)dst, dst_capacity, block_index);
 1783|  9.64k|    } else {
 1784|  9.64k|        res = zxc_compress_chunk_wrapper(&cctx->inner, (const uint8_t*)src, src_size, (uint8_t*)dst,
 1785|  9.64k|                                         dst_capacity, block_index);
 1786|  9.64k|    }
 1787|  9.64k|    if (UNLIKELY(res < 0)) return res;
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
 1788|  9.64k|    return (int64_t)res;
 1789|  9.64k|}
zxc_dispatch.c:zxc_ctx_sync_dict_huf:
  977|  9.64k|                                 int* RESTRICT cached, const uint8_t* RESTRICT dict_huf) {
  978|  9.64k|    if (dict_huf) {
  ------------------
  |  Branch (978:9): [True: 0, False: 9.64k]
  ------------------
  979|      0|        if (!*cached || memcmp(cache, dict_huf, ZXC_HUF_TABLE_SIZE) != 0) {
  ------------------
  |  |   96|      0|#define ZXC_HUF_TABLE_SIZE 128
  ------------------
  |  Branch (979:13): [True: 0, False: 0]
  |  Branch (979:25): [True: 0, False: 0]
  ------------------
  980|      0|            *cached = 0; /* a failed attach leaves inner without a tree */
  981|      0|            if (UNLIKELY(zxc_cctx_attach_dict_huf(inner, dict_huf) != ZXC_OK))
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  982|      0|                return ZXC_ERROR_CORRUPT_DATA;
  983|      0|            ZXC_MEMCPY(cache, dict_huf, ZXC_HUF_TABLE_SIZE);
  ------------------
  |  |  170|      0|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  984|      0|            *cached = 1;
  985|      0|        }
  986|  9.64k|    } else if (*cached) {
  ------------------
  |  Branch (986:16): [True: 0, False: 9.64k]
  ------------------
  987|      0|        (void)zxc_cctx_attach_dict_huf(inner, NULL);
  988|      0|        *cached = 0;
  989|      0|    }
  990|  9.64k|    return ZXC_OK;
  991|  9.64k|}

zxc_huf_unpack_lengths_default:
  957|  2.41k|int zxc_huf_unpack_lengths(const uint8_t* RESTRICT in, uint8_t* RESTRICT code_len) {
  958|  2.41k|    int max_len = 0;
  959|  2.41k|    int n_present = 0;
  960|   311k|    for (int i = 0; i < ZXC_HUF_NUM_SYMBOLS; i += 2) {
  ------------------
  |  |  785|   311k|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (960:21): [True: 309k, False: 2.41k]
  ------------------
  961|   309k|        const uint8_t b = in[i >> 1];
  962|   309k|        const uint8_t lo = b & 0x0F;
  963|   309k|        const uint8_t hi = (uint8_t)(b >> 4);
  964|   309k|        code_len[i] = lo;
  965|   309k|        code_len[i + 1] = hi;
  966|   309k|        if (lo > max_len) max_len = lo;
  ------------------
  |  Branch (966:13): [True: 924, False: 308k]
  ------------------
  967|   309k|        if (hi > max_len) max_len = hi;
  ------------------
  |  Branch (967:13): [True: 1.90k, False: 307k]
  ------------------
  968|   309k|        if (lo) n_present++;
  ------------------
  |  Branch (968:13): [True: 44.6k, False: 264k]
  ------------------
  969|   309k|        if (hi) n_present++;
  ------------------
  |  Branch (969:13): [True: 44.9k, False: 264k]
  ------------------
  970|   309k|    }
  971|  2.41k|    if (UNLIKELY(max_len > ZXC_HUF_MAX_CODE_LEN_ULTRA || n_present == 0))
  ------------------
  |  |  154|  4.80k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 29, False: 2.38k]
  |  |  |  Branch (154:42): [True: 28, False: 2.38k]
  |  |  |  Branch (154:42): [True: 1, False: 2.38k]
  |  |  ------------------
  ------------------
  972|     29|        return ZXC_ERROR_CORRUPT_DATA;
  973|  2.38k|    return ZXC_OK;
  974|  2.41k|}
zxc_huf_decode_section_default:
 2282|  2.46k|                           uint8_t* RESTRICT dst, const size_t n, uint8_t* RESTRICT scratch) {
 2283|  2.46k|    if (UNLIKELY(payload_size < (size_t)ZXC_HUF_TABLE_SIZE)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  2.46k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 45, False: 2.41k]
  |  |  ------------------
  ------------------
 2284|  2.41k|    uint8_t code_len[ZXC_HUF_NUM_SYMBOLS];
 2285|  2.41k|    const int rc = zxc_huf_unpack_lengths(payload, code_len);
  ------------------
  |  |   44|  2.41k|#define zxc_huf_unpack_lengths ZXC_CAT(zxc_huf_unpack_lengths, ZXC_FUNCTION_SUFFIX)
  |  |  ------------------
  |  |  |  |   41|  2.41k|#define ZXC_CAT(x, y) ZXC_CAT_IMPL(x, y)
  |  |  |  |  ------------------
  |  |  |  |  |  |   40|  2.41k|#define ZXC_CAT_IMPL(x, y) x##y
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2286|  2.41k|    if (UNLIKELY(rc != ZXC_OK)) return rc;
  ------------------
  |  |  154|  2.41k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 29, False: 2.38k]
  |  |  ------------------
  ------------------
 2287|  2.38k|    zxc_pivco_tree_t t;
 2288|  2.38k|    if (UNLIKELY(zxc_pivco_tree_build(code_len, &t) != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  2.38k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 32, False: 2.35k]
  |  |  ------------------
  ------------------
 2289|  2.35k|    return zxc_pivco_decode_core(payload + ZXC_HUF_TABLE_SIZE, payload_size - ZXC_HUF_TABLE_SIZE,
  ------------------
  |  |   96|  2.35k|#define ZXC_HUF_TABLE_SIZE 128
  ------------------
                  return zxc_pivco_decode_core(payload + ZXC_HUF_TABLE_SIZE, payload_size - ZXC_HUF_TABLE_SIZE,
  ------------------
  |  |   96|  2.35k|#define ZXC_HUF_TABLE_SIZE 128
  ------------------
 2290|  2.35k|                                 dst, n, &t, scratch);
 2291|  2.38k|}
zxc_huffman.c:zxc_pivco_tree_build:
 1048|  2.38k|static int zxc_pivco_tree_build(const uint8_t* RESTRICT code_len, zxc_pivco_tree_t* RESTRICT t) {
 1049|  2.38k|    uint16_t bl_count[ZXC_HUF_MAX_CODE_LEN_ULTRA + 1] = {0};
 1050|  2.38k|    int n_present = 0;
 1051|  2.38k|    int max_depth = 0;
 1052|   613k|    for (int s = 0; s < ZXC_HUF_NUM_SYMBOLS; s++) {
  ------------------
  |  |  785|   613k|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (1052:21): [True: 610k, False: 2.38k]
  ------------------
 1053|   610k|        const int l = code_len[s];
 1054|   610k|        if (l == 0) continue;
  ------------------
  |  Branch (1054:13): [True: 525k, False: 85.6k]
  ------------------
 1055|  85.6k|        if (UNLIKELY(l > ZXC_HUF_MAX_CODE_LEN_ULTRA)) return -1;
  ------------------
  |  |  154|  85.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 85.6k]
  |  |  ------------------
  ------------------
 1056|  85.6k|        bl_count[l]++;
 1057|  85.6k|        n_present++;
 1058|  85.6k|        if (l > max_depth) max_depth = l;
  ------------------
  |  Branch (1058:13): [True: 2.71k, False: 82.9k]
  ------------------
 1059|  85.6k|    }
 1060|  2.38k|    if (UNLIKELY(n_present == 0)) return -1;
  ------------------
  |  |  154|  2.38k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 2.38k]
  |  |  ------------------
  ------------------
 1061|  2.38k|    if (n_present >= 2) {
  ------------------
  |  Branch (1061:9): [True: 2.17k, False: 207]
  ------------------
 1062|  2.17k|        uint32_t kraft = 0;
 1063|  26.1k|        for (int l = 1; l <= ZXC_HUF_MAX_CODE_LEN_ULTRA; l++)
  ------------------
  |  |  778|  26.1k|#define ZXC_HUF_MAX_CODE_LEN_ULTRA 11
  ------------------
  |  Branch (1063:25): [True: 23.9k, False: 2.17k]
  ------------------
 1064|  23.9k|            kraft += (uint32_t)bl_count[l] << (ZXC_HUF_MAX_CODE_LEN_ULTRA - l);
  ------------------
  |  |  778|  23.9k|#define ZXC_HUF_MAX_CODE_LEN_ULTRA 11
  ------------------
 1065|  2.17k|        if (UNLIKELY(kraft != (1U << ZXC_HUF_MAX_CODE_LEN_ULTRA))) return -1;
  ------------------
  |  |  154|  2.17k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 31, False: 2.14k]
  |  |  ------------------
  ------------------
 1066|  2.17k|    } else if (UNLIKELY(bl_count[1] != 1)) {
  ------------------
  |  |  154|    207|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1, False: 206]
  |  |  ------------------
  ------------------
 1067|      1|        return -1; /* the lone symbol is pinned at length 1 */
 1068|      1|    }
 1069|  2.35k|    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|  2.35k|    unsigned width = 1;
 1074|  2.35k|    unsigned first = 0;
 1075|  2.35k|    t->node_base[0] = 0;
 1076|  2.35k|    t->leaf_base[0] = 0;
 1077|  10.0k|    for (int d = 0; d <= max_depth; d++) {
  ------------------
  |  Branch (1077:21): [True: 7.70k, False: 2.35k]
  ------------------
 1078|  7.70k|        t->base[d] = (int16_t)(t->node_base[d] - (int)first);
 1079|  7.70k|        t->node_base[d + 1] = (uint16_t)(t->node_base[d] + width);
 1080|  7.70k|        t->leaf_base[d + 1] = (uint16_t)(t->leaf_base[d] + bl_count[d]);
 1081|  7.70k|        first = 2 * (first + bl_count[d]);
 1082|  7.70k|        width = (d == 0 && n_present == 1) ? 1U : 2 * (width - bl_count[d]);
  ------------------
  |  Branch (1082:18): [True: 2.35k, False: 5.35k]
  |  Branch (1082:28): [True: 206, False: 2.14k]
  ------------------
 1083|  7.70k|    }
 1084|       |
 1085|  2.35k|    uint16_t pos[ZXC_HUF_MAX_CODE_LEN_ULTRA + 1];
 1086|  10.0k|    for (int d = 0; d <= max_depth; d++) pos[d] = t->leaf_base[d];
  ------------------
  |  Branch (1086:21): [True: 7.70k, False: 2.35k]
  ------------------
 1087|   604k|    for (int s = 0; s < ZXC_HUF_NUM_SYMBOLS; s++)
  ------------------
  |  |  785|   604k|#define ZXC_HUF_NUM_SYMBOLS 256
  ------------------
  |  Branch (1087:21): [True: 602k, False: 2.35k]
  ------------------
 1088|   602k|        if (code_len[s]) t->syms[pos[code_len[s]]++] = (uint8_t)s;
  ------------------
  |  Branch (1088:13): [True: 81.9k, False: 520k]
  ------------------
 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|  2.35k|    enum { INCOMPLETE = 0xFE };
 1094|  2.35k|    t->flat_d[t->node_base[max_depth + 1]] = 0;
 1095|  10.0k|    for (int d = max_depth; d >= 0; d--) {
  ------------------
  |  Branch (1095:29): [True: 7.70k, False: 2.35k]
  ------------------
 1096|  7.70k|        uint8_t* const h = t->flat_d + t->node_base[d];
 1097|  7.70k|        const uint8_t* const hc = t->flat_d + t->node_base[d + 1];
 1098|  7.70k|        const int L = zxc_pivco_leaves(t, d);
 1099|  7.70k|        const int N = t->node_base[d + 1] - t->node_base[d];
 1100|  89.6k|        for (int i = 0; i < L; i++) h[i] = 0;
  ------------------
  |  Branch (1100:25): [True: 81.9k, False: 7.70k]
  ------------------
 1101|  87.4k|        for (int i = L; i < N; i++) {
  ------------------
  |  Branch (1101:25): [True: 79.7k, False: 7.70k]
  ------------------
 1102|  79.7k|            const uint8_t a = hc[2 * (i - L)];
 1103|  79.7k|            const uint8_t b = hc[2 * (i - L) + 1];
 1104|  79.7k|            h[i] = (a == b && a != INCOMPLETE) ? (uint8_t)(a + 1) : (uint8_t)INCOMPLETE;
  ------------------
  |  Branch (1104:21): [True: 76.0k, False: 3.68k]
  |  Branch (1104:31): [True: 75.7k, False: 297]
  ------------------
 1105|  79.7k|        }
 1106|  7.70k|    }
 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|  7.70k|    for (int d = 0; d < max_depth; d++) {
  ------------------
  |  Branch (1110:21): [True: 5.35k, False: 2.35k]
  ------------------
 1111|  5.35k|        uint8_t* const fd = t->flat_d + t->node_base[d];
 1112|  5.35k|        const uint8_t* const up =
 1113|  5.35k|            d ? t->flat_d + t->node_base[d - 1] + zxc_pivco_leaves(t, d - 1) : NULL;
  ------------------
  |  Branch (1113:13): [True: 2.99k, False: 2.35k]
  ------------------
 1114|  5.35k|        const int N = t->node_base[d + 1] - t->node_base[d];
 1115|  85.1k|        for (int i = zxc_pivco_leaves(t, d); i < N; i++) {
  ------------------
  |  Branch (1115:46): [True: 79.7k, False: 5.35k]
  ------------------
 1116|  79.7k|            if (up && up[i >> 1]) {
  ------------------
  |  Branch (1116:17): [True: 77.4k, False: 2.35k]
  |  Branch (1116:23): [True: 70.4k, False: 6.96k]
  ------------------
 1117|  70.4k|                fd[i] = ZXC_PIVCO_COVERED;
  ------------------
  |  |  802|  70.4k|#define ZXC_PIVCO_COVERED 0xFFU
  ------------------
 1118|  70.4k|            } else if (fd[i] < 2 || fd[i] == INCOMPLETE) {
  ------------------
  |  Branch (1118:24): [True: 2.63k, False: 6.68k]
  |  Branch (1118:37): [True: 3.98k, False: 2.70k]
  ------------------
 1119|  6.61k|                fd[i] = 0;
 1120|  6.61k|            } else {
 1121|  2.70k|                const int g = t->node_base[d] + i;
 1122|  2.70k|                zxc_pivco_bitrev_permute(t->syms + zxc_pivco_flat_leaves(t, g, d, fd[i]), fd[i]);
 1123|  2.70k|            }
 1124|  79.7k|        }
 1125|  5.35k|    }
 1126|  2.35k|    return 0;
 1127|  2.38k|}
zxc_huffman.c:zxc_pivco_leaves:
 1012|  39.3k|static ZXC_ALWAYS_INLINE int zxc_pivco_leaves(const zxc_pivco_tree_t* RESTRICT t, const int d) {
 1013|  39.3k|    return t->leaf_base[d + 1] - t->leaf_base[d];
 1014|  39.3k|}
zxc_huffman.c:zxc_pivco_bitrev_permute:
 1024|  2.70k|static void zxc_pivco_bitrev_permute(uint8_t* RESTRICT s, const int D) {
 1025|  2.70k|    const unsigned m = 1U << D;
 1026|  2.70k|    unsigned c = 0; /* r bit-reversed */
 1027|  78.5k|    for (unsigned r = 0; r < m; r++) {
  ------------------
  |  Branch (1027:26): [True: 75.8k, False: 2.70k]
  ------------------
 1028|  75.8k|        if (r < c) {
  ------------------
  |  Branch (1028:13): [True: 30.6k, False: 45.1k]
  ------------------
 1029|  30.6k|            const uint8_t x = s[r];
 1030|  30.6k|            s[r] = s[c];
 1031|  30.6k|            s[c] = x;
 1032|  30.6k|        }
 1033|  75.8k|        unsigned bit = m >> 1; /* reversed increment */
 1034|   148k|        for (; c & bit; bit >>= 1) c ^= bit;
  ------------------
  |  Branch (1034:16): [True: 73.1k, False: 75.8k]
  ------------------
 1035|  75.8k|        c |= bit;
 1036|  75.8k|    }
 1037|  2.70k|}
zxc_huffman.c:zxc_pivco_flat_leaves:
 1018|  4.71k|                                                   const int d, const int D) {
 1019|  4.71k|    const int e = d + D;
 1020|  4.71k|    return t->leaf_base[e] + t->base[e] - t->node_base[e] + ((g - t->base[d]) << D);
 1021|  4.71k|}
zxc_huffman.c:zxc_pivco_run_bytes:
 1178|   157k|static ZXC_ALWAYS_INLINE size_t zxc_pivco_run_bytes(const uint32_t count, const uint8_t flat_d) {
 1179|   157k|    return flat_d ? ((size_t)count * flat_d + 7) / 8 : ((size_t)count + 7) / 8;
  ------------------
  |  Branch (1179:12): [True: 144k, False: 12.9k]
  ------------------
 1180|   157k|}
zxc_huffman.c:zxc_pivco_decode_core:
 2160|  2.35k|                                 const zxc_pivco_tree_t* RESTRICT t, uint8_t* RESTRICT scratch) {
 2161|  2.35k|    if (UNLIKELY(n == 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  2.35k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 1, False: 2.35k]
  |  |  ------------------
  ------------------
 2162|       |
 2163|       |    // Pass 1, in wire order: node counts from the partition bits, and where
 2164|       |    // each depth's runs start. Leaf-pair children (emitted by their parent) and
 2165|       |    // a flat root's inside get count 0: empty runs, nothing to flag.
 2166|  2.35k|    uint32_t count[ZXC_PIVCO_NODE_SLOTS];
 2167|  2.35k|    const uint8_t* lvl_run[ZXC_HUF_MAX_CODE_LEN_ULTRA];
 2168|  2.35k|    const int slot = t->node_base[t->max_depth + 1];
 2169|  2.35k|    count[0] = (uint32_t)n;
 2170|  2.35k|    count[slot] = 0;
 2171|  2.35k|    const uint8_t* p = payload;
 2172|  2.35k|    const uint8_t* const pend = payload + payload_size;
 2173|  7.60k|    for (int d = 0; d < t->max_depth; d++) {
  ------------------
  |  Branch (2173:21): [True: 5.27k, False: 2.33k]
  ------------------
 2174|  5.27k|        lvl_run[d] = p;
 2175|  5.27k|        const int L = zxc_pivco_leaves(t, d);
 2176|  5.27k|        const int N = t->node_base[d + 1] - t->node_base[d];
 2177|  5.27k|        const int Lc = zxc_pivco_leaves(t, d + 1);
 2178|  5.27k|        const uint32_t* const cnt = count + t->node_base[d];
 2179|  5.27k|        uint32_t* const ccnt = count + t->node_base[d + 1];
 2180|  5.27k|        const uint8_t* const fd = t->flat_d + t->node_base[d];
 2181|  83.8k|        for (int i = L; i < N; i++) {
  ------------------
  |  Branch (2181:25): [True: 78.5k, False: 5.25k]
  ------------------
 2182|  78.5k|            const uint32_t c = cnt[i];
 2183|  78.5k|            const int k2 = 2 * (i - L); /* first child */
 2184|  78.5k|            if (fd[i]) {
  ------------------
  |  Branch (2184:17): [True: 72.0k, False: 6.51k]
  ------------------
 2185|       |                // Packed-code run: no partition below, nothing to popcount.
 2186|  72.0k|                const size_t fbytes = zxc_pivco_run_bytes(c, fd[i]);
 2187|  72.0k|                if (UNLIKELY((size_t)(pend - p) < fbytes)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  72.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 6, False: 72.0k]
  |  |  ------------------
  ------------------
 2188|  72.0k|                p += fbytes;
 2189|  72.0k|                ccnt[k2] = 0;
 2190|  72.0k|                ccnt[k2 + 1] = 0;
 2191|  72.0k|                continue;
 2192|  72.0k|            }
 2193|  6.51k|            const size_t nbytes = zxc_pivco_run_bytes(c, 0); /* merge node: c partition bits */
 2194|  6.51k|            if (UNLIKELY((size_t)(pend - p) < nbytes)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  6.51k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 14, False: 6.50k]
  |  |  ------------------
  ------------------
 2195|       |            // popcount of the c valid bits = the right child's count. All but the
 2196|       |            // last byte counted fast, the last one with its padding masked - if the
 2197|       |            // 8-byte loop swallowed it unmasked, padding bits would inflate `ones`.
 2198|  6.50k|            uint32_t ones = 0;
 2199|  6.50k|            if (nbytes) {
  ------------------
  |  Branch (2199:17): [True: 5.58k, False: 920]
  ------------------
 2200|  5.58k|                const size_t full = nbytes - 1;
 2201|  5.58k|                size_t k = 0;
 2202|  73.4k|                for (; k + 8 <= full; k += 8) {
  ------------------
  |  Branch (2202:24): [True: 67.8k, False: 5.58k]
  ------------------
 2203|  67.8k|                    uint64_t w;
 2204|  67.8k|                    ZXC_MEMCPY(&w, p + k, 8);
  ------------------
  |  |  170|  67.8k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 2205|  67.8k|                    ones += (uint32_t)zxc_pivco_popcnt64(w);
 2206|  67.8k|                }
 2207|  23.0k|                for (; k < full; k++) ones += (uint32_t)zxc_pivco_popcnt32(p[k]);
  ------------------
  |  Branch (2207:24): [True: 17.4k, False: 5.58k]
  ------------------
 2208|  5.58k|                uint8_t last = p[full];
 2209|  5.58k|                if (c & 7U) last &= (uint8_t)((1U << (c & 7U)) - 1U);
  ------------------
  |  Branch (2209:21): [True: 4.24k, False: 1.34k]
  ------------------
 2210|  5.58k|                ones += (uint32_t)zxc_pivco_popcnt32(last);
 2211|  5.58k|            }
 2212|  6.50k|            p += nbytes;
 2213|  6.50k|            if (UNLIKELY(ones > c)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  6.50k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 6.50k]
  |  |  ------------------
  ------------------
 2214|  6.50k|            const int leaf_pair = k2 + 1 < Lc;
 2215|  6.50k|            ccnt[k2] = leaf_pair ? 0 : c - ones;
  ------------------
  |  Branch (2215:24): [True: 2.40k, False: 4.10k]
  ------------------
 2216|  6.50k|            ccnt[k2 + 1] = leaf_pair ? 0 : ones;
  ------------------
  |  Branch (2216:28): [True: 2.40k, False: 4.10k]
  ------------------
 2217|  6.50k|        }
 2218|  5.27k|    }
 2219|       |    // The slot stands for the lone-symbol root's missing child: no 1 bits.
 2220|  2.33k|    if (UNLIKELY(count[slot] != 0)) return ZXC_ERROR_CORRUPT_DATA;
  ------------------
  |  |  154|  2.33k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 4, False: 2.32k]
  |  |  ------------------
  ------------------
 2221|       |
 2222|       |    // Pass 2, bottom-up. Runs and children follow position order, so two
 2223|       |    // running offsets replace per-node tables.
 2224|  9.86k|    for (int d = t->max_depth; d >= 0; d--) {
  ------------------
  |  Branch (2224:32): [True: 7.53k, False: 2.32k]
  ------------------
 2225|  7.53k|        uint8_t* const buf_d = (d & 1) ? scratch : dst;
  ------------------
  |  Branch (2225:32): [True: 3.63k, False: 3.90k]
  ------------------
 2226|  7.53k|        const uint8_t* const buf_c = (d & 1) ? dst : scratch; /* children at d+1 (read-only) */
  ------------------
  |  Branch (2226:38): [True: 3.63k, False: 3.90k]
  ------------------
 2227|  7.53k|        const int L = zxc_pivco_leaves(t, d);
 2228|  7.53k|        const int N = t->node_base[d + 1] - t->node_base[d];
 2229|  7.53k|        const uint32_t* const cnt = count + t->node_base[d];
 2230|  7.53k|        const uint8_t* const sym = t->syms + t->leaf_base[d];
 2231|  7.53k|        size_t off = 0;
 2232|  88.0k|        for (int i = 0; i < L; i++) {
  ------------------
  |  Branch (2232:25): [True: 80.5k, False: 7.53k]
  ------------------
 2233|  80.5k|            if (cnt[i]) ZXC_MEMSET(buf_d + off, sym[i], cnt[i]);
  ------------------
  |  |  175|    857|#define ZXC_MEMSET(dst, val, n) __builtin_memset(dst, val, n)
  ------------------
  |  Branch (2233:17): [True: 857, False: 79.7k]
  ------------------
 2234|  80.5k|            off += cnt[i];
 2235|  80.5k|        }
 2236|  7.53k|        if (d == t->max_depth) continue; /* leaves only, as in pass 1 */
  ------------------
  |  Branch (2236:13): [True: 2.32k, False: 5.21k]
  ------------------
 2237|  5.21k|        const uint8_t* run = lvl_run[d];
 2238|  5.21k|        const uint32_t* const ccnt = count + t->node_base[d + 1];
 2239|  5.21k|        const uint8_t* const csym = t->syms + t->leaf_base[d + 1];
 2240|  5.21k|        const int Lc = zxc_pivco_leaves(t, d + 1);
 2241|  5.21k|        const uint8_t* const fd = t->flat_d + t->node_base[d];
 2242|  5.21k|        size_t coff = 0;
 2243|  83.6k|        for (int i = L; i < N; i++) {
  ------------------
  |  Branch (2243:25): [True: 78.4k, False: 5.21k]
  ------------------
 2244|  78.4k|            const uint32_t c = cnt[i];
 2245|  78.4k|            const int k2 = 2 * (i - L);
 2246|  78.4k|            if (c) {
  ------------------
  |  Branch (2246:17): [True: 7.53k, False: 70.8k]
  ------------------
 2247|  7.53k|                if (fd[i]) {
  ------------------
  |  Branch (2247:21): [True: 2.01k, False: 5.52k]
  ------------------
 2248|  2.01k|                    const int D = fd[i];
 2249|  2.01k|                    const int leaves = zxc_pivco_flat_leaves(t, t->node_base[d] + i, d, D);
 2250|  2.01k|                    zxc_pivco_unpack_flat(buf_d + off, c, D, run, t->syms + leaves);
 2251|  5.52k|                } else if (k2 + 1 < Lc) {
  ------------------
  |  Branch (2251:28): [True: 2.12k, False: 3.40k]
  ------------------
 2252|  2.12k|                    zxc_pivco_emit_leaf_pair(buf_d + off, c, csym[k2], csym[k2 + 1], run);
 2253|  3.40k|                } else {
 2254|  3.40k|                    const uint32_t nl = ccnt[k2];
 2255|  3.40k|                    zxc_pivco_merge(buf_d + off, buf_c + coff, nl, c - nl, run);
 2256|  3.40k|                }
 2257|  7.53k|            }
 2258|  78.4k|            run += zxc_pivco_run_bytes(c, fd[i]);
 2259|  78.4k|            off += c;
 2260|  78.4k|            coff += ccnt[k2] + ccnt[k2 + 1];
 2261|  78.4k|        }
 2262|  5.21k|    }
 2263|  2.32k|    return ZXC_OK;
 2264|  2.33k|}
zxc_huffman.c:zxc_pivco_popcnt64:
 1009|  67.8k|static ZXC_ALWAYS_INLINE int zxc_pivco_popcnt64(const uint64_t v) { return (int)ZXC_POPCOUNT64(v); }
  ------------------
  |  |  157|  67.8k|#define ZXC_POPCOUNT64(v) __builtin_popcountll(v)
  ------------------
zxc_huffman.c:zxc_pivco_popcnt32:
 1007|   191k|static ZXC_ALWAYS_INLINE int zxc_pivco_popcnt32(const uint32_t v) { return (int)ZXC_POPCOUNT32(v); }
  ------------------
  |  |  156|   191k|#define ZXC_POPCOUNT32(v) __builtin_popcount(v)
  ------------------
zxc_huffman.c:zxc_pivco_unpack_flat:
 1556|  2.01k|                                  const uint8_t* RESTRICT bits, const uint8_t* RESTRICT c2s) {
 1557|  2.01k|    size_t i = 0;
 1558|       |#if defined(ZXC_USE_NEON64)
 1559|       |    if (D == 2) {
 1560|       |        uint8_t c2s16[16];
 1561|       |        for (int k = 0; k < 16; k++) c2s16[k] = c2s[k & 3];
 1562|       |        const uint8x16_t vc2s = vld1q_u8(c2s16);
 1563|       |        static const uint8_t rep4[16] = {0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3};
 1564|       |        static const int8_t sh2[16] = {0, -2, -4, -6, 0, -2, -4, -6, 0, -2, -4, -6, 0, -2, -4, -6};
 1565|       |        const uint8x16_t vrep = vld1q_u8(rep4);
 1566|       |        const int8x16_t vsh = vld1q_s8(sh2);
 1567|       |        const uint8x16_t vmask = vdupq_n_u8(0x03);
 1568|       |        while (i + 16 <= n) {
 1569|       |            uint8x16_t raw = vdupq_n_u8(0);
 1570|       |            raw = vreinterpretq_u8_u32(
 1571|       |                vsetq_lane_u32(zxc_le32(bits + ((i * 2) >> 3)), vreinterpretq_u32_u8(raw), 0));
 1572|       |            const uint8x16_t rep = vqtbl1q_u8(raw, vrep);
 1573|       |            const uint8x16_t codes = vandq_u8(vshlq_u8(rep, vsh), vmask);
 1574|       |            vst1q_u8(out + i, vqtbl1q_u8(vc2s, codes));
 1575|       |            i += 16;
 1576|       |        }
 1577|       |    } else if (D == 3) {
 1578|       |        // Odd D straddle bytes: build a 16-bit window {byte_j,byte_j+1} per lane
 1579|       |        // (byte_j = Di>>3), right-shift by Di&7, mask D bits. 16/step, two u16x8
 1580|       |        // halves sharing the shift vector. D=3: 6 source bytes.
 1581|       |        uint8_t c2s16[16];
 1582|       |        for (int k = 0; k < 16; k++) c2s16[k] = c2s[k & 7];
 1583|       |        const uint8x16_t vc2s = vld1q_u8(c2s16); /* 8 entries, padded to 16 */
 1584|       |        static const uint8_t idxA[16] = {0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3};
 1585|       |        static const uint8_t idxB[16] = {3, 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 5, 5, 6, 5, 6};
 1586|       |        static const int16_t sh8[8] = {0, -3, -6, -1, -4, -7, -2, -5};
 1587|       |        const uint8x16_t vidxA = vld1q_u8(idxA);
 1588|       |        const uint8x16_t vidxB = vld1q_u8(idxB);
 1589|       |        const int16x8_t vsh = vld1q_s16(sh8);
 1590|       |        const uint16x8_t vmask = vdupq_n_u16(0x07);
 1591|       |        while (i + 16 <= n) {
 1592|       |            const size_t off = (i * 3) >> 3;
 1593|       |            uint32_t w0;
 1594|       |            uint16_t w1;
 1595|       |            ZXC_MEMCPY(&w0, bits + off, 4);
 1596|       |            ZXC_MEMCPY(&w1, bits + off + 4, 2); /* exactly 6 bytes read */
 1597|       |            uint8x16_t raw = vdupq_n_u8(0);
 1598|       |            raw = vreinterpretq_u8_u32(vsetq_lane_u32(w0, vreinterpretq_u32_u8(raw), 0));
 1599|       |            raw = vreinterpretq_u8_u16(vsetq_lane_u16(w1, vreinterpretq_u16_u8(raw), 2));
 1600|       |            const uint16x8_t winA = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxA));
 1601|       |            const uint16x8_t winB = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxB));
 1602|       |            const uint8x8_t cA = vmovn_u16(vandq_u16(vshlq_u16(winA, vsh), vmask));
 1603|       |            const uint8x8_t cB = vmovn_u16(vandq_u16(vshlq_u16(winB, vsh), vmask));
 1604|       |            vst1q_u8(out + i, vqtbl1q_u8(vc2s, vcombine_u8(cA, cB)));
 1605|       |            i += 16;
 1606|       |        }
 1607|       |    } else if (D == 4) {
 1608|       |        const uint8x16_t vc2s = vld1q_u8(c2s); /* 16 entries */
 1609|       |        static const uint8_t rep2[16] = {0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7};
 1610|       |        static const int8_t sh4[16] = {0, -4, 0, -4, 0, -4, 0, -4, 0, -4, 0, -4, 0, -4, 0, -4};
 1611|       |        const uint8x16_t vrep = vld1q_u8(rep2);
 1612|       |        const int8x16_t vsh = vld1q_s8(sh4);
 1613|       |        const uint8x16_t vmask = vdupq_n_u8(0x0F);
 1614|       |        while (i + 16 <= n) {
 1615|       |            uint8x16_t raw = vdupq_n_u8(0);
 1616|       |            raw = vreinterpretq_u8_u64(
 1617|       |                vsetq_lane_u64(zxc_le64(bits + ((i * 4) >> 3)), vreinterpretq_u64_u8(raw), 0));
 1618|       |            const uint8x16_t rep = vqtbl1q_u8(raw, vrep);
 1619|       |            const uint8x16_t codes = vandq_u8(vshlq_u8(rep, vsh), vmask);
 1620|       |            vst1q_u8(out + i, vqtbl1q_u8(vc2s, codes));
 1621|       |            i += 16;
 1622|       |        }
 1623|       |    } else if (D == 5) {
 1624|       |        // Same window scheme as D=3; c2s has 32 entries (vqtbl2q). 10 bytes.
 1625|       |        const uint8x16x2_t vc2s = vld1q_u8_x2(c2s);
 1626|       |        static const uint8_t idxA[16] = {0, 1, 0, 1, 1, 2, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5};
 1627|       |        static const uint8_t idxB[16] = {5, 6, 5, 6, 6, 7, 6, 7, 7, 8, 8, 9, 8, 9, 9, 10};
 1628|       |        static const int16_t sh8[8] = {0, -5, -2, -7, -4, -1, -6, -3};
 1629|       |        const uint8x16_t vidxA = vld1q_u8(idxA);
 1630|       |        const uint8x16_t vidxB = vld1q_u8(idxB);
 1631|       |        const int16x8_t vsh = vld1q_s16(sh8);
 1632|       |        const uint16x8_t vmask = vdupq_n_u16(0x1F);
 1633|       |        while (i + 16 <= n) {
 1634|       |            const size_t off = (i * 5) >> 3;
 1635|       |            uint64_t w0;
 1636|       |            uint16_t w1;
 1637|       |            ZXC_MEMCPY(&w0, bits + off, 8);
 1638|       |            ZXC_MEMCPY(&w1, bits + off + 8, 2);
 1639|       |            uint8x16_t raw = vdupq_n_u8(0);
 1640|       |            raw = vreinterpretq_u8_u64(vsetq_lane_u64(w0, vreinterpretq_u64_u8(raw), 0));
 1641|       |            raw = vreinterpretq_u8_u16(vsetq_lane_u16(w1, vreinterpretq_u16_u8(raw), 4));
 1642|       |            const uint16x8_t winA = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxA));
 1643|       |            const uint16x8_t winB = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxB));
 1644|       |            const uint8x8_t cA = vmovn_u16(vandq_u16(vshlq_u16(winA, vsh), vmask));
 1645|       |            const uint8x8_t cB = vmovn_u16(vandq_u16(vshlq_u16(winB, vsh), vmask));
 1646|       |            vst1q_u8(out + i, vqtbl2q_u8(vc2s, vcombine_u8(cA, cB)));
 1647|       |            i += 16;
 1648|       |        }
 1649|       |    } else if (D == 6) {
 1650|       |        // Same window scheme as D=3; c2s has 64 entries (vqtbl4q). 12 bytes.
 1651|       |        const uint8x16x4_t vc2s = vld1q_u8_x4(c2s);
 1652|       |        static const uint8_t idxA[16] = {0, 1, 0, 1, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 5, 6};
 1653|       |        static const uint8_t idxB[16] = {6, 7, 6, 7, 7, 8, 8, 9, 9, 10, 9, 10, 10, 11, 11, 12};
 1654|       |        static const int16_t sh8[8] = {0, -6, -4, -2, 0, -6, -4, -2};
 1655|       |        const uint8x16_t vidxA = vld1q_u8(idxA);
 1656|       |        const uint8x16_t vidxB = vld1q_u8(idxB);
 1657|       |        const int16x8_t vsh = vld1q_s16(sh8);
 1658|       |        const uint16x8_t vmask = vdupq_n_u16(0x3F);
 1659|       |        while (i + 16 <= n) {
 1660|       |            const size_t off = (i * 6) >> 3;
 1661|       |            uint64_t w0;
 1662|       |            uint32_t w1;
 1663|       |            ZXC_MEMCPY(&w0, bits + off, 8);
 1664|       |            ZXC_MEMCPY(&w1, bits + off + 8, 4);
 1665|       |            uint8x16_t raw = vdupq_n_u8(0);
 1666|       |            raw = vreinterpretq_u8_u64(vsetq_lane_u64(w0, vreinterpretq_u64_u8(raw), 0));
 1667|       |            raw = vreinterpretq_u8_u32(vsetq_lane_u32(w1, vreinterpretq_u32_u8(raw), 2));
 1668|       |            const uint16x8_t winA = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxA));
 1669|       |            const uint16x8_t winB = vreinterpretq_u16_u8(vqtbl1q_u8(raw, vidxB));
 1670|       |            const uint8x8_t cA = vmovn_u16(vandq_u16(vshlq_u16(winA, vsh), vmask));
 1671|       |            const uint8x8_t cB = vmovn_u16(vandq_u16(vshlq_u16(winB, vsh), vmask));
 1672|       |            vst1q_u8(out + i, vqtbl4q_u8(vc2s, vcombine_u8(cA, cB)));
 1673|       |            i += 16;
 1674|       |        }
 1675|       |    }
 1676|       |#elif defined(ZXC_USE_NEON32)
 1677|       |    // d-register mirrors of the AArch64 kernels: 8 codes per step, c2s lookup
 1678|       |    // via VTBL (16-entry table = two d-registers).
 1679|       |    if (D == 2) {
 1680|       |        uint8_t c2s8[8];
 1681|       |        for (int k = 0; k < 8; k++) c2s8[k] = c2s[k & 3];
 1682|       |        const uint8x8_t vc2s = vld1_u8(c2s8);
 1683|       |        static const uint8_t rep4[8] = {0, 0, 0, 0, 1, 1, 1, 1};
 1684|       |        static const int8_t sh2[8] = {0, -2, -4, -6, 0, -2, -4, -6};
 1685|       |        const uint8x8_t vrep = vld1_u8(rep4);
 1686|       |        const int8x8_t vsh = vld1_s8(sh2);
 1687|       |        const uint8x8_t vmask = vdup_n_u8(0x03);
 1688|       |        while (i + 8 <= n) {
 1689|       |            const uint16_t w = (uint16_t)((uint16_t)bits[(i * 2) >> 3] |
 1690|       |                                          ((uint16_t)bits[((i * 2) >> 3) + 1] << 8));
 1691|       |            const uint8x8_t raw = vreinterpret_u8_u16(vdup_n_u16(w));
 1692|       |            const uint8x8_t rep = vtbl1_u8(raw, vrep);
 1693|       |            const uint8x8_t codes = vand_u8(vshl_u8(rep, vsh), vmask);
 1694|       |            vst1_u8(out + i, vtbl1_u8(vc2s, codes));
 1695|       |            i += 8;
 1696|       |        }
 1697|       |    } else if (D == 3) {
 1698|       |        // 8 codes/step. 3-bit codes straddle bytes, so build a 16-bit window
 1699|       |        // {byte_j, byte_j+1} per lane via two VTBLs, then extract bits [s,s+3)
 1700|       |        // by multiply-by-2^(13-s) then >>13 - ARMv7 has no per-lane u16 variable
 1701|       |        // shift. 8 codes fit in 3 source bytes.
 1702|       |        const uint8x8_t vc2s = vld1_u8(c2s); /* 8 entries (2^3) */
 1703|       |        static const uint8_t idxlo[8] = {0, 1, 0, 1, 0, 1, 1, 2};
 1704|       |        static const uint8_t idxhi[8] = {1, 2, 1, 2, 2, 3, 2, 3};
 1705|       |        static const uint16_t mul8[8] = {8192, 1024, 128, 4096, 512, 64, 2048, 256};
 1706|       |        const uint8x8_t vidxlo = vld1_u8(idxlo);
 1707|       |        const uint8x8_t vidxhi = vld1_u8(idxhi);
 1708|       |        const uint16x8_t vmul = vld1q_u16(mul8);
 1709|       |        const uint16x8_t vmask = vdupq_n_u16(0x07);
 1710|       |        while (i + 8 <= n) {
 1711|       |            const size_t off = (i * 3) >> 3;
 1712|       |            const uint32_t w = (uint32_t)bits[off] | ((uint32_t)bits[off + 1] << 8) |
 1713|       |                               ((uint32_t)bits[off + 2] << 16); /* exactly 3 bytes */
 1714|       |            const uint8x8_t raw = vreinterpret_u8_u32(vdup_n_u32(w));
 1715|       |            const uint8x8_t wlo = vtbl1_u8(raw, vidxlo);
 1716|       |            const uint8x8_t whi = vtbl1_u8(raw, vidxhi);
 1717|       |            const uint16x8_t win = vreinterpretq_u16_u8(vcombine_u8(wlo, whi));
 1718|       |            const uint16x8_t codes16 = vandq_u16(vshrq_n_u16(vmulq_u16(win, vmul), 13), vmask);
 1719|       |            vst1_u8(out + i, vtbl1_u8(vc2s, vmovn_u16(codes16)));
 1720|       |            i += 8;
 1721|       |        }
 1722|       |    } else if (D == 4) {
 1723|       |        /* Register by register: GCC has no AArch32 vld1_u8_x2/_x4 before 14.
 1724|       |         * Loaded once per call, so the tuple form bought nothing anyway. */
 1725|       |        uint8x8x2_t vc2s;
 1726|       |        vc2s.val[0] = vld1_u8(c2s);
 1727|       |        vc2s.val[1] = vld1_u8(c2s + 8);
 1728|       |        static const uint8_t rep2[8] = {0, 0, 1, 1, 2, 2, 3, 3};
 1729|       |        static const int8_t sh4[8] = {0, -4, 0, -4, 0, -4, 0, -4};
 1730|       |        const uint8x8_t vrep = vld1_u8(rep2);
 1731|       |        const int8x8_t vsh = vld1_s8(sh4);
 1732|       |        const uint8x8_t vmask = vdup_n_u8(0x0F);
 1733|       |        while (i + 8 <= n) {
 1734|       |            uint32_t w;
 1735|       |            ZXC_MEMCPY(&w, bits + ((i * 4) >> 3), 4);
 1736|       |            const uint8x8_t raw = vreinterpret_u8_u32(vdup_n_u32(w));
 1737|       |            const uint8x8_t rep = vtbl1_u8(raw, vrep);
 1738|       |            const uint8x8_t codes = vand_u8(vshl_u8(rep, vsh), vmask);
 1739|       |            vst1_u8(out + i, vtbl2_u8(vc2s, codes));
 1740|       |            i += 8;
 1741|       |        }
 1742|       |    } else if (D == 5) {
 1743|       |        // Same window scheme as D=3; c2s has 32 entries (VTBL4). 5 source bytes.
 1744|       |        // Register by register: see D == 4.
 1745|       |        uint8x8x4_t vc2s;
 1746|       |        vc2s.val[0] = vld1_u8(c2s);
 1747|       |        vc2s.val[1] = vld1_u8(c2s + 8);
 1748|       |        vc2s.val[2] = vld1_u8(c2s + 16);
 1749|       |        vc2s.val[3] = vld1_u8(c2s + 24);
 1750|       |        static const uint8_t idxlo[8] = {0, 1, 0, 1, 1, 2, 1, 2};
 1751|       |        static const uint8_t idxhi[8] = {2, 3, 3, 4, 3, 4, 4, 5};
 1752|       |        static const uint16_t mul8[8] = {2048, 64, 512, 16, 128, 1024, 32, 256};
 1753|       |        const uint8x8_t vidxlo = vld1_u8(idxlo);
 1754|       |        const uint8x8_t vidxhi = vld1_u8(idxhi);
 1755|       |        const uint16x8_t vmul = vld1q_u16(mul8);
 1756|       |        const uint16x8_t vmask = vdupq_n_u16(0x1F);
 1757|       |        while (i + 8 <= n) {
 1758|       |            uint64_t w = 0;
 1759|       |            ZXC_MEMCPY(&w, bits + ((i * 5) >> 3), 5);
 1760|       |            const uint8x8_t raw = vcreate_u8(w);
 1761|       |            const uint16x8_t win =
 1762|       |                vreinterpretq_u16_u8(vcombine_u8(vtbl1_u8(raw, vidxlo), vtbl1_u8(raw, vidxhi)));
 1763|       |            const uint8x8_t codes =
 1764|       |                vmovn_u16(vandq_u16(vshrq_n_u16(vmulq_u16(win, vmul), 11), vmask));
 1765|       |            vst1_u8(out + i, vtbl4_u8(vc2s, codes));
 1766|       |            i += 8;
 1767|       |        }
 1768|       |    } else if (D == 6) {
 1769|       |        // Same window scheme; c2s has 64 entries: two VTBL4 halves, select by
 1770|       |        // code bit 5. 6 source bytes.
 1771|       |        uint8x8x4_t lo, hi;  // register by register: see D == 4
 1772|       |        lo.val[0] = vld1_u8(c2s);
 1773|       |        lo.val[1] = vld1_u8(c2s + 8);
 1774|       |        lo.val[2] = vld1_u8(c2s + 16);
 1775|       |        lo.val[3] = vld1_u8(c2s + 24);
 1776|       |        hi.val[0] = vld1_u8(c2s + 32);
 1777|       |        hi.val[1] = vld1_u8(c2s + 40);
 1778|       |        hi.val[2] = vld1_u8(c2s + 48);
 1779|       |        hi.val[3] = vld1_u8(c2s + 56);
 1780|       |        static const uint8_t idxlo[8] = {0, 1, 0, 1, 1, 2, 2, 3};
 1781|       |        static const uint8_t idxhi[8] = {3, 4, 3, 4, 4, 5, 5, 6};
 1782|       |        static const uint16_t mul8[8] = {1024, 16, 64, 256, 1024, 16, 64, 256};
 1783|       |        const uint8x8_t vidxlo = vld1_u8(idxlo);
 1784|       |        const uint8x8_t vidxhi = vld1_u8(idxhi);
 1785|       |        const uint16x8_t vmul = vld1q_u16(mul8);
 1786|       |        const uint16x8_t vmask = vdupq_n_u16(0x3F);
 1787|       |        while (i + 8 <= n) {
 1788|       |            uint64_t w = 0;
 1789|       |            ZXC_MEMCPY(&w, bits + ((i * 6) >> 3), 6);
 1790|       |            const uint8x8_t raw = vcreate_u8(w);
 1791|       |            const uint16x8_t win =
 1792|       |                vreinterpretq_u16_u8(vcombine_u8(vtbl1_u8(raw, vidxlo), vtbl1_u8(raw, vidxhi)));
 1793|       |            const uint8x8_t codes =
 1794|       |                vmovn_u16(vandq_u16(vshrq_n_u16(vmulq_u16(win, vmul), 10), vmask));
 1795|       |            const uint8x8_t sel =
 1796|       |                vbsl_u8(vcge_u8(codes, vdup_n_u8(32)), vtbl4_u8(hi, vsub_u8(codes, vdup_n_u8(32))),
 1797|       |                        vtbl4_u8(lo, codes));
 1798|       |            vst1_u8(out + i, sel);
 1799|       |            i += 8;
 1800|       |        }
 1801|       |    }
 1802|       |#elif defined(ZXC_USE_AVX512) || defined(ZXC_USE_AVX2) || \
 1803|       |    (defined(ZXC_USE_SSE2) && defined(__SSE4_1__))
 1804|       |#if defined(ZXC_USE_AVX512) && defined(__AVX512VBMI__)
 1805|       |    /* vpmultishiftqb reads an 8-bit field at an arbitrary bit offset: the
 1806|       |     * unaligned D-bit read, in one instruction. Two facts carry the rest -
 1807|       |     * 64 codes are exactly 8*D bytes and byte-aligned, so the tables are the
 1808|       |     * same every step; and only the low D bits of a field survive, so bytes
 1809|       |     * past 8*D are irrelevant and both accesses can be clamped to the run.
 1810|       |     * Clamping the store also ends the run, hence nothing narrower below. */
 1811|       |    if (D >= 2 && D <= 6) {
 1812|       |        uint8_t arr[64];
 1813|       |        uint8_t shf[64];
 1814|       |        for (int k = 0; k < 8; k++) {
 1815|       |            for (int j = 0; j < 8; j++) {
 1816|       |                arr[k * 8 + j] = (uint8_t)(k * D + j);
 1817|       |                shf[k * 8 + j] = (uint8_t)(j * D);
 1818|       |            }
 1819|       |        }
 1820|       |        const __m512i varr = _mm512_loadu_si512((const void*)arr);
 1821|       |        const __m512i vshf = _mm512_loadu_si512((const void*)shf);
 1822|       |        const __m512i vand = _mm512_set1_epi8((char)((1 << D) - 1));
 1823|       |        /* c2s holds 2^D entries and nothing is guaranteed past them. */
 1824|       |        const __mmask64 tm = (D == 6) ? ~(__mmask64)0 : (((__mmask64)1 << (1 << D)) - 1);
 1825|       |        const __m512i vc2s = _mm512_maskz_loadu_epi8(tm, (const void*)c2s);
 1826|       |        const size_t nbytes = zxc_pivco_run_bytes((uint32_t)n, (uint8_t)D);
 1827|       |        while (i < n) {
 1828|       |            const size_t off = ((size_t)i * (size_t)D) >> 3;
 1829|       |            const size_t avail = nbytes - off;
 1830|       |            const size_t left = n - i;
 1831|       |            const __mmask64 lm = (avail >= 64) ? ~(__mmask64)0 : (((__mmask64)1 << avail) - 1);
 1832|       |            const __mmask64 sm = (left >= 64) ? ~(__mmask64)0 : (((__mmask64)1 << left) - 1);
 1833|       |            const __m512i raw = _mm512_maskz_loadu_epi8(lm, (const void*)(bits + off));
 1834|       |            const __m512i q = _mm512_permutexvar_epi8(varr, raw);
 1835|       |            const __m512i codes = _mm512_and_si512(_mm512_multishift_epi64_epi8(vshf, q), vand);
 1836|       |            _mm512_mask_storeu_epi8((void*)(out + i), sm, _mm512_permutexvar_epi8(codes, vc2s));
 1837|       |            i += 64;
 1838|       |        }
 1839|       |        if (i > n) i = n;
 1840|       |    }
 1841|       |#else
 1842|       |#if defined(ZXC_USE_AVX2)
 1843|       |    /* Codes 16..31 start exactly 2*D bytes in, so the upper half runs the same
 1844|       |     * pattern over a shifted source: one shuffle vector serves both, and packus
 1845|       |     * leaves each half's codes in order in its own lane - no cross-lane fixup.
 1846|       |     * The bound keeps both 16-byte reads inside the run; the exact-length
 1847|       |     * 16-wide loops below take the tail. */
 1848|       |    if (D >= 2 && D <= 6) {
 1849|       |        uint8_t sa[16];
 1850|       |        uint8_t sb[16];
 1851|       |        uint16_t mu[8];
 1852|       |        for (int q = 0; q < 8; q++) {
 1853|       |            const int ba = (q * D) >> 3;
 1854|       |            sa[2 * q] = (uint8_t)ba;
 1855|       |            sa[2 * q + 1] = (uint8_t)(ba + 1);
 1856|       |            sb[2 * q] = (uint8_t)(ba + D); /* code q+8 sits D bytes further */
 1857|       |            sb[2 * q + 1] = (uint8_t)(ba + D + 1);
 1858|       |            mu[q] = (uint16_t)(1U << (16 - D - ((q * D) & 7)));
 1859|       |        }
 1860|       |        const __m256i vsa = _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)sa));
 1861|       |        const __m256i vsb = _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)sb));
 1862|       |        const __m256i vmu = _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)mu));
 1863|       |        const __m256i vand = _mm256_set1_epi8((char)((1 << D) - 1));
 1864|       |        uint8_t tab[64];
 1865|       |        for (int e = 0; e < 64; e++) tab[e] = c2s[e & ((1 << D) - 1)];
 1866|       |        const __m256i t0 = _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)tab));
 1867|       |        const __m256i t1 =
 1868|       |            _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)(tab + 16)));
 1869|       |        const __m256i t2 =
 1870|       |            _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)(tab + 32)));
 1871|       |        const __m256i t3 =
 1872|       |            _mm256_broadcastsi128_si256(_mm_loadu_si128((const __m128i*)(void*)(tab + 48)));
 1873|       |        const size_t nbytes = zxc_pivco_run_bytes((uint32_t)n, (uint8_t)D);
 1874|       |        while (i + 32 <= n && ((size_t)i * (size_t)D >> 3) + (size_t)(2 * D) + 16 <= nbytes) {
 1875|       |            const uint8_t* src = bits + ((size_t)i * (size_t)D >> 3);
 1876|       |            const __m256i raw = _mm256_inserti128_si256(
 1877|       |                _mm256_castsi128_si256(_mm_loadu_si128((const __m128i*)(const void*)src)),
 1878|       |                _mm_loadu_si128((const __m128i*)(const void*)(src + 2 * D)), 1);
 1879|       |            const __m256i ca =
 1880|       |                _mm256_srli_epi16(_mm256_mullo_epi16(_mm256_shuffle_epi8(raw, vsa), vmu), 16 - D);
 1881|       |            const __m256i cb =
 1882|       |                _mm256_srli_epi16(_mm256_mullo_epi16(_mm256_shuffle_epi8(raw, vsb), vmu), 16 - D);
 1883|       |            const __m256i codes = _mm256_and_si256(_mm256_packus_epi16(ca, cb), vand);
 1884|       |            __m256i sym;
 1885|       |            if (D <= 4) {
 1886|       |                sym = _mm256_shuffle_epi8(t0, codes);
 1887|       |            } else {
 1888|       |                const __m256i b4 = _mm256_slli_epi16(codes, 3); /* code bit 4 -> sign */
 1889|       |                const __m256i lo = _mm256_blendv_epi8(_mm256_shuffle_epi8(t0, codes),
 1890|       |                                                      _mm256_shuffle_epi8(t1, codes), b4);
 1891|       |                if (D == 5) {
 1892|       |                    sym = lo;
 1893|       |                } else {
 1894|       |                    const __m256i hi = _mm256_blendv_epi8(_mm256_shuffle_epi8(t2, codes),
 1895|       |                                                          _mm256_shuffle_epi8(t3, codes), b4);
 1896|       |                    sym = _mm256_blendv_epi8(lo, hi, _mm256_slli_epi16(codes, 2));
 1897|       |                }
 1898|       |            }
 1899|       |            _mm256_storeu_si256((__m256i*)(void*)(out + i), sym);
 1900|       |            i += 32;
 1901|       |        }
 1902|       |    }
 1903|       |#endif
 1904|       |    if (D == 4) {
 1905|       |        const __m128i vc2s = _mm_loadu_si128((const __m128i*)(const void*)c2s);
 1906|       |        const __m128i vrep = _mm_setr_epi8(0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7);
 1907|       |        const __m128i vmask = _mm_set1_epi8(0x0F);
 1908|       |        // even lanes keep low nibble, odd lanes take the high nibble: shift the
 1909|       |        // replicated bytes right by 4 via a 16-bit shift + odd-lane select.
 1910|       |        const __m128i vodd = _mm_set1_epi16(0x0F00 - 0x0F00 + (short)0xFF00);
 1911|       |        while (i + 16 <= n) {
 1912|       |            const __m128i raw =
 1913|       |                _mm_loadl_epi64((const __m128i*)(const void*)(bits + ((i * 4) >> 3)));
 1914|       |            const __m128i rep = _mm_shuffle_epi8(raw, vrep);
 1915|       |            const __m128i hi = _mm_and_si128(_mm_srli_epi16(rep, 4), _mm_set1_epi8(0x0F));
 1916|       |            const __m128i lo = _mm_and_si128(rep, vmask);
 1917|       |            const __m128i codes = _mm_blendv_epi8(lo, hi, vodd);
 1918|       |            _mm_storeu_si128((__m128i*)(void*)(out + i), _mm_shuffle_epi8(vc2s, codes));
 1919|       |            i += 16;
 1920|       |        }
 1921|       |    } else if (D == 2) {
 1922|       |        // 16 codes from 4 bytes. SSE has no per-lane byte shift, so shift by
 1923|       |        // multiply: (b << (6 - 2j)) >> 6 keeps bits [2j+1:2j]. Bytes spread to
 1924|       |        // u16 lanes, times {64,16,4,1}, shifted, then packed back.
 1925|       |        uint8_t c2s16[16];
 1926|       |        for (int k = 0; k < 16; k++) c2s16[k] = c2s[k & 3];
 1927|       |        const __m128i vc2s = _mm_loadu_si128((const __m128i*)(const void*)c2s16);
 1928|       |        const __m128i vspreadA =
 1929|       |            _mm_setr_epi8(0, (char)0x80, 0, (char)0x80, 0, (char)0x80, 0, (char)0x80, 1, (char)0x80,
 1930|       |                          1, (char)0x80, 1, (char)0x80, 1, (char)0x80);
 1931|       |        const __m128i vspreadB =
 1932|       |            _mm_setr_epi8(2, (char)0x80, 2, (char)0x80, 2, (char)0x80, 2, (char)0x80, 3, (char)0x80,
 1933|       |                          3, (char)0x80, 3, (char)0x80, 3, (char)0x80);
 1934|       |        const __m128i vmul = _mm_setr_epi16(64, 16, 4, 1, 64, 16, 4, 1);
 1935|       |        while (i + 16 <= n) {
 1936|       |            const __m128i raw = _mm_cvtsi32_si128(
 1937|       |                (int)((uint32_t)bits[(i * 2) >> 3] | ((uint32_t)bits[((i * 2) >> 3) + 1] << 8) |
 1938|       |                      ((uint32_t)bits[((i * 2) >> 3) + 2] << 16) |
 1939|       |                      ((uint32_t)bits[((i * 2) >> 3) + 3] << 24)));
 1940|       |            const __m128i a16 =
 1941|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, vspreadA), vmul), 6);
 1942|       |            const __m128i b16 =
 1943|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, vspreadB), vmul), 6);
 1944|       |            const __m128i codes = _mm_and_si128(_mm_packus_epi16(a16, b16), _mm_set1_epi8(3));
 1945|       |            _mm_storeu_si128((__m128i*)(void*)(out + i), _mm_shuffle_epi8(vc2s, codes));
 1946|       |            i += 16;
 1947|       |        }
 1948|       |    } else if (D == 3) {
 1949|       |        // 16-bit window {byte_j,byte_j+1} per lane (byte_j = Di>>3); SSE has no
 1950|       |        // per-lane u16 shift, so extract bits [s,s+D) of window w by w*2^(16-D-s)
 1951|       |        // (field lands in the top D bits) then >>(16-D); s_j = Dj&7. D=3: 6 bytes.
 1952|       |        uint8_t c2s16[16];
 1953|       |        for (int k = 0; k < 16; k++) c2s16[k] = c2s[k & 7];
 1954|       |        const __m128i vc2s = _mm_loadu_si128((const __m128i*)(const void*)c2s16);
 1955|       |        const __m128i shufA = _mm_setr_epi8(0, 1, 0, 1, 0, 1, 1, 2, 1, 2, 1, 2, 2, 3, 2, 3);
 1956|       |        const __m128i shufB = _mm_setr_epi8(3, 4, 3, 4, 3, 4, 4, 5, 4, 5, 4, 5, 5, 6, 5, 6);
 1957|       |        const __m128i vmul = _mm_setr_epi16(8192, 1024, 128, 4096, 512, 64, 2048, 256);
 1958|       |        while (i + 16 <= n) {
 1959|       |            const size_t off = (i * 3) >> 3;
 1960|       |            uint32_t w0;
 1961|       |            uint16_t w1;
 1962|       |            ZXC_MEMCPY(&w0, bits + off, 4);
 1963|       |            ZXC_MEMCPY(&w1, bits + off + 4, 2); /* exactly 6 bytes read */
 1964|       |            const __m128i raw = _mm_insert_epi16(_mm_cvtsi32_si128((int)w0), (int16_t)w1, 2);
 1965|       |            const __m128i cA =
 1966|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufA), vmul), 13);
 1967|       |            const __m128i cB =
 1968|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufB), vmul), 13);
 1969|       |            const __m128i codes = _mm_and_si128(_mm_packus_epi16(cA, cB), _mm_set1_epi8(7));
 1970|       |            _mm_storeu_si128((__m128i*)(void*)(out + i), _mm_shuffle_epi8(vc2s, codes));
 1971|       |            i += 16;
 1972|       |        }
 1973|       |    } else if (D == 5) {
 1974|       |        // c2s has 32 entries: pshufb does 16, so select lo/hi by code bit 4.
 1975|       |        const __m128i vlo = _mm_loadu_si128((const __m128i*)(const void*)c2s);
 1976|       |        const __m128i vhi = _mm_loadu_si128((const __m128i*)(const void*)(c2s + 16));
 1977|       |        const __m128i shufA = _mm_setr_epi8(0, 1, 0, 1, 1, 2, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5);
 1978|       |        const __m128i shufB = _mm_setr_epi8(5, 6, 5, 6, 6, 7, 6, 7, 7, 8, 8, 9, 8, 9, 9, 10);
 1979|       |        const __m128i vmul = _mm_setr_epi16(2048, 64, 512, 16, 128, 1024, 32, 256);
 1980|       |        while (i + 16 <= n) {
 1981|       |            const size_t off = (i * 5) >> 3;
 1982|       |            uint16_t w1;
 1983|       |            ZXC_MEMCPY(&w1, bits + off + 8, 2); /* 10 source bytes */
 1984|       |            const __m128i raw = _mm_insert_epi16(
 1985|       |                _mm_loadl_epi64((const __m128i*)(const void*)(bits + off)), (int16_t)w1, 4);
 1986|       |            const __m128i cA =
 1987|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufA), vmul), 11);
 1988|       |            const __m128i cB =
 1989|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufB), vmul), 11);
 1990|       |            const __m128i codes = _mm_and_si128(_mm_packus_epi16(cA, cB), _mm_set1_epi8(0x1F));
 1991|       |            const __m128i sel =
 1992|       |                _mm_blendv_epi8(_mm_shuffle_epi8(vlo, codes), _mm_shuffle_epi8(vhi, codes),
 1993|       |                                _mm_slli_epi16(codes, 3));
 1994|       |            _mm_storeu_si128((__m128i*)(void*)(out + i), sel);
 1995|       |            i += 16;
 1996|       |        }
 1997|       |    } else if (D == 6) {
 1998|       |        // c2s has 64 entries: 4 pshufb sub-tables, select by code bits 4-5.
 1999|       |        const __m128i t0 = _mm_loadu_si128((const __m128i*)(const void*)c2s);
 2000|       |        const __m128i t1 = _mm_loadu_si128((const __m128i*)(const void*)(c2s + 16));
 2001|       |        const __m128i t2 = _mm_loadu_si128((const __m128i*)(const void*)(c2s + 32));
 2002|       |        const __m128i t3 = _mm_loadu_si128((const __m128i*)(const void*)(c2s + 48));
 2003|       |        const __m128i shufA = _mm_setr_epi8(0, 1, 0, 1, 1, 2, 2, 3, 3, 4, 3, 4, 4, 5, 5, 6);
 2004|       |        const __m128i shufB = _mm_setr_epi8(6, 7, 6, 7, 7, 8, 8, 9, 9, 10, 9, 10, 10, 11, 11, 12);
 2005|       |        const __m128i vmul = _mm_setr_epi16(1024, 16, 64, 256, 1024, 16, 64, 256);
 2006|       |        while (i + 16 <= n) {
 2007|       |            const size_t off = (i * 6) >> 3;
 2008|       |            uint32_t w1;
 2009|       |            ZXC_MEMCPY(&w1, bits + off + 8, 4); /* 12 source bytes */
 2010|       |            const __m128i raw = _mm_insert_epi32(
 2011|       |                _mm_loadl_epi64((const __m128i*)(const void*)(bits + off)), (int)w1, 2);
 2012|       |            const __m128i cA =
 2013|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufA), vmul), 10);
 2014|       |            const __m128i cB =
 2015|       |                _mm_srli_epi16(_mm_mullo_epi16(_mm_shuffle_epi8(raw, shufB), vmul), 10);
 2016|       |            const __m128i codes = _mm_and_si128(_mm_packus_epi16(cA, cB), _mm_set1_epi8(0x3F));
 2017|       |            const __m128i m4 = _mm_slli_epi16(codes, 3);
 2018|       |            const __m128i lo =
 2019|       |                _mm_blendv_epi8(_mm_shuffle_epi8(t0, codes), _mm_shuffle_epi8(t1, codes), m4);
 2020|       |            const __m128i hi =
 2021|       |                _mm_blendv_epi8(_mm_shuffle_epi8(t2, codes), _mm_shuffle_epi8(t3, codes), m4);
 2022|       |            _mm_storeu_si128((__m128i*)(void*)(out + i),
 2023|       |                             _mm_blendv_epi8(lo, hi, _mm_slli_epi16(codes, 2)));
 2024|       |            i += 16;
 2025|       |        }
 2026|       |    }
 2027|       |#endif /* AVX-512 VBMI, else AVX2 + SSE */
 2028|       |#endif
 2029|       |    // Generic scalar bit-reader (any D).
 2030|  2.01k|    {
 2031|  2.01k|        uint64_t bitpos = i * (uint64_t)D;
 2032|  2.01k|        const uint32_t m = (1U << D) - 1U;
 2033|  2.01k|        const size_t fbytes = (size_t)(((uint64_t)n * (uint64_t)D + 7U) >> 3);
 2034|   322k|        while (i < n) {
  ------------------
  |  Branch (2034:16): [True: 320k, False: 2.01k]
  ------------------
 2035|   320k|            const size_t byte = (size_t)(bitpos >> 3);
 2036|   320k|            uint32_t w = bits[byte];
 2037|   320k|            if (byte + 1 < fbytes) w |= (uint32_t)bits[byte + 1] << 8;
  ------------------
  |  Branch (2037:17): [True: 318k, False: 2.35k]
  ------------------
 2038|   320k|            if (D > 8 && byte + 2 < fbytes) w |= (uint32_t)bits[byte + 2] << 16;
  ------------------
  |  Branch (2038:17): [True: 0, False: 320k]
  |  Branch (2038:26): [True: 0, False: 0]
  ------------------
 2039|   320k|            out[i++] = c2s[(w >> (bitpos & 7U)) & m];
 2040|   320k|            bitpos += (uint64_t)D;
 2041|   320k|        }
 2042|  2.01k|    }
 2043|  2.01k|}
zxc_huffman.c:zxc_pivco_emit_leaf_pair:
 2055|  2.12k|                                                       const uint8_t* RESTRICT bits) {
 2056|  2.12k|    size_t i = 0;
 2057|       |#if defined(ZXC_USE_NEON64)
 2058|       |    const uint8x16_t vsym0 = vdupq_n_u8(sym0);
 2059|       |    const uint8x16_t vdelta = vdupq_n_u8((uint8_t)(sym0 ^ sym1));
 2060|       |    static const uint8_t rep_idx[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1};
 2061|       |    static const uint8_t bit_sel[16] = {1, 2, 4, 8, 16, 32, 64, 128, 1, 2, 4, 8, 16, 32, 64, 128};
 2062|       |    const uint8x16_t vrep = vld1q_u8(rep_idx);
 2063|       |    const uint8x16_t vsel = vld1q_u8(bit_sel);
 2064|       |    while (i + 16 <= n) {
 2065|       |        uint8x16_t ctrl = vdupq_n_u8(0);
 2066|       |        ctrl = vsetq_lane_u8(bits[i >> 3], ctrl, 0);
 2067|       |        ctrl = vsetq_lane_u8(bits[(i >> 3) + 1], ctrl, 1);
 2068|       |        const uint8x16_t rep = vqtbl1q_u8(ctrl, vrep);
 2069|       |        const uint8x16_t mask = vtstq_u8(rep, vsel);
 2070|       |        vst1q_u8(out + i, veorq_u8(vsym0, vandq_u8(vdelta, mask)));
 2071|       |        i += 16;
 2072|       |    }
 2073|       |#elif defined(ZXC_USE_NEON32)
 2074|       |    const uint8x8_t vsym0 = vdup_n_u8(sym0);
 2075|       |    const uint8x8_t vdelta = vdup_n_u8((uint8_t)(sym0 ^ sym1));
 2076|       |    static const uint8_t bit_sel8[8] = {1, 2, 4, 8, 16, 32, 64, 128};
 2077|       |    const uint8x8_t vsel = vld1_u8(bit_sel8);
 2078|       |    while (i + 8 <= n) {
 2079|       |        const uint8x8_t mask = vtst_u8(vdup_n_u8(bits[i >> 3]), vsel);
 2080|       |        vst1_u8(out + i, veor_u8(vsym0, vand_u8(vdelta, mask)));
 2081|       |        i += 8;
 2082|       |    }
 2083|       |#elif defined(ZXC_USE_AVX512) || defined(ZXC_USE_AVX2) || \
 2084|       |    (defined(ZXC_USE_SSE2) && defined(__SSSE3__))
 2085|       |#if defined(ZXC_USE_AVX512)
 2086|       |    /* The control word is already the blend mask; the masked store takes the
 2087|       |     * tail, hence nothing narrower below. */
 2088|       |    {
 2089|       |        const __m512i z0 = _mm512_set1_epi8((char)sym0);
 2090|       |        const __m512i z1 = _mm512_set1_epi8((char)sym1);
 2091|       |        while (i < n) {
 2092|       |            const size_t left = n - i;
 2093|       |            const size_t cb = (left + 7) >> 3;
 2094|       |            uint64_t ctrl = 0;
 2095|       |            ZXC_MEMCPY(&ctrl, bits + (i >> 3), cb < 8 ? cb : 8); /* not past the run */
 2096|       |            const __mmask64 sm = (left >= 64) ? ~(__mmask64)0 : (((__mmask64)1 << left) - 1);
 2097|       |            _mm512_mask_storeu_epi8((void*)(out + i), sm,
 2098|       |                                    _mm512_mask_blend_epi8((__mmask64)ctrl, z0, z1));
 2099|       |            i += 64;
 2100|       |        }
 2101|       |        if (i > n) i = n;
 2102|       |    }
 2103|       |#else
 2104|       |#if defined(ZXC_USE_AVX2)
 2105|       |    /* Broadcasting the control dword lets each 128-bit half pick its own two
 2106|       |     * bytes out of it. */
 2107|       |    {
 2108|       |        const __m256i y0 = _mm256_set1_epi8((char)sym0);
 2109|       |        const __m256i ydelta = _mm256_set1_epi8((char)(uint8_t)(sym0 ^ sym1));
 2110|       |        const __m256i yrep = _mm256_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2,
 2111|       |                                              2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3);
 2112|       |        const __m256i ysel =
 2113|       |            _mm256_setr_epi8(1, 2, 4, 8, 16, 32, 64, (char)128, 1, 2, 4, 8, 16, 32, 64, (char)128,
 2114|       |                             1, 2, 4, 8, 16, 32, 64, (char)128, 1, 2, 4, 8, 16, 32, 64, (char)128);
 2115|       |        while (i + 32 <= n) {
 2116|       |            uint32_t c4;
 2117|       |            ZXC_MEMCPY(&c4, bits + (i >> 3), 4);
 2118|       |            const __m256i rep = _mm256_shuffle_epi8(_mm256_set1_epi32((int)c4), yrep);
 2119|       |            const __m256i mask = _mm256_cmpeq_epi8(_mm256_and_si256(rep, ysel), ysel);
 2120|       |            _mm256_storeu_si256((__m256i*)(void*)(out + i),
 2121|       |                                _mm256_xor_si256(y0, _mm256_and_si256(ydelta, mask)));
 2122|       |            i += 32;
 2123|       |        }
 2124|       |    }
 2125|       |#endif
 2126|       |    const __m128i vsym0 = _mm_set1_epi8((char)sym0);
 2127|       |    const __m128i vdelta = _mm_set1_epi8((char)(uint8_t)(sym0 ^ sym1));
 2128|       |    const __m128i vrep = _mm_setr_epi8(0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1);
 2129|       |    const __m128i vsel =
 2130|       |        _mm_setr_epi8(1, 2, 4, 8, 16, 32, 64, (char)128, 1, 2, 4, 8, 16, 32, 64, (char)128);
 2131|       |    while (i + 16 <= n) {
 2132|       |        const __m128i ctrl = _mm_cvtsi32_si128(bits[i >> 3] | ((int)bits[(i >> 3) + 1] << 8));
 2133|       |        const __m128i rep = _mm_shuffle_epi8(ctrl, vrep);
 2134|       |        // lanes where the selected bit is set -> 0xFF
 2135|       |        const __m128i mask = _mm_cmpeq_epi8(_mm_and_si128(rep, vsel), vsel);
 2136|       |        _mm_storeu_si128((__m128i*)(void*)(out + i),
 2137|       |                         _mm_xor_si128(vsym0, _mm_and_si128(vdelta, mask)));
 2138|       |        i += 16;
 2139|       |    }
 2140|       |#endif /* AVX-512, else AVX2 + SSE */
 2141|       |#endif
 2142|  3.10M|    while (i < n) {
  ------------------
  |  Branch (2142:12): [True: 3.10M, False: 2.12k]
  ------------------
 2143|  3.10M|        const int bit = (bits[i >> 3] >> (i & 7)) & 1;
 2144|  3.10M|        out[i++] = bit ? sym1 : sym0;
  ------------------
  |  Branch (2144:20): [True: 1.00M, False: 2.09M]
  ------------------
 2145|  3.10M|    }
 2146|  2.12k|}
zxc_huffman.c:zxc_pivco_merge:
 1378|  3.40k|                                              const uint8_t* RESTRICT bits) {
 1379|  3.40k|    const uint8_t* L = src;
 1380|  3.40k|    const uint8_t* R = src + nl;
 1381|  3.40k|    const size_t n = nl + nr;
 1382|  3.40k|    size_t i = 0;
 1383|  3.40k|    size_t lp = 0;
 1384|  3.40k|    size_t rp = 0;
 1385|       |#if defined(ZXC_USE_NEON64)
 1386|       |    // 16 outputs per step: two-register TBL over {L[0..15], R[0..15]} with the
 1387|       |    // signed-index tables (see zxc_pivco_tables.h).
 1388|       |    while (i + 16 <= n) {
 1389|       |        const uint8_t b0 = bits[i >> 3];
 1390|       |        const uint8_t b1 = bits[(i >> 3) + 1];
 1391|       |        uint8x16x2_t tb;
 1392|       |        tb.val[0] = vld1q_u8(L + lp);
 1393|       |        tb.val[1] = vld1q_u8(R + rp);
 1394|       |        const int pc0 = zxc_pivco_popcnt32(b0);
 1395|       |        const uint8x8_t ia = vld1_u8(zxc_pivco_idxa_u8[b0]);
 1396|       |        const uint8x8_t ib = vld1_u8(zxc_pivco_idxb_pre[pc0][b1]);
 1397|       |        vst1q_u8(out + i, vqtbl2q_u8(tb, vcombine_u8(ia, ib)));
 1398|       |        const int pc = pc0 + zxc_pivco_popcnt32(b1);
 1399|       |        ZXC_PIVCO_MERGE_STEP(16, pc);
 1400|       |    }
 1401|       |#else /* x86 tiers */
 1402|       |#if defined(ZXC_USE_AVX512) && defined(__AVX512VBMI2__)
 1403|       |    // 64 outputs per step: the merge IS a pair of byte expands - L's bytes fill
 1404|       |    // the control word's 0-bit lanes, R's the 1-bit lanes. The masked expand
 1405|       |    // loads only touch the bytes they consume, so the speculative reads stay
 1406|       |    // fault-safe without extra buffer slack.
 1407|       |    const __m512i zero = _mm512_setzero_si512();
 1408|       |    while (i + 64 <= n) {
 1409|       |        uint64_t ctrl;
 1410|       |        ZXC_MEMCPY(&ctrl, bits + (i >> 3), 8);
 1411|       |        const __m512i vl =
 1412|       |            _mm512_mask_expandloadu_epi8(zero, (__mmask64)~ctrl, (const void*)(L + lp));
 1413|       |        const __m512i outv =
 1414|       |            _mm512_mask_expandloadu_epi8(vl, (__mmask64)ctrl, (const void*)(R + rp));
 1415|       |        _mm512_storeu_si512((void*)(out + i), outv);
 1416|       |        const int pc = zxc_pivco_popcnt64(ctrl);
 1417|       |        ZXC_PIVCO_MERGE_STEP(64, pc);
 1418|       |    }
 1419|       |#endif
 1420|       |#if defined(ZXC_USE_AVX512) || defined(ZXC_USE_AVX2) || \
 1421|       |    (defined(ZXC_USE_SSE2) && defined(__SSSE3__))
 1422|       |    // 16 outputs/step: pshufb(L, ix+0x70) | pshufb(R, ix-16) selects L[ix] or
 1423|       |    // R[ix-16] (out-of-range lanes zero out); 32/step unrolls it twice.
 1424|       |#if defined(ZXC_USE_AVX2)
 1425|       |    // Same thing at 256 bits, 32 outputs/step. Both selects take the index
 1426|       |    // unbiased: table lanes all sit in [0, 31], so pshufb masks to 4 bits and
 1427|       |    // bit 4 is the L/R selector - shifted into the sign it drives the blend,
 1428|       |    // and both bias vectors go away. L and R stay two 128-bit loads: the
 1429|       |    // second cursor is lp + (16 - pcA), never lp + 16.
 1430|       |    while (i + 32 <= n) {
 1431|       |        const uint8_t* cb = bits + (i >> 3);
 1432|       |        const int pcA0 = zxc_pivco_popcnt32(cb[0]);
 1433|       |        const int pcA = pcA0 + zxc_pivco_popcnt32(cb[1]);
 1434|       |        const int pcB0 = zxc_pivco_popcnt32(cb[2]);
 1435|       |        const int pcB = pcB0 + zxc_pivco_popcnt32(cb[3]);
 1436|       |        const size_t lpB = lp + (size_t)(16 - pcA);
 1437|       |        const size_t rpB = rp + (size_t)pcA;
 1438|       |        const __m256i vl = _mm256_inserti128_si256(
 1439|       |            _mm256_castsi128_si256(_mm_loadu_si128((const __m128i*)(const void*)(L + lp))),
 1440|       |            _mm_loadu_si128((const __m128i*)(const void*)(L + lpB)), 1);
 1441|       |        const __m256i vr = _mm256_inserti128_si256(
 1442|       |            _mm256_castsi128_si256(_mm_loadu_si128((const __m128i*)(const void*)(R + rp))),
 1443|       |            _mm_loadu_si128((const __m128i*)(const void*)(R + rpB)), 1);
 1444|       |        const __m128i ixA = _mm_unpacklo_epi64(
 1445|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxa_u8[cb[0]]),
 1446|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxb_pre[pcA0][cb[1]]));
 1447|       |        const __m128i ixB = _mm_unpacklo_epi64(
 1448|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxa_u8[cb[2]]),
 1449|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxb_pre[pcB0][cb[3]]));
 1450|       |        const __m256i ix = _mm256_inserti128_si256(_mm256_castsi128_si256(ixA), ixB, 1);
 1451|       |        _mm256_storeu_si256(
 1452|       |            (__m256i*)(void*)(out + i),
 1453|       |            _mm256_blendv_epi8(_mm256_shuffle_epi8(vl, ix), _mm256_shuffle_epi8(vr, ix),
 1454|       |                               _mm256_slli_epi16(ix, 3)));
 1455|       |        lp = lpB + (size_t)(16 - pcB);
 1456|       |        rp = rpB + (size_t)pcB;
 1457|       |        i += 32;
 1458|       |    }
 1459|       |#else
 1460|       |    while (i + 32 <= n) {
 1461|       |        const uint8_t* cb = bits + (i >> 3);
 1462|       |        const int pcA0 = zxc_pivco_popcnt32(cb[0]);
 1463|       |        const int pcA = pcA0 + zxc_pivco_popcnt32(cb[1]);
 1464|       |        const int pcB0 = zxc_pivco_popcnt32(cb[2]);
 1465|       |        const int pcB = pcB0 + zxc_pivco_popcnt32(cb[3]);
 1466|       |        const size_t lpB = lp + (size_t)(16 - pcA);
 1467|       |        const size_t rpB = rp + (size_t)pcA;
 1468|       |        const __m128i vlA = _mm_loadu_si128((const __m128i*)(const void*)(L + lp));
 1469|       |        const __m128i vrA = _mm_loadu_si128((const __m128i*)(const void*)(R + rp));
 1470|       |        const __m128i vlB = _mm_loadu_si128((const __m128i*)(const void*)(L + lpB));
 1471|       |        const __m128i vrB = _mm_loadu_si128((const __m128i*)(const void*)(R + rpB));
 1472|       |        const __m128i iaA = _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxa_u8[cb[0]]);
 1473|       |        const __m128i ibA =
 1474|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxb_pre[pcA0][cb[1]]);
 1475|       |        const __m128i iaB = _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxa_u8[cb[2]]);
 1476|       |        const __m128i ibB =
 1477|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxb_pre[pcB0][cb[3]]);
 1478|       |        const __m128i ixA = _mm_unpacklo_epi64(iaA, ibA);
 1479|       |        const __m128i ixB = _mm_unpacklo_epi64(iaB, ibB);
 1480|       |        const __m128i selA =
 1481|       |            _mm_or_si128(_mm_shuffle_epi8(vlA, _mm_add_epi8(ixA, _mm_set1_epi8(0x70))),
 1482|       |                         _mm_shuffle_epi8(vrA, _mm_sub_epi8(ixA, _mm_set1_epi8(16))));
 1483|       |        const __m128i selB =
 1484|       |            _mm_or_si128(_mm_shuffle_epi8(vlB, _mm_add_epi8(ixB, _mm_set1_epi8(0x70))),
 1485|       |                         _mm_shuffle_epi8(vrB, _mm_sub_epi8(ixB, _mm_set1_epi8(16))));
 1486|       |        _mm_storeu_si128((__m128i*)(void*)(out + i), selA);
 1487|       |        _mm_storeu_si128((__m128i*)(void*)(out + i + 16), selB);
 1488|       |        lp = lpB + (size_t)(16 - pcB);
 1489|       |        rp = rpB + (size_t)pcB;
 1490|       |        i += 32;
 1491|       |    }
 1492|       |#endif
 1493|       |    while (i + 16 <= n) {
 1494|       |        const uint8_t b0 = bits[i >> 3];
 1495|       |        const uint8_t b1 = bits[(i >> 3) + 1];
 1496|       |        const __m128i vl = _mm_loadu_si128((const __m128i*)(const void*)(L + lp));
 1497|       |        const __m128i vr = _mm_loadu_si128((const __m128i*)(const void*)(R + rp));
 1498|       |        const int pc0 = zxc_pivco_popcnt32(b0);
 1499|       |        const __m128i ia = _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxa_u8[b0]);
 1500|       |        const __m128i ib =
 1501|       |            _mm_loadl_epi64((const __m128i*)(const void*)zxc_pivco_idxb_pre[pc0][b1]);
 1502|       |        const __m128i ix = _mm_unpacklo_epi64(ia, ib);
 1503|       |        const __m128i sell = _mm_shuffle_epi8(vl, _mm_add_epi8(ix, _mm_set1_epi8(0x70)));
 1504|       |        const __m128i selr = _mm_shuffle_epi8(vr, _mm_sub_epi8(ix, _mm_set1_epi8(16)));
 1505|       |        _mm_storeu_si128((__m128i*)(void*)(out + i), _mm_or_si128(sell, selr));
 1506|       |        const int pc = pc0 + zxc_pivco_popcnt32(b1);
 1507|       |        ZXC_PIVCO_MERGE_STEP(16, pc);
 1508|       |    }
 1509|       |#elif defined(ZXC_USE_NEON32)
 1510|       |    // 8 outputs per step: four-register VTBL over {L[0..7], -, R[0..7], -}. The
 1511|       |    // shared index tables address a 32-lane view, and an 8-output step only
 1512|       |    // touches lanes 0..7 and 16..23, so the two spare d-registers stay zero.
 1513|       |    while (i + 8 <= n) {
 1514|       |        const uint8_t b = bits[i >> 3];
 1515|       |        uint8x8x4_t tb;
 1516|       |        tb.val[0] = vld1_u8(L + lp);
 1517|       |        tb.val[1] = vdup_n_u8(0);
 1518|       |        tb.val[2] = vld1_u8(R + rp);
 1519|       |        tb.val[3] = vdup_n_u8(0);
 1520|       |        vst1_u8(out + i, vtbl4_u8(tb, vld1_u8(zxc_pivco_idxa_u8[b])));
 1521|       |        const int pc = zxc_pivco_popcnt32(b);
 1522|       |        ZXC_PIVCO_MERGE_STEP(8, pc);
 1523|       |    }
 1524|       |#endif
 1525|  3.40k|#endif /* x86 tiers */
 1526|       |    // Portable 8-output path: byte selects from a 24-byte scratch laid out
 1527|       |    // as the low half of the 32-lane view the shared index tables assume
 1528|       |    // (L at offset 0, R at offset 16).
 1529|   171k|    while (i + 8 <= n) {
  ------------------
  |  Branch (1529:12): [True: 168k, False: 3.40k]
  ------------------
 1530|   168k|        const uint8_t b = bits[i >> 3];
 1531|   168k|        uint8_t comb[24];
 1532|   168k|        ZXC_MEMCPY(comb, L + lp, 8);
  ------------------
  |  |  170|   168k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1533|   168k|        ZXC_MEMCPY(comb + 16, R + rp, 8);
  ------------------
  |  |  170|   168k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1534|   168k|        const uint8_t* ix = zxc_pivco_idxa_u8[b];
 1535|  1.51M|        for (int j = 0; j < 8; j++) out[i + (size_t)j] = comb[ix[j]];
  ------------------
  |  Branch (1535:25): [True: 1.34M, False: 168k]
  ------------------
 1536|   168k|        const int pc = zxc_pivco_popcnt32(b);
 1537|   168k|        ZXC_PIVCO_MERGE_STEP(8, pc);
  ------------------
  |  | 1361|   168k|    do {                            \
  |  | 1362|   168k|        rp += (size_t)(pc);         \
  |  | 1363|   168k|        lp += (size_t)((w) - (pc)); \
  |  | 1364|   168k|        i += (w);                   \
  |  | 1365|   168k|    } while (0)
  |  |  ------------------
  |  |  |  Branch (1365:14): [Folded, False: 168k]
  |  |  ------------------
  ------------------
 1538|   168k|    }
 1539|  15.0k|    while (i < n) {
  ------------------
  |  Branch (1539:12): [True: 11.6k, False: 3.40k]
  ------------------
 1540|  11.6k|        const int bit = (bits[i >> 3] >> (i & 7)) & 1;
 1541|  11.6k|        out[i++] = bit ? R[rp++] : L[lp++];
  ------------------
  |  Branch (1541:20): [True: 5.94k, False: 5.68k]
  ------------------
 1542|  11.6k|    }
 1543|  3.40k|}

zxc_common.c:zxc_log2_u32:
 1117|  53.5k|static ZXC_ALWAYS_INLINE uint32_t zxc_log2_u32(const uint32_t v) {
 1118|       |#ifdef _MSC_VER
 1119|       |    unsigned long index;
 1120|       |    return (v == 0) ? 0 : (_BitScanReverse(&index, v) ? index : 0);
 1121|       |#else
 1122|  53.5k|    return (v == 0) ? 0 : (uint32_t)(31 - __builtin_clz(v));
  ------------------
  |  Branch (1122:12): [True: 0, False: 53.5k]
  ------------------
 1123|  53.5k|#endif
 1124|  53.5k|}
zxc_common.c:zxc_store_le32:
 1456|  60.6k|static ZXC_ALWAYS_INLINE void zxc_store_le32(void* p, const uint32_t v) {
 1457|       |#ifdef ZXC_BIG_ENDIAN
 1458|       |    const uint32_t s = ZXC_BSWAP32(v);
 1459|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1460|       |#else
 1461|  60.6k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  170|  60.6k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1462|  60.6k|#endif
 1463|  60.6k|}
zxc_common.c:zxc_file_header_sign:
 1525|  9.47k|static ZXC_ALWAYS_INLINE void zxc_file_header_sign(uint8_t* h) {
 1526|  9.47k|    zxc_store_le16(h + 14, 0);
 1527|  9.47k|    zxc_store_le16(h + 14, zxc_hash16(h));
 1528|  9.47k|}
zxc_common.c:zxc_store_le16:
 1438|  18.9k|static ZXC_ALWAYS_INLINE void zxc_store_le16(void* p, const uint16_t v) {
 1439|       |#ifdef ZXC_BIG_ENDIAN
 1440|       |    const uint16_t s = ZXC_BSWAP16(v);
 1441|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1442|       |#else
 1443|  18.9k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  170|  18.9k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1444|  18.9k|#endif
 1445|  18.9k|}
zxc_common.c:zxc_le32:
 1356|  86.6k|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1357|  86.6k|    uint32_t v;
 1358|  86.6k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  86.6k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1359|       |#ifdef ZXC_BIG_ENDIAN
 1360|       |    return ZXC_BSWAP32(v);
 1361|       |#else
 1362|  86.6k|    return v;
 1363|  86.6k|#endif
 1364|  86.6k|}
zxc_common.c:zxc_le16:
 1337|  16.5k|static ZXC_ALWAYS_INLINE uint16_t zxc_le16(const void* p) {
 1338|  16.5k|    uint16_t v;
 1339|  16.5k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  16.5k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1340|       |#ifdef ZXC_BIG_ENDIAN
 1341|       |    return ZXC_BSWAP16(v);
 1342|       |#else
 1343|  16.5k|    return v;
 1344|  16.5k|#endif
 1345|  16.5k|}
zxc_common.c:zxc_hash16:
 1514|  26.0k|static ZXC_ALWAYS_INLINE uint16_t zxc_hash16(const uint8_t* p) {
 1515|  26.0k|    const uint64_t h1 = (zxc_le64(p) ^ ZXC_HASH_MULT64) * ZXC_HASH_MULT64;
  ------------------
  |  |  755|  26.0k|#define ZXC_HASH_MULT64 0xD2D84A61D2D84A61ULL
  ------------------
                  const uint64_t h1 = (zxc_le64(p) ^ ZXC_HASH_MULT64) * ZXC_HASH_MULT64;
  ------------------
  |  |  755|  26.0k|#define ZXC_HASH_MULT64 0xD2D84A61D2D84A61ULL
  ------------------
 1516|       |
 1517|  26.0k|    return (uint16_t)(((h1 + zxc_le64(p + 8) + ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64) >> 48);
  ------------------
  |  |  749|  26.0k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
                  return (uint16_t)(((h1 + zxc_le64(p + 8) + ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64) >> 48);
  ------------------
  |  |  749|  26.0k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
 1518|  26.0k|}
zxc_common.c:zxc_le64:
 1419|   111k|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1420|   111k|    uint64_t v;
 1421|   111k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|   111k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1422|       |#ifdef ZXC_BIG_ENDIAN
 1423|       |    return ZXC_BSWAP64(v);
 1424|       |#else
 1425|   111k|    return v;
 1426|   111k|#endif
 1427|   111k|}
zxc_common.c:zxc_hash8:
 1495|  59.2k|static ZXC_ALWAYS_INLINE uint8_t zxc_hash8(const uint8_t* p) {
 1496|  59.2k|    const uint64_t h = (zxc_le64(p) ^ ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64;
  ------------------
  |  |  749|  59.2k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
                  const uint64_t h = (zxc_le64(p) ^ ZXC_HASH_GOLDEN64) * ZXC_HASH_GOLDEN64;
  ------------------
  |  |  749|  59.2k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
 1497|       |
 1498|  59.2k|    return (uint8_t)(h >> 56);
 1499|  59.2k|}
zxc_common.c:zxc_seek_table_bytes:
  483|  9.47k|static ZXC_ALWAYS_INLINE uint64_t zxc_seek_table_bytes(const uint64_t nblocks) {
  484|  9.47k|    return zxc_seek_group_count(nblocks) * ZXC_SEEK_ANCHOR_SIZE + nblocks * ZXC_SEEK_SIZE_ENTRY;
  ------------------
  |  |  465|  9.47k|#define ZXC_SEEK_ANCHOR_SIZE 8U
  ------------------
                  return zxc_seek_group_count(nblocks) * ZXC_SEEK_ANCHOR_SIZE + nblocks * ZXC_SEEK_SIZE_ENTRY;
  ------------------
  |  |  467|  9.47k|#define ZXC_SEEK_SIZE_ENTRY 4U
  ------------------
  485|  9.47k|}
zxc_common.c:zxc_seek_group_count:
  472|  9.47k|static ZXC_ALWAYS_INLINE uint64_t zxc_seek_group_count(const uint64_t nblocks) {
  473|  9.47k|    return (nblocks + ZXC_SEEK_GROUP - 1) / ZXC_SEEK_GROUP;
  ------------------
  |  |  463|  9.47k|#define ZXC_SEEK_GROUP 64U
  ------------------
                  return (nblocks + ZXC_SEEK_GROUP - 1) / ZXC_SEEK_GROUP;
  ------------------
  |  |  463|  9.47k|#define ZXC_SEEK_GROUP 64U
  ------------------
  474|  9.47k|}
zxc_common.c:zxc_store_le64:
 1474|  2.23k|static ZXC_ALWAYS_INLINE void zxc_store_le64(void* p, const uint64_t v) {
 1475|       |#ifdef ZXC_BIG_ENDIAN
 1476|       |    const uint64_t s = ZXC_BSWAP64(v);
 1477|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1478|       |#else
 1479|  2.23k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  170|  2.23k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1480|  2.23k|#endif
 1481|  2.23k|}
zxc_common.c:zxc_footer_layout:
 2388|  9.47k|                                                               const int checksum_enabled) {
 2389|  9.47k|    zxc_footer_layout_t l;
 2390|  9.47k|    l.skip = checksum_enabled ? (size_t)ZXC_FILE_DIGEST_SIZE : 0U;
  ------------------
  |  |  127|  1.31k|#define ZXC_FILE_DIGEST_SIZE 8
  ------------------
  |  Branch (2390:14): [True: 1.31k, False: 8.15k]
  ------------------
 2391|  9.47k|    l.nd = zxc_uint_bytes(src_size);
 2392|  9.47k|    const uint64_t base = prefix + l.skip + l.nd + 1;
 2393|  9.47k|    l.nf = 1;
 2394|  15.0k|    while (zxc_uint_bytes(base + l.nf) > l.nf) l.nf++;
  ------------------
  |  Branch (2394:12): [True: 5.60k, False: 9.47k]
  ------------------
 2395|  9.47k|    l.compressed_size = base + l.nf;
 2396|  9.47k|    l.len = l.skip + l.nd + l.nf + 1;
 2397|  9.47k|    return l;
 2398|  9.47k|}
zxc_common.c:zxc_uint_bytes:
 2365|  24.5k|static ZXC_ALWAYS_INLINE size_t zxc_uint_bytes(const uint64_t v) {
 2366|  24.5k|    size_t n = 1;
 2367|  43.6k|    while (n < sizeof(uint64_t) && (v >> (8 * n)) != 0) n++;
  ------------------
  |  Branch (2367:12): [True: 43.6k, False: 0]
  |  Branch (2367:36): [True: 19.1k, False: 24.5k]
  ------------------
 2368|  24.5k|    return n;
 2369|  24.5k|}
zxc_compress.c:zxc_get_lz77_params:
 1221|  9.64k|static ZXC_ALWAYS_INLINE zxc_lz77_params_t zxc_get_lz77_params(const int level) {
 1222|       |    // The distance floor stops at level 5: the slow levels keep every distance.
 1223|       |    // Match splitting at levels 3-5 only: 1-2 are PAK, 6-7 keep every escape.
 1224|       |    // search_depth, sufficient_len, use_lazy, lazy_attempts, lazy_len_threshold, step_base,
 1225|       |    // step_shift, min_offset, split_max
 1226|  9.64k|    static const zxc_lz77_params_t table[7] = {
 1227|  9.64k|        {3, 16, 0, 0, 0, 4, 4, ZXC_LZ_MINDIST, 0},        // fallback
  ------------------
  |  |  697|  9.64k|#define ZXC_LZ_MINDIST 32
  ------------------
 1228|  9.64k|        {3, 16, 0, 0, 0, 4, 4, ZXC_LZ_MINDIST, 0},        // level 1
  ------------------
  |  |  697|  9.64k|#define ZXC_LZ_MINDIST 32
  ------------------
 1229|  9.64k|        {3, 18, 0, 0, 0, 3, 6, ZXC_LZ_MINDIST, 0},        // level 2
  ------------------
  |  |  697|  9.64k|#define ZXC_LZ_MINDIST 32
  ------------------
 1230|  9.64k|        {3, 16, 1, 4, 128, 1, 4, ZXC_LZ_MINDIST, 33},     // level 3
  ------------------
  |  |  697|  9.64k|#define ZXC_LZ_MINDIST 32
  ------------------
 1231|  9.64k|        {3, 18, 1, 4, 128, 1, 5, ZXC_LZ_MINDIST, 24},     // level 4
  ------------------
  |  |  697|  9.64k|#define ZXC_LZ_MINDIST 32
  ------------------
 1232|  9.64k|        {64, 256, 1, 16, 128, 1, 8, ZXC_LZ_MINDIST, 23},  // level 5
  ------------------
  |  |  697|  9.64k|#define ZXC_LZ_MINDIST 32
  ------------------
 1233|  9.64k|        {64, 256, 0, 0, 0, 1, 8, 1, 0}                    // level 6
 1234|  9.64k|    };
 1235|  9.64k|    return (level >= ZXC_LEVEL_ULTRA)
  ------------------
  |  Branch (1235:12): [True: 0, False: 9.64k]
  ------------------
 1236|  9.64k|               ? (zxc_lz77_params_t){128, 256, 0, 0, 0, 1, 8, 1, 0}
 1237|  9.64k|               : table[level < ZXC_LEVEL_FASTEST ? ZXC_LEVEL_FASTEST : level];
  ------------------
  |  Branch (1237:24): [True: 0, False: 9.64k]
  ------------------
 1238|  9.64k|}
zxc_compress.c:zxc_block_is_short_dist_bound:
 1379|  9.64k|                                                           const size_t size) {
 1380|  9.64k|    const size_t d_max = ZXC_LZ_MINDIST;
  ------------------
  |  |  697|  9.64k|#define ZXC_LZ_MINDIST 32
  ------------------
 1381|       |    // Too small to sample, and too small to gain: keep every distance.
 1382|  9.64k|    if (size < d_max + sizeof(uint32_t)) return 1;
  ------------------
  |  Branch (1382:9): [True: 584, False: 9.05k]
  ------------------
 1383|       |
 1384|  9.05k|    size_t want = size / ZXC_LZ_MINDIST_PROBE_PER_KB;
  ------------------
  |  |  704|  9.05k|#define ZXC_LZ_MINDIST_PROBE_PER_KB 1024
  ------------------
 1385|  9.05k|    if (want < ZXC_LZ_MINDIST_PROBE_MIN) want = ZXC_LZ_MINDIST_PROBE_MIN;
  ------------------
  |  |  705|  9.05k|#define ZXC_LZ_MINDIST_PROBE_MIN 16
  ------------------
                  if (want < ZXC_LZ_MINDIST_PROBE_MIN) want = ZXC_LZ_MINDIST_PROBE_MIN;
  ------------------
  |  |  705|  7.00k|#define ZXC_LZ_MINDIST_PROBE_MIN 16
  ------------------
  |  Branch (1385:9): [True: 7.00k, False: 2.04k]
  ------------------
 1386|  9.05k|    if (want > ZXC_LZ_MINDIST_PROBE_MAX) want = ZXC_LZ_MINDIST_PROBE_MAX;
  ------------------
  |  |  706|  9.05k|#define ZXC_LZ_MINDIST_PROBE_MAX 64
  ------------------
                  if (want > ZXC_LZ_MINDIST_PROBE_MAX) want = ZXC_LZ_MINDIST_PROBE_MAX;
  ------------------
  |  |  706|  1.40k|#define ZXC_LZ_MINDIST_PROBE_MAX 64
  ------------------
  |  Branch (1386:9): [True: 1.40k, False: 7.65k]
  ------------------
 1387|  9.05k|    size_t stride = size / want;
 1388|  9.05k|    if (stride < d_max) stride = d_max;
  ------------------
  |  Branch (1388:9): [True: 4.86k, False: 4.19k]
  ------------------
 1389|       |
 1390|  9.05k|    const size_t planned = (size - sizeof(uint32_t) - d_max) / stride + 1;
 1391|  9.05k|    const size_t bar = (size_t)ZXC_LZ_MINDIST_MAX_SHORT_PCT * planned;
  ------------------
  |  |  714|  9.05k|#define ZXC_LZ_MINDIST_MAX_SHORT_PCT 20
  ------------------
 1392|       |
 1393|  9.05k|    size_t samples = 0;
 1394|  9.05k|    size_t hits = 0;
 1395|  92.3k|    for (size_t i = d_max; i + sizeof(uint32_t) <= size; i += stride) {
  ------------------
  |  Branch (1395:28): [True: 92.3k, False: 0]
  ------------------
 1396|  92.3k|        const uint32_t cur = zxc_le32(blk + i);
 1397|  92.3k|        samples++;
 1398|  1.92M|        for (size_t d = 1; d < d_max; d++) {
  ------------------
  |  Branch (1398:28): [True: 1.86M, False: 56.8k]
  ------------------
 1399|  1.86M|            if (zxc_le32(blk + i - d) == cur) {
  ------------------
  |  Branch (1399:17): [True: 35.4k, False: 1.82M]
  ------------------
 1400|  35.4k|                hits++;
 1401|  35.4k|                break;
 1402|  35.4k|            }
 1403|  1.86M|        }
 1404|  92.3k|        if (hits * 100U > bar) return 1;                           // can only rise
  ------------------
  |  Branch (1404:13): [True: 7.23k, False: 85.0k]
  ------------------
 1405|  85.0k|        if ((hits + (planned - samples)) * 100U <= bar) return 0;  // out of reach
  ------------------
  |  Branch (1405:13): [True: 1.82k, False: 83.2k]
  ------------------
 1406|  85.0k|    }
 1407|      0|    return hits * 100U > bar;
 1408|  9.05k|}
zxc_compress.c:zxc_le32:
 1356|  20.3M|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1357|  20.3M|    uint32_t v;
 1358|  20.3M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  20.3M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1359|       |#ifdef ZXC_BIG_ENDIAN
 1360|       |    return ZXC_BSWAP32(v);
 1361|       |#else
 1362|  20.3M|    return v;
 1363|  20.3M|#endif
 1364|  20.3M|}
zxc_compress.c:zxc_le64:
 1419|  31.1M|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1420|  31.1M|    uint64_t v;
 1421|  31.1M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  31.1M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1422|       |#ifdef ZXC_BIG_ENDIAN
 1423|       |    return ZXC_BSWAP64(v);
 1424|       |#else
 1425|  31.1M|    return v;
 1426|  31.1M|#endif
 1427|  31.1M|}
zxc_compress.c:zxc_ctz64:
 1612|  3.30M|static ZXC_ALWAYS_INLINE int zxc_ctz64(const uint64_t x) {
 1613|  3.30M|    if (x == 0) return 64;
  ------------------
  |  Branch (1613:9): [True: 0, False: 3.30M]
  ------------------
 1614|  3.30M|#if defined(__GNUC__) || defined(__clang__)
 1615|  3.30M|    return __builtin_ctzll(x);
 1616|       |#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_ARM64))
 1617|       |    unsigned long r;
 1618|       |    _BitScanForward64(&r, x);
 1619|       |    return (int)r;
 1620|       |#elif defined(_MSC_VER)
 1621|       |    // Use two 32-bit scans to avoid fragile 64-bit De Bruijn multiplication.
 1622|       |    unsigned long r;
 1623|       |    const uint32_t lo = (uint32_t)x;
 1624|       |    if (_BitScanForward(&r, lo)) return (int)r;
 1625|       |    _BitScanForward(&r, (uint32_t)(x >> 32));
 1626|       |    return 32 + (int)r;
 1627|       |#else
 1628|       |    // Fallback De Bruijn for non-GCC/non-MSVC compilers
 1629|       |    static const int Debruijn64[64] = {
 1630|       |        0,  1,  48, 2,  57, 49, 28, 3,  61, 58, 50, 42, 38, 29, 17, 4,  62, 55, 59, 36, 53, 51,
 1631|       |        43, 22, 45, 39, 33, 30, 24, 18, 12, 5,  63, 47, 56, 27, 60, 41, 37, 16, 54, 35, 52, 21,
 1632|       |        44, 32, 23, 11, 46, 26, 40, 15, 34, 20, 31, 10, 25, 14, 19, 9,  13, 8,  7,  6};
 1633|       |    return Debruijn64[((x & (0ULL - x)) * 0x03F79D71B4CA8B09ULL) >> 58];
 1634|       |#endif
 1635|  3.30M|}
zxc_compress.c:zxc_ctz32:
 1586|   167k|static ZXC_ALWAYS_INLINE int zxc_ctz32(const uint32_t x) {
 1587|   167k|    if (x == 0) return 32;
  ------------------
  |  Branch (1587:9): [True: 0, False: 167k]
  ------------------
 1588|   167k|#if defined(__GNUC__) || defined(__clang__)
 1589|   167k|    return __builtin_ctz(x);
 1590|       |#elif defined(_MSC_VER)
 1591|       |    unsigned long r;
 1592|       |    _BitScanForward(&r, x);
 1593|       |    return (int)r;
 1594|       |#else
 1595|       |    // Fallback De Bruijn (32 bits)
 1596|       |    static const int DeBruijn32[32] = {0,  1,  28, 2,  29, 14, 24, 3,  30, 22, 20,
 1597|       |                                       15, 25, 17, 4,  8,  31, 27, 13, 23, 21, 19,
 1598|       |                                       16, 7,  26, 12, 18, 6,  11, 5,  10, 9};
 1599|       |    return DeBruijn32[((uint32_t)((x & (0U - x)) * 0x077CB531U)) >> 27];
 1600|       |#endif
 1601|   167k|}
zxc_compress.c:zxc_copy32:
 1558|  1.01M|static ZXC_ALWAYS_INLINE void zxc_copy32(void* dst, const void* src) {
 1559|       |#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
 1560|       |    // AVX2/AVX512: Single 256-bit (32 byte) unaligned load/store
 1561|       |    _mm256_storeu_si256((__m256i*)dst, _mm256_loadu_si256((const __m256i*)src));
 1562|       |#elif defined(ZXC_USE_SSE2)
 1563|       |    const __m128i a = _mm_loadu_si128((const __m128i*)src);
 1564|  1.01M|    const __m128i b = _mm_loadu_si128((const __m128i*)((const uint8_t*)src + 16));
 1565|  1.01M|    _mm_storeu_si128((__m128i*)dst, a);
 1566|  1.01M|    _mm_storeu_si128((__m128i*)((uint8_t*)dst + 16), b);
 1567|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
 1568|       |    const uint8x16_t a = vld1q_u8((const uint8_t*)src);
 1569|       |    const uint8x16_t b = vld1q_u8((const uint8_t*)src + 16);
 1570|       |    vst1q_u8((uint8_t*)dst, a);
 1571|       |    vst1q_u8((uint8_t*)dst + 16, b);
 1572|       |#else
 1573|       |    ZXC_MEMCPY(dst, src, 32);
 1574|       |#endif
 1575|  1.01M|}
zxc_compress.c:zxc_store_le32:
 1456|  1.39k|static ZXC_ALWAYS_INLINE void zxc_store_le32(void* p, const uint32_t v) {
 1457|       |#ifdef ZXC_BIG_ENDIAN
 1458|       |    const uint32_t s = ZXC_BSWAP32(v);
 1459|       |    ZXC_MEMCPY(p, &s, sizeof(s));
 1460|       |#else
 1461|  1.39k|    ZXC_MEMCPY(p, &v, sizeof(v));
  ------------------
  |  |  170|  1.39k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1462|  1.39k|#endif
 1463|  1.39k|}
zxc_compress.c:zxc_checksum:
 1672|  1.39k|                                               const uint64_t seed, const uint8_t hash_method) {
 1673|  1.39k|    (void)hash_method; /* single algorithm for now; extend when adding more */
 1674|  1.39k|    const uint64_t hash = rapidhash_withSeed(input, len, seed);
 1675|       |
 1676|       |    return (uint32_t)(hash ^ (hash >> (sizeof(uint32_t) * CHAR_BIT)));
 1677|  1.39k|}
zxc_decompress.c:zxc_le32:
 1356|  2.68M|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1357|  2.68M|    uint32_t v;
 1358|  2.68M|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  2.68M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1359|       |#ifdef ZXC_BIG_ENDIAN
 1360|       |    return ZXC_BSWAP32(v);
 1361|       |#else
 1362|  2.68M|    return v;
 1363|  2.68M|#endif
 1364|  2.68M|}
zxc_decompress.c:zxc_copy32:
 1558|  12.8M|static ZXC_ALWAYS_INLINE void zxc_copy32(void* dst, const void* src) {
 1559|       |#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512)
 1560|       |    // AVX2/AVX512: Single 256-bit (32 byte) unaligned load/store
 1561|       |    _mm256_storeu_si256((__m256i*)dst, _mm256_loadu_si256((const __m256i*)src));
 1562|       |#elif defined(ZXC_USE_SSE2)
 1563|       |    const __m128i a = _mm_loadu_si128((const __m128i*)src);
 1564|  12.8M|    const __m128i b = _mm_loadu_si128((const __m128i*)((const uint8_t*)src + 16));
 1565|  12.8M|    _mm_storeu_si128((__m128i*)dst, a);
 1566|  12.8M|    _mm_storeu_si128((__m128i*)((uint8_t*)dst + 16), b);
 1567|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
 1568|       |    const uint8x16_t a = vld1q_u8((const uint8_t*)src);
 1569|       |    const uint8x16_t b = vld1q_u8((const uint8_t*)src + 16);
 1570|       |    vst1q_u8((uint8_t*)dst, a);
 1571|       |    vst1q_u8((uint8_t*)dst + 16, b);
 1572|       |#else
 1573|       |    ZXC_MEMCPY(dst, src, 32);
 1574|       |#endif
 1575|  12.8M|}
zxc_decompress.c:zxc_le64:
 1419|  53.0k|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1420|  53.0k|    uint64_t v;
 1421|  53.0k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  53.0k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1422|       |#ifdef ZXC_BIG_ENDIAN
 1423|       |    return ZXC_BSWAP64(v);
 1424|       |#else
 1425|  53.0k|    return v;
 1426|  53.0k|#endif
 1427|  53.0k|}
zxc_decompress.c:zxc_read_varint:
  619|   367k|static ZXC_ALWAYS_INLINE uint32_t zxc_read_varint(const uint8_t** ptr, const uint8_t* end) {
  620|   367k|    const uint8_t* p = *ptr;
  621|   367k|    if (UNLIKELY(p >= end)) return ZXC_VARINT_INVALID;
  ------------------
  |  |  154|   367k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 566, False: 367k]
  |  |  ------------------
  ------------------
                  if (UNLIKELY(p >= end)) return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|    566|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|    566|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|    566|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  622|       |
  623|   367k|    const uint32_t b0 = p[0];
  624|       |
  625|       |    // 1 Byte: 0xxxxxxx (7 bits) -> val < 128 (2^7)
  626|   367k|    if (LIKELY(b0 < 0x80)) {
  ------------------
  |  |  148|   367k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 276k, False: 90.9k]
  |  |  ------------------
  ------------------
  627|   276k|        *ptr = p + 1;
  628|   276k|        return b0;
  629|   276k|    }
  630|       |
  631|       |    // 2 Bytes: 10xxxxxx xxxxxxxx (14 bits) -> val < 16384 (2^14)
  632|  90.9k|    if (LIKELY(b0 < 0xC0)) {
  ------------------
  |  |  148|  90.9k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 77.9k, False: 13.0k]
  |  |  ------------------
  ------------------
  633|  77.9k|        if (UNLIKELY(p + 1 >= end)) {
  ------------------
  |  |  154|  77.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 93, False: 77.8k]
  |  |  ------------------
  ------------------
  634|     93|            *ptr = end;
  635|     93|            return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|     93|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|     93|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|     93|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  636|     93|        }
  637|  77.8k|        *ptr = p + 2;
  638|  77.8k|        return (b0 & 0x3F) | ((uint32_t)p[1] << 6);
  639|  77.9k|    }
  640|       |
  641|       |    // 3 Bytes: 110xxxxx xxxxxxxx xxxxxxxx (21 bits) -> val < 2^21. The longest
  642|       |    // a legitimate varint can be: values are (ll - MASK) or (ml - MASK), always
  643|       |    // strictly below block_size_max = 2^21.
  644|  13.0k|    if (LIKELY(b0 < 0xE0)) {
  ------------------
  |  |  148|  13.0k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 12.0k, False: 950]
  |  |  ------------------
  ------------------
  645|  12.0k|        if (UNLIKELY(p + 2 >= end)) {
  ------------------
  |  |  154|  12.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 77, False: 11.9k]
  |  |  ------------------
  ------------------
  646|     77|            *ptr = end;
  647|     77|            return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|     77|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|     77|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|     77|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  648|     77|        }
  649|  11.9k|        *ptr = p + 3;
  650|  11.9k|        return (b0 & 0x1F) | ((uint32_t)p[1] << 5) | ((uint32_t)p[2] << 13);
  651|  12.0k|    }
  652|       |
  653|       |    // extra encoding: out-of-spec for the current format, reject.
  654|    950|    *ptr = end;
  655|    950|    return ZXC_VARINT_INVALID;
  ------------------
  |  |  586|    950|#define ZXC_VARINT_INVALID (2U * ZXC_BLOCK_SIZE_MAX)
  |  |  ------------------
  |  |  |  |   75|    950|#define ZXC_BLOCK_SIZE_MAX (1U << ZXC_BLOCK_SIZE_MAX_LOG2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   69|    950|#define ZXC_BLOCK_SIZE_MAX_LOG2 21
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  656|  13.0k|}
zxc_decompress.c:zxc_copy16:
 1539|  3.16M|static ZXC_ALWAYS_INLINE void zxc_copy16(void* dst, const void* src) {
 1540|  3.16M|#if defined(ZXC_USE_AVX2) || defined(ZXC_USE_AVX512) || defined(ZXC_USE_SSE2)
 1541|       |    // x86 SSE2/AVX2/AVX512: Single 128-bit unaligned load/store
 1542|  3.16M|    _mm_storeu_si128((__m128i*)dst, _mm_loadu_si128((const __m128i*)src));
 1543|       |#elif defined(ZXC_USE_NEON64) || defined(ZXC_USE_NEON32)
 1544|       |    vst1q_u8((uint8_t*)dst, vld1q_u8((const uint8_t*)src));
 1545|       |#else
 1546|       |    ZXC_MEMCPY(dst, src, 16);
 1547|       |#endif
 1548|  3.16M|}
zxc_decompress.c:zxc_le16:
 1337|  10.3k|static ZXC_ALWAYS_INLINE uint16_t zxc_le16(const void* p) {
 1338|  10.3k|    uint16_t v;
 1339|  10.3k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  10.3k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1340|       |#ifdef ZXC_BIG_ENDIAN
 1341|       |    return ZXC_BSWAP16(v);
 1342|       |#else
 1343|  10.3k|    return v;
 1344|  10.3k|#endif
 1345|  10.3k|}
zxc_decompress.c:zxc_checksum:
 1672|  1.39k|                                               const uint64_t seed, const uint8_t hash_method) {
 1673|  1.39k|    (void)hash_method; /* single algorithm for now; extend when adding more */
 1674|  1.39k|    const uint64_t hash = rapidhash_withSeed(input, len, seed);
 1675|       |
 1676|       |    return (uint32_t)(hash ^ (hash >> (sizeof(uint32_t) * CHAR_BIT)));
 1677|  1.39k|}
zxc_dispatch.c:zxc_block_size_ceil:
 1131|  9.64k|static ZXC_ALWAYS_INLINE size_t zxc_block_size_ceil(const size_t v) {
 1132|  9.64k|    uint64_t x = (uint64_t)v - 1;
 1133|  9.64k|    x |= x >> 1;
 1134|  9.64k|    x |= x >> 2;
 1135|  9.64k|    x |= x >> 4;
 1136|  9.64k|    x |= x >> 8;
 1137|  9.64k|    x |= x >> 16;
 1138|  9.64k|    x |= x >> 32;
 1139|  9.64k|    x++;
 1140|  9.64k|    const size_t bs = (size_t)x;
 1141|  9.64k|    return (bs < ZXC_BLOCK_SIZE_MIN) ? ZXC_BLOCK_SIZE_MIN : bs;
  ------------------
  |  |   73|  9.64k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  9.64k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
                  return (bs < ZXC_BLOCK_SIZE_MIN) ? ZXC_BLOCK_SIZE_MIN : bs;
  ------------------
  |  |   73|  6.31k|#define ZXC_BLOCK_SIZE_MIN (1U << ZXC_BLOCK_SIZE_MIN_LOG2)
  |  |  ------------------
  |  |  |  |   67|  6.31k|#define ZXC_BLOCK_SIZE_MIN_LOG2 12
  |  |  ------------------
  ------------------
  |  Branch (1141:12): [True: 6.31k, False: 3.32k]
  ------------------
 1142|  9.64k|}
zxc_pstream.c:zxc_magic_prefix_ok:
  318|  4.91k|static inline int zxc_magic_prefix_ok(const uint8_t* p, const size_t n) {
  319|  4.91k|    static const uint8_t magic[4] = {(uint8_t)ZXC_MAGIC_WORD, (uint8_t)(ZXC_MAGIC_WORD >> 8),
  ------------------
  |  |  117|  4.91k|#define ZXC_MAGIC_WORD 0x9CB02EF5U
  ------------------
                  static const uint8_t magic[4] = {(uint8_t)ZXC_MAGIC_WORD, (uint8_t)(ZXC_MAGIC_WORD >> 8),
  ------------------
  |  |  117|  4.91k|#define ZXC_MAGIC_WORD 0x9CB02EF5U
  ------------------
  320|  4.91k|                                     (uint8_t)(ZXC_MAGIC_WORD >> 16),
  ------------------
  |  |  117|  4.91k|#define ZXC_MAGIC_WORD 0x9CB02EF5U
  ------------------
  321|  4.91k|                                     (uint8_t)(ZXC_MAGIC_WORD >> 24)};
  ------------------
  |  |  117|  4.91k|#define ZXC_MAGIC_WORD 0x9CB02EF5U
  ------------------
  322|  22.7k|    for (size_t i = 0; i < n && i < sizeof(magic); i++)
  ------------------
  |  Branch (322:24): [True: 21.5k, False: 1.17k]
  |  Branch (322:33): [True: 17.8k, False: 3.72k]
  ------------------
  323|  17.8k|        if (p[i] != magic[i]) return 0;
  ------------------
  |  Branch (323:13): [True: 20, False: 17.8k]
  ------------------
  324|  4.89k|    return 1;
  325|  4.91k|}
zxc_pstream.c:zxc_digest_combine:
 1692|  2.78k|                                                     const uint32_t block_checksum) {
 1693|  2.78k|    const uint64_t a = acc ^ ((uint64_t)block_checksum + 1U) * ZXC_HASH_GOLDEN64;
  ------------------
  |  |  749|  2.78k|#define ZXC_HASH_GOLDEN64 0x9E3779B97F4A7C15ULL
  ------------------
 1694|  2.78k|    const uint64_t b = ZXC_HASH_XORSHIFT64;
  ------------------
  |  |  751|  2.78k|#define ZXC_HASH_XORSHIFT64 0x2545F4914F6CDD1DULL
  ------------------
 1695|  2.78k|#if defined(__SIZEOF_INT128__)
 1696|  2.78k|    const __uint128_t r = (__uint128_t)a * b;
 1697|  2.78k|    return (uint64_t)r ^ (uint64_t)(r >> 64);
 1698|       |#else
 1699|       |    const uint64_t alo = (uint32_t)a, ahi = a >> 32, blo = (uint32_t)b, bhi = b >> 32;
 1700|       |    const uint64_t lolo = alo * blo, lohi = alo * bhi, hilo = ahi * blo, hihi = ahi * bhi;
 1701|       |    const uint64_t cross = (lolo >> 32) + (uint32_t)lohi + (uint32_t)hilo;
 1702|       |    const uint64_t hi = hihi + (lohi >> 32) + (hilo >> 32) + (cross >> 32);
 1703|       |    const uint64_t lo = (cross << 32) | (uint32_t)lolo;
 1704|       |    return lo ^ hi;
 1705|       |#endif
 1706|  2.78k|}
zxc_pstream.c:zxc_le32:
 1356|  2.78k|static ZXC_ALWAYS_INLINE uint32_t zxc_le32(const void* p) {
 1357|  2.78k|    uint32_t v;
 1358|  2.78k|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|  2.78k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1359|       |#ifdef ZXC_BIG_ENDIAN
 1360|       |    return ZXC_BSWAP32(v);
 1361|       |#else
 1362|  2.78k|    return v;
 1363|  2.78k|#endif
 1364|  2.78k|}
zxc_pstream.c:zxc_footer_layout:
 2388|  19.6k|                                                               const int checksum_enabled) {
 2389|  19.6k|    zxc_footer_layout_t l;
 2390|  19.6k|    l.skip = checksum_enabled ? (size_t)ZXC_FILE_DIGEST_SIZE : 0U;
  ------------------
  |  |  127|  1.82k|#define ZXC_FILE_DIGEST_SIZE 8
  ------------------
  |  Branch (2390:14): [True: 1.82k, False: 17.7k]
  ------------------
 2391|  19.6k|    l.nd = zxc_uint_bytes(src_size);
 2392|  19.6k|    const uint64_t base = prefix + l.skip + l.nd + 1;
 2393|  19.6k|    l.nf = 1;
 2394|  29.5k|    while (zxc_uint_bytes(base + l.nf) > l.nf) l.nf++;
  ------------------
  |  Branch (2394:12): [True: 9.99k, False: 19.6k]
  ------------------
 2395|  19.6k|    l.compressed_size = base + l.nf;
 2396|  19.6k|    l.len = l.skip + l.nd + l.nf + 1;
 2397|  19.6k|    return l;
 2398|  19.6k|}
zxc_pstream.c:zxc_uint_bytes:
 2365|  49.2k|static ZXC_ALWAYS_INLINE size_t zxc_uint_bytes(const uint64_t v) {
 2366|  49.2k|    size_t n = 1;
 2367|  83.3k|    while (n < sizeof(uint64_t) && (v >> (8 * n)) != 0) n++;
  ------------------
  |  Branch (2367:12): [True: 83.3k, False: 0]
  |  Branch (2367:36): [True: 34.1k, False: 49.2k]
  ------------------
 2368|  49.2k|    return n;
 2369|  49.2k|}
zxc_pstream.c:zxc_le64:
 1419|    854|static ZXC_ALWAYS_INLINE uint64_t zxc_le64(const void* p) {
 1420|    854|    uint64_t v;
 1421|    854|    ZXC_MEMCPY(&v, p, sizeof(v));
  ------------------
  |  |  170|    854|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
 1422|       |#ifdef ZXC_BIG_ENDIAN
 1423|       |    return ZXC_BSWAP64(v);
 1424|       |#else
 1425|    854|    return v;
 1426|    854|#endif
 1427|    854|}

zxc_cstream_create:
  263|  9.47k|zxc_cstream* zxc_cstream_create(const zxc_cctx* cfg) {
  264|  9.47k|    zxc_cstream* cs = (zxc_cstream*)ZXC_CALLOC(1, sizeof(*cs));
  ------------------
  |  |   74|  9.47k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
  265|  9.47k|    if (UNLIKELY(!cs)) return NULL;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  266|       |
  267|  9.47k|    if (cfg) cs->opts = *zxc_cctx_params(cfg);
  ------------------
  |  Branch (267:9): [True: 9.47k, False: 0]
  ------------------
  268|       |
  269|       |    // Push streams take no dictionary yet (deferred until a need arises): the
  270|       |    // header id stays 0, so a dictionary here would produce archives that
  271|       |    // decode wrong elsewhere.
  272|  9.47k|    if (UNLIKELY(cs->opts.dict || cs->opts.dict_size || cs->opts.dict_huf)) {
  ------------------
  |  |  154|  37.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  |  Branch (154:42): [True: 0, False: 9.47k]
  |  |  |  Branch (154:42): [True: 0, False: 9.47k]
  |  |  |  Branch (154:42): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  273|      0|        ZXC_FREE(cs);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  274|      0|        return NULL;
  275|      0|    }
  276|       |
  277|  9.47k|    cs->opts.level = ZXC_OPTS_LEVEL(&cs->opts, ZXC_LEVEL_DEFAULT);
  ------------------
  |  |  993|  9.47k|#define ZXC_OPTS_LEVEL(o, dflt) (((o) && (o)->level != 0) ? (o)->level : (dflt))
  |  |  ------------------
  |  |  |  Branch (993:35): [True: 9.47k, False: 0]
  |  |  |  Branch (993:42): [True: 9.47k, False: 0]
  |  |  ------------------
  ------------------
  278|  9.47k|    cs->opts.block_size = ZXC_OPTS_BLOCK_SIZE(&cs->opts, ZXC_BLOCK_SIZE_DEFAULT);
  ------------------
  |  |  995|  9.47k|#define ZXC_OPTS_BLOCK_SIZE(o, dflt) (((o) && (o)->block_size > 0) ? (o)->block_size : (dflt))
  |  |  ------------------
  |  |  |  Branch (995:40): [True: 9.47k, False: 0]
  |  |  |  Branch (995:47): [True: 9.47k, False: 0]
  |  |  ------------------
  ------------------
  279|       |    // n_threads is ignored on this single-threaded path.
  280|  9.47k|    cs->opts.n_threads = 0;
  281|  9.47k|    cs->opts.progress_cb = NULL;
  282|  9.47k|    cs->opts.user_data = NULL;
  283|  9.47k|    cs->opts.seekable = 0;
  284|  9.47k|    cs->block_size = cs->opts.block_size;
  285|       |
  286|       |    // The block encoder reads its parameters from cs->opts on every call;
  287|       |    // the context only needs to exist.
  288|  9.47k|    cs->cctx = zxc_create_cctx();
  289|       |    // LCOV_EXCL_START
  290|  9.47k|    if (UNLIKELY(!cs->cctx)) {
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  291|      0|        ZXC_FREE(cs);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  292|      0|        return NULL;
  293|      0|    }
  294|  9.47k|    cs->in_block = (uint8_t*)ZXC_MALLOC(cs->block_size);
  ------------------
  |  |   68|  9.47k|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  295|  9.47k|    if (UNLIKELY(!cs->in_block)) {
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  296|      0|        zxc_free_cctx(cs->cctx);
  297|      0|        ZXC_FREE(cs);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  298|      0|        return NULL;
  299|      0|    }
  300|       |    // LCOV_EXCL_STOP
  301|       |    // Pre-size pending so the file header and footer paths never need realloc.
  302|  9.47k|    cs->pending_cap = ZXC_FILE_HEADER_SIZE > ZXC_FOOTER_MAX_SIZE_WITH_DIGEST
  ------------------
  |  |  120|  9.47k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
                  cs->pending_cap = ZXC_FILE_HEADER_SIZE > ZXC_FOOTER_MAX_SIZE_WITH_DIGEST
  ------------------
  |  | 2445|  9.47k|#define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  127|  9.47k|#define ZXC_FILE_DIGEST_SIZE 8
  |  |  ------------------
  |  |               #define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  125|  9.47k|#define ZXC_FILE_FOOTER_MAX_SIZE 17
  |  |  ------------------
  ------------------
  |  Branch (302:23): [Folded, False: 9.47k]
  ------------------
  303|  9.47k|                          ? ZXC_FILE_HEADER_SIZE
  ------------------
  |  |  120|      0|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  304|  9.47k|                          : ZXC_FOOTER_MAX_SIZE_WITH_DIGEST;
  ------------------
  |  | 2445|  18.9k|#define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  127|  9.47k|#define ZXC_FILE_DIGEST_SIZE 8
  |  |  ------------------
  |  |               #define ZXC_FOOTER_MAX_SIZE_WITH_DIGEST (ZXC_FILE_DIGEST_SIZE + ZXC_FILE_FOOTER_MAX_SIZE)
  |  |  ------------------
  |  |  |  |  125|  9.47k|#define ZXC_FILE_FOOTER_MAX_SIZE 17
  |  |  ------------------
  ------------------
  305|  9.47k|    cs->pending = (uint8_t*)ZXC_MALLOC(cs->pending_cap);
  ------------------
  |  |   68|  9.47k|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  306|       |    // LCOV_EXCL_START
  307|  9.47k|    if (UNLIKELY(!cs->pending)) {
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  308|      0|        ZXC_FREE(cs->in_block);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  309|      0|        zxc_free_cctx(cs->cctx);
  310|      0|        ZXC_FREE(cs);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  311|      0|        return NULL;
  312|      0|    }
  313|       |    // LCOV_EXCL_STOP
  314|  9.47k|    cs->state = CS_INIT;
  315|  9.47k|    return cs;
  316|  9.47k|}
zxc_cstream_free:
  385|  9.47k|void zxc_cstream_free(zxc_cstream* cs) {
  386|  9.47k|    if (!cs) return;
  ------------------
  |  Branch (386:9): [True: 0, False: 9.47k]
  ------------------
  387|  9.47k|    ZXC_FREE(cs->pending);
  ------------------
  |  |   86|  9.47k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  388|  9.47k|    ZXC_FREE(cs->in_block);
  ------------------
  |  |   86|  9.47k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  389|  9.47k|    zxc_free_cctx(cs->cctx);
  390|  9.47k|    ZXC_FREE(cs);
  ------------------
  |  |   86|  9.47k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  391|  9.47k|}
zxc_cstream_compress:
  424|  52.3M|int64_t zxc_cstream_compress(zxc_cstream* cs, zxc_outbuf_t* out, zxc_inbuf_t* in) {
  425|  52.3M|    if (UNLIKELY(!cs || !out || !in || in->pos > in->size || out->pos > out->size ||
  ------------------
  |  |  154|   942M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 52.3M]
  |  |  |  Branch (154:42): [True: 0, False: 52.3M]
  |  |  |  Branch (154:42): [True: 0, False: 52.3M]
  |  |  |  Branch (154:42): [True: 0, False: 52.3M]
  |  |  |  Branch (154:42): [True: 0, False: 52.3M]
  |  |  |  Branch (154:42): [True: 0, False: 52.3M]
  |  |  |  Branch (154:42): [True: 52.3M, False: 41.4k]
  |  |  |  Branch (154:42): [True: 0, False: 52.3M]
  |  |  |  Branch (154:42): [True: 52.3M, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 52.3M]
  |  |  |  Branch (154:42): [True: 0, False: 52.3M]
  |  |  ------------------
  ------------------
  426|  52.3M|                 (in->size > in->pos && !in->src) || (out->size > out->pos && !out->dst) ||
  427|  52.3M|                 cs->state == CS_DONE)) {
  428|      0|        return ZXC_ERROR_NULL_INPUT;
  429|      0|    }
  430|  52.3M|    if (UNLIKELY(cs->state == CS_ERRORED)) return cs->error_code;
  ------------------
  |  |  154|  52.3M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 52.3M]
  |  |  ------------------
  ------------------
  431|       |
  432|  52.3M|    for (;;) {
  433|  52.3M|        switch (cs->state) {
  ------------------
  |  Branch (433:17): [True: 52.3M, False: 0]
  ------------------
  434|  9.47k|            case CS_INIT: {
  ------------------
  |  Branch (434:13): [True: 9.47k, False: 52.3M]
  ------------------
  435|  9.47k|                const int rc = cs_stage_file_header(cs);
  436|  9.47k|                if (UNLIKELY(rc < 0)) return cs_set_error(cs, rc);  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  437|  9.47k|                cs->state = CS_DRAIN_HEADER;
  438|  9.47k|                break;
  439|  9.47k|            }
  440|       |
  441|  9.47k|            case CS_DRAIN_HEADER:
  ------------------
  |  Branch (441:13): [True: 9.47k, False: 52.3M]
  ------------------
  442|   213k|            case CS_DRAIN_BLOCK: {
  ------------------
  |  Branch (442:13): [True: 204k, False: 52.1M]
  ------------------
  443|   213k|                if (!cs_drain_pending(cs, out)) return (int64_t)(cs->pending_len - cs->pending_pos);
  ------------------
  |  Branch (443:21): [True: 203k, False: 9.65k]
  ------------------
  444|  9.65k|                cs->state = CS_ACCUMULATE;
  445|  9.65k|                break;
  446|   213k|            }
  447|       |
  448|  52.1M|            case CS_ACCUMULATE: {
  ------------------
  |  Branch (448:13): [True: 52.1M, False: 223k]
  ------------------
  449|  52.1M|                const size_t avail_in = in->size - in->pos;
  450|  52.1M|                if (cs->in_used == 0 && avail_in >= cs->block_size) {
  ------------------
  |  Branch (450:21): [True: 9.68k, False: 52.1M]
  |  Branch (450:41): [True: 0, False: 9.68k]
  ------------------
  451|      0|                    const int rc = cs_compress_block_from(cs, (const uint8_t*)in->src + in->pos,
  452|      0|                                                          cs->block_size);
  453|      0|                    if (UNLIKELY(rc < 0)) return cs_set_error(cs, rc);  // LCOV_EXCL_LINE
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  454|      0|                    in->pos += cs->block_size;
  455|      0|                    cs->state = CS_DRAIN_BLOCK;
  456|      0|                    break;
  457|      0|                }
  458|       |
  459|  52.1M|                const size_t room = cs->block_size - cs->in_used;
  460|  52.1M|                const size_t n = avail_in < room ? avail_in : room;
  ------------------
  |  Branch (460:34): [True: 52.1M, False: 181]
  ------------------
  461|  52.1M|                if (n) {
  ------------------
  |  Branch (461:21): [True: 52.1M, False: 46]
  ------------------
  462|  52.1M|                    ZXC_MEMCPY(cs->in_block + cs->in_used, (const uint8_t*)in->src + in->pos, n);
  ------------------
  |  |  170|  52.1M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  463|  52.1M|                    in->pos += n;
  464|  52.1M|                    cs->in_used += n;
  465|  52.1M|                }
  466|       |
  467|  52.1M|                if (cs->in_used == cs->block_size) {
  ------------------
  |  Branch (467:21): [True: 181, False: 52.1M]
  ------------------
  468|    181|                    const int rc = cs_compress_one_block(cs);
  469|    181|                    if (UNLIKELY(rc < 0)) return cs_set_error(cs, rc);  // LCOV_EXCL_LINE
  ------------------
  |  |  154|    181|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 181]
  |  |  ------------------
  ------------------
  470|    181|                    cs->state = CS_DRAIN_BLOCK;
  471|    181|                    break;
  472|    181|                }
  473|       |                // Block not yet full either in is empty or we made no progress.
  474|  52.1M|                return 0;
  475|  52.1M|            }
  476|       |
  477|      0|            case CS_DRAIN_LAST:
  ------------------
  |  Branch (477:13): [True: 0, False: 52.3M]
  ------------------
  478|      0|            case CS_DRAIN_EOF:
  ------------------
  |  Branch (478:13): [True: 0, False: 52.3M]
  ------------------
  479|      0|            case CS_DRAIN_FOOTER:
  ------------------
  |  Branch (479:13): [True: 0, False: 52.3M]
  ------------------
  480|      0|            case CS_DONE:
  ------------------
  |  Branch (480:13): [True: 0, False: 52.3M]
  ------------------
  481|      0|            case CS_ERRORED:
  ------------------
  |  Branch (481:13): [True: 0, False: 52.3M]
  ------------------
  482|       |                // These states are owned by _end().
  483|      0|                return ZXC_ERROR_NULL_INPUT;
  484|  52.3M|        }
  485|  52.3M|    }
  486|  52.3M|}
zxc_cstream_end:
  497|   453k|int64_t zxc_cstream_end(zxc_cstream* cs, zxc_outbuf_t* out) {
  498|   453k|    if (UNLIKELY(!cs || !out || cs->state == CS_DONE)) return ZXC_ERROR_NULL_INPUT;
  ------------------
  |  |  154|  1.81M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 453k]
  |  |  |  Branch (154:42): [True: 0, False: 453k]
  |  |  |  Branch (154:42): [True: 0, False: 453k]
  |  |  |  Branch (154:42): [True: 0, False: 453k]
  |  |  ------------------
  ------------------
  499|   453k|    if (UNLIKELY(cs->state == CS_ERRORED)) return cs->error_code;
  ------------------
  |  |  154|   453k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 453k]
  |  |  ------------------
  ------------------
  500|       |
  501|   482k|    for (;;) {
  502|   482k|        switch (cs->state) {
  ------------------
  |  Branch (502:17): [True: 482k, False: 0]
  ------------------
  503|      0|            case CS_INIT: {
  ------------------
  |  Branch (503:13): [True: 0, False: 482k]
  ------------------
  504|       |                // _end before any input, still need to emit file header.
  505|      0|                const int rc = cs_stage_file_header(cs);
  506|      0|                if (UNLIKELY(rc < 0)) return cs_set_error(cs, rc);  // LCOV_EXCL_LINE
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  507|      0|                cs->state = CS_DRAIN_HEADER;
  508|      0|                break;
  509|      0|            }
  510|       |
  511|      0|            case CS_DRAIN_HEADER:
  ------------------
  |  Branch (511:13): [True: 0, False: 482k]
  ------------------
  512|      0|            case CS_DRAIN_BLOCK: {
  ------------------
  |  Branch (512:13): [True: 0, False: 482k]
  ------------------
  513|      0|                if (!cs_drain_pending(cs, out)) return (int64_t)(cs->pending_len - cs->pending_pos);
  ------------------
  |  Branch (513:21): [True: 0, False: 0]
  ------------------
  514|      0|                cs->state = CS_ACCUMULATE;
  515|      0|                break;
  516|      0|            }
  517|       |
  518|  9.47k|            case CS_ACCUMULATE: {
  ------------------
  |  Branch (518:13): [True: 9.47k, False: 472k]
  ------------------
  519|       |                // Compress the residual partial block (if any), then EOF + footer.
  520|  9.47k|                if (cs->in_used > 0) {
  ------------------
  |  Branch (520:21): [True: 9.46k, False: 11]
  ------------------
  521|  9.46k|                    const int rc = cs_compress_one_block(cs);
  522|  9.46k|                    if (UNLIKELY(rc < 0)) return cs_set_error(cs, rc);  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  9.46k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.46k]
  |  |  ------------------
  ------------------
  523|  9.46k|                    cs->state = CS_DRAIN_LAST;
  524|  9.46k|                    break;
  525|  9.46k|                }
  526|       |                // No residual data: go straight to EOF.
  527|     11|                {
  528|     11|                    const int rc = cs_stage_eof(cs);
  529|     11|                    if (UNLIKELY(rc < 0)) return cs_set_error(cs, rc);  // LCOV_EXCL_LINE
  ------------------
  |  |  154|     11|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 11]
  |  |  ------------------
  ------------------
  530|     11|                    cs->state = CS_DRAIN_EOF;
  531|     11|                    break;
  532|     11|                }
  533|     11|            }
  534|       |
  535|   453k|            case CS_DRAIN_LAST: {
  ------------------
  |  Branch (535:13): [True: 453k, False: 28.8k]
  ------------------
  536|   453k|                if (!cs_drain_pending(cs, out)) return (int64_t)(cs->pending_len - cs->pending_pos);
  ------------------
  |  Branch (536:21): [True: 443k, False: 9.46k]
  ------------------
  537|       |                // After last data block -> EOF.
  538|  9.46k|                const int rc = cs_stage_eof(cs);
  539|  9.46k|                if (UNLIKELY(rc < 0)) return cs_set_error(cs, rc);  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  9.46k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.46k]
  |  |  ------------------
  ------------------
  540|  9.46k|                cs->state = CS_DRAIN_EOF;
  541|  9.46k|                break;
  542|  9.46k|            }
  543|       |
  544|  9.71k|            case CS_DRAIN_EOF: {
  ------------------
  |  Branch (544:13): [True: 9.71k, False: 472k]
  ------------------
  545|  9.71k|                if (!cs_drain_pending(cs, out)) return (int64_t)(cs->pending_len - cs->pending_pos);
  ------------------
  |  Branch (545:21): [True: 238, False: 9.47k]
  ------------------
  546|  9.47k|                const int rc = cs_stage_footer(cs);
  547|  9.47k|                if (UNLIKELY(rc < 0)) return cs_set_error(cs, rc);  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  548|  9.47k|                cs->state = CS_DRAIN_FOOTER;
  549|  9.47k|                break;
  550|  9.47k|            }
  551|       |
  552|  9.68k|            case CS_DRAIN_FOOTER: {
  ------------------
  |  Branch (552:13): [True: 9.68k, False: 472k]
  ------------------
  553|  9.68k|                if (!cs_drain_pending(cs, out)) return (int64_t)(cs->pending_len - cs->pending_pos);
  ------------------
  |  Branch (553:21): [True: 210, False: 9.47k]
  ------------------
  554|  9.47k|                cs->state = CS_DONE;
  555|  9.47k|                return 0;
  556|  9.68k|            }
  557|       |
  558|      0|            case CS_DONE:
  ------------------
  |  Branch (558:13): [True: 0, False: 482k]
  ------------------
  559|      0|            case CS_ERRORED:
  ------------------
  |  Branch (559:13): [True: 0, False: 482k]
  ------------------
  560|      0|                return cs->state == CS_ERRORED ? cs->error_code : 0;  // LCOV_EXCL_LINE
  ------------------
  |  Branch (560:24): [True: 0, False: 0]
  ------------------
  561|   482k|        }
  562|   482k|    }
  563|   453k|}
zxc_dstream_create:
  799|  18.9k|zxc_dstream* zxc_dstream_create(const zxc_dctx* cfg) {
  800|  18.9k|    zxc_dstream* ds = (zxc_dstream*)ZXC_CALLOC(1, sizeof(*ds));
  ------------------
  |  |   74|  18.9k|#define ZXC_CALLOC(nmemb, size) calloc(nmemb, size)
  ------------------
  801|  18.9k|    if (UNLIKELY(!ds)) return NULL;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  18.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.9k]
  |  |  ------------------
  ------------------
  802|  18.9k|    if (cfg) ds->opts = *zxc_dctx_params(cfg);
  ------------------
  |  Branch (802:9): [True: 18.9k, False: 0]
  ------------------
  803|  18.9k|    if (UNLIKELY(ds->opts.dict || ds->opts.dict_size || ds->opts.dict_huf)) {
  ------------------
  |  |  154|  75.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.9k]
  |  |  |  Branch (154:42): [True: 0, False: 18.9k]
  |  |  |  Branch (154:42): [True: 0, False: 18.9k]
  |  |  |  Branch (154:42): [True: 0, False: 18.9k]
  |  |  ------------------
  ------------------
  804|      0|        ZXC_FREE(ds);
  ------------------
  |  |   86|      0|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  805|      0|        return NULL;
  806|      0|    }
  807|  18.9k|    ds->opts.n_threads = 0;
  808|  18.9k|    ds->opts.progress_cb = NULL;
  809|       |    ds->opts.user_data = NULL;
  810|  18.9k|    ds_start_frame(ds);
  811|  18.9k|    return ds;
  812|  18.9k|}
zxc_dstream_free:
  819|  18.9k|void zxc_dstream_free(zxc_dstream* ds) {
  820|  18.9k|    if (UNLIKELY(!ds)) return;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  18.9k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 18.9k]
  |  |  ------------------
  ------------------
  821|  18.9k|    ds_free_buffers(ds);
  822|  18.9k|    ZXC_FREE(ds);
  ------------------
  |  |   86|  18.9k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  823|  18.9k|}
zxc_dstream_finished:
  828|  8.49k|int zxc_dstream_finished(const zxc_dstream* ds) { return (ds && ds->state == DS_DONE) ? 1 : 0; }
  ------------------
  |  Branch (828:59): [True: 8.49k, False: 0]
  |  Branch (828:65): [True: 8.49k, False: 0]
  ------------------
zxc_dstream_decompress:
 1011|  27.9M|int64_t zxc_dstream_decompress(zxc_dstream* ds, zxc_outbuf_t* out, zxc_inbuf_t* in) {
 1012|  27.9M|    if (UNLIKELY(!ds || !out || !in || in->pos > in->size || out->pos > out->size ||
  ------------------
  |  |  154|   447M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 27.9M]
  |  |  |  Branch (154:42): [True: 0, False: 27.9M]
  |  |  |  Branch (154:42): [True: 0, False: 27.9M]
  |  |  |  Branch (154:42): [True: 0, False: 27.9M]
  |  |  |  Branch (154:42): [True: 0, False: 27.9M]
  |  |  |  Branch (154:42): [True: 0, False: 27.9M]
  |  |  |  Branch (154:42): [True: 27.9M, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 27.9M]
  |  |  |  Branch (154:42): [True: 27.9M, False: 0]
  |  |  |  Branch (154:42): [True: 0, False: 27.9M]
  |  |  ------------------
  ------------------
 1013|  27.9M|                 (in->size > in->pos && !in->src) || (out->size > out->pos && !out->dst))) {
 1014|      0|        return ZXC_ERROR_NULL_INPUT;
 1015|      0|    }
 1016|  27.9M|    if (UNLIKELY(ds->state == DS_ERRORED)) return ds->error_code;
  ------------------
  |  |  154|  27.9M|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 27.9M]
  |  |  ------------------
  ------------------
 1017|  27.9M|    if (ds->state == DS_DONE) {
  ------------------
  |  Branch (1017:9): [True: 615, False: 27.9M]
  ------------------
 1018|    615|        if (in->pos == in->size) return 0;
  ------------------
  |  Branch (1018:13): [True: 0, False: 615]
  ------------------
 1019|    615|        ds_start_frame(ds);  // concatenated archives: what follows is another frame
 1020|    615|    }
 1021|       |
 1022|  27.9M|    size_t produced = 0;
 1023|       |
 1024|  28.0M|    for (;;) {
 1025|  28.0M|        switch (ds->state) {
  ------------------
  |  Branch (1025:17): [True: 28.0M, False: 0]
  ------------------
 1026|  72.1k|            case DS_NEED_FILE_HEADER: {
  ------------------
  |  Branch (1026:13): [True: 72.1k, False: 28.0M]
  ------------------
 1027|  72.1k|                const int rc = ds_handle_need_file_header(ds, in);
 1028|  72.1k|                if (rc == 1) return (int64_t)produced;
  ------------------
  |  Branch (1028:21): [True: 52.7k, False: 19.4k]
  ------------------
 1029|  19.4k|                if (rc < 0) return rc;
  ------------------
  |  Branch (1029:21): [True: 3.21k, False: 16.2k]
  ------------------
 1030|  16.2k|                break;
 1031|  19.4k|            }
 1032|       |
 1033|  53.3k|            case DS_NEED_BLOCK_HEADER: {
  ------------------
  |  Branch (1033:13): [True: 53.3k, False: 28.0M]
  ------------------
 1034|  53.3k|                const int rc = ds_handle_need_block_header(ds, in);
 1035|  53.3k|                if (rc == 1) return (int64_t)produced;
  ------------------
  |  Branch (1035:21): [True: 25.9k, False: 27.4k]
  ------------------
 1036|  27.4k|                if (rc < 0) return rc;
  ------------------
  |  Branch (1036:21): [True: 264, False: 27.1k]
  ------------------
 1037|  27.1k|                break;
 1038|  27.4k|            }
 1039|       |
 1040|  26.5M|            case DS_NEED_BLOCK_PAYLOAD: {
  ------------------
  |  Branch (1040:13): [True: 26.5M, False: 1.49M]
  ------------------
 1041|  26.5M|                if (!ds_pull(ds->payload, &ds->payload_used, ds->payload_need, in))
  ------------------
  |  Branch (1041:21): [True: 26.5M, False: 17.7k]
  ------------------
 1042|  26.5M|                    return (int64_t)produced;
 1043|  17.7k|                ds->frame_in += ds->payload_need - ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  17.7k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1044|  17.7k|                ds->state = DS_DECODE_BLOCK;
 1045|  17.7k|                break;
 1046|  26.5M|            }
 1047|       |
 1048|  17.7k|            case DS_DECODE_BLOCK: {
  ------------------
  |  Branch (1048:13): [True: 17.7k, False: 28.0M]
  ------------------
 1049|  17.7k|                const int direct = (out->size - out->pos) >= ds->decoded_cap;
 1050|  17.7k|                uint8_t* const ddst = direct ? (uint8_t*)out->dst + out->pos : ds->decoded;
  ------------------
  |  Branch (1050:39): [True: 0, False: 17.7k]
  ------------------
 1051|  17.7k|                const int dsz =
 1052|  17.7k|                    zxc_decompress_chunk_wrapper(&ds->inner, ds->payload, ds->payload_used, ddst,
 1053|  17.7k|                                                 ds->decoded_cap, ds->block_index);
 1054|  17.7k|                if (UNLIKELY(dsz < 0)) return ds_set_error(ds, dsz);
  ------------------
  |  |  154|  17.7k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 4.88k, False: 12.8k]
  |  |  ------------------
  ------------------
 1055|  12.8k|                ds->block_index++;
 1056|       |                // Folded only when DS_VALIDATE_FOOTER will compare it.
 1057|  12.8k|                if (ds->file_has_checksum && ds->opts.checksum_enabled)
  ------------------
  |  Branch (1057:21): [True: 1.39k, False: 11.4k]
  |  Branch (1057:46): [True: 1.39k, False: 0]
  ------------------
 1058|  1.39k|                    ds->digest = zxc_digest_combine(
 1059|  1.39k|                        ds->digest,
 1060|  1.39k|                        zxc_le32(ds->payload + ds->payload_used - ZXC_BLOCK_CHECKSUM_SIZE));
  ------------------
  |  |  430|  1.39k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
 1061|       |
 1062|  12.8k|                if (direct) {
  ------------------
  |  Branch (1062:21): [True: 0, False: 12.8k]
  ------------------
 1063|      0|                    out->pos += (size_t)dsz;
 1064|      0|                    produced += (size_t)dsz;
 1065|      0|                    ds->total_out += (uint64_t)dsz;
 1066|      0|                    ds->decoded_size = 0;
 1067|      0|                    ds->decoded_pos = 0;
 1068|      0|                    ds->state = DS_NEED_BLOCK_HEADER;
 1069|      0|                    ds->scratch_used = 0;
 1070|      0|                    ds->scratch_need = ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|      0|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1071|      0|                    break;
 1072|      0|                }
 1073|       |
 1074|  12.8k|                ds->decoded_size = (size_t)dsz;
 1075|  12.8k|                ds->decoded_pos = 0;
 1076|  12.8k|                ds->state = DS_EMIT_DECODED;
 1077|  12.8k|                break;
 1078|  12.8k|            }
 1079|       |
 1080|  1.33M|            case DS_EMIT_DECODED: {
  ------------------
  |  Branch (1080:13): [True: 1.33M, False: 26.7M]
  ------------------
 1081|  1.33M|                const int done = ds_drain_decoded(ds, out, &produced);
 1082|  1.33M|                if (!done) return (int64_t)produced;
  ------------------
  |  Branch (1082:21): [True: 1.32M, False: 12.4k]
  ------------------
 1083|  12.4k|                ds->state = DS_NEED_BLOCK_HEADER;
 1084|  12.4k|                ds->scratch_used = 0;
 1085|  12.4k|                ds->scratch_need = ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  12.4k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1086|  12.4k|                break;
 1087|  1.33M|            }
 1088|       |
 1089|      0|            case DS_NEED_SEK_HEADER: {
  ------------------
  |  Branch (1089:13): [True: 0, False: 28.0M]
  ------------------
 1090|       |                // Checked as bytes arrive: a wrong header fails without waiting.
 1091|      0|                const int full = ds_pull(ds->scratch, &ds->scratch_used, ds->scratch_need, in);
 1092|      0|                const int rc = zxc_check_seek_header(ds->scratch, ds->scratch_used, ds->total_out,
 1093|      0|                                                     ds->block_size, &ds->sek_remaining);
 1094|      0|                if (UNLIKELY(rc == ZXC_ERROR_CORRUPT_DATA)) return ds_set_error(ds, rc);
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1095|      0|                if (!full) return (int64_t)produced;
  ------------------
  |  Branch (1095:21): [True: 0, False: 0]
  ------------------
 1096|      0|                ds->frame_in += ZXC_BLOCK_HEADER_SIZE + ds->sek_remaining;
  ------------------
  |  |  428|      0|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
 1097|      0|                ds->state = DS_DRAIN_SEK_PAYLOAD;
 1098|      0|                break;
 1099|      0|            }
 1100|       |
 1101|      0|            case DS_DRAIN_SEK_PAYLOAD: {
  ------------------
  |  Branch (1101:13): [True: 0, False: 28.0M]
  ------------------
 1102|      0|                const size_t avail = in->size - in->pos;
 1103|      0|                const size_t n =
 1104|      0|                    (uint64_t)avail < ds->sek_remaining ? avail : (size_t)ds->sek_remaining;
  ------------------
  |  Branch (1104:21): [True: 0, False: 0]
  ------------------
 1105|      0|                in->pos += n;
 1106|      0|                ds->sek_remaining -= n;
 1107|      0|                if (ds->sek_remaining > 0) return (int64_t)produced;
  ------------------
  |  Branch (1107:21): [True: 0, False: 0]
  ------------------
 1108|      0|                ds->state = DS_NEED_FOOTER;
 1109|      0|                ds->scratch_used = 0;
 1110|      0|                ds->scratch_need =
 1111|      0|                    zxc_footer_layout(ds->frame_in, ds->total_out, ds->file_has_checksum).len;
 1112|      0|                break;
 1113|      0|            }
 1114|       |
 1115|  10.2k|            case DS_NEED_FOOTER: {
  ------------------
  |  Branch (1115:13): [True: 10.2k, False: 28.0M]
  ------------------
 1116|       |                // Checked as bytes arrive, like the SEK header.
 1117|  10.2k|                const int full = ds_pull(ds->scratch, &ds->scratch_used, ds->scratch_need, in);
 1118|  10.2k|                const zxc_footer_layout_t fl =
 1119|  10.2k|                    zxc_footer_layout(ds->frame_in, ds->total_out, ds->file_has_checksum);
 1120|  10.2k|                const int rc =
 1121|  10.2k|                    zxc_check_file_footer(ds->scratch, ds->scratch_used, &fl, ds->total_out, NULL);
 1122|  10.2k|                if (UNLIKELY(rc == ZXC_ERROR_CORRUPT_DATA)) return ds_set_error(ds, rc);
  ------------------
  |  |  154|  10.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 79, False: 10.2k]
  |  |  ------------------
  ------------------
 1123|  10.2k|                if (!full) return (int64_t)produced;
  ------------------
  |  Branch (1123:21): [True: 1.09k, False: 9.11k]
  ------------------
 1124|  9.11k|                ds->state = DS_VALIDATE_FOOTER;
 1125|  9.11k|                break;
 1126|  10.2k|            }
 1127|       |
 1128|  9.11k|            case DS_VALIDATE_FOOTER: {
  ------------------
  |  Branch (1128:13): [True: 9.11k, False: 28.0M]
  ------------------
 1129|  9.11k|                const uint64_t stored_digest = ds->file_has_checksum ? zxc_le64(ds->scratch) : 0;
  ------------------
  |  Branch (1129:48): [True: 854, False: 8.26k]
  ------------------
 1130|  9.11k|                if (ds->file_has_checksum && ds->opts.checksum_enabled &&
  ------------------
  |  Branch (1130:21): [True: 854, False: 8.26k]
  |  Branch (1130:46): [True: 854, False: 0]
  ------------------
 1131|    854|                    UNLIKELY(stored_digest != ds->digest))
  ------------------
  |  |  154|    854|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 854]
  |  |  ------------------
  ------------------
 1132|      0|                    return ds_set_error(ds, ZXC_ERROR_BAD_CHECKSUM);
 1133|       |                // The call ends with the frame, its output handed over before
 1134|       |                // anything that follows is looked at.
 1135|  9.11k|                ds->after_frame = 1;
 1136|  9.11k|                ds->state = DS_DONE;
 1137|  9.11k|                return (int64_t)produced;
 1138|  9.11k|            }
 1139|       |
 1140|      0|            case DS_DONE:
  ------------------
  |  Branch (1140:13): [True: 0, False: 28.0M]
  ------------------
 1141|      0|                return (int64_t)produced;  // LCOV_EXCL_LINE
 1142|       |
 1143|      0|            case DS_ERRORED:
  ------------------
  |  Branch (1143:13): [True: 0, False: 28.0M]
  ------------------
 1144|      0|                return ds->error_code;
 1145|  28.0M|        }
 1146|  28.0M|    }
 1147|  27.9M|}
zxc_pstream.c:cs_stage_file_header:
  324|  9.47k|static int cs_stage_file_header(zxc_cstream* cs) {
  325|  9.47k|    const int w = zxc_write_file_header(cs->pending, cs->pending_cap, cs->block_size,
  326|  9.47k|                                        cs->opts.checksum_enabled, 0, 0);
  327|  9.47k|    if (UNLIKELY(w < 0)) return w;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  328|  9.47k|    cs->pending_len = (size_t)w;
  329|  9.47k|    cs->pending_pos = 0;
  330|  9.47k|    cs->total_out = (uint64_t)w;
  331|  9.47k|    return ZXC_OK;
  332|  9.47k|}
zxc_pstream.c:cs_drain_pending:
  246|   686k|static int cs_drain_pending(zxc_cstream* cs, zxc_outbuf_t* out) {
  247|   686k|    zxc_outbuf_push(out, cs->pending, &cs->pending_pos, cs->pending_len);
  248|   686k|    return cs->pending_pos == cs->pending_len;
  249|   686k|}
zxc_pstream.c:zxc_outbuf_push:
  233|  2.01M|                              const size_t len) {
  234|  2.01M|    const size_t avail_out = out->size - out->pos;
  235|  2.01M|    const size_t avail_src = len - *pos;
  236|  2.01M|    const size_t n = avail_out < avail_src ? avail_out : avail_src;
  ------------------
  |  Branch (236:22): [True: 1.96M, False: 50.4k]
  ------------------
  237|  2.01M|    if (n) {
  ------------------
  |  Branch (237:9): [True: 2.01M, False: 1.12k]
  ------------------
  238|  2.01M|        ZXC_MEMCPY((uint8_t*)out->dst + out->pos, src + *pos, n);
  ------------------
  |  |  170|  2.01M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  239|  2.01M|        out->pos += n;
  240|  2.01M|        *pos += n;
  241|  2.01M|    }
  242|  2.01M|    return n;
  243|  2.01M|}
zxc_pstream.c:cs_compress_block_from:
  181|  9.64k|static int cs_compress_block_from(zxc_cstream* cs, const uint8_t* RESTRICT src, const size_t len) {
  182|  9.64k|    const size_t bound = zxc_compress_block_bound(len);
  183|       |    // LCOV_EXCL_START
  184|  9.64k|    if (UNLIKELY(bound == 0)) return ZXC_ERROR_OVERFLOW;
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
  185|  9.64k|    if (UNLIKELY(bound > cs->pending_cap)) {
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 9.47k, False: 170]
  |  |  ------------------
  ------------------
  186|  9.47k|        uint8_t* nb = (uint8_t*)ZXC_REALLOC(cs->pending, bound);
  ------------------
  |  |   80|  9.47k|#define ZXC_REALLOC(ptr, size) realloc(ptr, size)
  ------------------
  187|  9.47k|        if (UNLIKELY(!nb)) return ZXC_ERROR_MEMORY;
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  188|  9.47k|        cs->pending = nb;
  189|  9.47k|        cs->pending_cap = bound;
  190|  9.47k|    }
  191|       |    // LCOV_EXCL_STOP
  192|  9.64k|    const int64_t csize = zxc_compress_block_at(cs->cctx, src, len, cs->pending, cs->pending_cap,
  193|  9.64k|                                                &cs->opts, cs->block_index);
  194|  9.64k|    if (UNLIKELY(csize < 0)) return (int)csize;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  9.64k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.64k]
  |  |  ------------------
  ------------------
  195|  9.64k|    cs->block_index++;
  196|       |
  197|  9.64k|    cs->pending_len = (size_t)csize;
  198|  9.64k|    cs->pending_pos = 0;
  199|  9.64k|    cs->total_in += len;
  200|  9.64k|    cs->total_out += (uint64_t)csize;
  201|  9.64k|    if (cs->opts.checksum_enabled && cs->pending_len >= ZXC_BLOCK_CHECKSUM_SIZE)
  ------------------
  |  |  430|  1.39k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
  |  Branch (201:9): [True: 1.39k, False: 8.24k]
  |  Branch (201:38): [True: 1.39k, False: 0]
  ------------------
  202|  1.39k|        cs->digest = zxc_digest_combine(
  203|  1.39k|            cs->digest, zxc_le32(cs->pending + cs->pending_len - ZXC_BLOCK_CHECKSUM_SIZE));
  ------------------
  |  |  430|  1.39k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
  204|  9.64k|    return ZXC_OK;
  205|  9.64k|}
zxc_pstream.c:cs_compress_one_block:
  220|  9.64k|static int cs_compress_one_block(zxc_cstream* cs) {
  221|  9.64k|    const int rc = cs_compress_block_from(cs, cs->in_block, cs->in_used);
  222|  9.64k|    if (LIKELY(rc == ZXC_OK)) cs->in_used = 0;
  ------------------
  |  |  148|  9.64k|#define LIKELY(x) (__builtin_expect(!!(x), 1))
  |  |  ------------------
  |  |  |  Branch (148:19): [True: 9.64k, False: 0]
  |  |  ------------------
  ------------------
  223|  9.64k|    return rc;
  224|  9.64k|}
zxc_pstream.c:cs_stage_eof:
  343|  9.47k|static int cs_stage_eof(zxc_cstream* cs) {
  344|       |    // LCOV_EXCL_START
  345|  9.47k|    if (UNLIKELY(ZXC_BLOCK_HEADER_SIZE > cs->pending_cap)) {
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  346|      0|        uint8_t* nb = (uint8_t*)ZXC_REALLOC(cs->pending, ZXC_BLOCK_HEADER_SIZE);
  ------------------
  |  |   80|      0|#define ZXC_REALLOC(ptr, size) realloc(ptr, size)
  ------------------
  347|      0|        if (UNLIKELY(!nb)) return ZXC_ERROR_MEMORY;
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  348|      0|        cs->pending = nb;
  349|      0|        cs->pending_cap = ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|      0|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  350|      0|    }
  351|       |    // LCOV_EXCL_STOP
  352|  9.47k|    const zxc_block_header_t eof = {
  353|  9.47k|        .block_type = (uint8_t)ZXC_BLOCK_EOF,
  354|  9.47k|        .block_flags = 0,
  355|  9.47k|        .reserved = 0,
  356|  9.47k|        .header_checksum = 0,
  357|  9.47k|        .comp_size = 0,
  358|  9.47k|    };
  359|  9.47k|    const int w = zxc_write_block_header(cs->pending, cs->pending_cap, &eof);
  360|  9.47k|    if (UNLIKELY(w < 0)) return w;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  361|  9.47k|    cs->pending_len = (size_t)w;
  362|  9.47k|    cs->pending_pos = 0;
  363|  9.47k|    cs->total_out += (uint64_t)w;
  364|  9.47k|    return ZXC_OK;
  365|  9.47k|}
zxc_pstream.c:cs_stage_footer:
  376|  9.47k|static int cs_stage_footer(zxc_cstream* cs) {
  377|  9.47k|    const int w = zxc_write_file_footer(cs->pending, cs->pending_cap, cs->total_out, cs->total_in,
  378|  9.47k|                                        cs->digest, cs->opts.checksum_enabled);
  379|  9.47k|    if (UNLIKELY(w < 0)) return w;  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  9.47k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 9.47k]
  |  |  ------------------
  ------------------
  380|  9.47k|    cs->pending_len = (size_t)w;
  381|  9.47k|    cs->pending_pos = 0;
  382|  9.47k|    return ZXC_OK;
  383|  9.47k|}
zxc_pstream.c:ds_start_frame:
  775|  19.5k|static void ds_start_frame(zxc_dstream* ds) {
  776|  19.5k|    ds->state = DS_NEED_FILE_HEADER;
  777|  19.5k|    ds->scratch_used = 0;
  778|  19.5k|    ds->scratch_need = ZXC_FILE_HEADER_SIZE;
  ------------------
  |  |  120|  19.5k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  779|  19.5k|    ds->payload_used = ds->payload_need = 0;
  780|  19.5k|    ds->decoded_size = ds->decoded_pos = 0;
  781|  19.5k|    ds->sek_remaining = 0;
  782|  19.5k|    ds->block_index = 0;
  783|  19.5k|    ds->total_out = 0;
  784|  19.5k|    ds->frame_in = 0;
  785|  19.5k|    ds->digest = 0;
  786|  19.5k|}
zxc_pstream.c:ds_free_buffers:
  763|  34.5k|static void ds_free_buffers(zxc_dstream* ds) {
  764|  34.5k|    ZXC_FREE(ds->payload);
  ------------------
  |  |   86|  34.5k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  765|  34.5k|    ZXC_FREE(ds->decoded);
  ------------------
  |  |   86|  34.5k|#define ZXC_FREE(ptr) free(ptr)
  ------------------
  766|  34.5k|    if (ds->inner_initialized) zxc_cctx_free(&ds->inner);
  ------------------
  |  Branch (766:9): [True: 15.6k, False: 18.9k]
  ------------------
  767|  34.5k|    ds->payload = NULL;
  768|       |    ds->decoded = NULL;
  769|  34.5k|    ds->payload_cap = ds->decoded_cap = 0;
  770|  34.5k|    ds->inner_initialized = 0;
  771|  34.5k|    ds->alloc_block_size = 0;
  772|  34.5k|}
zxc_pstream.c:ds_handle_need_file_header:
  879|  72.1k|static int ds_handle_need_file_header(zxc_dstream* ds, zxc_inbuf_t* in) {
  880|  72.1k|    const int full = ds_pull(ds->scratch, &ds->scratch_used, ds->scratch_need, in);
  881|       |    // After a frame, bytes that open no other are corrupt, checked as they arrive.
  882|  72.1k|    if (UNLIKELY(ds->after_frame && !zxc_magic_prefix_ok(ds->scratch, ds->scratch_used)))
  ------------------
  |  |  154|  77.0k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 20, False: 72.1k]
  |  |  |  Branch (154:42): [True: 4.91k, False: 67.2k]
  |  |  |  Branch (154:42): [True: 20, False: 4.89k]
  |  |  ------------------
  ------------------
  883|     20|        return ds_set_error(ds, ZXC_ERROR_CORRUPT_DATA);
  884|  72.1k|    if (!full) return 1;
  ------------------
  |  Branch (884:9): [True: 52.7k, False: 19.4k]
  ------------------
  885|       |
  886|  19.4k|    size_t bs = 0;
  887|  19.4k|    int has_csum = 0;
  888|  19.4k|    int has_seek = 0;
  889|  19.4k|    uint32_t dict_id = 0;
  890|  19.4k|    const int rc =
  891|  19.4k|        zxc_read_file_header(ds->scratch, ds->scratch_used, &bs, &has_csum, &dict_id, &has_seek);
  892|  19.4k|    if (UNLIKELY(rc != ZXC_OK)) return ds_set_error(ds, rc);  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  19.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 3.19k, False: 16.2k]
  |  |  ------------------
  ------------------
  893|       |    // Push streams take no dictionary yet, so an archive requiring one is refused.
  894|  16.2k|    if (UNLIKELY(dict_id != 0)) return ds_set_error(ds, ZXC_ERROR_DICT_REQUIRED);
  ------------------
  |  |  154|  16.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 16.2k]
  |  |  ------------------
  ------------------
  895|  16.2k|    ds->block_size = bs;
  896|  16.2k|    ds->file_has_checksum = has_csum;
  897|  16.2k|    ds->file_has_seek = has_seek;
  898|       |
  899|       |    // Payload + decoded buffers sized from block_size; a frame declaring the
  900|       |    // block size of the one before keeps them.
  901|  16.2k|    if (ds->alloc_block_size != ds->block_size) {
  ------------------
  |  Branch (901:9): [True: 15.6k, False: 564]
  ------------------
  902|  15.6k|        ds_free_buffers(ds);
  903|  15.6k|        const size_t pb = zxc_compress_block_bound(ds->block_size);
  904|       |        // LCOV_EXCL_START
  905|  15.6k|        if (UNLIKELY(pb == 0)) return ds_set_error(ds, ZXC_ERROR_OVERFLOW);
  ------------------
  |  |  154|  15.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 15.6k]
  |  |  ------------------
  ------------------
  906|       |        // LCOV_EXCL_STOP
  907|  15.6k|        ds->payload_cap = pb;
  908|  15.6k|        ds->payload = (uint8_t*)ZXC_MALLOC(ds->payload_cap);
  ------------------
  |  |   68|  15.6k|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  909|       |
  910|  15.6k|        ds->decoded_cap = ds->block_size + ZXC_DECOMPRESS_TAIL_PAD;
  ------------------
  |  |  361|  15.6k|#define ZXC_DECOMPRESS_TAIL_PAD (4 * ZXC_PAK_MAX_INLINE_OUT_PER_SEQ + ZXC_PAD_SIZE) /* 2084 */
  |  |  ------------------
  |  |  |  |  674|  15.6k|    ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  528|  15.6k|#define ZXC_SEQ_LL_MASK ((1U << ZXC_SEQ_LL_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  522|  15.6k|#define ZXC_SEQ_LL_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  530|  15.6k|#define ZXC_SEQ_ML_MASK ((1U << ZXC_SEQ_ML_BITS) - 1)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  524|  15.6k|#define ZXC_SEQ_ML_BITS 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |                   ((ZXC_SEQ_LL_MASK - 1U) + (ZXC_SEQ_ML_MASK - 1U) + ZXC_LZ_MIN_MATCH_LEN) /* 513 */
  |  |  |  |  ------------------
  |  |  |  |  |  |  575|  15.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 */
  |  |  ------------------
  |  |  |  |  331|  15.6k|#define ZXC_PAD_SIZE 32
  |  |  ------------------
  ------------------
  911|  15.6k|        ds->decoded = (uint8_t*)ZXC_MALLOC(ds->decoded_cap);
  ------------------
  |  |   68|  15.6k|#define ZXC_MALLOC(size) malloc(size)
  ------------------
  912|       |        // LCOV_EXCL_START
  913|  15.6k|        if (UNLIKELY(!ds->payload || !ds->decoded)) return ds_set_error(ds, ZXC_ERROR_MEMORY);
  ------------------
  |  |  154|  31.2k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 15.6k]
  |  |  |  Branch (154:42): [True: 0, False: 15.6k]
  |  |  |  Branch (154:42): [True: 0, False: 15.6k]
  |  |  ------------------
  ------------------
  914|  15.6k|        if (UNLIKELY(zxc_cctx_init(&ds->inner, ds->block_size, 0, 0, 0, 0) != ZXC_OK))
  ------------------
  |  |  154|  15.6k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 15.6k]
  |  |  ------------------
  ------------------
  915|      0|            return ds_set_error(ds, ZXC_ERROR_MEMORY);
  916|       |        // LCOV_EXCL_STOP
  917|  15.6k|        ds->inner_initialized = 1;
  918|  15.6k|        ds->alloc_block_size = ds->block_size;
  919|  15.6k|    }
  920|  16.2k|    ds->inner.checksum_enabled = ds->file_has_checksum && ds->opts.checksum_enabled;
  ------------------
  |  Branch (920:34): [True: 1.31k, False: 14.8k]
  |  Branch (920:59): [True: 1.31k, False: 0]
  ------------------
  921|       |
  922|  16.2k|    ds->frame_in = ZXC_FILE_HEADER_SIZE;
  ------------------
  |  |  120|  16.2k|#define ZXC_FILE_HEADER_SIZE 16
  ------------------
  923|  16.2k|    ds->state = DS_NEED_BLOCK_HEADER;
  924|  16.2k|    ds->scratch_used = 0;
  925|  16.2k|    ds->scratch_need = ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  16.2k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  926|  16.2k|    return 0;
  927|  16.2k|}
zxc_pstream.c:ds_handle_need_block_header:
  945|  53.3k|static int ds_handle_need_block_header(zxc_dstream* ds, zxc_inbuf_t* in) {
  946|  53.3k|    if (!ds_pull(ds->scratch, &ds->scratch_used, ds->scratch_need, in)) return 1;
  ------------------
  |  Branch (946:9): [True: 25.9k, False: 27.4k]
  ------------------
  947|       |
  948|  27.4k|    const int rc = zxc_read_block_header(ds->scratch, ds->scratch_used, &ds->cur_bh);
  949|  27.4k|    if (UNLIKELY(rc != ZXC_OK)) return ds_set_error(ds, rc);  // LCOV_EXCL_LINE
  ------------------
  |  |  154|  27.4k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 208, False: 27.2k]
  |  |  ------------------
  ------------------
  950|  27.2k|    ds->frame_in += ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  27.2k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  951|       |
  952|  27.2k|    if (ds->cur_bh.block_type == (uint8_t)ZXC_BLOCK_EOF) {
  ------------------
  |  Branch (952:9): [True: 9.34k, False: 17.8k]
  ------------------
  953|       |        // EOF block: one valid header, no payload, no checksum.
  954|  9.34k|        if (UNLIKELY(zxc_check_eof_header(ds->scratch) != ZXC_OK))
  ------------------
  |  |  154|  9.34k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 31, False: 9.31k]
  |  |  ------------------
  ------------------
  955|     31|            return ds_set_error(ds, ZXC_ERROR_BAD_HEADER);
  956|  9.31k|        ds->state = ds->file_has_seek ? DS_NEED_SEK_HEADER : DS_NEED_FOOTER;
  ------------------
  |  Branch (956:21): [True: 0, False: 9.31k]
  ------------------
  957|  9.31k|        ds->scratch_used = 0;
  958|  9.31k|        ds->scratch_need =
  959|  9.31k|            ds->file_has_seek
  ------------------
  |  Branch (959:13): [True: 0, False: 9.31k]
  ------------------
  960|  9.31k|                ? ZXC_BLOCK_HEADER_SIZE
  ------------------
  |  |  428|      0|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  961|  9.31k|                : zxc_footer_layout(ds->frame_in, ds->total_out, ds->file_has_checksum).len;
  962|  9.31k|        return 0;
  963|  9.34k|    }
  964|       |
  965|       |    // Data block: validate comp_size against the block_size negotiated in the file header.
  966|  17.8k|    if (UNLIKELY((uint64_t)ds->cur_bh.comp_size > (uint64_t)ds->block_size))
  ------------------
  |  |  154|  17.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 25, False: 17.8k]
  |  |  ------------------
  ------------------
  967|     25|        return ds_set_error(ds, ZXC_ERROR_BAD_BLOCK_SIZE);
  968|       |
  969|       |    // Read comp_size [+ ZXC_BLOCK_CHECKSUM_SIZE if file-level checksums].
  970|  17.8k|    const uint64_t need = (uint64_t)ds->cur_bh.comp_size +
  971|  17.8k|                          (ds->file_has_checksum ? (uint64_t)ZXC_BLOCK_CHECKSUM_SIZE : 0U);
  ------------------
  |  |  430|  1.39k|#define ZXC_BLOCK_CHECKSUM_SIZE 4
  ------------------
  |  Branch (971:28): [True: 1.39k, False: 16.4k]
  ------------------
  972|  17.8k|    if (UNLIKELY(need > ds->payload_cap)) return ds_set_error(ds, ZXC_ERROR_BAD_BLOCK_SIZE);
  ------------------
  |  |  154|  17.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 17.8k]
  |  |  ------------------
  ------------------
  973|       |
  974|       |    // Feed the full block (header + payload + opt csum) to zxc_decompress_block,
  975|       |    // so prefix with the 8-byte header we just parsed.
  976|  17.8k|    ZXC_MEMCPY(ds->payload, ds->scratch, ZXC_BLOCK_HEADER_SIZE);
  ------------------
  |  |  170|  17.8k|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  977|  17.8k|    ds->payload_used = ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  17.8k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  978|  17.8k|    ds->payload_need = (size_t)need + ZXC_BLOCK_HEADER_SIZE;
  ------------------
  |  |  428|  17.8k|#define ZXC_BLOCK_HEADER_SIZE 8
  ------------------
  979|       |    // LCOV_EXCL_START
  980|  17.8k|    if (UNLIKELY(ds->payload_need > ds->payload_cap)) {
  ------------------
  |  |  154|  17.8k|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 17.8k]
  |  |  ------------------
  ------------------
  981|       |        // grow
  982|      0|        uint8_t* nb = (uint8_t*)ZXC_REALLOC(ds->payload, ds->payload_need);
  ------------------
  |  |   80|      0|#define ZXC_REALLOC(ptr, size) realloc(ptr, size)
  ------------------
  983|      0|        if (UNLIKELY(!nb)) return ds_set_error(ds, ZXC_ERROR_MEMORY);
  ------------------
  |  |  154|      0|#define UNLIKELY(x) (__builtin_expect(!!(x), 0))
  |  |  ------------------
  |  |  |  Branch (154:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  984|      0|        ds->payload = nb;
  985|      0|        ds->payload_cap = ds->payload_need;
  986|      0|    }
  987|       |    // LCOV_EXCL_STOP
  988|  17.8k|    ds->state = DS_NEED_BLOCK_PAYLOAD;
  989|  17.8k|    return 0;
  990|  17.8k|}
zxc_pstream.c:ds_pull:
  750|  26.7M|                   zxc_inbuf_t* in) {
  751|  26.7M|    const size_t want = need - *used;
  752|  26.7M|    const size_t avail = in->size - in->pos;
  753|  26.7M|    const size_t n = want < avail ? want : avail;
  ------------------
  |  Branch (753:22): [True: 52.7k, False: 26.6M]
  ------------------
  754|  26.7M|    if (n) {
  ------------------
  |  Branch (754:9): [True: 26.7M, False: 6.76k]
  ------------------
  755|  26.7M|        ZXC_MEMCPY(dst + *used, (const uint8_t*)in->src + in->pos, n);
  ------------------
  |  |  170|  26.7M|#define ZXC_MEMCPY(dst, src, n) __builtin_memcpy(dst, src, n)
  ------------------
  756|  26.7M|        in->pos += n;
  757|  26.7M|        *used += n;
  758|  26.7M|    }
  759|  26.7M|    return *used == need;
  760|  26.7M|}
zxc_pstream.c:ds_set_error:
  736|  8.44k|static int ds_set_error(zxc_dstream* ds, const int code) {
  737|  8.44k|    ds->error_code = code;
  738|  8.44k|    ds->state = DS_ERRORED;
  739|  8.44k|    return code;
  740|  8.44k|}
zxc_pstream.c:ds_drain_decoded:
  856|  1.33M|static int ds_drain_decoded(zxc_dstream* ds, zxc_outbuf_t* out, size_t* produced) {
  857|  1.33M|    const size_t n = zxc_outbuf_push(out, ds->decoded, &ds->decoded_pos, ds->decoded_size);
  858|  1.33M|    ds->total_out += n;
  859|  1.33M|    if (produced) *produced += n;
  ------------------
  |  Branch (859:9): [True: 1.33M, False: 0]
  ------------------
  860|  1.33M|    return ds->decoded_pos == ds->decoded_size;
  861|  1.33M|}

LLVMFuzzerTestOneInput:
  110|  9.49k|int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
  111|  9.49k|    if (size < 3) return 0;
  ------------------
  |  Branch (111:9): [True: 2, False: 9.49k]
  ------------------
  112|       |
  113|       |    /* Save raw input for the parser-fuzzing phase. */
  114|  9.49k|    const uint8_t* const raw_data = data;
  115|  9.49k|    const size_t raw_size = size;
  116|       |
  117|       |    /* Header bytes drive pstream-specific axes. data[0] is reserved (the
  118|       |     * compression level is intentionally fixed to 1, see copts below); it
  119|       |     * is still consumed so corpus byte offsets stay stable. */
  120|  9.49k|    const int checksum_enabled = data[1] & 1;
  121|  9.49k|    const size_t in_chunk = derive_chunk_size(data[2]);
  122|  9.49k|    data += 3;
  123|  9.49k|    size -= 3;
  124|       |
  125|  9.49k|    if (size == 0 || size > FUZZ_PSTREAM_MAX_INPUT) return 0;
  ------------------
  |  |   42|  9.47k|#define FUZZ_PSTREAM_MAX_INPUT (2 << 20) /* 2 MiB */
  ------------------
  |  Branch (125:9): [True: 24, False: 9.47k]
  |  Branch (125:22): [True: 0, False: 9.47k]
  ------------------
  126|       |
  127|       |    /* Persistent buffers - reused across iterations to reduce allocator
  128|       |     * pressure (same pattern as fuzz_seekable.c). */
  129|  9.47k|    static uint8_t* comp_buf = NULL;
  130|  9.47k|    static size_t comp_cap = 0;
  131|  9.47k|    static uint8_t* round_buf = NULL;
  132|  9.47k|    static size_t round_cap = 0;
  133|       |
  134|       |    /* ------------------------------------------------------------------ */
  135|       |    /* Phase 1: Push compression in chunks                                */
  136|       |    /* ------------------------------------------------------------------ */
  137|       |    /* Level forced to 1: pstream's state-machine surface (framing, drain,
  138|       |     * resumption, sticky errors) is independent of compression strength,
  139|       |     * and buffer-API fuzzers (roundtrip, decompress) already exercise the
  140|       |     * level dimension. Cheaper compression = more iterations/sec. */
  141|  9.47k|    zxc_cctx* const copts = zxc_create_cctx();
  142|  9.47k|    if (!copts || zxc_cctx_set_param(copts, ZXC_C_LEVEL, 1) != ZXC_OK ||
  ------------------
  |  Branch (142:9): [True: 0, False: 9.47k]
  |  Branch (142:19): [True: 0, False: 9.47k]
  ------------------
  143|  9.47k|        zxc_cctx_set_param(copts, ZXC_C_CHECKSUM, checksum_enabled) != ZXC_OK) {
  ------------------
  |  Branch (143:9): [True: 0, False: 9.47k]
  ------------------
  144|      0|        zxc_free_cctx(copts);
  145|      0|        return 0;
  146|      0|    }
  147|  9.47k|    zxc_cstream* cs = zxc_cstream_create(copts);
  148|  9.47k|    zxc_free_cctx(copts);
  149|  9.47k|    if (!cs) return 0;
  ------------------
  |  Branch (149:9): [True: 0, False: 9.47k]
  ------------------
  150|       |
  151|       |    /* Sized so the compressor never runs out - bound is a safe upper limit. */
  152|  9.47k|    const size_t bound = zxc_compress_bound(size);
  153|  9.47k|    if (bound == 0) {
  ------------------
  |  Branch (153:9): [True: 0, False: 9.47k]
  ------------------
  154|      0|        zxc_cstream_free(cs);
  155|      0|        return 0;
  156|      0|    }
  157|  9.47k|    if (bound > comp_cap) {
  ------------------
  |  Branch (157:9): [True: 2.81k, False: 6.65k]
  ------------------
  158|  2.81k|        void* nb = realloc(comp_buf, bound);
  159|  2.81k|        if (!nb) {
  ------------------
  |  Branch (159:13): [True: 0, False: 2.81k]
  ------------------
  160|      0|            zxc_cstream_free(cs);
  161|      0|            return 0;
  162|      0|        }
  163|  2.81k|        comp_buf = (uint8_t*)nb;
  164|  2.81k|        comp_cap = bound;
  165|  2.81k|    }
  166|       |
  167|  9.47k|    size_t comp_len = 0;
  168|  9.47k|    size_t in_pos = 0;
  169|       |
  170|       |    /* Feed input in `in_chunk`-sized slices. */
  171|  52.1M|    while (in_pos < size) {
  ------------------
  |  Branch (171:12): [True: 52.1M, False: 9.47k]
  ------------------
  172|  52.1M|        const size_t feed = (size - in_pos < in_chunk) ? (size - in_pos) : in_chunk;
  ------------------
  |  Branch (172:29): [True: 8.74k, False: 52.1M]
  ------------------
  173|  52.1M|        zxc_inbuf_t in = {.src = data + in_pos, .size = feed, .pos = 0};
  174|       |
  175|       |        /* Drain repeatedly until this slice is fully consumed. */
  176|  52.3M|        for (;;) {
  177|  52.3M|            size_t window = bound - comp_len;
  178|  52.3M|            if (window > FUZZ_PSTREAM_OUT_CAP) window = FUZZ_PSTREAM_OUT_CAP;
  ------------------
  |  |   46|  52.3M|#define FUZZ_PSTREAM_OUT_CAP 256
  ------------------
                          if (window > FUZZ_PSTREAM_OUT_CAP) window = FUZZ_PSTREAM_OUT_CAP;
  ------------------
  |  |   46|  52.3M|#define FUZZ_PSTREAM_OUT_CAP 256
  ------------------
  |  Branch (178:17): [True: 52.3M, False: 12.5k]
  ------------------
  179|  52.3M|            if (window == 0) {
  ------------------
  |  Branch (179:17): [True: 0, False: 52.3M]
  ------------------
  180|       |                /* Bound exhausted - shouldn't happen with zxc_compress_bound. */
  181|      0|                zxc_cstream_free(cs);
  182|      0|                return 0;
  183|      0|            }
  184|  52.3M|            zxc_outbuf_t ob = {.dst = comp_buf + comp_len, .size = window, .pos = 0};
  185|  52.3M|            const int64_t r = zxc_cstream_compress(cs, &ob, &in);
  186|  52.3M|            if (r < 0) {
  ------------------
  |  Branch (186:17): [True: 0, False: 52.3M]
  ------------------
  187|      0|                zxc_cstream_free(cs);
  188|      0|                return 0;
  189|      0|            }
  190|  52.3M|            comp_len += ob.pos;
  191|  52.3M|            if (in.pos == in.size && r == 0) break;
  ------------------
  |  Branch (191:17): [True: 52.2M, False: 162k]
  |  Branch (191:38): [True: 52.1M, False: 41.4k]
  ------------------
  192|  52.3M|        }
  193|  52.1M|        in_pos += in.pos;
  194|  52.1M|    }
  195|       |
  196|       |    /* Finalize: zxc_cstream_end may report >0 pending bytes; drain until 0. */
  197|   453k|    for (;;) {
  198|   453k|        size_t window = bound - comp_len;
  199|   453k|        if (window > FUZZ_PSTREAM_OUT_CAP) window = FUZZ_PSTREAM_OUT_CAP;
  ------------------
  |  |   46|   453k|#define FUZZ_PSTREAM_OUT_CAP 256
  ------------------
                      if (window > FUZZ_PSTREAM_OUT_CAP) window = FUZZ_PSTREAM_OUT_CAP;
  ------------------
  |  |   46|   452k|#define FUZZ_PSTREAM_OUT_CAP 256
  ------------------
  |  Branch (199:13): [True: 452k, False: 1.63k]
  ------------------
  200|   453k|        if (window == 0) {
  ------------------
  |  Branch (200:13): [True: 0, False: 453k]
  ------------------
  201|      0|            zxc_cstream_free(cs);
  202|      0|            return 0;
  203|      0|        }
  204|   453k|        zxc_outbuf_t ob = {.dst = comp_buf + comp_len, .size = window, .pos = 0};
  205|   453k|        const int64_t pending = zxc_cstream_end(cs, &ob);
  206|   453k|        if (pending < 0) {
  ------------------
  |  Branch (206:13): [True: 0, False: 453k]
  ------------------
  207|      0|            zxc_cstream_free(cs);
  208|      0|            return 0;
  209|      0|        }
  210|   453k|        comp_len += ob.pos;
  211|   453k|        if (pending == 0) break;
  ------------------
  |  Branch (211:13): [True: 9.47k, False: 444k]
  ------------------
  212|   453k|    }
  213|       |
  214|  9.47k|    zxc_cstream_free(cs);
  215|       |
  216|       |    /* ------------------------------------------------------------------ */
  217|       |    /* Phase 2: Push decompression with chunked feeding + roundtrip       */
  218|       |    /* ------------------------------------------------------------------ */
  219|  9.47k|    if (size > round_cap) {
  ------------------
  |  Branch (219:9): [True: 2.81k, False: 6.65k]
  ------------------
  220|  2.81k|        void* nb = realloc(round_buf, size);
  221|  2.81k|        if (!nb) return 0;
  ------------------
  |  Branch (221:13): [True: 0, False: 2.81k]
  ------------------
  222|  2.81k|        round_buf = (uint8_t*)nb;
  223|  2.81k|        round_cap = size;
  224|  2.81k|    }
  225|       |
  226|  9.47k|    const int64_t dsize =
  227|  9.47k|        drip_decompress(comp_buf, comp_len, round_buf, size, in_chunk, checksum_enabled);
  228|  9.47k|    if (dsize >= 0) {
  ------------------
  |  Branch (228:9): [True: 9.47k, False: 0]
  ------------------
  229|  9.47k|        assert((size_t)dsize == size);
  ------------------
  |  Branch (229:9): [True: 0, False: 9.47k]
  |  Branch (229:9): [True: 9.47k, False: 0]
  ------------------
  230|  9.47k|        assert(memcmp(data, round_buf, size) == 0);
  ------------------
  |  Branch (230:9): [True: 0, False: 9.47k]
  |  Branch (230:9): [True: 9.47k, False: 0]
  ------------------
  231|  9.47k|    }
  232|       |
  233|       |    /* ------------------------------------------------------------------ */
  234|       |    /* Phase 3: Parser fuzzing - feed raw input directly                  */
  235|       |    /*                                                                    */
  236|       |    /* This is where malformed-frame and truncation bugs live.  We don't  */
  237|       |    /* care about the result, only that no UB / crash occurs.             */
  238|       |    /* ------------------------------------------------------------------ */
  239|  9.47k|    if (raw_size > 0) {
  ------------------
  |  Branch (239:9): [True: 9.47k, False: 0]
  ------------------
  240|       |        /* Output is discarded - a single small stack buffer suffices and
  241|       |         * keeps the parser's resumption code (small ob.size) under fuzz. */
  242|  9.47k|        uint8_t scratch[FUZZ_PSTREAM_OUT_CAP];
  243|  9.47k|        const size_t parser_chunk = derive_chunk_size(raw_data[raw_size - 1]);
  244|       |
  245|  9.47k|        zxc_dctx* const cfg = zxc_create_dctx();
  246|  9.47k|        zxc_dstream* ds = NULL;
  247|  9.47k|        if (cfg && zxc_dctx_set_param(cfg, ZXC_D_CHECKSUM, checksum_enabled) == 0) {
  ------------------
  |  Branch (247:13): [True: 9.47k, False: 0]
  |  Branch (247:20): [True: 9.47k, False: 0]
  ------------------
  248|  9.47k|            ds = zxc_dstream_create(cfg);
  249|  9.47k|        }
  250|  9.47k|        zxc_free_dctx(cfg);
  251|  9.47k|        if (ds) {
  ------------------
  |  Branch (251:13): [True: 9.47k, False: 0]
  ------------------
  252|  9.47k|            size_t pos = 0;
  253|  9.47k|            int rounds = 0;
  254|   744k|            while (pos < raw_size && rounds < 1024) {
  ------------------
  |  Branch (254:20): [True: 743k, False: 1.01k]
  |  Branch (254:38): [True: 743k, False: 10]
  ------------------
  255|   743k|                const size_t feed =
  256|   743k|                    (raw_size - pos < parser_chunk) ? (raw_size - pos) : parser_chunk;
  ------------------
  |  Branch (256:21): [True: 70.9k, False: 672k]
  ------------------
  257|   743k|                zxc_inbuf_t in = {.src = raw_data + pos, .size = feed, .pos = 0};
  258|   743k|                zxc_outbuf_t ob = {.dst = scratch, .size = sizeof scratch, .pos = 0};
  259|   743k|                const size_t before_in = in.pos;
  260|   743k|                const size_t before_out = ob.pos;
  261|   743k|                const int64_t r = zxc_dstream_decompress(ds, &ob, &in);
  262|   743k|                pos += in.pos;
  263|   743k|                if (r < 0) break;
  ------------------
  |  Branch (263:21): [True: 8.44k, False: 735k]
  ------------------
  264|   735k|                if (in.pos == before_in && ob.pos == before_out) break;
  ------------------
  |  Branch (264:21): [True: 97.5k, False: 637k]
  |  Branch (264:44): [True: 0, False: 97.5k]
  ------------------
  265|   735k|                rounds++;
  266|   735k|            }
  267|  9.47k|            zxc_dstream_free(ds);
  268|  9.47k|        }
  269|  9.47k|    }
  270|       |
  271|  9.47k|    return 0;
  272|  9.47k|}
fuzz_pstream.c:derive_chunk_size:
   48|  18.9k|static size_t derive_chunk_size(uint8_t b) {
   49|       |    /* Map [0..255] -> [1..512] with a non-linear distribution biased toward
   50|       |     * small values (small chunks stress the state machine the most). */
   51|  18.9k|    if (b == 0) return 1;
  ------------------
  |  Branch (51:9): [True: 2.93k, False: 16.0k]
  ------------------
   52|  16.0k|    if (b < 64) return (size_t)b;      /* 1..63 */
  ------------------
  |  Branch (52:9): [True: 3.24k, False: 12.7k]
  ------------------
   53|  12.7k|    if (b < 192) return (size_t)b * 2; /* 128..382 */
  ------------------
  |  Branch (53:9): [True: 9.03k, False: 3.75k]
  ------------------
   54|  3.75k|    return (size_t)b + 256;            /* 448..511 */
   55|  12.7k|}
fuzz_pstream.c:drip_decompress:
   66|  9.47k|                               size_t in_chunk, int checksum_enabled) {
   67|  9.47k|    zxc_dctx* const cfg = zxc_create_dctx();
   68|  9.47k|    if (!cfg || zxc_dctx_set_param(cfg, ZXC_D_CHECKSUM, checksum_enabled) != 0) {
  ------------------
  |  Branch (68:9): [True: 0, False: 9.47k]
  |  Branch (68:17): [True: 0, False: 9.47k]
  ------------------
   69|      0|        zxc_free_dctx(cfg);
   70|      0|        return -1;
   71|      0|    }
   72|  9.47k|    zxc_dstream* ds = zxc_dstream_create(cfg);
   73|  9.47k|    zxc_free_dctx(cfg);
   74|  9.47k|    if (!ds) return -1;
  ------------------
  |  Branch (74:9): [True: 0, False: 9.47k]
  ------------------
   75|       |
   76|  9.47k|    size_t in_pos = 0;
   77|  9.47k|    size_t out_total = 0;
   78|       |
   79|  27.2M|    while (in_pos < csize || !zxc_dstream_finished(ds)) {
  ------------------
  |  Branch (79:12): [True: 27.2M, False: 8.49k]
  |  Branch (79:30): [True: 0, False: 8.49k]
  ------------------
   80|  27.2M|        if (out_total >= out_cap) {
  ------------------
  |  Branch (80:13): [True: 976, False: 27.2M]
  ------------------
   81|       |            /* Caller's buffer full - stop without asserting. */
   82|    976|            zxc_dstream_free(ds);
   83|    976|            return (int64_t)out_total;
   84|    976|        }
   85|  27.2M|        const size_t feed = (csize - in_pos < in_chunk) ? (csize - in_pos) : in_chunk;
  ------------------
  |  Branch (85:29): [True: 772k, False: 26.4M]
  ------------------
   86|  27.2M|        size_t window = out_cap - out_total;
   87|  27.2M|        if (window > FUZZ_PSTREAM_OUT_CAP) window = FUZZ_PSTREAM_OUT_CAP;
  ------------------
  |  |   46|  27.2M|#define FUZZ_PSTREAM_OUT_CAP 256
  ------------------
                      if (window > FUZZ_PSTREAM_OUT_CAP) window = FUZZ_PSTREAM_OUT_CAP;
  ------------------
  |  |   46|  27.2M|#define FUZZ_PSTREAM_OUT_CAP 256
  ------------------
  |  Branch (87:13): [True: 27.2M, False: 30.8k]
  ------------------
   88|  27.2M|        zxc_inbuf_t in = {.src = comp + in_pos, .size = feed, .pos = 0};
   89|  27.2M|        zxc_outbuf_t ob = {.dst = out + out_total, .size = window, .pos = 0};
   90|       |
   91|  27.2M|        const size_t before_in = in.pos;
   92|  27.2M|        const size_t before_out = ob.pos;
   93|  27.2M|        const int64_t r = zxc_dstream_decompress(ds, &ob, &in);
   94|  27.2M|        if (r < 0) {
  ------------------
  |  Branch (94:13): [True: 0, False: 27.2M]
  ------------------
   95|      0|            zxc_dstream_free(ds);
   96|      0|            return r;
   97|      0|        }
   98|       |
   99|  27.2M|        out_total += ob.pos;
  100|  27.2M|        in_pos += in.pos;
  101|       |
  102|       |        /* No progress and no more input: prevent infinite loop on truncation. */
  103|  27.2M|        if (in.pos == before_in && ob.pos == before_out && in_pos == csize) break;
  ------------------
  |  Branch (103:13): [True: 1.21M, False: 26.0M]
  |  Branch (103:36): [True: 0, False: 1.21M]
  |  Branch (103:60): [True: 0, False: 0]
  ------------------
  104|  27.2M|    }
  105|       |
  106|  8.49k|    zxc_dstream_free(ds);
  107|  8.49k|    return (int64_t)out_total;
  108|  9.47k|}

