What can our next president do about the flawed, and downright dangerous, Iran deal?

Of course, President Obama and Secretary of State John Kerry will tell you all is well. Iran is in full compliance. The international community is keeping a vigilant eye. Worse comes to worst, if Iran violates the deal, sanctions can quickly be “snapped back.”

Really?

Under the agreement, Iran was supposed to reduce its stockpiles of heavy water, which can be used for making plutonium-based bombs. Oops — turns out it overproduced and has 70 tons beyond the agreed-on amount.

No worries. America will buy some of the excess stock, 32 tons of it, for $8.6 million (even though Iranian access to US currency wasn’t part of the deal).

But where is that excess stock now? As Harvard’s Olli Heinonen told a group of reporters this week, “It looks to me that it isn’t in US government possession.” It might be in or outside Iran — say, in Oman — while the purchase details are finalized.

If Iran still legally owns that stock today (as is likely), that’s a violation of the deal, while we pretend it’s in full compliance.

As a former top inspector at the International Atomic Energy Agency, which is charged with making sure Iran complies with the deal, Heinonen should know. He says the most recent IAEA report on that file is “fairly thin,” missing quite a few details.

One footnote states that man-made uranium was found in the secretive military base of Parchin (after Iran agreed to allow very limited inspection access there). Did it get there because of “contamination” — traces transferred from another site? Does it indicate advance nuclear research, in gross violation of the deal? No follow-up is indicated. Just an obscure footnote.

Maybe this is outside political pressure. Maybe the inspectors’ own decision. Either way, Heinonen says, the IAEA director, Yukiya Amano, “has taken this line that everything’s OK.”

If only.

Alas, the next president can’t simply tear up that deal. Although never signed as a treaty, it’s backed by a United Nations Security Council resolution, so America’s legally obliged to abide by it.

That doesn’t mean we can’t do anything. Iran is renegotiating the deal as we speak. It’s demanding, for one, access to the US banking system, which wasn’t part of the deal. As Mark Dubowitz of the Foundation for Defense of Democracies sees it, we should renegotiate, too.

A few ideas:

Rethink the gradual closing of Iran’s nuclear file. The deal’s “sunset” clause allows the mullahs in, at most, 15 years to decide on their own if they want to be a nuclear-armed power. It removes an existing arms embargo after five years and nixes restrictions on industrial advanced centrifuges in less than nine years. It’s the most dangerous part of the Iran deal.

Impose more sanctions on Iran for testing ballistic missiles — even though the UN resolution doesn’t completely mandate a ban on such activities. The more tests Iran conducts, the faster it’ll develop the capacity to bomb Israel, Europe or even the United States with nukes or other WMDs.

Impose new American sanctions on Iran for its human-rights violations, which are only growing under the “moderate” President Hassan Rouhani.

Give ourselves the ability to really return tough sanctions, if and when needed, by denying Iranian access to world financial institutions.

That means banking systems that the US can influence, insurance and re-insurance companies and any other financial tool America can use in the future to lean on companies eager to explore Iranian markets.

The next president should signal early on that the mullahs will no longer have it as easy as they did with Kerry and Obama. Getting tough with Tehran won’t only ease some of the Mideast allies’ biggest fears. It’ll also strengthen America’s stance in the world and perhaps even encourage the people of Iran to stand up to their oppressive rulers.

Obama’s mantra has been “It’s this deal or war.” But as Dubowitz sees it, with an increasingly belligerent Iran and no change of direction, “we can get this deal and war.”