As I understand it, there is no loophole here. They’re not getting any discount on their taxes for writing it off.
They’re just not going to make any money to be taxed on. If you paid them $1m for it, they’d have to pay tax on that million. And that’s all they’re trying to avoid.