The Iranians are Shiites so they won't side with ISIS who are Sunni.
The government in Baghdad is Shiite in the most part.
The Bathists (Sunni) are allied with ISIS (for the moment).
Wow...
A couple of phrases come to mind:
"Politics makes strange bedfellows"
and
"The enemy of my enemy is my friend."
Who would have thought that "axis of evil" Iran could ever be found working in the interests of the USA.