protected static long packRegId(long key, DBTraceSpaceKey spaceKey) {
		long spaceId = spaceKey.getAddressSpace().getSpaceID();
		long threadKey = spaceKey.getThread().getKey();
		int frameLevel = spaceKey.getFrameLevel();

		if ((spaceId & SPACE_ID_MASK) != spaceId) {
			throw new AssertionError("Bad assumption");
		}
		if ((threadKey & REG_THREAD_MASK) != threadKey) {
			throw new AssertionError("Bad assumption");
		}
		if ((frameLevel & REG_FRAME_MASK) != frameLevel) {
			throw new AssertionError("Bad assumption");
		}
		if ((key & REG_KEY_MASK) != key) {
			throw new AssertionError("Bad assumption");
		}
		return (spaceId << SPACE_ID_SHIFT) | (threadKey << REG_THREAD_SHIFT) |
			(frameLevel << REG_FRAME_SHIFT) | (key << REG_KEY_SHIFT);
	}
For non-register space:

{@code
+---12----+----52----+
| SpaceID |    Key   |
+---------+----------+
}

For register space:

{@code
+---12----+----32----+----8----+--12--+
| SpaceID |  Thread  |  Frame  |  Key |
+---------+----------+---------+------+
}
Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/bookmark/DBTraceBookmarkManager.java