private InstructionSequence getInstructionsFollowFlow(int numInstructions, Program program,
			Address startAddress, Listing listing) {
		InstructionSequence instructions = new InstructionSequence(numInstructions);
		Function func = program.getFunctionManager().getFunctionAt(startAddress);
		InstructionIterator instIter = listing.getInstructions(func.getBody(), true);

		for (int i = 0; i < numInstructions; ++i) {
			Instruction currentInst = instIter.next();
			if (currentInst == null) {
				break;//out of instructions, stop
			}

			//if a function contains a jump to a section of code which comes before its entry point in memory,
			//advance the iterator to the entry point
			while (currentInst.getAddress().compareTo(func.getEntryPoint()) < 0) {
				currentInst = instIter.next();
			}

			try {
				instructions.getInstructions()[i] = (currentInst.getMnemonicString());
				instructions.getSizes()[i] = (currentInst.getBytes().length);
				StringBuilder sb = new StringBuilder();

				//build the csv string of operands for the ith instruction
				for (int j = 0; j < currentInst.getNumOperands(); j++) {
					sb.append(currentInst.getDefaultOperandRepresentation(j));
					if (j != currentInst.getNumOperands() - 1) {
						sb.append(",");
					}
				}
				instructions.getCommaSeparatedOperands()[i] = (sb.toString());
			}
			catch (MemoryAccessException e) {
				//Msg.info(this, "Memory Access Exception at " + currentInst.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