I've got a very ugly old program to try to organize/prettify. A few thousand lines, a few dozen labels and about 100 goto's. The goto's are about half forward and half backward. They overlap every which way, and there are even some computed goto's and some case statements that spray goto's willy-nilly out of several of their cases. The only bad things that I can say the program does not do is to branch into thens, elses or cases. It uses conditional branches backwards instead of loops, but many of these are within cases statements.
I recall that it was proved maybe 40 or 50 years ago that goto's are not needed if one has loops and if-then-else (not to mention cases). The question is: are there any manageable algorithms or sets of rules to follow, by hand or by computer, to do what the proof proved possible, i.e. translate spaghetti to reasonably readable code with most of the goto's gone?