porting inliner to new top_level_scopes