optimize tail calls with RESTORE-CSP