As we can see in the main function of recovery, it calls to the get_args function to retrieve arguments from the main system or bootloader. The following is the flow diagram of get_args. It is in the same $AOSP/bootable/recovery/recovery.cpp file as the main function of recovery.
From the following code snippet, we can see that it calls to the get_bootloader_message function to get the BCB data structure, boot:
static void get_args(int *argc, char ***argv) { struct bootloader_message boot; memset(&boot, 0, sizeof(boot)); get_bootloader_message(&boot); // this may fail, ...