Profits are whatever you want them to be
Any accountant can make profits dance anywhere they like, for a multinational.
You can reduce profits in the UK by charging the UK firm a fee for use of IP, but ensure that said fee winds up in a place not taxed.
Google's global margins are around 27%.
Any sensible tax system would look at the UK sales, and if the company was declaring lower margins, simply tax the company as if it's UK margins reflected the global ones.
At a stroke this would remove any incentive for companies to structure in ways that focused on tax, but would have no effect on structure for logical business purposes. E.g. if Ireland has the best sales staff or L'burg the best IP lawyers, keep using them.
It's also something that every other country could implement as well.