You are the living proof of why Americans are outright ignorant when it comes to international affairs. Open some history books before you let your uneducated mouth speak.
Iran just went through a bloody and chaotic revolution at that time, which changed the entire political order, but also saw its Imperial army being purged, with most of its generals being either executed or arrested. Almost its entire officer corpse was removed as well. Deemed as royal loyalists, most of its pilots either fled, were executed or imprisoned. In the war, Iran was fighting despite having less manpower, less armoured vehicles and tanks, less fighter jets, way less international political, military and economic support (the Saudis bankrolled Iraq throughout the entire war). You should check these numbers to understand the odds Iran was fighting against. The fact that Iran managed to survive, even recapturing all of its territory, was a bloody miracle, and couldn't have been possible without the sacrifices of the Iranian people.
Strength comparison:
Iraq: 9 well-armed divisions, 2750 tanks, 1400 artillery pieces, 4000 ACPs and 340 fighter bombers
Iran: 2 badly-depleted divisions and equally brigades, 500 tanks, 300 artillery pieces and no less than 100 operational aircraft.
What saved Iraq was not only petrodollars from the Gulf, but also US intelligence support. Rick Francona, who was a US intelligence officer in Iraq during that war, claimed that Iran would have captured Baghdad if it wasn't for the battlefield intelligence the Americans provided the Iraqis with. The same intelligence which were then used by Iraq to effectively use chemical weapons against Iranian forces:
http://foreignpolicy.com/2013/08/26...rove-america-helped-saddam-as-he-gassed-iran/
Do not blame us for your stupidity in eliminating competent military officers
Iraq was in possession of Iranian territory in 1988. If Iran had less manpower because they sacrificed entire generation of youth in human wave tactics