// Path: src/mgi/tools/jagdecs2/util/DecompilerUtils.java
// public class DecompilerUtils {
// 
// 	public static class SwitchCase {
// 		private CaseAnnotation[] annotations;
// 		private FlowBlock block;
// 		
// 		public SwitchCase(CaseAnnotation[] annotations,FlowBlock block) {
// 			this.annotations = annotations;
// 			this.block = block;
// 		}
// 	
// 		public CaseAnnotation[] getAnnotations() {
// 			return annotations;
// 		}
// 	
// 		public FlowBlock getBlock() {
// 			return block;
// 		}
// 		
// 		public void setBlock(FlowBlock block) {
// 			this.block = block;
// 		}
// 		
// 		public String toString() {
// 			StringBuilder bld = new StringBuilder();
// 			for (int i = 0; i < annotations.length; i++) {
// 				bld.append(annotations[i]);
// 				if ((i + 1) < annotations.length)
// 					bld.append(" AND ");
// 			}
// 			bld.append("\t GOTO flow_" + block.getBlockID());
// 			return bld.toString();
// 		}
// 		
// 	}
// 
// 	public static SwitchCase[] makeSwitchCases(SwitchFlowBlockJump sbj) {
// 		SwitchCase[] buff = new SwitchCase[sbj.getCases().length];
// 		FlowBlock lastBlock = null;
// 		List<CaseAnnotation> annotations = new ArrayList<CaseAnnotation>();
// 		int count = 0;
// 		for (int i = 0; i < sbj.getCases().length; i++) {
// 			if (sbj.getTargets()[i] == lastBlock)
// 				annotations.add(sbj.getDefaultIndex() == i ? new CaseAnnotation() : new CaseAnnotation(sbj.getCases()[i]));
// 			else {
// 				if (lastBlock != null) {
// 					CaseAnnotation[] ann = new CaseAnnotation[annotations.size()];
// 					int aWrite = 0;
// 					for (CaseAnnotation a : annotations)
// 						ann[aWrite++] = a;
// 					buff[count++] = new SwitchCase(ann,lastBlock);
// 				}
// 				lastBlock = sbj.getTargets()[i];
// 				annotations.clear();
// 				annotations.add(sbj.getDefaultIndex() == i ? new CaseAnnotation() : new CaseAnnotation(sbj.getCases()[i]));
// 			}
// 		}
// 		if (lastBlock != null) {
// 			CaseAnnotation[] ann = new CaseAnnotation[annotations.size()];
// 			int aWrite = 0;
// 			for (CaseAnnotation a : annotations)
// 				ann[aWrite++] = a;
// 			buff[count++] = new SwitchCase(ann,lastBlock);
// 		}
// 		
// 		if (count == buff.length)
// 			return buff;
// 		
// 		SwitchCase[] full = new SwitchCase[count];
// 		System.arraycopy(buff, 0, full, 0, count);
// 		return full;
// 	}
// 	
// }


import java.util.ArrayList;
import java.util.List;
import mgi.tools.jagdecs2.ast.*;
import mgi.tools.jagdecs2.util.DecompilerUtils;

		if (!(v0 instanceof SwitchFlowBlockJump))
			return false;
		SwitchFlowBlockJump sw = (SwitchFlowBlockJump)v0;
		if (sw.getCases().length <= 0)
			return false;
		if (sw.getTargets()[0].getBlockID() <= block.getBlockID())
			return false;
		FlowBlock start = sw.getTargets()[0];
		FlowBlock end = sw.getTargets()[sw.getTargets().length - 1];
		if (start.getPrev() == null)
			attachSynthethicBlockBefore(start);
		if (end.getNext() == null)
			attachSynthethicBlockAfter(end);
		start = start.getPrev();
		end = end.getNext();
		
		main: while (true) {
			List<FlowBlock> outJumps = this.getAllOutjumps(start, end);
			for (FlowBlock out : outJumps) {
				if (out.getBlockID() < end.getBlockID())
					return false;
				if (end != out) {
					end = out;
					continue main;
				}
			}
			break;
		}
		
		

// Path: src/mgi/tools/jagdecs2/util/DecompilerUtils.java
// public class DecompilerUtils {
// 
// 	public static class SwitchCase {
// 		private CaseAnnotation[] annotations;
// 		private FlowBlock block;
// 		
// 		public SwitchCase(CaseAnnotation[] annotations,FlowBlock block) {
// 			this.annotations = annotations;
// 			this.block = block;
// 		}
// 	
// 		public CaseAnnotation[] getAnnotations() {
// 			return annotations;
// 		}
// 	
// 		public FlowBlock getBlock() {
// 			return block;
// 		}
// 		
// 		public void setBlock(FlowBlock block) {
// 			this.block = block;
// 		}
// 		
// 		public String toString() {
// 			StringBuilder bld = new StringBuilder();
// 			for (int i = 0; i < annotations.length; i++) {
// 				bld.append(annotations[i]);
// 				if ((i + 1) < annotations.length)
// 					bld.append(" AND ");
// 			}
// 			bld.append("\t GOTO flow_" + block.getBlockID());
// 			return bld.toString();
// 		}
// 		
// 	}
// 
// 	public static SwitchCase[] makeSwitchCases(SwitchFlowBlockJump sbj) {
// 		SwitchCase[] buff = new SwitchCase[sbj.getCases().length];
// 		FlowBlock lastBlock = null;
// 		List<CaseAnnotation> annotations = new ArrayList<CaseAnnotation>();
// 		int count = 0;
// 		for (int i = 0; i < sbj.getCases().length; i++) {
// 			if (sbj.getTargets()[i] == lastBlock)
// 				annotations.add(sbj.getDefaultIndex() == i ? new CaseAnnotation() : new CaseAnnotation(sbj.getCases()[i]));
// 			else {
// 				if (lastBlock != null) {
// 					CaseAnnotation[] ann = new CaseAnnotation[annotations.size()];
// 					int aWrite = 0;
// 					for (CaseAnnotation a : annotations)
// 						ann[aWrite++] = a;
// 					buff[count++] = new SwitchCase(ann,lastBlock);
// 				}
// 				lastBlock = sbj.getTargets()[i];
// 				annotations.clear();
// 				annotations.add(sbj.getDefaultIndex() == i ? new CaseAnnotation() : new CaseAnnotation(sbj.getCases()[i]));
// 			}
// 		}
// 		if (lastBlock != null) {
// 			CaseAnnotation[] ann = new CaseAnnotation[annotations.size()];
// 			int aWrite = 0;
// 			for (CaseAnnotation a : annotations)
// 				ann[aWrite++] = a;
// 			buff[count++] = new SwitchCase(ann,lastBlock);
// 		}
// 		
// 		if (count == buff.length)
// 			return buff;
// 		
// 		SwitchCase[] full = new SwitchCase[count];
// 		System.arraycopy(buff, 0, full, 0, count);
// 		return full;
// 	}
// 	
// }


// Path: src/mgi/tools/jagdecs2/FlowBlocksSolver.java
import java.util.ArrayList;
import java.util.List;
import mgi.tools.jagdecs2.ast.*;
import mgi.tools.jagdecs2.util.DecompilerUtils;

		if (!(v0 instanceof SwitchFlowBlockJump))
			return false;
		SwitchFlowBlockJump sw = (SwitchFlowBlockJump)v0;
		if (sw.getCases().length <= 0)
			return false;
		if (sw.getTargets()[0].getBlockID() <= block.getBlockID())
			return false;
		FlowBlock start = sw.getTargets()[0];
		FlowBlock end = sw.getTargets()[sw.getTargets().length - 1];
		if (start.getPrev() == null)
			attachSynthethicBlockBefore(start);
		if (end.getNext() == null)
			attachSynthethicBlockAfter(end);
		start = start.getPrev();
		end = end.getNext();
		
		main: while (true) {
			List<FlowBlock> outJumps = this.getAllOutjumps(start, end);
			for (FlowBlock out : outJumps) {
				if (out.getBlockID() < end.getBlockID())
					return false;
				if (end != out) {
					end = out;
					continue main;
				}
			}
			break;
		}
		
		

		DecompilerUtils.SwitchCase[] cases = DecompilerUtils.makeSwitchCases(sw);
