private boolean checkAlreadyInFunctionAbove(Program program, Address addr, Function funcAbove) {
			// if no funcAbove, make sure an instruction, doesn't fall into this one.
			Address addrBefore = addr.previous();
			if (addrBefore == null) {
				return false;
			}
			if (funcAbove != null) {
				// check if in function right above
				Function myfunc = program.getFunctionManager().getFunctionContaining(addr);
				if (myfunc != null && myfunc.getEntryPoint().equals(funcAbove.getEntryPoint())) {
					return true;
				}
				// I could be in a different function, just not one above
				return false;
			}

			// no function above, but check for references, that would make this a function
			// or references that would imply it is part of another function.
			Instruction instr = program.getListing().getInstructionContaining(addrBefore);
			if (instr != null && addr.equals(instr.getFallThrough())) {
				return true;
			}
			// check for references to this function, address
			ReferenceIterator referencesTo =
				program.getReferenceManager().getReferencesTo(addr);
			for (Reference reference : referencesTo) {
				// someone flows to or reads/writes this location, shouldn't be a start
				RefType referenceType = reference.getReferenceType();
				if (referenceType.isData() &&
					!(referenceType.isRead() || referenceType.isWrite())) {
					continue;
				}
				// any other reference to here is bad, since a function or other flow should
				//   have created the location
				return true;
			}

			return false;
		}
Check if there are only pure data references to the location

@param program program to check
@param addrToCheck location to check
@return true if there are only pure data references (no flow, or r/w)
Ghidra/Features/BytePatterns/src/main/java/ghidra/app/analyzers/FunctionStartAnalyzer.java