int inc(int x) { int m = 1; while(m) { x ^= m; m = (m & ~x) << 1; } return x; }