Carbon and oxygen production during the helium burning phase in intermediate mass stars