private AddressSetView computeThunkBody(Program program) {
		if (program.getMemory().isExternalBlockAddress(entry)) {
			return new AddressSet(entry, entry);
		}
		Listing listing = program.getListing();
		Instruction instr = listing.getInstructionAt(entry);
		if (instr == null) {
			return null;
		}
		FlowType flowtype = instr.getFlowType();
		if (flowtype == RefType.UNCONDITIONAL_JUMP || flowtype == RefType.COMPUTED_JUMP ||
			flowtype == RefType.COMPUTED_CALL_TERMINATOR || flowtype == RefType.CALL_TERMINATOR) {
			return new AddressSet(instr.getMinAddress(), instr.getMaxAddress());
		}
		setStatusMsg("Must specify thunk function body");
		return null;
	}
Constructs a new command for creating a thunk function that can compute the function this function is thunking to.

@param entry entry point address for the function to be created.
@param checkForSideEffects true to check for side-effects that indicate it is not a pure thunk.

The body may be computed.  References to the thunked to function may be created.

If no function exists at the location being thunked, it will be created based on the above rules.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/CreateThunkFunctionCmd.java