there are two main options, and they are dependent on the problem your code solves
1.) if your condition is the same throughout your c code file, meaning the condition does not change, but code must behave differently in several places.
i.e.
/* prepare */
if(cond == 1){
/*prepare 1 */
}elseif(cond == 2){
/*prepare 2 */
}
/* run */
if(cond == 1){
/*run 1 */
}elseif(cond == 2){
/* run 2 */
}
in this case you should just refactor things to be under a single condition. i.e.
/* process and run */
if(cond == 1){
/* process 1 */
/* run 1 */
}elseif(cond == 2){
/* process 2 */
/* run 2 */
}
if you have a changing condition throughout the code. i.e.
cond = DEFAULT_COND /* = 1 */;
/* prepare */
if(cond == 1){
cond = prepare_1();
}elseif(cond == 2){
cond = prepare_2();
}
/* run */
if(cond == 1){
/* run 1 */
}elseif(cond == 2){
/* run 2 */
}
in this case your code is too complex to simply refactor because the cond variable at the time that the "run" code is evaluated may have been changed by the "process" code, in this case, but only in a case like this. will you be unable to refactor the code into a single condition.