wow so glad I can extract this minimal and efficient C++ from my verified Kernighan popcount in Lean 😅

https://gist.github.com/regehr/3461027009efbe9452d8a5c343174443

gist:3461027009efbe9452d8a5c343174443

GitHub Gist: instantly share code, notes, and snippets.

Gist
after much struggling I got the code below, which turns into the instructions that I wanted! but that's as much a testament to modern compilers as it is to Lean :)
@regehr I love your colors