It's worth noting that modern x86 CPUs have specialized extensions for bit manipulation. Furthermore C23 added stdbit.h that has some operations for bit manipulation
https://en.wikipedia.org/wiki/X86_Bit_manipulation_instructi...
https://thephd.dev/_vendor/future_cxx/papers/C%20-%20Modern%...