A First-Principles Multi-phase Equation of State of Carbon under Extreme Conditions