private InstructionSequence getInstructionsAgainstFlow(int numInstructions, Program program,
			Address startAddress, Listing listing, AddressSetView validAddresses) {
		InstructionSequence instructions = new InstructionSequence(numInstructions);
		CodeUnit cu = listing.getCodeUnitContaining(startAddress);

		if (cu instanceof Instruction) {
			Instruction preInstruction = (Instruction) cu;
			for (int j = 0; j < numInstructions; j++) {
				try {
					if (preInstruction == null) {
						break;
					}
					//if validAddresses is not null, check that the address is
					//in validAddresses 
					if (validAddresses != null) {
						Address preInstStart = preInstruction.getAddress();
						if (!validAddresses.contains(preInstStart)) {
							break;
						}
					}
					instructions.getInstructions()[j] = (preInstruction.getMnemonicString());
					instructions.getSizes()[j] = (preInstruction.getBytes().length);
					StringBuilder sb = new StringBuilder();
					for (int k = 0; k < preInstruction.getNumOperands(); k++) {
						sb.append(preInstruction.getDefaultOperandRepresentation(k));
						if (k != preInstruction.getNumOperands() - 1) {
							sb.append(",");
						}
					}
					instructions.getCommaSeparatedOperands()[j] = (sb.toString());
					preInstruction = preInstruction.getPrevious();

				}
				catch (MemoryAccessException e) {
					//Msg.info(this, "Memory Access Exception at " +
					//	preInstruction.getAddress().toString());
					break;
				}
			}
		}
		return instructions;
	}
Creates a {@link FunctionBitPatternInfo} object consisting of information gathered
for a given {@link Function} using the specified {@link DataGatheringParams}
@param program {@link Program} containing the {@link Function}
@param func {@link Function} to gather data about
@param params parameters controlling how much data is gathered
Ghidra/Features/BytePatterns/src/main/java/ghidra/bitpatterns/info/FunctionBitPatternInfo.java