Delay auto-generating the main function until the end of the first semantic pass