private Address getFirstCalledFunction(Function func) {

		//could be issues if func's body has addresses that are before the entry point of
		//func - see the comment in getFirstFuncWithVar
		ReferenceIterator refIter =
			func.getProgram().getReferenceManager().getReferenceIterator(func.getEntryPoint());

		Address maxAddr = func.getBody().getMaxAddress();

		for (Reference ref : CollectionUtils.asIterable(refIter)) {
			// check whether we are at an address not in the function
			// only necessary in case func consists of non-contiguous blocks
			// TODO: handle tail-call elimination
			if (!func.getBody().contains(ref.getFromAddress())) {
				continue;
			}

			// return the first call for the function
			if (isValidCallReference(ref)) {
				return ref.getToAddress();
			}
			// The references are sorted by their "from" addresses, so if this condition is true, 
			// we've searched all the references from the body of func and haven't found anything.
			// So, stop looking.
			if (ref.getFromAddress().compareTo(maxAddr) > 0) {
				return Address.NO_ADDRESS;
			}
		}
		//in case there are no references with "from" addresses after the body of func
		return Address.NO_ADDRESS;
	}
Returns the address of first function called by {@code func}.  That is, the returned {@link Address}
is the target of the call instruction with the least address within the body of {@code func}. 
@param func the {@link Function} to search for calls
@return the {@link Address} of the first called function, or {@code Address.NO_ADDRESS} if
no calls are found.
Ghidra/Features/Decompiler/ghidra_scripts/FindPotentialDecompilerProblems.java