Near-infrared (7500 Å) and infrared (1.6-4.0 μm) spectra are analyzed to provide elemental and isotopic C, N, and O abundance, iron peak (Ti, Fe, and Ni) abundances, and heavy element s-process (Y, Zr, Nd) abundances for a sample of M, MS, and S giants. The compositions of the M giants are similar to those of G and K giants and consistent with predictions for giants that have a deep convective envelope and so have experienced the first dredge-up. The MS and S giants have compositions that betray the signatures of the third dredge-up that occurs in thermally pulsing asymptotic giant branch stars. The sample, through a correlation between 12C/16O and 12C/13C, shows that 12C, a principal product of the He-burning shell, has been added to the envelopes of MS and S stars. The 12C enrichment is correlated with a more marked enrichment of the s-process elements that are predicted to be synthesized when a neutron source is ignited in the He-burning shell. The pattern of the s-process abundances suggests a neutron exposure τ0 = 0.3 mb-1 at 30 keV. The MS and S giants show a higher N abundance than the M giants: this is attributed to the expected deep mixing that occurs with the onset of the episodic third dredge-up. A suggestion that the MS and S giants that lack Tc may be evolved barium giants is discussed. Several extremely N-rich S stars are found and identified as the progenitors of similarly N-rich planetary nebulae. Comparisons are made between the compositions of oxygen-rich and carbon-rich AGB stars and planetary nebulae.