#include #include "common.h" #include "counts.h" /* rotates left */ void rotate(char *base, size_t size, size_t shift) { size_t a = shift, b = size - shift; while (a && b) { if (a <= b) { swap(base, base + b, a); b -= a; } else { swap(base, base + a, b); base += b; a -= b; } } }