The electronic character of photoexcited molecules can abruptly change at avoided crossings and conical intersections. Here, we report direct mapping of the coupled interplay between electrons and nuclei in a prototype molecule, iodine monobromide (IBr), using attosecond transient absorption spectroscopy. A few-femtosecond visible pulse resonantly excites the B(3_0+) state of IBr and the accompanying photodissociation dynamics are tracked by an attosecond extreme-ultraviolet pulse that simultaneously probes the I-4d and Br-3d corelevel absorption edges. Direct comparison with quantum mechanical simulations unambiguously identifies the core-level absorption features associated with adiabatic and diabatic channels at the B/Y avoided crossing and concurrent two-photon dissociation processes that involve the Y/Z avoided crossing. The results show clear evidence for rapid switching of valence molecularorbital occupations at the avoided crossing.