C implementation: optimize endian test