-#define SHL64(a,n) ((a)<<(n))
-#define SHR64(a,n) ((a)>>(n))
-#define ROTL64(a,n) (((a)<<(n))|((a)>>(64-(n))))
-#define ROTR64(a,n) (((a)>>(n))|((a)<<(64-(n))))
+#define SHL64(a,n) shiftl64(a,n)
+#define SHR64(a,n) shiftr64(a,n)
+#define ROTL64(a,n) rotl64(a,n)
+#define ROTR64(a,n) rotr64(a,n)
+static
+uint64_t rotl64(uint64_t a, uint8_t r){
+ return (a<<r)|(a>>(64-r));
+}
+
+static
+uint64_t rotr64(uint64_t a, uint8_t r){
+ return (a>>r)|(a<<(64-r));
+}
+
+static
+uint64_t shiftl64(uint64_t a, uint8_t r){
+ return (a<<r);
+}
+
+static
+uint64_t shiftr64(uint64_t a, uint8_t r){
+ return (a>>r);
+}
+
16LL*K, 17LL*K, 18LL*K, 19LL*K,
20LL*K, 21LL*K, 22LL*K, 23LL*K,
24LL*K, 25LL*K, 26LL*K, 27LL*K,
16LL*K, 17LL*K, 18LL*K, 19LL*K,
20LL*K, 21LL*K, 22LL*K, 23LL*K,
24LL*K, 25LL*K, 26LL*K, 27LL*K,
0x5555555555555550LL, 0x5aaaaaaaaaaaaaa5LL, 0x5ffffffffffffffaLL,
0x655555555555554fLL, 0x6aaaaaaaaaaaaaa4LL, 0x6ffffffffffffff9LL,
0x755555555555554eLL, 0x7aaaaaaaaaaaaaa3LL, 0x7ffffffffffffff8LL,
0x5555555555555550LL, 0x5aaaaaaaaaaaaaa5LL, 0x5ffffffffffffffaLL,
0x655555555555554fLL, 0x6aaaaaaaaaaaaaa4LL, 0x6ffffffffffffff9LL,
0x755555555555554eLL, 0x7aaaaaaaaaaaaaa3LL, 0x7ffffffffffffff8LL,
-static uint16_t hack_table[5] PROGMEM = { 0x0311, 0xDDB3, 0x2A79, 0x07AA, 0x51C2 };
-static uint8_t offset_table[5] PROGMEM = { 4+16, 6+16, 9+16, 12+16, 13+16 };
+static const uint16_t hack_table[5] PROGMEM = { 0x0311, 0xDDB3, 0x2A79, 0x07AA, 0x51C2 };
+static const uint8_t offset_table[5] PROGMEM = { 4+16, 6+16, 9+16, 12+16, 13+16 };
5<<1, ( 7<<1)+1, (10<<1)+0, (13<<1)+0, (14<<1)+0,
6<<1, ( 8<<1)+1, (11<<1)+0, (14<<1)+0, (15<<1)+1,
0<<1, ( 7<<1)+0, ( 9<<1)+0, (12<<1)+1, (15<<1)+0,
5<<1, ( 7<<1)+1, (10<<1)+0, (13<<1)+0, (14<<1)+0,
6<<1, ( 8<<1)+1, (11<<1)+0, (14<<1)+0, (15<<1)+1,
0<<1, ( 7<<1)+0, ( 9<<1)+0, (12<<1)+1, (15<<1)+0,