minify globals in a pass before the functions