* these double checks are not necessary
* the compiler will move the early return outside of the called
function, basically the functions is partially inlined
* however lto/amalgamation needed for the optimization
Originally I made those as macros. However we have many
other small functions like mp_clamp, mp_exch which are also not implemented
as macros right now.
If we would use c99, I would implement them as private static inline
functions. And mp_exch would be a public static inline function.
But since we are bound to c89, we simply use normal functions.
To achieve optimal performance one should either use link time
optimization or amalgamation.