/* Get the offset to the state for a specific hash function within the context structure. This shall be called only for the supported hash functions,  */
static size_t get_state_offset(int id)
/* Get the offset to the state for a specific hash function within the context structure. This shall be called only for the supported hash functions,  */
static size_t get_state_offset(int id)
{
	if (id >= 5) {
		return offsetof(br_multihash_context, val_64)
			+ ((size_t)(id - 5) * (8 * sizeof(uint64_t)));
	} else {
		unsigned x;
		x = id - 1;
		x = ((x + (x & (x >> 1))) << 2) + (x >> 1);
		return offsetof(br_multihash_context, val_32)
			+ x * sizeof(uint32_t);
	}
}