static void setFunctionName(Function destinationFunction, Function sourceFunction)
			throws InvalidInputException, DuplicateNameException {
		String sourceName = sourceFunction.getName();
		Address sourceEntryPoint = sourceFunction.getEntryPoint();
		Namespace sourceNamespace = sourceFunction.getParentNamespace();
		String defaultFunctionName = SymbolUtilities.getDefaultFunctionName(sourceEntryPoint);
		boolean isDefaultFunctionName = defaultFunctionName.equals(sourceName);
		if (isDefaultFunctionName) {
			return; // Do nothing if source was default name.
		}
		String destinationName = destinationFunction.getName();
		if (sourceName.equals(destinationName)) {
			return; // names already the same.
		}
		// Set the destination name to the same as the source or a conflict name if necessary.
		String baseName = getBaseName(sourceFunction);
		SymbolTable symbolTable = sourceFunction.getProgram().getSymbolTable();
		Symbol symbol = symbolTable.getSymbol(sourceName, sourceEntryPoint, sourceNamespace);
		SourceType source = (symbol != null) ? symbol.getSource() : SourceType.USER_DEFINED;
		try {
			destinationFunction.setName(baseName, source);
		}
		catch (DuplicateNameException e) {
			// Create a conflict name.
			baseName = createConflictName(baseName, destinationFunction);
			// Retry with new conflict name.
			destinationFunction.setName(baseName, source);
		}
	}
Sets the destination function's name to match the source function's name. Otherwise, it
creates a conflict name if the desired name already exists elsewhere in the program.
@param destinationFunction the destination function to update
@param sourceFunction the source function to use as a template
@throws InvalidInputException if the function name is invalid.
@throws DuplicateNameException This shouldn't happen since it will try to create a conflict
name for the function if necessary. Otherwise, this would be because the function's name
already exists.
Ghidra/Features/Base/src/main/java/ghidra/program/util/FunctionUtility.java