In msc_sys.c defined functions for the whole clock system, including RTC. That’s why msc_sys.c has [rtc.h] included.
msc_sys.c is used for start-up process, it has [rtc.h] and [gpio.h] included. That’s why RTC and GPIO are required for sample code.