https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101822
--- Comment #1 from Jeremy R. <llvm at rifkin dot dev> --- Never mind, 101821 was invalid and the initial xor eax eax is by design (still wondering whether this applies to new CPUs though). There is still a discrepancy between this code and the __builtin_popcount code though.