peer review
The code looks good and works. As your comment states the 0-counting algorithm is not very efficient but you explain that it was the way you did in lab2 and wanted to compare which is good. It looks a bit dangerous with the bit counting destroying the seed value all the time instead of using a temporary variable but I guess it is fine since seed just become x+y+n in the end anyways.
As you say the compiler also optimizes your bit counting since i guess it realizes what you are trying to do and just makes it faster. All in all good code and explanations as to what happens and well commented. Good job