// Path: src/main/java/jasm/util/Pair.java
// public class Pair<FIRST,SECOND> {
// 	protected final FIRST first;
// 	protected final SECOND second;	
// 	
// 	public Pair(FIRST f, SECOND s) {
// 		first=f;
// 		second=s;			
// 	}		
// 	
// 	public FIRST first() { return first; }
// 	public SECOND second() { return second; }
// 	
// 	public int hashCode() {
// 		int fhc = first == null ? 0 : first.hashCode();
// 		int shc = second == null ? 0 : second.hashCode();
// 		return fhc ^ shc; 
// 	}
// 		
// 	public boolean equals(Object o) {
// 		if(o instanceof Pair) {
// 			Pair<FIRST, SECOND> p = (Pair<FIRST, SECOND>) o;
// 			boolean r = false;
// 			if(first != null) { r = first.equals(p.first()); }
// 			else { r = p.first() == first; }
// 			if(second != null) { r &= second.equals(p.second()); }
// 			else { r &= p.second() == second; }
// 			return r;				
// 		}
// 		return false;
// 	}
// 	
// 	public String toString() {
// 		String fstr = first != null ? first.toString() : "null";
// 		String sstr = second != null ? second.toString() : "null";
// 		return "(" + fstr + ", " + sstr + ")";
// 	}
// }


import jasm.attributes.*;
import jasm.lang.*;
import jasm.util.Pair;
import java.util.*;

		// First, check no two identical labels
		for(Bytecode b : code.bytecodes()) {
			if(b instanceof Bytecode.Label) {
				Bytecode.Label lab = (Bytecode.Label) b;
				if(labels.contains(lab.name)) {
					// need better error reporting system.
					throw new IllegalArgumentException("Duplicate label \""
							+ lab.name + "\" in method " + method.name() + ", "
							+ method.type());
				}
				labels.add(lab.name);
			}
		}
		
		// Second, check every branch target exists
		for(Bytecode b : code.bytecodes()) {
			if(b instanceof Bytecode.Branch) {
				Bytecode.Branch br = (Bytecode.Branch) b;
				if(!labels.contains(br.label)){
					throw new IllegalArgumentException("Unknown branch target \""
							+ br.label + "\" in method " + method.name() + ", "
							+ method.type());
				}
			} else if(b instanceof Bytecode.Switch) {
				Bytecode.Switch sw = (Bytecode.Switch) b;
				if(!labels.contains(sw.defaultLabel)){
					throw new IllegalArgumentException("Unknown branch target \""
							+ sw.defaultLabel + "\" in method " + method.name() + ", "
							+ method.type());
				}

// Path: src/main/java/jasm/util/Pair.java
// public class Pair<FIRST,SECOND> {
// 	protected final FIRST first;
// 	protected final SECOND second;	
// 	
// 	public Pair(FIRST f, SECOND s) {
// 		first=f;
// 		second=s;			
// 	}		
// 	
// 	public FIRST first() { return first; }
// 	public SECOND second() { return second; }
// 	
// 	public int hashCode() {
// 		int fhc = first == null ? 0 : first.hashCode();
// 		int shc = second == null ? 0 : second.hashCode();
// 		return fhc ^ shc; 
// 	}
// 		
// 	public boolean equals(Object o) {
// 		if(o instanceof Pair) {
// 			Pair<FIRST, SECOND> p = (Pair<FIRST, SECOND>) o;
// 			boolean r = false;
// 			if(first != null) { r = first.equals(p.first()); }
// 			else { r = p.first() == first; }
// 			if(second != null) { r &= second.equals(p.second()); }
// 			else { r &= p.second() == second; }
// 			return r;				
// 		}
// 		return false;
// 	}
// 	
// 	public String toString() {
// 		String fstr = first != null ? first.toString() : "null";
// 		String sstr = second != null ? second.toString() : "null";
// 		return "(" + fstr + ", " + sstr + ")";
// 	}
// }


// Path: src/main/java/jasm/verifier/ClassFileVerifier.java
import jasm.attributes.*;
import jasm.lang.*;
import jasm.util.Pair;
import java.util.*;

		// First, check no two identical labels
		for(Bytecode b : code.bytecodes()) {
			if(b instanceof Bytecode.Label) {
				Bytecode.Label lab = (Bytecode.Label) b;
				if(labels.contains(lab.name)) {
					// need better error reporting system.
					throw new IllegalArgumentException("Duplicate label \""
							+ lab.name + "\" in method " + method.name() + ", "
							+ method.type());
				}
				labels.add(lab.name);
			}
		}
		
		// Second, check every branch target exists
		for(Bytecode b : code.bytecodes()) {
			if(b instanceof Bytecode.Branch) {
				Bytecode.Branch br = (Bytecode.Branch) b;
				if(!labels.contains(br.label)){
					throw new IllegalArgumentException("Unknown branch target \""
							+ br.label + "\" in method " + method.name() + ", "
							+ method.type());
				}
			} else if(b instanceof Bytecode.Switch) {
				Bytecode.Switch sw = (Bytecode.Switch) b;
				if(!labels.contains(sw.defaultLabel)){
					throw new IllegalArgumentException("Unknown branch target \""
							+ sw.defaultLabel + "\" in method " + method.name() + ", "
							+ method.type());
				}

				for(Pair<Integer,String> c : sw.cases) {
