static int reverseBits(int i) { int j = 0; repeat 32 { j = (j << 1) | (i & 1); i >>>= 1; } ret j; }