Evolution of terrestrial proto-CO2 atmosphere coupled with thermal history of the earth