At stake is not only who leads Iran, but what the country has become, 50 years after a revolution that promised an end to dynastic rule.