public static ArrayList<Varnode> mergeSequence(ArrayList<Varnode> seq, Language language) {
		int i = 1;
		boolean bigEndian = language.isBigEndian();
		while (i < seq.size()) {
			Varnode hi = seq.get(i - 1);
			Varnode lo = seq.get(i);
			if (hi.isContiguous(lo, bigEndian))
				break;
			i += 1;
		}
		if (i >= seq.size())
			return seq;
		ArrayList<Varnode> buffer = new ArrayList<>();
		i = 1;
		buffer.add(seq.getFirst());
		boolean lastIsInformal = false;
		while (i < seq.size()) {
			Varnode hi = buffer.getLast();
			Varnode lo = seq.get(i);
			if (hi.isContiguous(lo, bigEndian)) {
				long off = bigEndian ? hi.getOffset() : lo.getOffset();
				int sz = hi.getSize() + lo.getSize();
				Varnode newVn = new Varnode(hi.getAddress().getAddressSpace().getAddress(off), sz);
				buffer.removeLast();
				buffer.add(newVn);
				// Test if new Varnode is a formal register
				if (!newVn.getAddress().isStackAddress()) {
					lastIsInformal =
						language.getRegister(newVn.getAddress(), newVn.getSize()) == null;
				}
			}
			else {
				if (lastIsInformal)
					break;
				buffer.add(lo);
			}
			i += 1;
		}
		if (lastIsInformal)		// If the merge contains an informal register
			return seq;			// throw it out and keep original sequence
		return buffer;
	}
Assuming the given list of Varnodes go from most significant to least significant,
merge any contiguous elements in the list.  Merges in a register space are only allowed
if the bigger Varnode exists as a formal register.
@param seq is the given list of Varnodes
@param language is the Language associated with the calling convention.
@return the merged list  (which may be the original list)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/ParameterPieces.java