Now that the United States Congress has passed the Republican tax overhaul, Apple is in a position to potentially bring back its $252.3 billion foreign cash pile without a major tax hit.

In doing so, Apple would be paying a 15.5% tax on repatriated cash thanks to the cut in the corporate tax rate from 35% to 21%. Doing the math quickly, it would cost the company around $39.1 billion to repatriate its $252.3 billion foreign cash pile under the new tax bill.

While this has been the company’s long-standing goal, there’s one slight problem.

According to Reuters today, a provision in the bill creates a minimum tax of around 13% on income from patents held overseas whilst lowering a tax break for patents held in the US from the standard corporate rate of 21% down to 13.1%.

In effect, the company attributes a large portion of the value of its products to patents and other intellectual property such as trademarks.

Apple then assigns some of that IP, proportional to overseas sales, to subsidiaries in countries with low tax rates and assesses substantial patent royalties on sales. Those royalties then flow back to those low-tax locations, like Ireland.

The new tax bill would put an end to such practice by creating basically the same minimum tax on patent income as if the patents were held abroad. Because it would no longer matter where the patents were held from a tax rate perspective, the hope is that companies like Apple might be discouraged from assigning patents to their overseas subsidiaries.

“The whole intention of the measures is to bring back that intellectual property to the United States,” said Gavin Ekins, a research economist with the Tax Foundation.

On the other hand, some people believe that 13.1% is higher than Apple’s actual non-US patent tax rate. “It’s entirely possible their cash tax bill going forward would go up based on this alone,” said Ed Kleinbard, a tax professor at the University of California and former chief of staff of the US Congress’s Joint Committee on Taxation.

He added that Congress “screwed it up” by creating the patent box without providing a tax-break to companies that are willing to reassign their overseas patents to the United States.

Apple has thus far raised $97 billion debt to fund its capital return program. Why has Apple, with all its cash holdings, raised debt? Because it pays a far lower interest rate on its debt than the 35% corporate tax rate it would’ve paid on repatriated funds before the tax overhaul.

The company has said that it intends to repatriate some of its overseas cash pile and has already allocated $36.3 billion to pay Uncle Sam a one-time 15.5% tax on its $252.3 billion in overseas cash, which works out to about $39.1 billion.

If it brings its foreign cash back home, the Cupertino technology giant could easily clear all of its $97 billion in long-term debt with the repatriated cash and still have some spare change left.

Photo: iPhone 8 launch at Apple Store Regent, London