An efficient divergent synthetic strategy for the synthesis of the opiate and amaryllidaceae alkaloids emerges by employing a Pd-catalyzed asymmetric allylic alkylation (AAA) to set the stereochemistry. Three generations of syntheses of galanthamine are discussed in detail with particular focus on the scope of the palladium-catalyzed AAA reactions and intramolecular Heck reactions. The pivotal tricyclic intermediate is available in six steps from 2-bromovanillin and the monoester of methyl 6-hydroxycyclohexene-1-carboxylate. This intermediate requires only two steps to convert to (-)-galanthamine. Using a Heck vinylation, we found that the fourth ring of codeine/morphine could be formed. The final ring formation involves a novel visible light-promoted hydroamination. Thus, six steps are required to convert the pivotal tricyclic intermediate into codeine, which has been demethylated in high yield to morphine.