private Function getChildVirtualFunction(RecoveredClass recoveredClass,
			int virtualFunctionNumber) throws CancelledException {

		Function nonThisFunction = null;

		List<RecoveredClass> childClasses = recoveredClass.getChildClasses();
		if (childClasses.isEmpty()) {
			return null;
		}

		// The child functions should all have the same function signature so just get any one of them
		// if for some reason they don't, still have to pick one and let user decide how to update
		for (RecoveredClass childClass : childClasses) {
			monitor.checkCancelled();

			List<Address> childVftableAddresses = childClass.getVftableAddresses();
			if (childVftableAddresses.isEmpty()) {
				continue;
			}

			// get the correct child vftable for the given parent class
			for (Address childVftableAddress : childVftableAddresses) {
				RecoveredClass parentForVftable =
					childClass.getVftableBaseClass(childVftableAddress);
				if (parentForVftable == null) {
					continue;
				}
				if (parentForVftable.equals(recoveredClass)) {
					List<Function> childVirtualFunctionsForGivenParent =
						childClass.getVirtualFunctions(childVftableAddress);
					if (childVirtualFunctionsForGivenParent.size() < virtualFunctionNumber) {
						continue;
					}
					Function vfunction =
						childVirtualFunctionsForGivenParent.get(virtualFunctionNumber - 1);
					Parameter[] parameters = vfunction.getParameters();
					if (parameters.length == 0) {
						continue;
					}
					if (parameters[0].getName().equals("this")) {
						return vfunction;
					}

					nonThisFunction = vfunction;
				}
			}
		}
		return nonThisFunction; //or null if no vfunctions at all which should never happen 
	}
Method to get a child class virtual function at the given offset into the correct virtual function table
@param recoveredClass the given class
@param virtualFunctionNumber the virtual function offset into the table
@return a child class virtual function at the given offset
@throws CancelledException if cancelled
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java