Lots of interesting tricks in this code base. Gives also a good idea of the shape and tradeoffs of such ports.