#include int uint8_bottomzeros_num(uint8_t x) { int result = 0; int j; for (j = 0;j < 8;++j) { if (1 & (x >> j)) break; ++result; } return result; }