>>352
int rot(int x) {
int tmp = x & (1 << 7);
x ^= tmp;
x <<= 1;
if (tmp) x |= 1; else x &= ~1;
return x;
}