public static boolean fixupFunctionBody(Program program, Function func, TaskMonitor monitor)
			throws CancelledException {
		if (func == null || func.isExternal()) {
			return false;
		}
		Address entry = func.getEntryPoint();
		AddressSetView newBody = getFunctionBody(program, entry, false, monitor);

		// function could now be a thunk, since someone is calling this because of a potential body flow change
		if (func.getSignatureSource() == SourceType.DEFAULT && !func.isThunk() &&
			resolveThunk(program, entry, newBody, monitor)) {
			// function flow might have changed, and could now be a thunk, without the body changing.
			// don't worry about it below, because if there is an overlapping body, something strange
			// going on, and the function should still be a thunk
			return true;
		}

		if (newBody == null || newBody.isEmpty()) {
			// don't set a new body, if body returned is null, or empty
			return false;
		}

		// new body was equal to old body, nothing to do.
		if (func.getBody().equals(newBody)) {
			return false;
		}

		try {
			func.setBody(newBody); // trigger analysis
		}
		catch (OverlappingFunctionException e) {

			Map<Function, AddressSetView> bodyChangeMap = new HashMap<>();
			try {
				newBody = subtractBodyFromExisting(program, entry, newBody, bodyChangeMap, monitor);

				func.setBody(newBody); // trigger analysis
			}
			catch (CancelledException | OverlappingFunctionException e1) {
				// something went wrong, put things back the way they were

				restoreOriginalBodies(bodyChangeMap);
				return false;
			}
		}

		return true;
	}
Recompute function body.  An open transaction must already exist.
@param program the program the function is in.
@param func the function to be fixed up.  A null function will return false.
@param monitor task monitor
@return true if successful, false if unable to fixup function or
no function found containing the start address of the indicated instruction
@throws CancelledException if the function fixup is cancelled.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/CreateFunctionCmd.java