WASHINGTON ― In 1996, Purdue Pharma introduced a new painkiller it said carried a low risk of abuse or addiction. It called the drug “OxyContin.”

In reality, of course, OxyContin was extremely addictive — and Purdue knew it. A decade later, three Purdue executives, and the company itself, pleaded guilty to criminal charges tied to OxyContin’s marketing and agreed to pay more than $600 million in fines.

But the executives dodged prison time, and the prosecution did little to slow the rise of opioid use. The pharmaceutical industry had spent the past 10 years and billions of dollars pushing the medical community to ramp up the use of OxyContin and other opioids. By 2013, the number of annual opioid prescriptions, including short term and multiple, had nearly tripled, topping 200 million — in a country of just over 300 million people.

Congress, however, has finally done something. On Nov. 30, the House approved the 21st Century Cures Act by an overwhelming 392-26 vote. This Wednesday, with a 94-5 vote, the Senate did the same, sending the bill to President Barack Obama’s desk for his signature. The bill commits billions of dollars to medical research while sending $1 billion to states to help combat heroin and painkiller addiction and assist with recovery.

But there’s a complication: Instead of cracking down on the pharmaceutical companies that fueled the boom in opioid abuse, lawmakers rewarded the industry. No health care-related bill of this size could move through Congress without the support of Big Pharma. The authors of the 21st Century Cures Act earned the industry’s support by including regulatory rollbacks that drugmakers have long sought and creating cheaper and quicker paths for drug approval by reducing safeguards. It’s as if the fire department had to pay off the arsonist to get permission to put out a fire.

Lawmakers were left with a Hobson’s choice. The bill would make billions of dollars available for medical research. It would fund lofty goals, such as precision medicine, a White House initiative to map the human brain and Vice President Joe Biden’s “Cancer Moonshot.” It would save lives. But it would also undermine regulations that patient advocacy groups say are essential for making sure medical and drug research is conducted ethically and safely — meaning it could cost lives, too.

Some politicians thought the choice was clear. On Nov. 28, Sen. Elizabeth Warren (D-Mass.) denounced the measure in aggressive terms, calling it the result of “corruption” — fighting words on the Senate floor — and singling out Majority Leader Mitch McConnell (R-Ky.) for taking millions from a donor with an interest in the bill’s passage. Warren was hoping to make a battle around the Cures Act the moment that Democrats announced, in the wake of Donald Trump’s election, that they were standing up and fighting against a broken and corrupt system.

“The American people didn’t give Democrats majority support so we could come back to Washington and play dead,” she said on the floor. “They didn’t send us here to whimper, whine, or grovel. Now they are watching, waiting and hoping ― hoping we show some spine and start fighting back when Congress completely ignores the message of the American people and returns to all its same old ways.”

Others read the politics around the bill differently. Sen. Johnny Isakson (R-Ga.), one of the bill’s supporters, called Warren’s floor speech “the most irresponsible statement anybody can possibly make,” adding: “She pontificates as if she knows everything, when in fact she knows nothing.”

Isakson and his allies won.

But the debate surrounding the 21st Century Cures Act came to embody a larger dispute about how government can and should operate. Some 1,455 lobbyists, acting on behalf of more than 400 companies and other organizations, lobbied on the legislation, according to the Center for Responsive Politics. Over the past year and a half, companies known to have lobbied on the Cures Act spent half a billion dollars to influence Congress. The resulting bill was packed with politicians’ pet projects and sops to industry.

The 2016 election, like every one prior, was run on a promise to change this sort of legislating ― to drain the swamp. But those pledges, like ones before, are already coming into conflict with how Washington actually works: by blending good motives, bad compromises and giveaways to interest groups ― and holding your nose as you vote on the result.

Jonathan Ernst / Reuters

Rep. Fred Upton, the Michigan Republican who chairs the House Energy and Commerce Committee, became convinced of the need for a Cures-type bill in 2011, after he met Brooke and Brielle Kennedy, two sisters (ages 8 and 9, respectively) with spinal muscular atrophy, a rare disease that destroys the nerves that control voluntary muscle movement.

“I remember when they first came to my office in Kalamazoo,” Upton told The Huffington Post last week. “I said, ‘What’s your name?’”

One of the girls answered that she was Cinderella and told Upton that her sister was Sleeping Beauty.

“So that’s who they’ve always been, those two,” Upton said. “But whether it’s that, whether it’s Duchenne, whether it’s Alzheimer’s, diabetes, lupus, cancer. I mean, we’re all impacted by these things.”

Gabe Griffin, an 11-year-old with Duchenne muscular dystrophy, became another inspiration for the bill. As did Upton’s family members. His wife has lupus, an autoimmune disease, his mother is a cancer survivor, and his father has diabetes. “I’m no different than anybody else,” Upton said. “We all have those stories.”

When Upton set out to craft the bill to help people like Griffin and the Kennedy sisters in December 2013, he knew he had to balance certain interests. Lots of politicians were pushing for more government funding for biomedical research. But Republicans didn’t want to raise taxes to pay for it — and argued the same result could be achieved by cutting regulatory red tape. The congressman saw an opportunity for a bargain in which both sides could get what they wanted.

In December 2013, he partnered with Rep. Diana DeGette (D-Colo.) to begin painstakingly assembling draft legislation. They, in turn, worked with the chairman and the ranking Democrat on the Senate Health Committee, Sens. Lamar Alexander (R-Tenn.) and Patty Murray (D-Wash.).

Upton and DeGette pulled together language from proposals intended to bring to market much-needed medical therapies that weren’t economically viable and from bills to stimulate investment in new infectious disease remedies. They added measures tinkering with the Food and Drug Administration’s approval processes and streamlining clinical trials. They proposed the creation of an administrative working group to address the hurdles scientists face when applying for federal research grants.

Most important, at a time when Congress was pinching every penny, the bill found revenue sources to fund more research. Upton and DeGette’s draft legislation devoted $8.75 billion to the National Institutes of Health and $550 million to the FDA over a five-year period — offset by selling oil from the Strategic Petroleum Reserve and cuts to the payments Medicare and Medicaid make to states, insurance companies and providers.

In April 2015, after eight hearings, 24 roundtable discussions and several white papers, the bipartisan pair released a discussion draft. The formal bill passed through committee by a 51-0 vote in May. In July of that year, the full House approved the bill by a vote of 344 to 77. PhRMA, United for Medical Research, Newt Gingrich and Katie Couric all applauded its passage.

House and Senate supporters of the legislation were working out the differences between their bills well before the Senate actually passed its own version. But the Senate was the Senate: slow to act. By the time that chamber took up the bill at the beginning of 2016, Congress had already used a chunk of Upton and DeGette’s funding sources on other things, forcing lawmakers to find new ways to pay for the bill or decrease its cost. They decreased its cost: bringing funding for the NIH from $8.75 billion over five years down to $4.8 billion over 10 years.

At the urging of Rep. Paul Ryan (R-Wis.), who became House speaker after the bill passed that chamber, they also changed the funding from mandatory spending, which is paid out automatically unless Congress votes to change it, to discretionary spending, which lawmakers have to vote to spend each year.

For biomedical research advocates, this shift complicated the part of the legislation that they actually loved. The NIH’s budget has grown slightly since taking a major hit in 2013: from $30.07 billion in fiscal year 2014 to $31.3 billion in FY 2016. But funding isn’t keeping up with inflation, and other countries are increasing the amount they spend on medical research at a much higher rate.

An infusion of $4.8 billion “isn’t anything to take lightly,” said one senior official for a biomedical research advocacy group. But by making the funding discretionary, the lawmakers also endangered it. Congress, for example, could decide to fund NIH at a lower level in 2017 by arguing that the funding made available from the 21st Century Cures Act justifies the cut. Congress could also choose to raid the $4.8 billion in NIH funding for unrelated purposes — fighting the next infectious disease outbreak, for example.

And then there is the matter of the incoming president, Donald J. Trump, who has promised to take advantage of low interest rates and borrow to invest in research and infrastructure, but whose commitment to science is not exactly sterling. Two Democratic senators said they spoke to Michael Botticelli, director of the Office of National Drug Control Policy, about concerns that Trump might not spend the opioid-related money for its stated purpose. Botticelli assured them that he could get the money out the door and to the states before Trump takes office on Jan. 20. It would be a bureaucratic feat, but “if anybody can do it, he can do it,” said Sen. Jeanne Shaheen (D-N.H.).

Still, believing that lawmakers and bureaucrats will keep their promises requires “an awful lot of putting faith in the process,” a second medical research advocate told HuffPost. And “faith” is not a sound foundation for science. Biomedical research relies, instead, on stability. Grants are awarded over several years and if a grant-awarding agency is worried that its funding pool might shift or dry up, the type of research it funds will be shorter-term investments.

“I am concerned that we’re talking about $6 billion of offsets, and of cuts, for only one year of guaranteed funding,” Sen. Bob Menendez (D-N.J.) told The Huffington Post. “I don’t know that I want to give the Republican majority 6 billion in cuts when I only have one year of funding.”

Republicans on Capitol Hill say they understand and recognize the worry about discretionary spending for the bill’s initiatives. But they argued it is overblown. As the congressional GOP aide noted, even mandatory funding isn’t guaranteed because no Congress can bind a future Congress. Far more important, he added, was that the research priorities funded by the 21st Century Cures Act enjoyed seemingly unshakeable bipartisan support.

“The concern is like saying, ‘OK, you won the lottery. But are you going to spend the money?’” the GOP aide said. “Everyone spends the money.”

The aide has a point: Despite their concerns about the vulnerability of the discretionary spending, most medical research advocacy groups support the bill.

Mario Anzuoni / Reuters

Many people in Washington are coming to the same conclusion as the medical research advocates: The bill is far from perfect, but it includes something for just about everyone. Its authors designed it that way.

In the legislation’s earliest forms, for example, some Republicans worried the NIH funding was akin to signing a blank check for the administration. But the bill’s backers recognized that if they took too much money out, they’d lose Democratic support. They came up with a workaround. Alexander, after meeting with Upton and White House officials, suggested targeting most of the money at three or four specific projects that could use a cash infusion. They settled on the brain-mapping program and the precision medicine initiative, which is designed to track how factors like lifestyle, wealth and even environmental variables affect diseases. And they included a parting gift for Biden ― $1.8 billion for the national Cancer Moonshot.

Biden lost his son Beau to brain cancer in May 2015. Five months later, when he announced in an emotional Rose Garden statement that he would pass on a run for president, he expressed a desire to make “an absolute national commitment to end cancer as we know it today.” Obama formally unveiled the “moonshot” campaign in his 2016 State of the Union address, when he declared it as ambitious as sending a man to the moon — hence the name. He tapped his VP to lead the effort.

For the rest of the year, Biden met with physicians, researchers, families, tech leaders and even Pope Francis to come up with the best ways to put government money to use to accelerate cancer research, prevention and detection. So far he has singled out efforts to make it easier for patients to get into clinical trials and pushed for more open data and collaboration between researchers. The vice president submitted his final report to Obama last month, outlining what his team accomplished over the year and offering a five-year plan “to unite and marshal every resource of the federal government.” And, according to sources, he is now calling his friends in the Senate, making a passionate case on behalf of the cancer research funding that is contained within the 21st Century Cures legislation.

“A lot of them [Democrats] see this a sort of a last thing for Biden,” one Democratic staffer told HuffPost. “But if he weren’t pushing for it, it would probably fail,” the aide said, speaking anonymously to offer candid insights.

Sen. Chris Coons, a Democrat from Biden’s home state of Delaware, said Biden’s appeal to him was decisive. “Perhaps the increase in spending on opioid prevention and reduction, and the increase in spending on treatments and cures, is dwarfed by the cuts, but I’ve heard from the vice president, who feels very strongly that this is an important next step in the fight against cancer,” Coons said.

Ed Hille/Philadelphia Inquirer via Getty Images Vice President Joe Biden with Collins discussing the Cancer Moonshot initiative.

Money for Biden’s cancer moonshot was the largest carrot meant to maintain support for the bill. But it was not the only one. The first two parts of the legislation include a host of intriguing funding initiatives of programmatic changes. There is a EUREKA prize competition (the Ensuring Useful Research Expenditures is Key for Alzheimer’s Act) that directs the NIH to establish a competition for innovative work to combat serious biomedical diseases. There are requirements for the institute to support opportunities for young researchers (a major problem in the field of science, where funding tends to go to established names). There are even sections designed to support the national Pediatric Research Network and accelerate therapies and preventions for tick-borne diseases.

But assembling a broad, bipartisan coalition often requires including ethically suspect giveaways. And this bill has those, too. The bill incorporates ideas from the so-called REGROW Act (Reliable and Effective Growth for Regenerative Health Options that Improve Wellness), introduced by Sen. Mark Kirk (R-Ill.) and co-sponsored by Sens. Susan Collins (R-Maine) and Joe Manchin (D-W.Va.).

While the language of REGROW and Cures are different, the driving idea is the same. Both bills would speed up the delivery of adult stem cell therapies to patients by allowing those therapies to go to market before they’re definitively proved to be safe and effective.

Such a strategy would “negatively impact the development of stem cell therapies, the integrity of the emerging regenerative medicine market, and the health and safety of people using stem cell products,” the International Society for Stem Cell Research, a coalition of medical researchers, warned in September.

REGROW was backed by a range of stem cell companies and patient support groups. But its most important backer is W. Ed Bosarge, a super-wealthy Texas entrepreneur who made huge contributions to the Senate Leadership Fund, the super PAC linked to Sen. McConnell, in the 2016 election cycle. Bosarge, who runs the stem-cell firm Bosarge Life Sciences, had given $3 million through the company Petrodome Energy LLC, an oil and gas business he operates, as of Oct. 19 ― the most recent date for such disclosures. These contributions made him the fourth-largest supporter of McConnell’s successful effort to keep the Senate in Republican hands. The stem-cell exec has donated at least $4.7 million to Republican super PACs since 2010, including $175,000 to Kentuckians for Strong Leadership, a super PAC that solely supported McConnell’s re-election in 2014.

The Bipartisan Policy Center, a corporate- and foundation-funded Washington think tank that is lobbying Congress in support of REGROW, thanked Bosarge for his “contributions” in a key policy paper backing the bill. In February 2015, the bipartisan lobbying firm Bockorny Group registered to lobby on behalf of Bosarge Life Sciences. As part of that lobbying, Bosarge met with Kirk’s staffers to discuss the legislation, according to a report by Politico. The lobbyists’ plan of action was to convince Congress to slip REGROW into more immediate legislation — like the 21st Century Cures Act.

Although they were unsuccessful in inserting the exact language, the bill still includes substantial provisions on regenerative therapies. The inclusion of those sorts of lobbyist and donor-backed provisions are exactly the sorts of deals that have some opponents of the Cures Act — including Warren — fuming. In her floor speech on Nov. 28, the Massachusetts Democrat decried the inclusion the regenerative language as a “special deal” for a “major Republican donor” — i.e., Bosarge — who “stands to benefit financially from selling cellular and regenerative medical therapies.” Her charge against McConnell inspired Sen. John Cornyn (R-Texas) to rise in his defense and accuse her of violating the Senate’s “decorum.”

But Warren didn’t find a lot of allies in her fight. “I understand that there’s a desire to immediately show some backbone and some fight,” said Sen. Chris Murphy (D-Conn.), a major supporter of the bill, who authored significant mental health policy legislation that was included as part of it. “I think this is the wrong place to make that stand... There’s going to be plenty of life or death fights once Donald Trump is president.”

Last Tuesday, Senate Democrats gathered for a private lunch to hash out strategy around the bill. It was, according to sources, less tense than expected, as Warren’s effort lost steam, but it was still a much feistier meeting than customary.

“I think that tension is productive,” Sen. Cory Booker (D-N.J.) said as he was leaving the meeting. “In the last several hours, we just won some more concessions.”

I am concerned that we’re talking about $6 billion of offsets, and of cuts, for only one year of guaranteed funding. Sen. Bob Menendez (D-N.J.)

Both parties did compromise. A manager’s amendment to the final version of the bill struck the rollback of the Sunshine Act. And Upton made another concession about a month ago when he removed the so-called Open Act, which would have given drug companies an additional six months of exclusivity for orphan drugs.

“We took out a couple provisions that actually would have helped the pharmaceutical industry,” Upton said, responding to Warren’s criticism.

Republicans also pulled a bipartisan provision ― authored by Sens. Orrin Hatch (R-Utah) and Ron Wyden (D-Ore.) and Rep. Vern Buchanan (R-Fla.) ― promoting evidence-based prevention services to help keep more children out of foster care after Sen. Richard Burr (R-N.C.) demanded it be stripped out.

The bill had passed the House unanimously in June when it came up for a standalone vote, and it’s backed by more than 500 child welfare groups. But Republican leaders backed down Tuesday after Burr, along with Republican Sens. Thom Tillis (N.C.), Mike Enzi (Wyo.), Pat Toomey (Pa.) and Dan Coats (Ind.), pressed McConnell and Ryan to remove it from the larger Cures Act.

With those demands met, Republicans easily got behind the bill.

It’s those sorts of trade-offs that win votes. But so too does money. Shaheen, the New Hampshire Democrat, has seen her home state ravaged by the opioid crisis. And she has pushed unsuccessfully for the past year to win $600 million in emergency funding to address the epidemic. She had no luck until 21st Century Cures came along.

“Listen, I appreciate that Senator Warren has some concerns with the bill,” Shaheen said. “I have concerns with the bill.” But, she added, the deal was too good to pass up.

“My goal has been trying to get funding to address the heroin and opioid epidemic,” she said. “And there is significant funding in this bill.”

This article has been updated throughout to reflect the bill’s passage in the House and Senate.

With reporting by Jen Bendery, Laura Barron-Lopez, Jason Cherkis, Paul Blumenthal and Michael McAuliff.

Use the form below, powered by PopVox, to write your member of Congress to let him or her know how you feel about the Cures Act.

CORRECTION: Due to an editing error, a previous version misstated the full name of the EUREKA Act; it was misidentified as Exceptional Unconventional Research Enabling Knowledge Acceleration, a separate grant program. Text has also been changed to indicate that the 21st Century Cures Act incorporates ideas similar to those included in the REGROW Act. The Century Cures Act does not include the REGROW Act.