This answer is comprehensive and correct, especially the second half. You cannot game the IRS, period. Google and Apple have billions of dollars in the bank in Ireland they can't spend because they have tried to game the IRS.
Actually--they borrow their own money from their foreign subsidiaries to have full use of the cash in the US. Expect the incoming US president to suggest changes that allow Apple, Facebook, et al to allow this openly rather than through construction.