-/* Returns the LZX position slot that corresponds to a given formatted offset.
- *
- * Logically, this returns the smallest i such that
- * formatted_offset >= lzx_position_base[i].
- *
- * The actual implementation below takes advantage of the regularity of the
- * numbers in the lzx_position_base array to calculate the slot directly from
- * the formatted offset without actually looking at the array.
- */
-static unsigned
-lzx_get_position_slot_raw(unsigned formatted_offset)
-{
-#if 0
- /*
- * Slots 36-49 (formatted_offset >= 262144) can be found by
- * (formatted_offset/131072) + 34 == (formatted_offset >> 17) + 34;
- * however, this check for formatted_offset >= 262144 is commented out
- * because WIM chunks cannot be that large.
- */
- if (formatted_offset >= 262144) {
- return (formatted_offset >> 17) + 34;
- } else
-#endif
- {
- /* Note: this part here only works if:
- *
- * 2 <= formatted_offset < 655360
- *
- * It is < 655360 because the frequency of the position bases
- * increases starting at the 655360 entry, and it is >= 2
- * because the below calculation fails if the most significant
- * bit is lower than the 2's place. */
- LZX_ASSERT(2 <= formatted_offset && formatted_offset < 655360);
- unsigned mssb_idx = bsr32(formatted_offset);
- return (mssb_idx << 1) |
- ((formatted_offset >> (mssb_idx - 1)) & 1);
- }
-}
-
-