Btw, XOR swap...
probably slower than register-aliased swap, but it swaps two registers without using a third:
void swap(char *s, int a, int b)
{
s[b] ^= s[a];
s[a] ^= s[b];
s[b] ^= s[a];
}