private Address getFirstBlockJumpCall(Program program, TaskMonitor monitor) {
		SimpleBlockModel simpleBlockModel = new SimpleBlockModel(program);

		try {
			CodeBlock codeBlockAt = simpleBlockModel.getCodeBlockAt(entry, monitor);
			if (codeBlockAt == null) {
				return null;
			}
			CodeBlockReferenceIterator destinations = codeBlockAt.getDestinations(monitor);
			while (destinations.hasNext()) {
				CodeBlockReference destRef = destinations.next();
				FlowType flowType = destRef.getFlowType();
				if ((flowType.isCall() || flowType.isJump()) && flowType.isUnConditional()) {
					return destRef.getDestinationAddress();
				}
			}
		}
		catch (CancelledException e) {
			// ignore
		}

		return null;
	}
Get the first blocks unconditional jump or call destination

@param program program
@param monitor monitor for potentially long operation
@return first blocks unconditional call/jump, null if none in first block
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/CreateThunkFunctionCmd.java