public int getAddrBySlot(int slotnum, int sz, int typeAlign, ParameterPieces res) {
		int spaceused;
		long offset;
		res.address = null;		// Start with an invalid result
		if (sz < minsize) {
			return slotnum;
		}
		if (alignment == 0) {		// If not an aligned entry (allowing multiple slots)
			if (slotnum != 0) {
				return slotnum;	// Can only allocate slot 0
			}
			if (sz > size) {
				return slotnum;		// Check on maximum size
			}
			offset = addressbase;			// Get base address of the slot
			spaceused = size;
			if ((flags & SMALLSIZE_FLOAT) != 0 && sz != size) {
				res.address = spaceid.getAddress(offset);
				res.joinPieces = new Varnode[1];
				res.joinPieces[0] = new Varnode(res.address, size);
				return slotnum;
			}
		}
		else {
			if (typeAlign > alignment) {
				int tmp = (slotnum * alignment) % typeAlign;
				if (tmp != 0) {
					slotnum += (typeAlign - tmp) / alignment;	// Waste slots to achieve typeAlign
				}
			}
			int slotsused = sz / alignment;	// How many slots does a -sz- byte object need
			if ((sz % alignment) != 0) {
				slotsused += 1;
			}
			if (slotnum + slotsused > numslots) {
				return slotnum;
			}
			spaceused = slotsused * alignment;
			int index;
			if (isReverseStack()) {
				index = numslots;
				index -= slotnum;
				index -= slotsused;
			}
			else {
				index = slotnum;
			}
			offset = addressbase + index * alignment;
			slotnum += slotsused;		// Inform caller of number of slots used
		}
		if (!isLeftJustified()) {
			offset += (spaceused - sz);
		}
		res.address = spaceid.getAddress(offset);
		if (res.address.getAddressSpace().getType() == AddressSpace.TYPE_JOIN) {
			res.joinPieces = getJoinPieces(sz);
		}

		return slotnum;
	}
Assign the storage address when allocating something of size -sz- assuming -slotnum- slots
have already been assigned.  Set the address to null if the -sz- is too small or if
there are not enough slots left
@param slotnum	number of slots already assigned
@param sz        number of bytes to being assigned
@param typeAlign required byte alignment for the parameter
@param res       will hold the final storage address
@return          slotnum plus the number of slots used
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/ParamEntry.java