Re: Legality?
"All of it is entirely legal."
I'd dispute that it is legal - transfer pricing to move profits around is illegal in most jurisdictions. Just because the crooked megacorps like Starbucks often use "license agreements" in this way doesn't mean it's legal. The problem is that national authorities don't work hard enough to find the details, prove that this is what is going on, and prosecute. Partly this is lack of will because too many politicians are on the lobbying payroll, but in large part it is a resource, skills and talent problem in HMRC, who don't have the time, the experience, or the intellectual firepower to take on some of the world's best (paid) tax lawyers. In exactly the same way that a premiership footballer stands a much better chance than an ordinary Joe Soap of being acquitted for rape, driving offences or what have you, because his lawyer is an experienced, talented expert paid far more than the Clown Prosecution Service drones.
The best way to fix this would be to partly outsource complex tax investigations to legal experts on a contingent fee basis. The big law firms wouldn't touch this work because they are on the side of the bad guys, but there's plenty of small expert law firms who take up the cudgels and have more than enough expertise. In much the way that RBS got thoroughly nailed by "small" law firms over Highland Capital (wink, wink, nudge, nudge, to those in the know).