setup generating code starting from the main function