Transformation of Dirac Surface States across the Quantum Phase Transition in a Topological Crystalline Insulator