You can see I added a try/finally where I construct a new dynamic scope for the static scope of the split method. This is not really in the right place since this same dynamicscope needs to be used for both interpret calls.
So you need to make equivalent try/finally in your asm logic where you push a new scope and pop it.
One thing which is a little foggy is that you can probably always push the extra dynamic scope but if it is not actually going to call into the interpreter there is no need to do it. So best solution might be to emit two versions instead of just one which handles the split and non-split case.