@chux-ReinstateMonica The most efficient optimization would do away with the
if
altogether (because jumps can be terrible on modern CPUs) and replace it with bit arithmetic, taking advantage of C's weak typing, like return 1 & (number != 1)
.