public static void convertFunctionWrappedExternalPointer(Symbol functionSymbol) {
		if (functionSymbol.getSymbolType() != SymbolType.FUNCTION) {
			return;
		}
		Program program = functionSymbol.getProgram();
		Listing listing = program.getListing();
		SymbolTable symbolTable = program.getSymbolTable();
		Data data = listing.getDefinedDataAt(functionSymbol.getAddress());
		if (data == null || !data.isPointer()) {
			return;
		}
		Reference ref = data.getPrimaryReference(0);
		if (ref == null || !ref.isExternalReference()) {
			return;
		}
		Address extAddr = ref.getToAddress();
		Symbol s = symbolTable.getPrimarySymbol(extAddr);
		if (s == null) {
			// Bad external reference
			program.getReferenceManager().delete(ref);
			return;
		}
		Function func = (Function) functionSymbol.getObject();
		if (func == null) {
			return;
		}

		try {
			if (s.getSymbolType() != SymbolType.LABEL) {
				functionSymbol.delete();
				return;
			}
			ExternalLocation extLoc = (ExternalLocation) s.getObject();
			Function extFunc = extLoc.createFunction();
			extFunc.setComment(func.getComment());
			func.setComment(null);
			extFunc.setStackPurgeSize(func.getStackPurgeSize());
			extFunc.setCallingConvention(func.getCallingConventionName());
			extFunc.setNoReturn(func.hasNoReturn());
			extFunc.setReturnType(func.getReturnType(), SourceType.ANALYSIS);
			for (Parameter param : func.getParameters()) {
				extFunc.addParameter(param, param.getSource());
			}
			extFunc.setVarArgs(func.hasVarArgs());
			functionSymbol.delete();
		}
		catch (InvalidInputException e) {
			Msg.error(ProgramUtilities.class, "Unexpected Exception", e);
		}
		catch (DuplicateNameException e) {
			Msg.error(ProgramUtilities.class, "Unexpected Exception", e);
		}
	}
Convert old function wrapped external pointers.  Migrate function to
external function.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/ProgramUtilities.java