[C] rename guard
[C] conditional generation of #define _state_Entry/Exit
[C] conditional generation of entry/exit
[C] refactor without POPULATE_STATE