The election was probably rigged but Ahmadinejad and Khamenei have the secret police. The regime has indeed lost legitimacy but it doesn't matter. A lot of regimes in the world have very little legitimaty in eyes of the people and live without any problems. What matters is authority. I think that the iranian people will have to live with this regime for another 30 years or until the regime runs out of easy oil money.