rotated = rotated or rotated # is this correct?
I doubt this is correct. For any `x`: expression `x or x` gives just `x`
(always), so this line is equivalent to
rotated = rotated
which is pointless and does nothing (unlike the original `rotated &= ~c;`).
