Sporadic protests in Tehran have spread nationwide, affecting at least 40 cities and leaving at least 12 people dead, according to official reports and media tallies.