EVERY night for three years in the early 1990s, Mark Whitacre lay awake, wondering how he was going to keep his job even though he was secretly taping executives at his company, agri-giant Archer Daniels Midland, helping the FBI to expose a price-fixing scheme.

In the end, the stress finally broke him. At one point, Whitacre’s wife found him outside their house blowing leaves off the driveway. At 3 a.m. In a rainstorm. Whitacre’s true story hits the screen Friday in “The Informant!” — although director Steven Soderbergh has reimagined it as an absurdist comedy, in which Whitacre (played by a doughy Matt Damon) bumbles his way through the undercover investigation. At one point, a tape recorder hidden in his briefcase begins buzzing during a high-level meeting.

As it turns out, Whitacre worst fears came true. (Minor spoiler alert.) He went to prison for taking some $9 million in kickbacks that, incredibly, he amassed while working as an informant.

“It crossed my mind every day that I was finally going to get fired, and that was the reason I took $9 million,” says Whitacre, three years out of prison and currently working for a biotech company. “I was trying to cover myself financially. I knew the company wouldn’t say anything to me, because I’d be thinking, ‘Gosh, guys, you took billions of dollars from the customers on the price-fixing scheme, and you turn me in with what I know about you guys?’ ”

“But once they found out I was the informant,” he says, “I got turned in immediately, because they were really mad.”

After landing in prison, Whitacre realized he was bipolar and that the disorder contributed to his often-irregular behavior. As the movie dramatizes, he could carry on a conversation while his thoughts turned to something completely unrelated, like how he flossed in the shower to save time or his favorite German word. His mental illness, coupled with the stress of wearing a wire every day for three years, caused him to break from reality at times.

“My wife would ask if I really thought I could stay at this company, and I’d say, ‘I think I have a good chance,’ ” he says. “That’s how delusional I was, thinking I could survive and move up in the company.”

Despite his arrest and incarceration, Whitacre says he has no resentment toward the FBI or his former bosses at ADM. As thanks for exposing the price-fixing scheme, various food companies who were getting ripped off by ADM helped support Whitacre’s family financially while its breadwinner was in jail. His wife got put through college, his kids were given cars.

Today, Whitacre is getting treatment for bipolar disorder, and he and his wife are still together. He’s doing well enough to find the humor in “The Informant!”

“There were some funny parts in the movie,” he says.

“It would have been harder to laugh at 17 years ago. It would have been harder to laugh at 10 years ago, when I was still in prison. But my wife and I, as we both watched it, knew that we not only survived, we thrived.”