Edit the number, pick an operation, and step through it bit by bit. Lit cells are 1, dark cells are 0. Two's complement; bit 0 is on the right.
-x is computed mod 232 (two's complement).
The Kernighan popcount loop runs x &= x-1 once per set bit. See junior.md and professional.md
for proofs that x & (x-1) clears, and x & -x isolates, the lowest set bit.