private static AddressSpace findAddressSpace(AddressFactory factory, String[] pieces) {
		// ignore the last piece, since that has to be part of the offset.

		int start = 1;
		int end = pieces.length - 2;
		if (pieces[end].length() == 0) { // if last piece is empty string, then it is not part of spaceName;
			end--;
		}

		while (start <= end) {
			String addrSpaceName = buildSpaceName(pieces, start, end);
			AddressSpace space = factory.getAddressSpace(addrSpaceName);
			if (space != null) {
				return space;
			}
			start++;
		}

		return factory.getDefaultAddressSpace();
	}
Returns the addressSpace that matches the largest range of parsed pieces, ignoring the first and
last piece (which can't be part of an addressSpace name).  In other words if the array of strings
passed in is {"a","b","c","d","e"}, it will test for addresSpaces named "b_c_d", then "c_d", and
finally "d".
@param factory the address factory containing the valid addressSpaces.
@param pieces the array of parsed label pieces
@return The addressSpace the matches the biggest string, or the default space if no match is found.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/symbol/SymbolUtilities.java