A Scanner Darkly
Donna (Winona Ryder) is actually "Hank". "Fred"/Robert Arctor (Keanu Reeves) is being deliberately hooked on Substance D so he can be inserted into the New Path rehabilitation program. The cops believe that New Path is manufacturing Substance D. Arctor's addiction is "discovered" through drug testing at his job. He is brought to the New Path rehab center by Donna after she discards her "Hank" suit. After a stay there, Arctor is shipped out to New Path's agricultural farm to be a cornfield worker. While working in the field, he looks down and sees that the tall cornstalks are actually hiding the tiny blue flowers from which Substance D is made. A bit of his police instinct still exists and takes hold of what's left of his mind. He places one of the flowers in his work boot while murmuring about giving it as a gift to his friends whom he can see during a scheduled furlough at Thanksgiving.
The last frames are a eulegy which Phillip K. Dick wrote regarding his friends and colleagues who died or suffered serious brain damage from hallucinogenic drugs.
Look for various homages to "A Clockwork Orange" and "The Naked Lunch" throughout the film.