I have listened to a number of journalists and political commentators, all of whom come up with the question, what will Iran do now? and all of them look at the obvious. Iran will not look at the obvious, If it cannot win, it will hurt so its primary outlet will be huge support for Russia. If Iran has not already done so, its access to 100,00 million Jihadis will give Russia, once trained, the manpower it needs to roll over Ukraine which means Iran and Russia will threatened the entire European mainland.
Given that many European countries have a Muslim fifth column inside their borders the chaos this would cause will go on for decades.