Apple CEO Tim Cook charmed the Senate today, testifying on the company's tax avoidance practices.

The most interesting part of the story wasn't on the Senate floor, however.

The report published by the Permanent Subcommittee on Investigations detailing Apple's strategies is a great read on its own.

The report gives an inside look on Apple's absolutely genius tax avoidance strategies.

Apple uses a variety of offshore structures and arrangements to shift billions of dollars from the United States to Ireland.

The U.S. corporate tax rate is 35%, while Apple said it has negotiated a special corporate tax rate in Ireland of less than 2%*.

(The 2% rate statement has proven controversial, see below for details)

Apple has found the secret to not paying taxes. You just avoid taxes by not declaring a tax residency for the company that oversees the entirety of your international income.

First, let's look at Apple's main offshore holding company:

Apple Operations International (AOI) is the company's primary offshore holding company. It was registered in Cork, Ireland in 1980, and its purpose is to serve as a cash consolidator for most of Apple's offshore affiliates. It receives dividends from those affiliates and makes contributions as needed.

Apple owns 100% of AOI either directly or through controlled foreign corporations.

AOI owns several subsidiaries, including Apple Operations Europe, Apple Distribution International, and Apple Singapore.

AOI has no physical presence and has not had any employees for 33 years. It has 2 directors and 1 officer, all Apple Inc. brass. One is Irish, two live in California.

32 of 33 AOI board meetings were held in Cupertino rather than Cork.

Shockingly, AOI doesn't pay taxes. Anywhere. The holding company had a net income of $30 billion from 2009 to 2012, but has not declared tax residency in any jurisdiction.

AOI's income made up 30% of Apple's total world profits from 2009- 2011.

A key quote from the report explains why AOI exists:

Apple explained that, although AOI has been incorporated in Ireland since 1980, it has not declared a tax residency in Ireland or any other country and so has not paid any corporate income tax to any national government in the past 5 years. Apple has exploited a difference between Irish and U.S. tax residency rules. Ireland uses a management and control test to determine tax residency, while the United States determines tax residency based upon the entity’s place of formation. Apple explained that, although AOI is incorporated in Ireland, it is not tax resident in Ireland, because AOI is neither managed nor controlled in Ireland. Apple also maintained that, because AOI was not incorporated in the United States, AOI is not a U.S. tax resident under U.S. tax law either. Please take a moment to consider the genius of Apple Inc. Apple Sales International (ASI) is a second Irish affiliate. It is the repository for all of Apple's offshore intellectual property rights.

ASI buys Apple's finished products from contracted manufacturers in China — think Foxconn — and resells them at a major markup to other Apple affiliates in Europe, the Middle East, Africa, India and the Pacific.

Although ASI is an Irish incorporated entity and the purchaser of the goods, only a small percentage of Apple’s manufactured products ever entered Ireland.

Upon arrival, the products were resold by ASI to the Apple distribution affiliate that took ownership of the goods.

Before 2012, ASI had no employees despite $38 billion in income over three years.

Apple's cost sharing arrangement facilitated the shift of $74 billion in worldwide profits away from the United States from 2009 to 2012.

ASI's parent company is Apple Operations Europe Inc. Together they own the intellectual property rights to Apple goods sold offshore.

Like AOI, ASI claims to be a tax resident of nowhere. It's not obligated to pay taxes to any nation.

Apple Sales International pays very, very little in global taxes:

The rest of the report is fascinating, but somewhat obtuse for people uninterested in international corporate finance.

Basically, Apple makes sure that income isn't taxed by the U.S. by exploiting a loophole in Subpart F of the corporate tax code.

They're able to route profits offshore and keep them there through licenses.

Here's the bottom line.

Apple was kind enough to tell the Senate investigators exactly how many taxes the company has dodged over two years by these arrangements:

Every day, Apple avoids paying more in taxes than Tumblr can hope to make all year.

Click here to read the full report >

*UPDATE: Earlier today an Irish minister disputed that Apple negotiated a tax rate less than two percent.

Here's the section from the subcommittee report disputing that comment, directly from Phillip Bullock, Apple Inc.'s Tax Operation Head. The interview was conducted on May 15, 2013.

Apple told the Subcommittee that, for many years, Ireland has provided Apple affiliates with a special tax rate that is substantially below its already relatively low statutory rate of 12 percent. Apple told the Subcommittee that it had obtained this special rate through negotiations with the Irish government. According to Apple, for the last ten years, this special corporate income tax rate has been 2 percent or less: “Since the early 1990’s, the Government of Ireland has calculated Apple’s taxable income in such a way as to produce an effective rate in the low single digits .... The rate has varied from year to year, but since 2003 has been 2% or less.” Other information provided by Apple indicates that the Irish tax rate assessed on Apple affiliates has recently been substantially below 2%. For example, Apple told the Subcommittee that, for the three year period from 2009 to 2011, ASI paid an Irish corporate income tax rate that was consistently below far below 1% and, in 2011, was as low as five-hundreds of one percent (0.05%):

It seems as if any deal pertains to a calculation of taxable income that procures a sub-2% rate rather than a toggled rate in and of itself.

And from document PSI-Apple-02-004, provided by Apple to the Senate: