int bar (int p, int q) { if (q > 0) do_stuff (q); else do_stuff (-q); if (q % 2) do_stuff2 (2 * q); else do_stuff2 (2 * (q + 1)); return foo (4, p); }
function() { if (do_stuff1() == ERROR) goto cleanup1; if (do_stuff2() == ERROR) goto cleanup2; return SUCCESS; cleanup2: do_cleanup2(); cleanup1: do_cleanup1(); return ERROR; }