private Function getFunctionAbove(Program program, Address addr) {
			// make sure there is an end of function before this one, and addr is not in the function
			Function func = null;
			Address addrBefore = addr.previous();
			if (addrBefore == null) {
				return null;
			}
			func = program.getFunctionManager().getFunctionContaining(addrBefore);
			return func;
		}
Get an existing function right above the addr.
@param program program to check
@param addr address to check
@return true if there is an existing function above addr
Ghidra/Features/BytePatterns/src/main/java/ghidra/app/analyzers/FunctionStartAnalyzer.java