Tom Duff was speeding up a real-time animation program at Lucasfilm that copied shorts into a hardware register and was running half as fast as it needed to. Unrolling the copy loop eight times was the obvious fix. The problem is the remainder: a count that is not a multiple of eight. Duff noticed that C's switch is only a computed jump, and that a do/while can begin in the middle of one.
The switch jumps into the body of the loop at exactly the right case to consume the remainder, then the loop takes over for the rest. Duff wrote that he felt "a combination of pride and revulsion" and that Dennis Ritchie had confirmed it was legal C. It is the clearest demonstration that C's control structures are thin paint over labels and gotos, and it still appears in textbooks as both a warning and a delight.