Implemented shiftIn() and shiftOut()

The time taken for this code to execute is trivial compared to the amount of time taken to transfer the data to a SOC pin (let alone the I/O Expander). The compiler may implement the logic using conditional branch instructions anyway (given it contains Boolean expressions).  Why not write clear, very easy to understand code and let the compiler optimize as it sees fit?