Good analysis from another forum
tbh i dont think there's really any accounting for what trump does by looking at objectives or factions. instead, look at whether there's an easy win for trump personally or not. on paper it's very hard for iran to win a limited (e.g., not setting the entire region on fire and attacking gulf states) war of attrition against israel because israel will be endlessly resupplied from US stockpiles. but in reality, the level of support is now contingent on whether trump thinks he's going to get an easy dunk. so the longer and messier the war is for israel, the less appealing it is for trump personally to commit more US assets and the more likely it is that he will perceive israel's campaign as a loser he can distance himself from (which has already started happening.)
meanwhile, iran staying in a limited fight makes it more likely that they get increasing levels of tacit material support from russia, china, etc. because a) israel is demonstrating how unhinged and destabilizing for the region they are while, b) iran keeps demonstrating that their command and control and political apparatus is going to survive this and they're not increasing regional instability by drawing in more countries. they have a rock solid casus belli for what they're currently doing and racking up tangible victories on those terms will keep their own population aligned behind the regime, allowing them to further focus on the external enemy rather than on suppressing domestic unrest.
in conclusion iran is going to suffer terribly but probably come out ahead if they just keep doing what they're doing.