https://github.com/adrian-prantl commented: The changes from int -> unsigned look like a good improvement to me. Can clang perform the same optimization for the modulus operation? If yes, I think I prefer the original code. If not, this LGTM. https://github.com/llvm/llvm-project/pull/75722