Senate GOP lawmakers have finally unveiled their version of the bill to repeal and replace Obamacare ... or major portions of it.

The Senate legislation largely mirrors the House bill, making sweeping changes to much of the nation's health care system. But it also keeps more of Obamacare's structure in place.

Like the House version, the bill would drastically cut back on federal support of Medicaid, which will likely force states to shrink their programs and people to lose coverage. However, the Senate bill would maintain much of Obamacare's subsidy structure to help people pay for individual coverage, but make it less generous, particularly for older enrollees. And it would keep more of Obamacare's insurance regulations than the House legislation.

As in the House bill, senators would repeal the mandates that require most Americans to obtain insurance and most employers to offer it, while eliminating Obamacare taxes on the wealthy, insurers and others.

But the Senate version also provides funds to stabilize the Obamacare market over the next few years, including allocating money for a key set of subsidies that insurers receive.

Related: Senate finally unveils secret health care bill

The Republican effort to repeal Obamacare has had a lot of critics, ranging from conservative lawmakers to moderate ones to insurers to the AARP. The House bill would have led to 23 million fewer people having coverage by 2026, according to the non-partisan Congressional Budget Office. Even President Trump called the House version "mean."

Proponents of the bill say it would save the individual health market from collapse. The legislation would provide Americans more choice, greater control and lower costs, they argued.

But opponents said it could reverse the gains in coverage that have been made since the Affordable Care Act was enacted in 2010.

The CBO is set to release its analysis of the Senate bill early next week, providing greater insight into how the legislation would affect Americans.

What the bill calls for

Revamp Medicaid funding. Just as in the House bill, the Senate version would send the states a fixed amount of money per Medicaid enrollee, known as a per-capita cap.

States could also opt to receive federal Medicaid funding as a block grant. Under the latter, states would get a set amount of federal funding each year, regardless of how many participants are in the program. Block grants wouldn't apply to funding for the elderly, disabled or children.

Either option would limit federal responsibility, shifting that burden to the states. However, since states don't have the money to make up the difference, they would likely either reduce eligibility, curtail benefits or cut provider payments. The block grant would be more restrictive since the funding level would not adjust for increases in enrollment, which often happens in bad economic times.

The Senate bill would also shrink the program even more over time by pegging the annual growth rate of those funds to standard inflation, rather than the more generous medical inflation, starting in 2025.

End enhanced federal funding for Medicaid expansion. The Senate would end the enhanced match rate for low-income adults covered under Medicaid expansion starting in 2021, one year later than in the House bill. It would then phase out the enhanced funding over three years, bringing federal support down to the traditional match rate starting in 2024. States, however, would have a tough time making up the difference, likely leading many to curtail enrollment, benefits or provider payments.

Allow states to institute work requirements for Medicaid. States would now have the option of requiring able-bodied Medicaid recipients to work. The disabled, elderly and pregnant women would be exempt, however.

Related: Senate GOP health plan may not protect millions on Medicaid expansion

Continue basing subsidies on income. Obamacare provides premium subsidies based on enrollees' income and cost of coverage in their area. The House bill would have offered refundable tax credits based mainly on age.

The Senate bill jettisons the House plan, instead providing assistance similar to Obamacare's subsidies. But the Senate's subsidies would be based on income, cost of coverage and age.

The Senate bill would tighten the eligibility criteria starting in 2020, shutting out more middle class folks from government help. Only those earning up to 350% of the poverty level ($41,600) would qualify, rather than the 400% threshold ($47,500) contained in Obamacare.

It would also open up the subsidies to enrollees below the poverty level so those living in states that didn't expand Medicaid could get some assistance to buy policies on the private market -- though it's questionable whether the poor could afford coverage even with the subsidies. Those eligible for Medicaid could not get the subsidies.

Peg subsidies to plans with higher deductibles. One notable change the Senate is making to the subsidy structure is to tie the payments to a less generous insurance plan. Under Obamacare, subsidy payments are based on the price of the second-lowest cost silver plan in one's area. In 2017, the average deductible for a silver plan was just under $3,600, according to Health Pocket, an insurance shopping site.

The Senate, however, would provide subsidies based on the cost of bronze plans, which had an average deductible of nearly $6,100 in 2017. This means consumers will likely have to pay more out of pocket to see the doctor and get treatment, though it reduces how much the federal government has to spend on the subsidies.

The Senate bill would also scale back the subsidies if they cost more than 0.4% of the nation's GDP, the most common metric of the nation's economy.

Make older consumers pay more. The Senate bill makes the subsidies less generous for older consumers with moderate incomes. They would have to put a larger share of their income towards coverage than younger ones earning the same amount. For instance, a 60-year-old enrollee making 350% of the poverty line would have to pay 16.2% of his income towards premiums, while a 29-year-old would only have to shell out 6.4%.

Loosen the age-band so insurers can charge older folks more. Under Obamacare, insurers could only charge older enrollees three times more than younger policy holders. The GOP bill would widen that band to five-to-one, which would hike premiums for those in their 50s and early 60s, but reduce them for younger folks.

Related: Comparing the Senate health care bill to Obamacare and the House proposal

Repeal the individual and employer mandates. Both the Senate and the House would get rid of the Obamacare provision that people must have health coverage or face a tax penalty. It would also eliminate the requirement that employers with at least 50 employees provide health insurance to their workers.

Under Obamacare, these companies were required to provide affordable insurance to staffers who work more than 30 hours a week. They would face a penalty if they did not meet this criteria and their employees sought subsidies on the exchanges. These repeal provisions take effect retroactively as of 2016.

Unlike the House bill, the Senate plan would not levy a 30% premium surcharge on those who let their coverage lapse. This was designed to keep people -- particularly healthy ones -- in the market, which would lower premiums.

Maintain ban on insurers setting premiums based on health status. The Senate bill would require insurers to cover those with pre-existing conditions and ban them from basing premiums on a person's health history. Last-minute House concessions to conservatives would have allowed states to obtain waivers of Obamacare's community rating provision. That would have permitted insurers to charge higher rates to those with pre-existing conditions who let their coverage lapse.

Allow states to seek waivers of the federal requirement that insurers cover 10 essential health benefits. Under Obamacare, carriers must provide 10 essential health benefits, including maternity, mental health, substance abuse and prescription drugs. The Senate bill would allow states to seek waivers of this provision, which would let insurers offer less comprehensive policies. This means those with pre-existing conditions may not be able to buy plans that cover all of their treatments and care.

Provide stabilization funding. The bill provides $50 billion over four years, starting in 2018, to help stabilize the insurance market. This reinsurance fund would give federal injections to insurers to help them cover higher-cost enrollees.

The legislation also allocates an additional $62 billion in state grants between 2019 and 2026. States could use that money in a variety of ways, but it is mainly aimed at offering financial assistance to high-cost consumers and giving insurers funds to lower premiums and to keep them in the market.

The House bill provided a total of $138 billion in a state stability fund to help states and insurers cover high-cost enrollees.

Provide temporary funding for cost-sharing subsidies to lower deductibles and co-pays. The Senate bill would also aim to shore up the existing Obamacare market by allocating funds for the cost-sharing subsidies until 2019. The payments reduce the deductibles and co-pays for more than half of enrollees on the Obamacare exchanges.

This will placate insurers, who were upset by President Trump's refusal to commit to continue making these payments, leading many carriers to hike rates or drop out of the exchanges for 2018.

However, the Senate bill would eliminate these subsidies starting in 2020.

Allow kids under age 26 to remain on their parents' policies. The Republicans want to keep this Obamacare provision, which has helped insure young adults. By one estimate, seven million people get coverage as a result.

Offer two tax cuts for the wealthy. The bill would eliminate two taxes that Obamacare imposed on the well-to-do to help pay for the law: The 3.8% tax on investment income and the 0.9% Medicare payroll tax on incomes over $200,000 for individuals and $250,000 for married couples who file jointly. The investment income tax would disappear in 2017, but the Medicare payroll tax would remain until 2023.

Repeal the taxes on health insurers, prescription drug makers and medical devices. The bill seeks to lift the annual tax Obamacare imposed on drug makers and health insurers and It would also get rid of the 2.3% excise tax on the sale of certain medical devices that was put in place. The taxes would disappear in either 2017 or 2018, depending on the levy.

Delay the Cadillac tax. Like the House bill, the Senate plan keeps but delays the controversial Cadillac tax, which calls for imposing a 40% excise tax on generous employer health insurance plans. Originally scheduled to go into effect in 2018, the law would have taxed employers on any premiums that exceed $10,200 for individual policies and $27,500 for family plans. After intense lobbying by companies and unions, lawmakers pushed back the start date to 2020. The Senate and House bills delay it until 2026.

Make tax-advantaged accounts for health costs more generous. Today, individuals can save up to $3,400 and families can save up to $6,750 tax free in a Health Savings Account. The Senate and House bills would raise that limit to the annual out-of-pocket maximum for high-deductible plans. For 2018, that would be $6,650 for individuals and $13,300 for families.

The legislation also would eliminate the caps on contributions to tax-deductible flexible spending accounts. Right now, employed individuals may each save up to $2,600 a year, so a two-earner couple can put away $5,200.

Raising or eliminating contribution limits on tax-advantaged accounts disproportionately benefits the highest-income Americans because they're in the best position to sock away more money.

The bills would also end the Obamacare prohibition on paying for over-the-counter medications with funds from tax-advantaged health accounts. And they reduce the penalty from 20% to 10% -- which was the pre-Obamacare levy -- if funds from an HSA are used for non-medical purposes. These provisions would take effect in 2018.

Say goodbye to the tanning tax. The bill would eliminate a 10% tax on indoor tanning services that was introduced as part of Obamacare. It would take effect in October 2017.

Related: Republican health care plan would repeal 'tanning tax'

Reduce the income threshold for deducting medical expenses. Under the Senate bill, taxpayers would be able to deduct medical expenses that exceed 7.5% of their adjusted gross income. Obamacare had raised the threshold to 10%. This would begin in 2017.

Defund Planned Parenthood. In keeping with longstanding Republican beliefs, the legislation prohibits federal funding for Planned Parenthood. But the restriction is only for a year.