fixed spot_scop_print_to_c() function to print the entire program and safe checking for null scop