This is some frackin' dark #compiler magic.
https://godbolt.org/z/6ans5YGnW
When I pay attention, I'm used to seeing `-Os` nibble at the edges to make the program's footprint smaller -- remove dead code, remove functions that don't get called, inline called-once functions, etc.
I'm not surprised that it was able to achieve some amazing compression given the structure of the `switch` statements (and the pattern of values in the nested array) -- but wow. It replaced both 34-entry jump tables with a single 34-element array, and replaced the nested array with code to compute the array's elements. When I say it like that, it seems (as I said) not surprising, but it's still frickin' amazing.
(For those wondering why I use this implementation instead of the commented-out simpler implementation, it's starter code for an assignment in which students need to scan a matrix keypad, replacing the library call -- giving them this in the starter code gets better results than giving them the simpler version in the starter code.)