free_xml(graph);
crm_mem_stats(mem_stats); crm_free(mem_stats); cl_malloc_setstats(NULL);  #ifdef MCHECK muntrace(); #endif
main(int argc, char **argv){	crm_data_t * cib_object = NULL;	int argerr = 0;	int flag;			crm_data_t * graph = NULL;	char *msg_buffer = NULL;	const char *xml_file = NULL;		cl_log_set_entity("ptest");	cl_log_set_facility(LOG_USER);	set_crm_log_level(LOG_WARNING);		while (1) {		int option_index = 0;		static struct option long_options[] = {			/* Top-level Options */			{F_CRM_DATA,  1, 0, 'X'},			{"help", 0, 0, 0},      			{0, 0, 0, 0}		};    		flag = getopt_long(argc, argv, OPTARGS,				   long_options, &option_index);		if (flag == -1)			break;    		switch(flag) {			case 0:				printf("option %s", long_options[option_index].name);				if (optarg)					printf(" with arg %s", optarg);				printf("\n");    				break;      			case 'w':				inhibit_exit = TRUE;				break;			case 'X':				xml_file = crm_strdup(optarg);				break;			case 'V':				cl_log_enable_stderr(TRUE);				alter_debug(DEBUG_INC);				break;			default:				printf("?? getopt returned character code 0%o ??\n", flag);				++argerr;				break;		}	}  	if (optind < argc) {		printf("non-option ARGV-elements: ");		while (optind < argc) {			printf("%s ", argv[optind++]);		}		printf("\n");	}  	if (optind > argc) {		++argerr;	}  	if (argerr) {		crm_err("%d errors in option parsing", argerr);	}  	crm_info("=#=#=#=#= Getting XML =#=#=#=#=");  #ifndef CRM_USE_MALLOC	crm_malloc0(mem_stats, sizeof(cl_mem_stats_t));	cl_malloc_setstats(mem_stats);#endif		if(xml_file != NULL) {		FILE *xml_strm = fopen(xml_file, "r");		cib_object = file2xml(xml_strm);	} else {		cib_object = stdin2xml();	}#ifdef MCHECK	mtrace();#endif	graph = do_calculations(cib_object);#ifdef MCHECK	muntrace();#endif	msg_buffer = dump_xml_formatted(graph);	fprintf(stdout, "%s\n", msg_buffer);	fflush(stdout);	crm_free(msg_buffer);	free_xml(graph);	free_xml(cib_object);#ifndef CRM_USE_MALLOC	crm_mem_stats(mem_stats);	cl_malloc_setstats(NULL);#endif	/* required for MallocDebug.app */	if(inhibit_exit) {		GMainLoop*  mainloop = g_main_new(FALSE);		g_main_run(mainloop);			}		return 0;}