Some got special prizes. Cruise lines, craft beer and wine producers (even foreign ones), car dealers, private equity, and oil and gas pipeline managers did particularly well. And perhaps the biggest winner is the industry where President Trump and his son-in-law, Jared Kushner , made their millions: commercial real estate.

After a frenzy of congressional action to rewrite the tax code, salesclerks and chief executives are calculating their gains. Business was treated with the everyone's-a-winner approach that ensures no summer camper goes home without a trophy.

House and Senate Republicans, in their divergent bills, both offered steeply reduced rates to corporate giants, partnerships and family-owned firms across the board. But when it came time to eliminate special breaks or impose tighter standards, real estate was generally excused from the room.

Most businesses were hit with new limits on deductions for interest payments, but not real estate. Most industries lost the ability to defer taxes on the exchange of similar kinds of property, but not real estate. Domestic manufacturers and pharmaceutical companies lost some industry-specific breaks, like the tax credit for so-called orphan drugs, in exchange for lower rates.

More from NYT:

Conservative groups seeking support for tax cuts find it a hard sell

Tax plan aims to slay a Reagan target: The government beast

How New Yorkers would lose under the Republican tax bill

The real estate industry ended up with an even more generous depreciation timetable, allowing owners to shelter more income.

And in a break from previous practice, rental and mortgage-interest income qualifies for a lower tax rate, the kind of special treatment traditionally reserved for long-term capital gains and certain qualified dividends.

"Real estate does great," said Daniel N. Shaviro, a professor of taxation at New York University Law School, who as a congressional staff member helped write the 1986 tax overhaul. "It's hard to imagine what they might have asked for that they don't have."

Real estate investment trusts, known as REITs, have extra cause for celebration. They are companies that make money by owning, financing and operating real estate. Both the Trump Organization and Kushner Companies, the family real estate firm partly owned by Mr. Kushner, have important deals with such trusts.

A REIT functions like a mutual fund, but instead of assembling a portfolio of stocks, it allows people to invest in a bundle of real estate assets, both buildings and mortgages. More important is the way they are taxed. They pay no separate business tax and instead are required to pass along virtually all of their taxable income to shareholders, who pay the tax when they file individual returns.

The Republican proposals sharply lower the top tax rate on the income that REITs and other businesses pass through to their owners and shareholders. Currently, those investors must pay taxes on that income at rates as high as 39.6 percent. Under the Senate provision, it would drop to 29.6 percent. (The House bill drops the rate even lower, to 25 percent.)

That's a big savings, and a big advantage. Those receiving mortgage-interest income outside a REIT would have to pay taxes based on ordinary rates.

The Trump Organization is a partner in two of its largest properties with Vornado Realty Trust, a REIT based in New York City. In January, the White House appointed Vornado's founder and chairman, Steven Roth, to develop a trillion-dollar infrastructure package as a leader of an advisory council that has since been abandoned.

Vornado has also been associated with Kushner Companies, helping bail out its stake in 666 Fifth Avenue, the Kushners' flagship property, when it was in danger of defaulting on a more than $1 billion loan.

Kushner Companies has teamed up with another New York-based REIT, SL Green Realty Corporation, in several deals. They are collaborating on a development in Brooklyn, and SL Green lent Mr. Kushner's firm $85 million in 2016 to refinance its slice of the former headquarters of The New York Times in Manhattan.

A Kushner Companies spokeswoman said the firm had not done any lobbying on the tax bill.

Kurt Koegl, a partner at the national accounting firm Marcum, noted that a lower corporate tax rate would enable other kinds of companies to better compete with REITs.

But REITs are favored in other ways. Individuals who borrow money to invest in a REIT will be able to deduct the interest they pay on the loan at the top individual rate. When it comes to paying taxes on the interest income they earn from that REIT investment, however, the new, lower pass-through rate would apply.

"That's a great deal, and it's going to create giant new tax shelters," said Steven M. Rosenthal, a tax expert at the nonpartisan Tax Policy Center. The tax code generally tries to prohibit this kind of tax rate arbitrage, he added.

The REIT advantage is one example of a broader issue: different tax treatment for similar activities.

Writers of the congressional bills promised that their overhaul would simplify the tax code, but the intricacies of the changes create countless opportunities for gamesmanship.

"Suddenly, there are a dozen different tax rates that apply to different businesses, in different industries, and to different investments," said Adam Looney, a senior fellow at the Brookings Institution and a former Treasury Department official. That means opportunities to come out ahead by making deals between these different groups or structuring businesses to take advantage of various provisions.

That could lead to a flurry of restructuring and asset shifting that has no purpose other than lowering the tax rate. One business might borrow money to invest in another, or buy equipment and treat it as an expense and then lease it to another company.

Ideally, the tax code is meant to encourage businesses to make sound economic decisions, and forgo activities whose sole purpose is to avoid taxes. But the proliferation of different business rates rewards loophole hunting and earnings shifting.

"The speed with which they're doing this creates a level of ambiguity that will keep tax lawyers and tax professionals busy for 20 years," said Scott D. Michel, a tax lawyer with Caplin & Drysdale.

For some industries, such accounting acrobatics may not be necessary. A Senate provision that is being marketed as an aid to small craft breweries would save money even for the largest beer, wine and liquor producers, whether they are in the United States or abroad.

Foreign cruise lines that operate in the United States got a last-minute reprieve from a new tax that was in an earlier version of the Senate bill.

Whistle-blowers and their attorneys are happy about a provision specifying that they can collect rewards based on criminal fines.

Car dealers escaped the cap on interest deductions that apply to most other businesses. Private equity firms were not able to sidestep that cap, but they held on to most of the carried-interest benefit that allows private equity managers, hedge fund managers and real estate investors to pay a lower rate on much of their income. Firms will have to hold an asset for three years instead of one, but the average hold time is already more than five years.

The energy industry also did well. Coal and natural gas would potentially benefit from provisions that undercut their renewable-energy competitors. In a reversal of more than four decades of national policy, the Senate bill would open a pristine 1.5-million-acre expanse of the Arctic National Wildlife Refuge to oil and gas exploration.

And at the last minute, the Senate bill gave master limited partnerships, which mainly finance pipelines, the same special tax treatment that REITs have: a lower rate on the income they generate.

House and Senate Republicans are still wrangling over the final version, and every comma is subject to change. But to some tax experts, an unlevel playing field that gives certain types of business and structures advantages over others is a bigger concern than a tax break for real estate or any other industry.

"It's easy to look at the deals that are explicitly in the bill — like the special treatment of auto-dealer financing or whistle-blowers — and call out 'loophole,'" Mr. Looney of Brookings said. "But the big problems are the things that aren't specifically noted in the bill, but will arise because of tax planning."