private int getNumberOfRefsByBaseTypeinfos(GccTypeinfo typeinfo, List<GccTypeinfo> typeinfos)
			throws CancelledException {

		int numRefs = 0;
		for (GccTypeinfo typinfo : typeinfos) {
			monitor.checkCancelled();

			if (typinfo.isSpecialTypeinfo()) {
				continue;
			}

			if (!typinfo.isVmiClassTypeinfo()) {
				continue;
			}

			List<BaseTypeinfo> baseTypeinfos = typinfo.getBaseTypeinfos();
			for (BaseTypeinfo baseTypeinfo : baseTypeinfos) {
				monitor.checkCancelled();

				if (baseTypeinfo.getBaseTypeinfo().equals(typeinfo)) {
					numRefs++;
				}
			}
		}
		return numRefs;
	}
method to find the main vtable for the given typeinfo and if any, add the
construction ones to the passed in list

@param typeinfo
@param map
@param constructionVtables
@param numBaseRefs
@return address of main vtable for this class
@throws CancelledException
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RTTIGccClassRecoverer.java