public Varnode[] getKilledVarnodes(Function targetFunc) {
		// TODO: This doesn't handle full bonded yet!
		PrototypeModel defaultCallingConvention =
			program.getCompilerSpec().getDefaultCallingConvention();

		if (targetFunc != null) {
			// TODO handle custom calling convention killed by call when supported
			PrototypeModel callingConvention = targetFunc.getCallingConvention();

			if (callingConvention != null) {
				return callingConvention.getKilledByCallList();
			}
		}

		// no function, so get the default convention and use that.
		if (killedVarnodes != null) {
			return killedVarnodes;
		}

		killedVarnodes = defaultCallingConvention.getKilledByCallList();

		// clean return varnodes out of list
		Varnode[] returnVarnodes = getReturnVarnode(null);
		ArrayList<Varnode> list = new ArrayList<Varnode>();
		for (Varnode varnode : killedVarnodes) {
			if (!ArrayUtils.contains(returnVarnodes, varnode)) {
				list.add(varnode);
			}
		}
		killedVarnodes = list.toArray(new Varnode[list.size()]);

		return killedVarnodes;
	}
@param targetFunc function to get killed varnodes for

NOTE: this removes the return varnodes so they aren't duplicated

@return varnode that represents where functions place their return value
Ghidra/Features/Base/src/main/java/ghidra/program/util/VarnodeContext.java