private void setupSampleProgram(boolean disableAnalysis) throws Exception {
		this.disableAnalysis = disableAnalysis;
		Program p = getProgram();
		if (disableAnalysis) {
			AutoAnalysisManager analysisMgr = AutoAnalysisManager.getAnalysisManager(p);
			TestUtils.setInstanceField("isEnabled", analysisMgr, Boolean.FALSE);
		}
		else {
			// enable full stack analysis with variable/param creation
			startTransaction();
			p.getOptions(Program.ANALYSIS_PROPERTIES).setBoolean("Stack", true);
			p.getOptions(Program.ANALYSIS_PROPERTIES)
					.setBoolean("Stack.Create Local Variables", true);
			p.getOptions(Program.ANALYSIS_PROPERTIES)
					.setBoolean("Stack.Create Param Variables", true);
			endTransaction();
		}

		createMemory(".text", "0x01001000", 0x6600);
		createMemory(".text", "0x01008000", 0x600);
		createMemory(".text", "0x0100a000", 0x5400);
		createMemory(".text", "0xf0000248", 0xa8);
		createMemory(".text", "0xf0001300", 0x1c);

		//
		// Externals
		//
		setBytes("0x01001000", "85 4f dc 77");
		applyDataType("0x01001000", new Pointer32DataType(), 1);
		createLabel("0x01001000", "ADVAPI32.dll_IsTextUnicode");
		createExternalReference("0x01001000", "ADVAPI32.dll", "IsTextUnicode", 0);
		createMemoryReference("0x010063cc", "0x01001000", RefType.INDIRECTION, SourceType.DEFAULT);

		setBytes("0x01001004", "b0 90 db 77");
		applyDataType("0x01001004", new Pointer32DataType(), 1);
		createLabel("0x01001004", "ADVAPI32.dll_RegCreateKeyW");
		createExternalReference("0x01001004", "ADVAPI32.dll", "RegCreateKeyW", 0);

		setBytes("0x01001008", "9c 1d b4 76");
		applyDataType("0x01001008", new Pointer32DataType(), 1);
		createLabel("0x01001008", "ADVAPI32.dll_RegQueryValueExW");
		createExternalReference("0x01001008", "ADVAPI32.dll", "RegQueryValueExW", 0);

		setBytes("0x010012f4", "9c 1d b4 76");
		applyDataType("0x010012f4", new Pointer32DataType(), 1);
		createLabel("0x010012f4", "comdlg32.dll_CommDlgExtendedError");
		createExternalReference("0x010012f4", "comdlg32.dll", "CommDlgExtendedError", 0);
		createMemoryReference("0x010030d2", "0x010012f4", RefType.INDIRECTION, SourceType.DEFAULT);

		//
		// Functions
		//
		// create the entry function, complete with bytes and disassembly
		createFunction_entry();

		createFunction_sscanf();

		createFunction_248f();

		createFunction_2cf5();

		createFunction_48a3();

		createFunction_59a3();

		createFunction_30d2();

		createFunction_2239();

		//
		// Labels
		//		
		createLabel("0x01001160", "MSVCRT.dll___set_app_type");
		createLabel("0x01002d1f", "MyLocal");
		createLabel("0x01002d2b", "AnotherLocal");
		createLabel("0x0100eb90", "rsrc_String_4_5c8");
		createLabel("0x0100f1d0", "rsrc_String_6_64");

		//
		// Equates
		//
		createEquate("0x100644d", "TWO", 0x2, 0);
		setBytes("0x0100f204", "65 00 6e 00 64 00 69 00"); // prepare for setting of an equate
		applyDataType("0x0100f204", new QWordDataType(), 1);

		//
		// Bytes for Data
		//
		// string data
		setBytes("0x0100750e", "52 65 67 69 73 74 65 72 43 6c 61 73 73 45 78 57 00");
		setBytes("0x01001484",
			"69 00 57 00 69 00 6e 00 64 00 6f 00 77 00 50 00 6f 00 73 00 44 00 58 00");
		setBytes("0x01006a02", "43 68 6f 6f 73 65 46 6f 6e 74 57 00"); // ChooseFontW
		setBytes("0x01006a0e", "15 00");
		setBytes("0x01006a10", "52 65 70 6c 61 63 65 54 65 78 74 57 00"); // ReplaceTextW
		setBytes("0x01006a1e", "04 00");
		setBytes("0x01008014", "01 00 00 00 53 00 61 00 6d 00 70 00 6c 00 65 00");
		setBytes("0x010085a7", "00 ef bb bf"); // float
		setBytes("0x010085a9", "bb bf 00 ff fe 00 00 fe"); // double		

		//
		// Data Types
		//
		addDataType(new ByteDataType());
		addDataType(new DWordDataType());

		StructureDataType floatStruct = new StructureDataType("FloatStruct", 0);
		floatStruct.add(new FloatDataType());
		addDataType(floatStruct);

		StructureDataType charStruct = new StructureDataType("CharStruct", 0);
		charStruct.add(new CharDataType());
		charStruct.add(new StringDataType(), 4);
		charStruct.add(new TerminatedStringDataType(), 8);
		charStruct.add(new UnicodeDataType(), 12);
		addDataType(charStruct);

		StructureDataType myStruct = new StructureDataType("MyStruct", 0);
		myStruct.add(floatStruct);
		Pointer32DataType pointer = new Pointer32DataType(charStruct);
		pointer = new Pointer32DataType(pointer);
		pointer = new Pointer32DataType(pointer);
		myStruct.add(pointer);
		addDataType(myStruct);

		StructureDataType dllTable = new StructureDataType("DLL_Table", 0);
		dllTable.add(new StringDataType(), 13, "COMDLG32", "");
		dllTable.add(new StringDataType(), 12, "SHELL32", "");
		dllTable.add(new StringDataType(), 11, "MSVCRT", "");
		dllTable.add(new StringDataType(), 13, "ADVAPI21", "");
		dllTable.add(new StringDataType(), 13, "KERNEL32", "");
		dllTable.add(new StringDataType(), 10, "GDI32", "");
		dllTable.add(new StringDataType(), 11, "USER32", "");
		dllTable.add(new StringDataType(), 13, "WINSPOOL", "");
		addDataType(dllTable);
		applyDataType("0xf0000290", dllTable);

		UnionDataType coolUnion = new UnionDataType("CoolUnion");
		coolUnion.add(new QWordDataType());
		coolUnion.add(new WordDataType());
		pointer = new Pointer32DataType(DefaultDataType.dataType);
		coolUnion.add(pointer);
		coolUnion.add(dllTable);
		pointer = new Pointer32DataType(dllTable);
		coolUnion.add(pointer);
		applyDataType("0x0100d0f3", coolUnion);

		//
		// Comments
		//
		createComment("0x0100415a", "Repeatable Comment", CommentType.REPEATABLE);

		//
		// References
		//
		createMemoryReference("0x01004930", "0x010049f9", RefType.CONDITIONAL_JUMP,
			SourceType.ANALYSIS);

// Any test needing complete analysis should call the analysis method 
//		if (!disableAnalysis) {
//			analyze();
//		}
	}
Construct sample program builder using the x86 language and default compiler spec.
A set of predefined memory bytes, code units and functions will be added.
@param name program name
@param disableAnalysis if true, the analysis manager will be disabled
@param consumer program consumer (if null this builder will be used as consumer and must be disposed to release program)
@throws Exception
Ghidra/Features/Base/src/main/java/ghidra/test/ClassicSampleX86ProgramBuilder.java