@Test
	public void testCLZ() throws Throwable {
		try (ToyDBTraceBuilder tb = new ToyDBTraceBuilder("Test", "ARM:LE:32:v8")) {
			TraceThread thread = initTrace(tb, """
					pc = 0x00400000;
					sp = 0x00110000;
					r0 = 0x00008000;
					""",
				List.of(
					"clz r1, r0"));

			BytesTracePcodeEmulator emu = new BytesTracePcodeEmulator(tb.host, 0);
			PcodeThread<byte[]> emuThread = emu.newThread(thread.getPath());
			emuThread.stepInstruction();

			try (Transaction tx = tb.startTransaction()) {
				emu.writeDown(tb.host, 1, 1);
			}

			assertEquals(BigInteger.valueOf(16),
				TraceSleighUtils.evaluate("r1", tb.trace, 1, thread, 0));
		}
	}
Test ARM's CLZ instruction

<p>
This tests that the state modifiers are properly invoked on CALLOTHER.
Ghidra/Debug/Framework-TraceModeling/src/test/java/ghidra/pcode/exec/trace/BytesTracePcodeEmulatorTest.java