Step 1: Papaver somniferum is the opium poppy, the source of opium alkaloids.
Step 2: The latex of this plant contains several benzylisoquinoline alkaloids, and codeine is one of the well known ones used directly as an analgesic and cough suppressant.
Step 3: Shikonin comes from Arnebia/Lithospermum roots and is used as a dye and wound healing agent, not from poppy. Diosgenin is a steroidal sapogenin from Dioscorea (yam) used to make steroid hormones. Scopolamine is a tropane alkaloid from Datura and related Solanaceae plants, used for motion sickness, not from poppy.
Step 4: So the analgesic compound from Papaver somniferum is codeine.