public AddressSet getSubroutineAddresses(Program program, Address address)
			throws CancelledException {

		// FIXME: Should not be passing program arg

		// Create a new address set to hold the entire selection.
		AddressSet subroutineAddresses = new AddressSet();

		IsolatedEntrySubModel model = new IsolatedEntrySubModel(currentProgram);
		CodeBlock[] codeBlocksContaining = model.getCodeBlocksContaining(address, monitor);

		for (CodeBlock element : codeBlocksContaining) {

			if (monitor.isCancelled()) {
				return subroutineAddresses;
			}
			subroutineAddresses.add(element);
		}

		return subroutineAddresses;
	}
Method to figure out a subroutine address set given an address contained in it
@param program the given program
@param address address in the potential subroutine
@return address set of the subroutine to be created
@throws CancelledException if cancelled
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/ExtendedFlatProgramAPI.java