codegen, toplevel: solve main_p problem with opt arg