The CloudFlare x86-64 optimized version of the longest match algorithm is especially well documented.
https://github.com/cloudflare/zlib/blob/31043308c3d3edfb487d...
It's great material for anyone interested in these types of low level optimizations.