Complex sentence: The Shahanshah was the sole and absolute regent, head of state and head of government of the empire, at least officially, though sometimes much power shifted de facto to other officials, especially the Spahbed.
Split into simpler sentences: The Shahanshah was the sole regent, head of state and head of government of the empire. At times, power shifted de facto to other officials, namely the Spahbed.