WASDQE, ARROWS. I decided to show how z clipping can be implemented with a max of 3 if-elses. There are 8 possible cases, so 3 is optimal. This is slightly faster than @howtomakeausername's code, however the way I did it will not be comptabile with my own engine, so that's unfortunate.
UPDATE: this is now part of the (currently unreleased) ChromeEngine