For several reasons, blueprint nodes are unique and the compiler cannot just duplicate them for the heck of it. Each output pin behaves pretty much like a global variable. It’s possible to connect the output pin of a node from one exec branch, to the input of a node in a different exec branch.
For example :
if the compiler would generate duplicate code for events A and B, then it becomes ambiguous which input the PrintString is connected to.
Latent nodes also have their own reason for being unique. There’s an expected behavior when code re-enters a latent node which is already executing. See how “Delay” and “Retriggerable Delay” behave when called repeatedly.
The compiler/machine code relies a lot on jumps, and that’s what will happen there. For example the entry point for OpenOptions will go straight to the execution of the node, while the entry point for ButtonClick will jump to the OpenOptions execution path. Or the other way around. No duplication. Maybe the two events will even share the same entry point.
Compiler will do essentially the same as what you did in second image, but with better performance. Function calls are quite expensive in comparison to a single bytecode jump instruction.