if (tr instanceof TraceCounterRecord) {
if (tr instanceof TraceCounterRecord || tr instanceof TracePaddingRecord || tr instanceof TraceExitRecord   ) {
  static private void build_structure(Trace trace)  {    TraceRecord[] records = trace.records;    if(options.debug>=3)System.out.println("build_structure() n_records = "+records.length);    for (int n_records=0; n_records<records.length; n_records++) {      TraceRecord tr = records[n_records];      if (tr == null) return;          if (tr instanceof TraceCounterRecord) {      } else if (tr instanceof TraceStartAppRecord) {	TraceStartAppRecord tsar = (TraceStartAppRecord)tr;	if(options.debug>=3)	  System.out.println("Start    application "+tsar.app_name+" at record "+n_records);	startApplication.put(tsar.app_name, new Integer(n_records));	      } else if (tr instanceof TraceCompleteAppRecord) {	TraceCompleteAppRecord tcar = (TraceCompleteAppRecord)tr;	if(options.debug>=3)	  System.out.println("Complete application "+tcar.app_name+" at record "+n_records);	completeApplication.put(tcar.app_name, new Integer(n_records));	      } else if (tr instanceof TraceStartAppRunRecord) {	TraceStartAppRunRecord tsarr = (TraceStartAppRunRecord)tr;	if(options.debug>=3)	  System.out.print("Start    application "+tsarr.app_name+" run "+tsarr.run+" at record "+n_records);	Integer Index = (Integer)startApplicationRunIndex.get(tsarr.app_name);	int [] map = null;	if (Index == null) {	  // first time run found for this application	  if(options.debug>=3)System.out.println(" first run ");	  Index = new Integer(tsarr.run+1);	  map = new int[tsarr.run+1];	  map[tsarr.run] = n_records;	} else {	  if(options.debug>=3)System.out.println();	  Index = new Integer(tsarr.run+1);	  map = (int[])startApplicationRunMap.get(tsarr.app_name);	  map = Utilities.addIntArrayElement(map, n_records, tsarr.run);	}	startApplicationRunIndex.put(tsarr.app_name, Index);	startApplicationRunMap.put(  tsarr.app_name, map);      } else if (tr instanceof TraceCompleteAppRunRecord) {	TraceCompleteAppRunRecord tcarr = (TraceCompleteAppRunRecord)tr;	if(options.debug>=3)	  System.out.print("Complete application "+tcarr.app_name+" run "+tcarr.run+" at record "+n_records);	Integer Index = (Integer)completeApplicationRunIndex.get(tcarr.app_name);	int [] map = null;	if (Index == null) {	  // first time run found for this application	  if(options.debug>=3)System.out.println(" first run found!");	  Index = new Integer(tcarr.run+1);	  map = new int[tcarr.run+1];	  map[tcarr.run] = n_records;	} else {	  if(options.debug>=3)System.out.println();	  Index = new Integer(tcarr.run+1);	  map = (int[])completeApplicationRunMap.get(tcarr.app_name);	  map = Utilities.addIntArrayElement(map, n_records, tcarr.run);	}	completeApplicationRunIndex.put(tcarr.app_name, Index);	completeApplicationRunMap.put(  tcarr.app_name, map);      } else {	System.out.println("***TraceFileReader.build_structure() unknown trace record format!***");	//	System.exit(-1);      }    } // end for  }