The war has left the country significantly weakened - and Ayatollah Ali Khamenei a diminished leader