Effects of molecular potential and geometry on atomic core-level photoemission over an extended energy range: The case study of the CO molecule