reorder endianness checks