runtime state stack and manual restore on c-c