public static void getVariableRefs(Variable var, List<Reference> xrefs,
			List<Reference> offcuts) {
		Address addr = var.getMinAddress();
		if (addr == null) {
			return;
		}

		Program program = var.getFunction().getProgram();
		ReferenceManager refMgr = program.getReferenceManager();
		Reference[] vrefs = refMgr.getReferencesTo(var);
		for (Reference vref : vrefs) {
			if (addr.equals(vref.getToAddress())) {
				xrefs.add(vref);
			}
			else {
				offcuts.add(vref);
			}
		}
	}
Populates the provided lists with the direct and offcut xrefs to the specified variable

@param var     variable to get references
@param xrefs   list to put direct references in
@param offcuts list to put offcut references in
Ghidra/Features/Base/src/main/java/ghidra/app/util/XReferenceUtil.java