1 2 3 4 5 6
#include <stdio.h> /* rotates x to the right by n positions */ unsigned rightrot(unsigned x, int n) { return (x >> n) | (x << (32 - n)); }