One possibility for "if (f()) else if (g()) else if (h()) else ...":
evaluate all the conditions in parallel
add (1<<i) to a sum if condition i is true: sum += (f() ? 1 : 0); sum += (g() ? 2 : 0); sum += (h() ? 4 : 0)
you might have to explicitly do the sum in a tree if the compiler wants to do it linearly
use some find-first-set-bit instruction to find the first set bit in the sum: log = ffsb(sum)
switch(log) { 0:, 1:, 2:, ...}
This will choose the first true condition without requiring that only one condition be true. There's tradeoffs of how much parallelism you have, how much the conditions cost to evaluate, how deep in the if-else chain the code usually has to go, and find-first-set is usually limited to 64 bits. Usually other mechanisms will be cheaper than this. But this approach can handle unrelated independent conditions without any linear dependency chain.