This performs the equivalent of applying repeatedly identity 3, in a much smaller amount of time. The loop is laid out so as to avoid repeated work; for instance, eliminating 2 as a factor of v was moved to the back of the loop, and after the exit condition, as v is known to be odd upon entering the loop. The body of the loop is branch-free except for its exit condition (v == 0), as the exchange of u and v (ensuring u ≤ v) compiles down to conditional moves.[1] Hard-to-predict branches can have a large, negative impact on performance.[2][3]