cgen main_main working