Advanced Evolution of Massive Stars. IV. Secondary Nucleosynthesis During Helium Burning