Safe stack reorganisation in terms of function casts.