n = quads.size(); for (int i=0; i<n; i+=1) { Quad quad = (Quad) quads.get(i); if (!quad.isDeadCode()) { quad.generateCode(x86cg); } } os.flush();
	public static void main(String args[]) throws SecurityException, IOException, ClassNotFoundException {		X86CpuID cpuId = X86CpuID.createID("p5");		TextX86Stream os = new TextX86Stream(new OutputStreamWriter(System.out), cpuId);		X86CodeGenerator x86cg = new X86CodeGenerator(os);		VmByteCode code = loadByteCode(args);		IRControlFlowGraph cfg = new IRControlFlowGraph(code);		IRGenerator irg = new IRGenerator(cfg);		BytecodeParser.parse(code, irg);		BootableArrayList quads = irg.getQuadList();		int n = quads.size();		BootableHashMap liveVariables = new BootableHashMap();		for (int i=0; i<n; i+=1) {			Quad quad = (Quad) quads.get(i);			quad.doPass2(liveVariables);		}		Collection lv = liveVariables.values();		n = lv.size();		LiveRange[] liveRanges = new LiveRange[n];		Iterator it = lv.iterator();		for (int i=0; i<n; i+=1) {			Variable v = (Variable) it.next();			liveRanges[i] = new LiveRange(v);		}		Arrays.sort(liveRanges);		LinearScanAllocator lsa = new LinearScanAllocator(liveRanges);		lsa.allocate();		x86cg.setArgumentVariables(irg.getVariables(), irg.getNoArgs());		x86cg.setSpilledVariables(lsa.getSpilledVariables());		x86cg.emitHeader();		n = quads.size();		for (int i=0; i<n; i+=1) {			Quad quad = (Quad) quads.get(i);			if (!quad.isDeadCode()) {				quad.generateCode(x86cg);			}		}		os.flush();/*		BytecodeViewer bv = new BytecodeViewer();		BytecodeParser.parse(code, bv);		// System.out.println(cfg.toString());		// System.out.println();				boolean printDeadCode = false;		boolean printDetail = false;		IRBasicBlock currentBlock = null;		for (int i=0; i<n; i+=1) {			Quad quad = (Quad) quads.get(i);			if (currentBlock != quad.getBasicBlock()) {				currentBlock = quad.getBasicBlock();				System.out.println();				System.out.println(currentBlock);			}			if (printDeadCode && quad.isDeadCode()) {				if (printDetail) {					printQuadDetail(quad);				}				System.out.println(quad);			}			if (!quad.isDeadCode()) {				if (printDetail) {					printQuadDetail(quad);				}				System.out.println(quad);			}		}		System.out.println();		System.out.println("Live ranges:");		n = lv.size();		for (int i=0; i<n; i+=1) {			System.out.println(liveRanges[i]);		}*/	}