@Override
		public void evaluate(Emulate emu, Varnode out, Varnode[] inputs) {
			Address currentAddress = emu.getExecuteAddress();
			long tbValue = emu.getMemoryState().getValue(TBreg);
			if (tbValue == 1) {
				// Thumb mode
				emu.setContextRegisterValue(tMode); // change context to be consistent with TB value
				if ((currentAddress.getOffset() & 0x1) == 1) {
					emu.setExecuteAddress(currentAddress.previous());
				}
			}
			else if (tbValue == 0) {

				if ((currentAddress.getOffset() & 0x1) == 1) {
					throw new LowlevelError(
						"Flow to odd address occurred without setting TB register (Thumb mode)");
				}

				// ARM mode
				emu.setContextRegisterValue(aMode); // change context to be consistent with TB value
			}
		}
Initialize TB register based upon context-register state before first instruction is
executed.
Ghidra/Processors/ARM/src/main/java/ghidra/program/emulation/ARMEmulateInstructionStateModifier.java