private void uniqueHash(Varnode root, PcodeSyntaxTree fd) {
		ArrayList<Varnode> vnlist = new ArrayList<>();
		ArrayList<Varnode> vnlist2 = new ArrayList<>();
		ArrayList<Varnode> champion = new ArrayList<>();
		int method;
		long tmphash = 0;
		Address tmpaddr = null;
		int maxduplicates = 8;

		for (method = 0; method < 4; ++method) {
			clear();
			calcHash(root, method);
			if (hash == 0) {
				return;				// Can't get a good hash
			}
			tmphash = hash;
			tmpaddr = addrresult;
			vnlist.clear();
			vnlist2.clear();
			gatherFirstLevelVars(vnlist, fd, tmpaddr, tmphash);
			for (int i = 0; i < vnlist.size(); ++i) {
				Varnode tmpvn = vnlist.get(i);
				clear();
				calcHash(tmpvn, method);
				if (getComparable(hash) == getComparable(tmphash)) {		// Hash collision
					vnlist2.add(tmpvn);
					if (vnlist2.size() > maxduplicates) {
						break;
					}
				}
			}
			if (vnlist2.size() <= maxduplicates) {
				if ((champion.size() == 0) || (vnlist2.size() < champion.size())) {
					champion = vnlist2;
					vnlist2 = new ArrayList<>();
					if (champion.size() == 1) {
						break;		// Current hash is unique
					}
				}
			}
		}
		if (champion.size() == 0) {
			hash = 0;
			addrresult = Address.NO_ADDRESS;	// Couldn't find a unique hash
			return;
		}
		int total = champion.size() - 1;	// total is in range [0,maxduplicates-1]
		int pos;
		for (pos = 0; pos <= total; ++pos) {
			if (champion.get(pos) == root) {
				break;
			}
		}
		if (pos > total) {
			hash = 0;
			addrresult = Address.NO_ADDRESS;
			return;
		}
		hash = tmphash | ((long) pos << 49);	// Store three bits for position with list of duplicate hashes
		hash |= ((long) total << 52);	// Store three bits for total number of duplicate hashes
		addrresult = tmpaddr;
	}
Encode a particular PcodeOp and slot
@param op is the PcodeOp to preserve
@param slot is the slot to preserve (-1 for output, >=0 for input)
@param method is the method to use for encoding (4, 5, or 6)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/DynamicHash.java