[WIP] insert variable disposal instructions in the IR

This should help fix #578