The latest bill in the U.S. Senate to repeal major portions of Obamacare would give Alabama a 10-year boost in federal Medicaid funding, according to a study by Avalere Health, a firm in Washington, D.C.

Republican Senators Lindsay Graham and Bill Cassidy introduced the legislation as a last-ditch effort to repeal Obamacare. Two previous attempts to undo former President Barack Obama's signature health legislation failed over the summer. Senators have until the end of September to pass the bill with a simple majority.

Sen. John McCain (R-Ariz.) announced Friday he would not vote for the bill, which could doom the legislation. He cast the decisive vote in July that killed a previous effort to repeal Obamacare.

Lawmakers have a little more than a week to change his mind or win over other Republicans who have opposed previous health care bills. The bill has drawn opposition from the American Medical Association, patient groups and major health insurance companies.

Graham-Cassidy would impose caps on federal Medicaid funding. It would reduce funding to states that expanded Medicaid and boost it in states with skimpier programs. Overall, the bill would cut about $215 billion from the federal Medicaid budget.

Between 2020 and 2027, Alabama would gain $3 billion, a 5 percent increase, according to the Avalere study. Alabama is one of 19 states that have not expanded Medicaid to low-income adults under Obamacare.

"The largest impact of the proposed bill would be the reallocation of federal dollars between states," wrote Elizabeth Carpenter, senior vice president at Avalere Health, in the study. "Medicaid expansion states and states that have enrolled a high number of people in insurance affordability programs would be most adversely impacted."

However, that financial boost would stop in 2027, according to the analysis. By 2036, funding would drop by $27 billion.

"Every state would be a loser under Graham-Cassidy, and Alabama is no exception," Arise Citizens' Policy Project policy director Jim Carnes said in a statement. "Over time, this bill would wreck our state's General Fund budget and force enormous Medicaid cuts that would hurt children, seniors, and people with disabilities across Alabama. We urge Congress to reject this harmful plan and work together in a bipartisan way to strengthen our country's health care system."

The law would not just affect Medicaid recipients in Alabama. It would also change major portions of the law regulating private insurance, doing away with health insurance requirements for businesses and individuals

The bill would give states much more flexibility to create health systems for the poor and middle class, but would also remove some federal support that has subsidized health care in Alabama. Federal funding for Medicaid, which currently picks ups about two-thirds of the state's tab, would cease to be open-ended.

In Alabama, the program covers mostly children, people with disabilities and elderly nursing home residents. Very few able-bodied adults qualify for Medicaid coverage. The ones that do all care for people receiving Medicaid and make a fraction of the federal poverty level.

The bill allows states to opt out of some Obamacare requirements and allow skimpier plans and higher charges for sicker and older customers. The Avalere study found the changes could lead to higher rates of coverage for some groups and increased costs for people with extensive medical needs.

Critics of the bill also worry about the fate of customers who purchase insurance on the federal exchange with tax credits that would be phased out under the new legislation. Almost 180,000 people in Alabama enrolled in private health insurance through the exchange for 2017.

Sen. Richard Shelby told reporters for the Washington Post that he supports the Graham-Cassidy bill, but Sen. Luther Strange has been more circumspect. According to the paper, he said he is still looking at the legislation and hasn't taken a position yet.