South Africa completely controlled Day 3 of the second Test in Guwahati, finishing with a commanding 314-run lead over India.