Last time spent fixing a bug here encouraged me to try to understand semantics of this method,
and it seems there was a lot of code duplication and convoluted logic here.
This patch aims to straighten semantics up, or at least make it somewhat more straightforward.
We have an input statement, and for it we try to find a sub-expression "Inner".
Then we try to find a node corresponding to "Inner", and we add visitors there, if it is "interesting".
Otherwise, we try to track the value and the contents of the sub-expression at a state.
I think this comment is still relevant (though probably it should be made more clear, because it takes me like 10 minutes to figure out what exactly did i mean here every time i read it).