Apple, just days away from a U.S. ban of its smartwatches, is plotting a rescue mission for the $17 billion business that includes software fixes and other potential workarounds.

Engineers at the company are racing to make changes to algorithms on the device that measure a user’s blood oxygen level — a feature that Masimo has argued infringes its patents. They’re adjusting how the technology determines oxygen saturation and presents the data to customers, according to people familiar with the work.

It’s a high-stakes engineering effort unlike any Apple has undertaken before. Though the iPhone-maker’s products have previously been barred in certain countries over legal disputes, this restriction would hit one of Apple’s biggest moneymakers in its home country — on Christmas no less. Without a last-minute veto by the White House, a ban imposed by the International Trade Commission will take effect on Dec. 25.