private Map<Long, Map<Integer, Object>> mapFunctionScalarAndAddressOperands(
			Function function, TaskMonitor monitor)
			throws CancelledException {

		Map<Long, Map<Integer, Object>> offsetToOperandsMap = new HashMap<>();
		

		Program program = function.getProgram();

		InstructionIterator func1InstIter =
			program.getListing().getInstructions(function.getBody(), true);

		while (func1InstIter.hasNext()) {
			monitor.checkCancelled();

			Instruction inst = func1InstIter.next();

			Map<Integer, Object> map = createOperandsMap(inst);

			if (map.keySet().isEmpty()) {
				continue;
			}
			
			// get offset from top of function to use in function to operandMap map
			// can be positive or negative offset (positive means instruction address is after 
			// the entry address, negative means instruction address is before entry address)
			Long entryOffset = function.getEntryPoint().getOffset();
			Long instOffset = inst.getAddress().getOffset();
			Long offset = instOffset - entryOffset;

			offsetToOperandsMap.put(offset, map);
		}

		if (offsetToOperandsMap.keySet().isEmpty()) {
			return null;
		}

		return offsetToOperandsMap;
	}
Method to create a map of the given functions scalar operands and address reference operands. 
The map keys will be offsets from the top of the function to the instruction containing the
 operand(s).
The map entries will be a map of the operands at the instruction indicated by the key's 
 offset value. This map has keys for operand index and entries for the type of object at
 that operand index, either Scalar or Address 
@param function the given function
@param monitor the task monitor
@return the resulting map for the given function
@throws CancelledException if cancelled
Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/actions/AutoVersionTrackingTask.java