This only works for 32-bit integers.
k=c>>31&1 isolates the sign bit, which is 0 or 1.
If k is 0, then a>=b and max = a - 0*(ab) = a .
If k is 1, then a<b and max = a - 1*(ab) = a-a+b = b .
Historically, pipelining of instructions has been the main reason for using code that avoids the if test. If the pipeline is deep and the processor does not use branch prediction, half a dozen whole operations may take less time than wasting time refueling the pipeline and working with speculative stores, if any. With branch prediction, code with if (or equivalent) can be faster. In any case, the cost of saved or lost nanoseconds may never exceed the cost of maintaining the program for this code.
source share