When this process occurs, the high-level constructs are translated into low-level spaghetti code which may resemble the first example above in terms of control flow.
Sure, you can easily devise state machines that would modify themselves at runtime (this is what often actually happens when you try to recode spaghetti code as a state machine).