I don't understand how this is connected to execution of the main program that is described.
Processing of the part from the reset handler to the main program is performed by a "start-up file".
Specifically, a branch instruction to the start-up routine is generated in the reset handler, therefore, the start-up routine is executed first.
This routine sets and defines variables.
When initial settings of the variables have been completed, the main function of the program you created is called by a subroutine call instruction, and the main program is thus executed.
Usually, processing that is executed first after the microcontroller is started (part (1) of A1) is described before a subroutine call of the main function.