private String generateSignature(PcodeOp op, String name, Function calledfunc) {

		// TODO: If an override has already be placed-down it should probably be used 
		// for the initial signature.  HighFunction does not make it easy to grab 
		// existing override prototype

		if (calledfunc != null) {
			SourceType signatureSource = calledfunc.getSignatureSource();
			if (signatureSource == SourceType.DEFAULT || signatureSource == SourceType.ANALYSIS) {
				calledfunc = null; // ignore
			}
		}

		StringBuffer buf = new StringBuffer();

		Varnode vn = op.getOutput();
		DataType dt = null;
		if (calledfunc != null) {
			dt = calledfunc.getReturnType();
			if (Undefined.isUndefined(dt)) {
				dt = null;
			}
		}
		if (dt == null && vn != null) {
			dt = vn.getHigh().getDataType();
		}
		if (dt != null) {
			buf.append(dt.getDisplayName());
		}
		else {
			buf.append(DataType.VOID.getDisplayName());
		}

		buf.append(' ').append(name).append('(');

		int index = 1;
		if (calledfunc != null) {
			for (Parameter p : calledfunc.getParameters()) {
				String dtName = getInputDataTypeName(op, index, p.getDataType());
				if (index++ != 1) {
					buf.append(", ");
				}
				buf.append(dtName);
				if (p.getSource() != SourceType.DEFAULT) {
					buf.append(' ');
					buf.append(p.getName());
				}
			}
		}

		for (int i = index; i < op.getNumInputs(); ++i) {
			if (i != 1) {
				buf.append(", ");
			}
			buf.append(getInputDataTypeName(op, i, null));
		}

		buf.append(')');
		return buf.toString();
	}
Try to find the PcodeOp representing the call the user has selected
@param program is the Program
@param tokenAtCursor is the point in the window the user has selected
@return the PcodeOp or null
Ghidra/Features/Decompiler/src/main/java/ghidra/app/plugin/core/decompile/actions/OverridePrototypeAction.java