“IT’S always a lot of fun when you win,” President Donald Trump enthused after his tax package was approved by Congress in December. Company bosses nodded along. The centrepiece of the reform is a drastic cut to the corporate-tax rate, from 35% to 21%, taking it below the rich-country average. Although its impact is partly offset by some revenue-raising measures, the congressional Joint Committee on Taxation estimates that American business will gain around $330bn from the reform over the next ten years. Yet within that are sizeable variations in terms of which firms and industries benefit most.

The biggest winners are more domestically oriented companies. These typically face higher effective tax rates than American companies with a big presence overseas, which do business in lower-tax countries. Bosses are also evaluating other new measures. So-called “full expensing”, for example, helps those with big spending plans by allowing them to deduct investment costs up front. But using debt will become less attractive, as interest payments are no longer fully deductible.

Some firms experienced high volatility in their earnings for the final quarter of 2017 thanks to the treatment of so-called “deferred tax assets”. These are past tax losses carried forward to set against future tax bills, and such assets have shrunk in value because of the lower corporate-tax rate. Other firms that hold deferred liabilities enjoyed big one-off gains.

Of the 150 S&P-listed companies that have so far released estimates of their effective tax rate for 2018, telecoms and consumer-focused companies (which often have a big American presence) expect to have gained the most, says Ramaswamy Variankaval of J.P. Morgan, an investment bank (see chart). AT&T, a telecoms giant, predicts a rise in cashflow of $3bn in 2018, or nearly a fifth of cashflow last year. Multinational firms do benefit from a lower American headline tax rate. They will also pay a much lower tax rate, of 15.5%, on foreign cash that is repatriated. Yet while they were previously taxed only when the money was brought home, now they must cough up and pay tax on all of their $3trn stockpile of foreign cash over an eight-year period. Other changes to the treatment of foreign income are more controversial. The new “base-erosion anti-abuse tax”, or BEAT, applies to all big firms operating in America and targets cross-border payments to foreign affiliates, such as royalties on intellectual property. Firms must now add such services back into their American corporate earnings, and pay a 10% tax (after 2018, until when a 5% rate applies) on this broader base—if it exceeds the standard calculation of 21% on a narrower base. Another new tax charge applies only to American firms that have “global intangible low-taxed income” or GILTI—returns on intangible assets, such as patents or software, parked abroad. Both BEAT and GILTI were intended to prevent companies from dodging tax by stashing intellectual property and other intangibles in tax havens, notes Jennifer Blouin, from the University of Pennsylvania. But, as drawn up, they are much broader, she says, and could capture all foreign affiliates, even if they already pay high tax rates, such as those in Germany. That has irked some European firms.

With bureaucrats still transcribing the hastily drafted legislation into rules for business, firms cannot yet be sure of their total impact. But many technology and pharmaceutical companies, even though together they hold the most cash abroad, anticipate slightly lower tax rates as a result of the reforms, says Mr Variankaval. Even Apple, which booked a $38bn tax payment on its $250bn mountain of foreign cash (it has yet actually to pay it), expects a net benefit. In contrast, some other firms, such as IBM and General Electric, expect slightly higher tax rates in 2018 than they paid last year, as the wider tax base offsets the lower headline rate.

Unsurprisingly, the reforms appear to negate the benefits of “inversion”, or setting up abroad for tax purposes. Valeant and Allergan, both drugmakers domiciled abroad, expect higher tax rates. It is too early to tell, though, if the tax changes will succeed in shifting supply chains and intangible assets back to America.

It is also too early to gauge how the winners will spend their gains. According to Americans for Tax Reform, a lobbying group, 377 companies have announced pay awards linked to the tax reform, including AT&T and American Airlines. Most are bonuses that amount to a small part of the total gains, leading sceptics to attribute the announcements to clever public relations. A few firms have gone further, announcing permanent wage increases or new investment projects. But these were probably in the pipeline anyway, given improving demand, says Matt Gardner, from the Institute on Taxation and Economic Policy, a think-tank.

That said, most analysts do expect the lower corporate-tax rate to make investing in America more attractive in the longer term. But if the past is any guide, argues Ms Blouin, repatriated earnings will mostly be returned to shareholders. Last week Cisco, a tech company, said that was precisely what it would do with most of the $67bn it was bringing home. Like Mr Trump, investors, too, are in for some fun.