private boolean isParameterMismatch(Function func, FunctionSignature signature) {

		// Default source types can be overridden
		if (func.getSignatureSource() == SourceType.DEFAULT) {
			return false;
		}

		int existingParameterCount = func.getParameterCount();

		// If we don't know the parameters, and have already decided on This calling
		// convention. is not a problem.
		String callingConventionName = func.getCallingConventionName();
		if (existingParameterCount == 0 && THIS_CALL.equals(callingConventionName)) {
			return false;
		}

		// are the data types already on the signature better than analysis provided ones
		if (isDefinedFunctionDataTypes(func)) {
			return true;
		}

		// If this function is not in a namespace, we don't care if the parameters mismatch,
		// just apply them.
		if (namespace == null || namespace.getName().startsWith("__")) {
			return false;
		}

		// If a function is in a namespace, must be VERY careful
		int mangledParamterCount = parameters.size();
		if (hasVoidParams()) {
			mangledParamterCount = 0;
		}

		boolean hasVarArgs = false;
		if (mangledParamterCount != 0) {
			hasVarArgs = hasVarArgs();
			if (hasVarArgs) {
				--mangledParamterCount;
			}
		}

		if (hasVarArgs != func.hasVarArgs()) {
			return true;
		}

		if (existingParameterCount == 0 && mangledParamterCount > 0) {
			// if operator overloading can have up to two parameters and can detect this
			// without full function params.
			if (isOverloadedOperator && parameters.size() <= 2) {
				return false;
			}

			// if there is only one compiler spec, then don't need to worry, just assign
			// them as we see them
			PrototypeModel[] specs = func.getProgram().getCompilerSpec().getCallingConventions();
			if (specs == null || specs.length == 1) {
				return false;
			}

			// no params defined, can't tell if detected is different
			return true;
		}

		return false;
	}
Determine if existing thunk relationship should be preserved and mangled symbol
discarded.  This is the case when the thunk function mangled name matches
the thunked function since we want to avoid duplicate symbol names.
@param thunkFunction thunk function with a mangled symbol which is currently
being demangled.
@return true if thunk should be preserved and mangled symbol discarded, otherwise
false if thunk relationship should be eliminated and demangled function information
should be applied as normal.
Ghidra/Features/Base/src/main/java/ghidra/app/util/demangler/DemangledFunction.java