/* Smalltalk from Squeak4.6 with VMMaker 4.21.3 translated as C source on 3 September 2025 7:07:02 pm */
/* Automatically generated by
	CCodeGeneratorGlobalStructure VMMaker-dtl.450 uuid: f678290f-9fef-4de7-a296-a5355372e272
   from
	ContextInterpreter VMMaker-dtl.450 uuid: f678290f-9fef-4de7-a296-a5355372e272
 */
static char __buildInfo[] = "ContextInterpreter VMMaker-dtl.450 uuid: f678290f-9fef-4de7-a296-a5355372e272 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;



#if 1
# define SQ_USE_GLOBAL_STRUCT 1
#else
# define SQ_USE_GLOBAL_STRUCT 0
#endif

#include "sq.h"
#include <setjmp.h>

#ifndef assert
 #include <assert.h>
#endif

#ifndef allocateMemoryMinimumImageFileHeaderSize
 /* Called by Interpreter>>allocateMemory:minimum:imageFile:headerSize: */
 /* Default definition if not previously defined in config.h */
 #define allocateMemoryMinimumImageFileHeaderSize(heapSize, minimumMemory, fileStream, headerSize) \
    sqAllocateMemory(minimumMemory, heapSize)
#endif

#ifndef sqImageFileReadEntireImage
 /* Called by Interpreter>>sqImage:read:size:length: */
 /* Default definition if not previously defined in config.h */
 #define sqImageFileReadEntireImage(memoryAddress, elementSize,  length, fileStream) \
    sqImageFileRead(memoryAddress, elementSize,  length, fileStream)
#endif

#ifndef error
 /* error() function called from Interpreter */
 /* Default definition if not previously defined in config.h */
 #define error(str) defaultErrorProc(str)
#endif

#ifndef ioMicroSecondClock
 /* Called by Interpreter>>primitiveMicrosecondClock and GC methods */
 /* Default definition if not previously defined in config.h */
 #define ioMicroSecondClock ioMSecs
#endif

#ifndef ioUtcWithOffset
 /* Called by Interpreter>>primitiveUtcWithOffset */
 /* Default definition if not previously defined in config.h */
 #define ioUtcWithOffset(clock, offset) setMicroSecondsandOffset(clock, offset)
#endif

#include "sqMemoryAccess.h"

sqInt printCallStack(void);
void defaultErrorProc(char *s) {
	/* Print an error message and exit. */
	static sqInt printingStack = false;

	printf("\n%s\n\n", s);
	if (!printingStack) {
		/* flag prevents recursive error when trying to print a broken stack */
		printingStack = true;
		printCallStack();
	}
	exit(-1);
}

/*** Constants ***/
#define ActiveProcessIndex 1
#define AtCacheFixedFields 4
#define AtCacheFmt 3
#define AtCacheMask 28
#define AtCacheOop 1
#define AtCacheSize 2
#define AtCacheTotalSize 64
#define AtPutBase 32
#define BlockArgumentCountIndex 3
#define Byte0Mask 0xFF
#define Byte1Mask 0xFF00
#define Byte1Shift 8
#define Byte1ShiftNegated -8
#define Byte2Mask 0xFF0000
#define Byte3Mask 0xFF000000U
#define Byte3Shift 24
#define Byte3ShiftNegated -24
#define Byte4Mask 0xFF00000000ULL
#define Byte4Shift 32
#define Byte4ShiftNegated -32
#define Byte5Mask 0xFF0000000000ULL
#define Byte5Shift 40
#define Byte5ShiftNegated -40
#define Byte6Mask 0xFF000000000000ULL
#define Byte7Mask 0xFF00000000000000ULL
#define Byte7Shift 56
#define Byte7ShiftNegated -56
#define Bytes3to0Mask 0xFFFFFFFFU
#define Bytes7to4Mask 0xFFFFFFFF00000000ULL
#define CacheProbeMax 3
#define CallerIndex 0
#define CharacterTable 24
#define CharacterValueIndex 0
#define ClassAlien 52
#define ClassArray 7
#define ClassBitmap 4
#define ClassBlockClosure 36
#define ClassBlockContext 11
#define ClassByteArray 26
#define ClassCharacter 19
#define ClassExternalAddress 43
#define ClassExternalData 45
#define ClassExternalFunction 46
#define ClassExternalLibrary 47
#define ClassExternalStructure 44
#define ClassFloat 9
#define ClassInteger 5
#define ClassLargeNegativeInteger 42
#define ClassLargeNegativeIntegerCompactIndex 4
#define ClassLargePositiveInteger 13
#define ClassLargePositiveIntegerCompactIndex 5
#define ClassMessage 15
#define ClassMethodContext 10
#define ClassPoint 12
#define ClassSemaphore 18
#define ClassString 6
#define ClassUnsafeAlien 54
#define ClassWeakFinalizer 55
#define ClosureFirstCopiedValueIndex 3
#define ClosureIndex 4
#define ClosureNumArgsIndex 2
#define ClosureOuterContextIndex 0
#define ClosureStartPCIndex 1
#define CompactClassMask 0x1F000
#define CompactClasses 28
#define ConstMinusOne -1
#define ConstOne 3
#define ConstTwo 5
#define ConstZero 1
#define ContextFixedSizePlusHeader 7
#define CrossedX 258
#define CtxtTempFrameStart 6
#define DoAssertionChecks 0
#define DoBalanceChecks 0
#define Done 4
#define EndOfRun 257
#define ExcessSignalsIndex 2
#define ExternalObjectsArray 38
#define ExtraRootSize 2048
#define FalseObject 1
#define FirstLinkIndex 0
#define GCTopMarker 3
#define HashBits 0x1FFE0000
#define HashBitsOffset 17
#define HashMaskUnshifted 0xFFF
#define HeaderIndex 0
#define HeaderTypeClass 1
#define HeaderTypeFree 2
#define HeaderTypeGC 2
#define HeaderTypeShort 3
#define HeaderTypeSizeAndClass 0
#define HomeIndex 5
#define InitialIPIndex 4
#define InstanceSpecificationIndex 2
#define InstructionPointerIndex 1
#define InterpreterSourceVersion "4.21.3"
#define InvokeCallbackSelector 53
#define LargeContextBit 0x40000
#define LastLinkIndex 1
#define LiteralStart 1
#define MaxExternalPrimitiveTableSize 4096
#define MaxJumpBuf 32
#define MaxPrimitiveIndex 575
#define MessageArgumentsIndex 1
#define MessageDictionaryIndex 1
#define MessageLookupClassIndex 2
#define MessageSelectorIndex 0
#define MethodArrayIndex 1
#define MethodCacheClass 2
#define MethodCacheEntries 512
#define MethodCacheEntrySize 8
#define MethodCacheMask 0xFF8
#define MethodCacheMethod 3
#define MethodCacheNative 5
#define MethodCachePrim 4
#define MethodCachePrimFunction 6
#define MethodCacheSelector 1
#define MethodCacheSize 4096
#define MethodDictionaryIndex 1
#define MethodIndex 3
#define MillisecondClockMask 0x1FFFFFFF
#define MyListIndex 3
#define NextLinkIndex 0
#define NilContext 1
#define NilObject 0
#define PrimErrBadArgument 3
#define PrimErrBadIndex 4
#define PrimErrBadNumArgs 5
#define PrimErrBadReceiver 2
#define PrimErrInappropriate 6
#define PrimErrNoMemory 9
#define PrimErrTableIndex 51
#define PrimErrUnsupported 7
#define PrimitiveExternalCallIndex 117
#define PriorityIndex 2
#define ProcessListsIndex 0
#define ProcessSignalingLowSpace 22
#define ProtectedPrimitiveCount 1
#define ReceiverIndex 5
#define RootTableRedZone 2400
#define RootTableSize 2500
#define SchedulerAssociation 3
#define SelectorAboutToReturn 48
#define SelectorCannotInterpret 34
#define SelectorCannotReturn 21
#define SelectorDoesNotUnderstand 20
#define SelectorMustBeBoolean 25
#define SelectorRunWithIn 49
#define SelectorStart 2
#define SemaphoresToSignalSize 500
#define SenderIndex 0
#define SpecialSelectors 23
#define StackPointerIndex 2
#define StartField 1
#define StartObj 2
#define StreamArrayIndex 0
#define StreamIndexIndex 1
#define StreamReadLimitIndex 2
#define StreamWriteLimitIndex 3
#define SuperclassIndex 0
#define SuspendedContextIndex 1
#define TempFrameStart 6
#define TheDisplay 14
#define TheFinalizationSemaphore 41
#define TheInterruptSemaphore 30
#define TheLowSpaceSemaphore 17
#define TheTimerSemaphore 29
#define TrueObject 2
#define TypeMask 3
#define Upward 3
#define ValueIndex 1
#define XIndex 0
#define YIndex 1

/*** Function Prototypes ***/
sqInt activateNewClosureMethod(sqInt blockClosure);
sqInt activateNewMethod(void);
#pragma export on
EXPORT(sqInt) addHighPriorityTickee(void *ticker, unsigned periodms);
EXPORT(sqInt) addSynchronousTickee(void *ticker, unsigned periodms, unsigned roundms);
#pragma export off
sqInt addFirstLinktoList(sqInt proc, sqInt aList);
#pragma export on
EXPORT(sqInt) addGCRoot(sqInt *varLoc);
#pragma export off
sqInt addLastLinktoList(sqInt proc, sqInt aList);
sqInt addNewMethodToCache(void);
sqInt addToExternalPrimitiveTable(void (*functionAddress)(void));
sqInt addressCouldBeObj(sqInt address);
sqInt adjustAllOopsBy(sqInt bytesToShift);
sqInt allYoungand(sqInt array1, sqInt array2);
sqInt allocateChunk(sqInt byteSize);
usqInt allocateMemoryheapSize(size_t  dataSize, usqInt desiredHeapSize);
sqInt allocateOrRecycleContext(sqInt needsLarge);
#pragma export on
EXPORT(sqInt) amInVMThread(void);
#pragma export off
sqInt argumentCountOf(sqInt methodPointer);
void * arrayValueOf(sqInt arrayOop);
sqInt asciiOfCharacter(sqInt characterObj);
sqInt balancedStackafterPrimitivewithArgs(sqInt delta, sqInt primIdx, sqInt nArgs);
sqInt beRootIfOld(sqInt oop);
sqInt beRootWhileForwarding(sqInt oop);
sqInt becomewith(sqInt array1, sqInt array2);
sqInt becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt copyHashFlag);
sqInt biasToGrow(void);
sqInt booleanValueOf(sqInt obj);
sqInt byteSizeOf(sqInt oop);
sqInt byteSwapByteObjectsFromto(sqInt startOop, sqInt stopAddr);
sqInt byteSwapped(sqInt w);
sqInt callExternalPrimitive(void (*functionID)(void));
#pragma export on
EXPORT(sqInt) callInterpreter(void);
EXPORT(sqInt) callbackEnter(sqInt *callbackID);
EXPORT(sqInt) callbackLeave(sqInt cbID);
#pragma export off
sqInt changeClassOfto(sqInt rcvr, sqInt argClass);
sqInt characterForAscii(sqInt ascii);
sqInt characterObjectOf(sqInt characterCode);
sqInt characterTable(void);
sqInt checkForInterrupts(void);
sqInt checkImageVersionFromstartingAt(sqImageFile  f, squeakFileOffsetType  imageOffset);
sqInt checkedIntegerValueOf(sqInt intOop);
sqInt checkedLongAt(sqInt byteAddress);
sqInt classAlien(void);
sqInt classArray(void);
sqInt classBitmap(void);
sqInt classByteArray(void);
sqInt classCharacter(void);
sqInt classExternalAddress(void);
sqInt classExternalData(void);
sqInt classExternalFunction(void);
sqInt classExternalLibrary(void);
sqInt classExternalStructure(void);
sqInt classFloat(void);
sqInt classLargeNegativeInteger(void);
sqInt classLargePositiveInteger(void);
sqInt classNameOfIs(sqInt aClass, char *className);
sqInt classPoint(void);
sqInt classSemaphore(void);
sqInt classSmallInteger(void);
sqInt classString(void);
sqInt classUnsafeAlien(void);
sqInt clone(sqInt oop);
sqInt commonAt(sqInt stringy);
sqInt commonAtPut(sqInt stringy);
sqInt commonVariableatcacheIndex(sqInt rcvr, sqInt index, sqInt atIx);
sqInt compare31or32Bitsequal(sqInt obj1, sqInt obj2);
sqInt compilerCreateActualMessagestoringArgs(sqInt aMessage, sqInt argArray);
sqInt compilerFlushCache(sqInt aCompiledMethod);
sqInt compilerMapFromto(sqInt memStart, sqInt memEnd);
sqInt compilerMark(void);
sqInt compilerPostGC(void);
sqInt compilerPostSnapshot(void);
sqInt compilerPreGC(sqInt fullGCFlag);
sqInt compilerPreSnapshot(void);
sqInt compilerProcessChange(void);
sqInt compilerProcessChangeto(sqInt oldProc, sqInt newProc);
sqInt compilerTranslateMethod(void);
sqInt containOnlyOopsand(sqInt array1, sqInt array2);
sqInt contexthasSender(sqInt thisCntx, sqInt aContext);
sqInt copyBits(void);
sqInt copyBitsFromtoat(sqInt x0, sqInt x1, sqInt y);
sqInt copyObjtoSegmentaddrstopAtsaveOopAtheaderAt(sqInt oop, sqInt segmentWordArray, sqInt lastSeg, sqInt stopAddr, sqInt oopPtr, sqInt hdrPtr);
sqInt createActualMessageTo(sqInt aClass);
sqInt dispatchFunctionPointer(void (*aFunctionPointer)(void));
sqInt dispatchFunctionPointerOnin(sqInt primIdx, void (*primTable[])(void));
sqInt displayBitsOfLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
sqInt displayObject(void);
sqInt doPrimitiveDivby(sqInt rcvr, sqInt arg);
sqInt doPrimitiveModby(sqInt rcvr, sqInt arg);
sqInt dummyReferToProxy(void);
#pragma export on
EXPORT(sqInt) dumpImage(char *fileName);
#pragma export off
sqInt executeNewMethodFromCache(void);
#pragma export on
EXPORT(sqInt) extraHeaderBytes(sqInt oopOrChunk);
#pragma export off
sqInt failed(void);
sqInt falseObject(void);
void * fetchArrayofObject(sqInt fieldIndex, sqInt objectPointer);
sqInt fetchClassOf(sqInt oop);
sqInt fetchClassOfNonInt(sqInt oop);
double fetchFloatofObject(sqInt fieldIndex, sqInt objectPointer);
sqInt fetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer);
sqInt fetchLong32ofObject(sqInt fieldIndex, sqInt oop);
sqLong fetchLong64ofObject(sqInt longIndex, sqInt oop);
sqInt fetchPointerofObject(sqInt fieldIndex, sqInt oop);
sqInt fetchStackPointerOf(sqInt aContext);
sqInt fetchWordLengthOf(sqInt objectPointer);
sqInt finalizeReference(usqInt oop);
sqInt findClassOfMethodforReceiver(sqInt meth, sqInt rcvr);
sqInt findNewMethodInClass(sqInt class);
sqInt findSelectorOfMethodforReceiver(sqInt meth, sqInt rcvr);
sqInt firstAccessibleObject(void);
sqInt firstByteFormat(void);
char * firstFixedField(sqInt oop);
char * firstIndexableField(sqInt oop);
double floatArg(sqInt index);
sqInt floatObjectOf(double  aFloat);
sqInt floatOrIntegerObjectOfLongdividedBy(sqLong numerator, sqInt denominator);
double floatValueOf(sqInt oop);
sqInt flushExternalPrimitiveOf(sqInt methodPtr);
sqInt flushExternalPrimitives(void);
sqInt followForwarded(sqInt objOop);
sqInt forceInterruptCheck(void);
sqInt fullDisplayUpdate(void);
sqInt fullGC(void);
sqInt fwdBlockValid(sqInt addr);
sqInt fwdTableInit(sqInt blkSize);
sqInt fwdTableSize(sqInt blkSize);
sqInt getCurrentBytecode(void);
sqInt getFullScreenFlag(void);
sqInt getInterruptCheckCounter(void);
sqInt getInterruptKeycode(void);
sqInt getInterruptPending(void);
sqInt getLongFromFileswap(sqImageFile  aFile, sqInt swapFlag);
sqInt getNextWakeupTick(void);
sqInt getSavedWindowSize(void);
#pragma export on
EXPORT(sqInt) getStackPointer(void);
#pragma export off
sqInt getThisSessionID(void);
sqInt growObjectMemory(usqInt delta);
sqInt headerAndSnapshotOfSizeclass(size_t size, sqInt class);
sqInt heapMapAtWord(sqInt wordPointer);
sqInt imageFormatSupportableVersion(void);
sqInt imageSegmentVersion(void);
sqInt incCompBody(void);
sqInt incCompMakeFwd(void);
sqInt incCompMove(sqInt bytesFreed);
sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
sqInt incrementalGC(void);
sqInt initCompilerHooks(void);
sqInt initializeImageFormatVersion(void);
sqInt initializeMemoryFirstFree(usqInt firstFree);
sqInt initializeObjectMemory(sqInt bytesToShift);
sqInt initializeSessionID(void);
sqInt installinAtCacheatstring(sqInt rcvr, sqInt *cache, sqInt atIx, sqInt stringy);
sqInt installPrimitiveat(void *selector, sqInt anInteger);
sqInt installPrimitivefromat(void *selector, void *moduleName, sqInt anInteger);
sqInt installPrimitiveTable(void);
sqInt instanceSizeOf(sqInt classObj);
sqInt instantiateClassindexableSize(sqInt classPointer, sqInt size);
sqInt instantiateContextsizeInBytes(sqInt classPointer, sqInt sizeInBytes);
sqInt instantiateSmallClasssizeInBytes(sqInt classPointer, sqInt sizeInBytes);
sqInt integerArg(sqInt index);
sqInt integerObjectOf(sqInt value);
sqInt integerValueOf(sqInt objectPointer);
#pragma export on
EXPORT(sqInt) internalIsImmutable(sqInt oop);
EXPORT(sqInt) internalIsMutable(sqInt oop);
#pragma export off
sqInt interpret(void);
sqInt ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean);
#pragma export on
EXPORT(usqLong) ioUTCMicroseconds(void);
#pragma export off
sqInt isKindOf(sqInt oop, char *className);
sqInt isKindOfClass(sqInt oop, sqInt aClass);
sqInt isMemberOf(sqInt oop, char *className);
sqInt isArray(sqInt oop);
sqInt isBigEnder(void);
sqInt isBytes(sqInt oop);
sqInt isContext(sqInt oop);
sqInt isExcessiveAllocationRequestshift(sqInt size, sqInt bits);
sqInt isFloatObject(sqInt oop);
sqInt isHandlerMarked(sqInt aContext);
sqInt isInMemory(sqInt address);
sqInt isIndexable(sqInt oop);
sqInt isIntegerObject(sqInt objectPointer);
sqInt isIntegerValue(sqInt intValue);
sqInt isNegativeIntegerValueOf(sqInt oop);
sqInt isNonImmediate(sqInt anOop);
sqInt isPointers(sqInt oop);
sqInt isWeak(sqInt oop);
sqInt isWords(sqInt oop);
sqInt isWordsOrBytes(sqInt oop);
sqInt isWordsOrBytesNonInt(sqInt oop);
sqInt isYoung(sqInt oop);
sqInt lastPointerOf(sqInt oop);
sqInt lengthOf(sqInt oop);
sqInt literalofMethod(sqInt offset, sqInt methodPointer);
sqInt literalCountOf(sqInt methodPointer);
sqInt literalCountOfHeader(sqInt headerPointer);
sqInt loadBitBltFrom(sqInt bb);
sqInt loadInitialContext(void);
sqInt lookupInMethodCacheSelclass(sqInt selector, sqInt class);
sqInt lookupMethodInClass(sqInt class);
sqInt lookupMethodInDictionary(sqInt dictionary);
sqInt lookupMethodNoMNUEtcInClass(sqInt class);
sqInt lowestFreeAfter(sqInt chunk);
sqInt magnitude64BitIntegerForneg(usqLong magnitude, sqInt isNegative);
usqLong magnitude64BitValueOf(sqInt oop);
sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue);
sqInt mapPointersInObjectsFromto(sqInt memStart, sqInt memEnd);
sqInt markAndTrace(sqInt oop);
sqInt markAndTraceInterpreterOops(sqInt fullGCFlag);
sqInt markPhase(void);
sqInt memoryHeaderState(sqInt dataSize);
sqInt memoryImageCopyAsbytesPerElement(sqInt class, sqInt bytesPerElement);
sqInt methodArg(sqInt index);
sqInt methodArgumentCount(void);
sqInt methodPrimitiveIndex(void);
sqInt methodReturnValue(sqInt oop);
#pragma export on
EXPORT(sqInt) moduleUnloaded(char *aModuleName);
#pragma export off
sqInt nilObject(void);
sqInt nonWeakFieldsOf(sqInt oop);
sqInt normalizeFloatOrderingInImage(void);
sqInt noteAsRootheaderLoc(sqInt oop, sqInt headerLoc);
sqInt nullCompilerHook(void);
sqInt numBytesOf(sqInt objOop);
sqInt numBytesOfBytes(sqInt objOop);
sqInt numSlotsOf(sqInt obj);
sqInt objCouldBeClassObj(sqInt objOop);
sqInt objectAfter(sqInt oop);
sqInt objectArg(sqInt index);
sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop);
sqInt okayFields(sqInt oop);
sqInt okayOop(sqInt signedOop);
sqInt oopisGreaterThan(sqInt anOop, sqInt otherOop);
sqInt oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop);
sqInt oopisLessThan(sqInt anOop, sqInt otherOop);
sqInt oopHasAcceptableClass(sqInt signedOop);
sqInt oopHasOkayClass(sqInt signedOop);
sqInt pop(sqInt nItems);
sqInt popthenPush(sqInt nItems, sqInt oop);
double popFloat(void);
sqInt popRemappableOop(void);
sqInt popStack(void);
sqInt positive32BitIntegerFor(sqInt integerValue);
sqInt positive32BitValueOf(sqInt oop);
sqInt positive64BitIntegerFor(sqLong integerValue);
sqLong positive64BitValueOf(sqInt oop);
sqInt possibleRootStoreIntovalue(sqInt oop, sqInt valueObj);
sqInt postGCAction(void);
sqInt prepareForSnapshot(void);
sqInt prepareForwardingTableForBecomingwithtwoWay(sqInt array1, sqInt array2, sqInt twoWayFlag);
void primitiveAdd(void);
#pragma export on
EXPORT(void) primitiveAddLargeIntegers(void);
#pragma export off
void primitiveAdoptInstance(void);
#pragma export on
EXPORT(sqInt) primitiveAllObjects(void);
#pragma export off
void primitiveArctan(void);
void primitiveArrayBecome(void);
void primitiveArrayBecomeOneWay(void);
void primitiveArrayBecomeOneWayCopyHash(void);
void primitiveArrayBecomeOneWayNoCopyHash(void);
void primitiveAsFloat(void);
void primitiveAsOop(void);
void primitiveAt(void);
sqInt primitiveAtEnd(void);
void primitiveAtPut(void);
void primitiveBeCursor(void);
void primitiveBeDisplay(void);
void primitiveBeep(void);
void primitiveBehaviorHash(void);
void primitiveBitAnd(void);
#pragma export on
EXPORT(void) primitiveBitAndLargeIntegers(void);
#pragma export off
void primitiveBitOr(void);
#pragma export on
EXPORT(void) primitiveBitOrLargeIntegers(void);
#pragma export off
void primitiveBitShift(void);
#pragma export on
EXPORT(void) primitiveBitShiftLargeIntegers(void);
#pragma export off
void primitiveBitXor(void);
#pragma export on
EXPORT(void) primitiveBitXorLargeIntegers(void);
#pragma export off
sqInt primitiveBlockCopy(void);
#pragma export on
EXPORT(sqInt) primitiveBytecodeSetsAvailable(void);
#pragma export off
void primitiveBytesLeft(void);
void primitiveCalloutToFFI(void);
void primitiveChangeClass(void);
void primitiveClass(void);
void primitiveClipboardText(void);
void primitiveClone(void);
void primitiveClosureCopyWithCopiedValues(void);
void primitiveClosureValue(void);
void primitiveClosureValueNoContextSwitch(void);
void primitiveClosureValueWithArgs(void);
void primitiveConstantFill(void);
void primitiveCopyObject(void);
void primitiveCosine(void);
void primitiveDeferDisplayUpdates(void);
#pragma export on
EXPORT(sqInt) primitiveDisablePowerManager(void);
#pragma export off
void primitiveDiv(void);
#pragma export on
EXPORT(void) primitiveDivLargeIntegers(void);
#pragma export off
void primitiveDivide(void);
#pragma export on
EXPORT(void) primitiveDivideLargeIntegers(void);
#pragma export off
void primitiveDoPrimitiveWithArgs(void);
void primitiveEnterCriticalSection(void);
void primitiveEqual(void);
#pragma export on
EXPORT(void) primitiveEqualLargeIntegers(void);
#pragma export off
sqInt primitiveErrorTable(void);
void primitiveExecuteMethod(void);
void primitiveExecuteMethodArgsArray(void);
void primitiveExitCriticalSection(void);
void primitiveExitToDebugger(void);
void primitiveExp(void);
void primitiveExponent(void);
void primitiveExternalCall(void);
sqInt primitiveFail(void);
sqInt primitiveFailAfterCleanup(sqInt outPointerArray);
sqInt primitiveFailFor(sqInt reasonCode);
sqInt primitiveFailureCode(void);
void primitiveFindHandlerContext(void);
void primitiveFindNextUnwindContext(void);
void primitiveFloatAdd(void);
sqInt primitiveFloatAddtoArg(sqInt rcvrOop, sqInt argOop);
void primitiveFloatAt(void);
void primitiveFloatAtPut(void);
void primitiveFloatDivide(void);
sqInt primitiveFloatDividebyArg(sqInt rcvrOop, sqInt argOop);
void primitiveFloatEqual(void);
sqInt primitiveFloatEqualtoArg(sqInt rcvrOop, sqInt argOop);
sqInt primitiveFloatGreaterthanArg(sqInt rcvrOop, sqInt argOop);
void primitiveFloatGreaterOrEqual(void);
sqInt primitiveFloatGreaterOrEqualtoArg(sqInt rcvrOop, sqInt argOop);
void primitiveFloatGreaterThan(void);
sqInt primitiveFloatLessthanArg(sqInt rcvrOop, sqInt argOop);
void primitiveFloatLessOrEqual(void);
sqInt primitiveFloatLessOrEqualtoArg(sqInt rcvrOop, sqInt argOop);
void primitiveFloatLessThan(void);
void primitiveFloatMultiply(void);
sqInt primitiveFloatMultiplybyArg(sqInt rcvrOop, sqInt argOop);
void primitiveFloatNotEqual(void);
void primitiveFloatSubtract(void);
sqInt primitiveFloatSubtractfromArg(sqInt rcvrOop, sqInt argOop);
void primitiveFlushCache(void);
void primitiveFlushCacheByMethod(void);
void primitiveFlushCacheBySelector(void);
void primitiveFlushExternalPrimitives(void);
void primitiveForceDisplayUpdate(void);
#pragma export on
EXPORT(sqInt) primitiveForceTenure(void);
#pragma export off
void primitiveFormPrint(void);
void primitiveFractionalPart(void);
void primitiveFullGC(void);
void primitiveGetAttribute(void);
void primitiveGetNextEvent(void);
void primitiveGreaterOrEqual(void);
#pragma export on
EXPORT(void) primitiveGreaterOrEqualLargeIntegers(void);
#pragma export off
void primitiveGreaterThan(void);
#pragma export on
EXPORT(void) primitiveGreaterThanLargeIntegers(void);
#pragma export off
void primitiveIdentical(void);
sqInt primitiveIdentityHash(void);
#pragma export on
EXPORT(sqInt) primitiveImageFormatVersion(void);
#pragma export off
void primitiveImageName(void);
void primitiveIncrementalGC(void);
sqInt primitiveIndexOf(sqInt methodPointer);
void primitiveInputSemaphore(void);
void primitiveInputWord(void);
void primitiveInstVarAt(void);
void primitiveInstVarAtPut(void);
void primitiveIntegerAt(void);
void primitiveIntegerAtPut(void);
#pragma export on
EXPORT(sqInt) primitiveInterpreterSourceVersion(void);
EXPORT(sqInt) primitiveInterpreterStateSnapshot(void);
#pragma export off
void primitiveInterruptSemaphore(void);
void primitiveInvokeObjectAsMethod(void);
#pragma export on
EXPORT(sqInt) primitiveIsBigEnder(void);
EXPORT(sqInt) primitiveIsRoot(void);
EXPORT(sqInt) primitiveIsYoung(void);
#pragma export off
void primitiveKbdNext(void);
void primitiveKbdPeek(void);
void primitiveLessOrEqual(void);
#pragma export on
EXPORT(void) primitiveLessOrEqualLargeIntegers(void);
#pragma export off
void primitiveLessThan(void);
#pragma export on
EXPORT(void) primitiveLessThanLargeIntegers(void);
#pragma export off
void primitiveListBuiltinModule(void);
void primitiveListExternalModule(void);
void primitiveLoadImageSegment(void);
void primitiveLoadInstVar(void);
#pragma export on
EXPORT(void) primitiveLocalMicrosecondClock(void);
#pragma export off
void primitiveLogN(void);
void primitiveLowSpaceSemaphore(void);
void primitiveMakePoint(void);
void primitiveMarkHandlerMethod(void);
void primitiveMarkUnwindMethod(void);
void primitiveMaxIdentityHash(void);
#pragma export on
EXPORT(sqInt) primitiveMemoryCopy(void);
EXPORT(sqInt) primitiveMemorySnapshotBytesWithHeader(void);
EXPORT(sqInt) primitiveMemorySnapshotWithHeader(void);
#pragma export off
sqInt primitiveMethod(void);
#pragma export on
EXPORT(sqInt) primitiveMicrosecondClock(void);
#pragma export off
void primitiveMillisecondClock(void);
#pragma export on
EXPORT(sqInt) primitiveMillisecondClockMask(void);
#pragma export off
void primitiveMod(void);
#pragma export on
EXPORT(void) primitiveModLargeIntegers(void);
#pragma export off
void primitiveMouseButtons(void);
void primitiveMousePoint(void);
void primitiveMultiply(void);
#pragma export on
EXPORT(void) primitiveMultiplyLargeIntegers(void);
#pragma export off
void primitiveNew(void);
void primitiveNewMethod(void);
void primitiveNewWithArg(void);
sqInt primitiveNext(void);
void primitiveNextInstance(void);
void primitiveNextObject(void);
sqInt primitiveNextPut(void);
void primitiveNoop(void);
void primitiveNotEqual(void);
#pragma export on
EXPORT(void) primitiveNotEqualLargeIntegers(void);
#pragma export off
void primitiveNotIdentical(void);
void primitiveObjectAt(void);
void primitiveObjectAtPut(void);
void primitiveObjectPointsTo(void);
void primitivePerform(void);
sqInt primitivePerformAt(sqInt lookupClass);
void primitivePerformInSuperclass(void);
void primitivePerformWithArgs(void);
#pragma export on
EXPORT(sqInt) primitivePlatformSourceVersion(void);
#pragma export off
sqInt primitivePointX(void);
sqInt primitivePointY(void);
void primitivePushFalse(void);
void primitivePushMinusOne(void);
void primitivePushNil(void);
void primitivePushOne(void);
void primitivePushSelf(void);
void primitivePushTrue(void);
void primitivePushTwo(void);
void primitivePushZero(void);
void primitiveQuit(void);
void primitiveQuo(void);
#pragma export on
EXPORT(void) primitiveQuoLargeIntegers(void);
#pragma export off
void primitiveRelinquishProcessor(void);
#pragma export on
EXPORT(void) primitiveRemLargeIntegers(void);
#pragma export off
sqInt primitiveResponse(void);
void primitiveResume(void);
#pragma export on
EXPORT(sqInt) primitiveResumeFromSnapshot(void);
EXPORT(sqInt) primitiveRootTable(void);
EXPORT(sqInt) primitiveRootTableAt(void);
#pragma export off
void primitiveScanCharacters(void);
#pragma export on
EXPORT(sqInt) primitiveScreenDepth(void);
#pragma export off
void primitiveScreenSize(void);
void primitiveSecondsClock(void);
void primitiveSetDisplayMode(void);
void primitiveSetFullScreen(void);
#pragma export on
EXPORT(sqInt) primitiveSetGCBiasToGrow(void);
EXPORT(sqInt) primitiveSetGCBiasToGrowGCLimit(void);
EXPORT(sqInt) primitiveSetGCSemaphore(void);
#pragma export off
void primitiveSetIdentityHash(void);
void primitiveSetInterruptKey(void);
void primitiveShortAt(void);
void primitiveShortAtPut(void);
void primitiveShowDisplayRect(void);
void primitiveSignal(void);
void primitiveSignalAtBytesLeft(void);
void primitiveSignalAtMilliseconds(void);
void primitiveSignalAtUTCMicroseconds(void);
void primitiveSine(void);
void primitiveSize(void);
void primitiveSnapshot(void);
void primitiveSnapshotEmbedded(void);
void primitiveSomeInstance(void);
void primitiveSomeObject(void);
void primitiveSpecialObjectsOop(void);
void primitiveSquareRoot(void);
void primitiveStoreImageSegment(void);
void primitiveStoreStackp(void);
void primitiveStringAt(void);
void primitiveStringAtPut(void);
void primitiveStringReplace(void);
void primitiveSubtract(void);
#pragma export on
EXPORT(void) primitiveSubtractLargeIntegers(void);
#pragma export off
void primitiveSuspend(void);
void primitiveTerminateTo(void);
void primitiveTestAndSetOwnershipOfCriticalSection(void);
void primitiveTestDisplayDepth(void);
#pragma export on
EXPORT(sqInt) primitiveTestShortenIndexableSize(void);
#pragma export off
void primitiveTimesTwoPower(void);
void primitiveTruncated(void);
#pragma export on
EXPORT(void) primitiveUTCMicrosecondClock(void);
#pragma export off
void primitiveUnloadModule(void);
#pragma export on
EXPORT(sqInt) primitiveUtcWithOffset(void);
#pragma export off
void primitiveVMParameter(void);
void primitiveVMPath(void);
#pragma export on
EXPORT(sqInt) primitiveVMVersion(void);
#pragma export off
sqInt primitiveValue(void);
sqInt primitiveValueUninterruptably(void);
sqInt primitiveValueWithArgs(void);
void primitiveWait(void);
void primitiveYield(void);
sqInt print(char *s);
#pragma export on
EXPORT(sqInt) printAllStacks(void);
#pragma export off
sqInt printCallStack(void);
sqInt printCallStackOf(sqInt aContext);
sqInt printHex(sqInt n);
sqInt printNameOfClasscount(sqInt classOop, sqInt cnt);
sqInt printNum(sqInt n);
sqInt printStringOf(sqInt oop);
sqInt printUnbalancedStack(sqInt primIdx);
sqInt push(sqInt object);
sqInt pushBool(sqInt trueOrFalse);
sqInt pushFloat(double f);
sqInt pushInteger(sqInt integerValue);
sqInt pushRemappableOop(sqInt oop);
sqInt putLongtoFile(sqInt aWord, sqImageFile  aFile);
sqInt readImageFromFileHeapSizeStartingAt(sqImageFile  f, usqInt desiredHeapSize, squeakFileOffsetType  imageOffset);
sqInt readableFormat(sqInt imageVersion);
#pragma export on
EXPORT(sqInt) reestablishContextPriorToCallback(sqInt callbackContext);
#pragma export off
sqInt remap(sqInt oop);
sqInt removeFirstLinkOfList(sqInt aList);
#pragma export on
EXPORT(sqInt) removeGCRoot(sqInt *varLoc);
#pragma export off
sqInt restoreHeaderOf(sqInt oop);
sqInt restoreHeadersFromtofromandtofrom(sqInt firstIn, sqInt lastIn, sqInt hdrBaseIn, sqInt firstOut, sqInt lastOut, sqInt hdrBaseOut);
sqInt resumepreemptedYieldingIf(sqInt aProcess, sqInt yieldImplicitly);
sqInt reverseDisplayFromto(sqInt startIndex, sqInt endIndex);
sqInt rewriteMethodCacheSelclassprimIndex(sqInt selector, sqInt class, sqInt localPrimIndex);
sqInt rewriteMethodCacheSelclassprimIndexprimFunction(sqInt selector, sqInt class, sqInt localPrimIndex, void (*localPrimAddress)(void));
#pragma export on
EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr);
#pragma export off
sqInt setCompilerInitialized(sqInt newFlag);
sqInt setFullScreenFlag(sqInt value);
sqInt setInterruptCheckCounter(sqInt value);
sqInt setInterruptKeycode(sqInt value);
sqInt setInterruptPending(sqInt value);
sqInt setMacFileTypeForImageFile(void);
sqInt setMemoryLimitsheapSize(size_t  dataSize, usqInt heapSize);
sqInt setMicroSecondsandOffset(sqLong *microSeconds, int *utcOffset);
sqInt setNextWakeupTick(sqInt value);
sqInt setSavedWindowSize(sqInt value);
sqInt shortentoIndexableSize(sqInt obj, sqInt nSlots);
sqInt showDisplayBitsLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
sqInt signalSemaphoreWithIndex(sqInt index);
sqInt signed32BitIntegerFor(int integerValue);
int signed32BitValueOf(sqInt oop);
sqInt signed64BitIntegerFor(sqLong integerValue);
sqLong signed64BitValueOf(sqInt oop);
sqInt sizeBitsOf(sqInt oop);
sqInt sizeOfSTArrayFromCPrimitive(void *cPtr);
sqInt slotSizeOf(sqInt oop);
sqInt snapshot(sqInt embedded);
usqInt snapshotMemoryReadsize(sqImageFile  imageFile, size_t  dataSize);
usqInt snapshotResumeheapSizeswapBytesoldBaseAddrspecialObjectsOoplastHashsavedWindowSizefullScreenFlagextraVMMemory(sqInt byteArrayOrBitmap, usqInt desiredHeapSize, sqInt swapBytes, sqInt oldBaseAddr, sqInt specialObjects, sqInt hashValue, sqInt windowSize, sqInt fullScreen, sqInt extraMemory);
sqInt splObj(sqInt index);
sqInt stObjectat(sqInt array, sqInt index);
sqInt stObjectatput(sqInt array, sqInt index, sqInt value);
sqInt stSizeOf(sqInt oop);
double stackFloatValue(sqInt offset);
sqInt stackIntegerValue(sqInt offset);
sqInt stackObjectValue(sqInt offset);
sqInt stackTop(void);
sqInt stackValue(sqInt offset);
sqInt storeIntegerofObjectwithValue(sqInt fieldIndex, sqInt objectPointer, sqInt integerValue);
sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt oop, sqInt valuePointer);
sqInt stringForCString(const char *aCString);
sqInt success(sqInt successBoolean);
sqInt successful(void);
sqInt sufficientSpaceAfterGC(usqInt minFree);
sqInt sufficientSpaceToAllocate(usqInt bytes);
sqInt superclassOf(sqInt classPointer);
sqInt swapBytesAndPrepareToInterpretoldBaseAddr(sqInt swapBytes, sqInt oldBaseAddr);
sqInt sweepPhase(void);
sqInt synchronousSignal(sqInt aSemaphore);
sqInt tenuringIncrementalGC(void);
sqInt topRemappableOop(void);
sqInt transferTo(sqInt aProc);
sqInt trueObject(void);
sqInt updatePointersInRangeFromto(sqInt memStart, sqInt memEnd);
sqInt updatePointersInRootObjectsFromto(sqInt memStart, sqInt memEnd);
sqInt updatePrimitiveTable(void);
sqInt validateRoots(void);
sqInt verifyCleanHeaders(void);
sqInt vmEndianness(void);
sqInt wakeHighestPriority(void);
sqInt wordSwapped(sqInt w);
sqInt writeImageFileIOembedded(sqInt imageBytes, sqInt embedded);
/*** Variables ***/
static struct foo {
sqInt primFailCode;
sqInt specialObjectsOop;
sqInt argumentCount;
sqInt nilObj;
sqInt trueObj;
sqInt falseObj;
sqInt interruptCheckCounter;
sqInt remapBufferCount;
sqInt messageSelector;
sqInt nextPollTick;
sqInt primitiveIndex;
sqInt compilerInitialized;
sqInt rootTableCount;
sqInt allocationCount;
sqInt receiver;
sqInt lkupClass;
sqInt allocationsBetweenGCs;
sqInt lowSpaceThreshold;
sqInt signalLowSpace;
sqInt lastHash;
sqInt fullScreenFlag;
sqInt freeContexts;
sqInt reclaimableContextCount;
sqInt nextWakeupTick;
sqInt jmpDepth;
sqInt methodClass;
sqInt pendingFinalizationSignals;
sqInt extraRootCount;
sqInt statMarkCount;
sqInt newNativeMethod;
sqInt freeLargeContexts;
sqInt allowAccessBeyondSP;
sqInt semaphoresUseBufferA;
sqInt statSweepCount;
sqInt semaphoresToSignalCountA;
sqInt receiverClass;
sqInt forceTenureFlag;
sqInt interruptKeycode;
sqInt statCompMoveCount;
sqInt interruptPending;
sqInt semaphoresToSignalCountB;
sqInt statMkFwdCount;
sqInt statRootTableOverflows;
sqInt interruptChecksEveryNms;
sqInt tenuringThreshold;
sqInt gcBiasToGrow;
sqInt gcBiasToGrowGCLimit;
sqInt statFullGCs;
sqInt statIncrGCs;
sqInt lastTick;
sqInt statTenures;
sqInt savedWindowSize;
sqInt statpendingFinalizationSignals;
sqInt totalObjectCount;
sqInt statGrowMemory;
sqInt deferDisplayUpdates;
sqInt statShrinkMemory;
sqInt weakRootCount;
sqInt jmpMax;
sqInt gcSemaphoreIndex;
sqInt globalSessionID;
sqInt statSpecialMarkCount;
sqInt interruptCheckCounterFeedBackReset;
sqInt statRootTableCount;
sqInt statAllocationCount;
sqInt statSurvivorCount;
sqInt statIGCDeltaUsecs;
sqLong statIGCDeltaTime;
sqInt gcStartUsecs;
sqLong statIncrGCMSecs;
sqInt statIncrGCUsecs;
usqInt gcBiasToGrowThreshold;
sqInt statFullGCUsecs;
sqInt headerTypeBytes[4];
usqInt growHeadroom;
usqInt shrinkThreshold;
sqLong statFullGCMSecs;
sqLong statGCTime;
usqInt stackPointer;
sqInt atCache[AtCacheTotalSize + 1 /* 65 */];
long methodCache[MethodCacheSize + 1 /* 4097 */];
usqInt instructionPointer;
usqInt method;
usqInt theHomeContext;
usqInt suspendedCallbacks[MaxJumpBuf + 1 /* 33 */];
sqInt semaphoresToSignalB[501];
sqInt semaphoresToSignalA[501];
jmp_buf jmpBuf[MaxJumpBuf + 1 /* 33 */];
sqInt weakRoots[2625];
sqInt* extraRoots[2049];
usqInt compStart;
usqInt freeBlock;
sqInt rootTable[2501];
usqInt fwdTableLast;
usqInt fwdTableNext;
usqInt compEnd;
sqInt rootTableOverflowed;
usqInt suspendedMethods[MaxJumpBuf + 1 /* 33 */];
usqInt newMethod;
usqInt activeContext;
usqInt memoryLimit;
usqInt endOfMemory;
usqInt youngStart;
sqInt remapBuffer[26];
 } fum;
struct foo * foo = &fum;

sqInt extraVMMemory;
void (*primitiveFunctionPointer)();
void (*externalPrimitiveTable[4097])(void);
void * showSurfaceFn;
struct VirtualMachine* interpreterProxy;
sqInt (*compilerHooks[16])();
sqInt imageFormatVersionNumber = 0;
const char *interpreterVersion = "Squeak4.6 of 21 July 2021 [latest update: #15118]";
sqInt imageFormatInitialVersion = 0;
void (*primitiveTable[578])(void);
usqInt memory;



/*	Similar to activateNewMethod but for Closure and newMethod. */

sqInt activateNewClosureMethod(sqInt blockClosure) {
register struct foo * foo = &fum;
    sqInt closureMethod;
    sqInt i;
    sqInt methodHeader;
    sqInt newContext;
    sqInt numCopied;
    sqInt outerContext;
    sqInt theBlockClosure;
    sqInt where;
    sqInt oop;
    sqInt tmp;
    sqInt valuePointer;

	if (DoAssertionChecks) {
		okayOop(blockClosure);
	}
	outerContext = longAt((blockClosure + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)));
	if (DoAssertionChecks) {
		okayOop(outerContext);
	}
	closureMethod = longAt((outerContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	methodHeader = longAt((closureMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD)));
	/* begin pushRemappableOop: */
	foo->remapBuffer[(foo->remapBufferCount += 1)] = blockClosure;

	/* All for one, and one for all! */
	/* allocateOrRecycleContext: may cause a GC; restore blockClosure and refetch outerContext et al */

	newContext = allocateOrRecycleContext(methodHeader & LargeContextBit);
	/* begin popRemappableOop */
	oop = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	theBlockClosure = oop;
	outerContext = longAt((theBlockClosure + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)));

	/* Assume: newContext will be recorded as a root if necessary by the
	 call to newActiveContext: below, so we can use unchecked stores. */

	numCopied = (fetchWordLengthOf(theBlockClosure)) - ClosureFirstCopiedValueIndex;
	where = newContext + (BASE_HEADER_SIZE);
	longAtput(where + (SenderIndex << (SHIFT_FOR_WORD)), foo->activeContext);
	longAtput(where + (InstructionPointerIndex << (SHIFT_FOR_WORD)), longAt((theBlockClosure + (BASE_HEADER_SIZE)) + (ClosureStartPCIndex << (SHIFT_FOR_WORD))));
	longAtput(where + (StackPointerIndex << (SHIFT_FOR_WORD)), (((foo->argumentCount + numCopied) << 1) | 1));
	longAtput(where + (MethodIndex << (SHIFT_FOR_WORD)), longAt((outerContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD))));
	longAtput(where + (ClosureIndex << (SHIFT_FOR_WORD)), theBlockClosure);
	longAtput(where + (ReceiverIndex << (SHIFT_FOR_WORD)), longAt((outerContext + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD))));
	for (i = 1; i <= foo->argumentCount; i += 1) {
		longAtput(where + ((ReceiverIndex + i) << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - ((foo->argumentCount - i) * (BYTES_PER_WORD))));
	}
	where = (newContext + (BASE_HEADER_SIZE)) + (((ReceiverIndex + 1) + foo->argumentCount) << (SHIFT_FOR_WORD));
	for (i = 0; i <= (numCopied - 1); i += 1) {
		longAtput(where + (i << (SHIFT_FOR_WORD)), longAt((theBlockClosure + (BASE_HEADER_SIZE)) + ((i + ClosureFirstCopiedValueIndex) << (SHIFT_FOR_WORD))));
	}
	/* begin pop: */
	foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
	/* begin newActiveContext: */
	/* begin storeContextRegisters: */
	longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
	longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
	if ((((usqInt) newContext)) < (((usqInt) foo->youngStart))) {
		beRootIfOld(newContext);
	}
	foo->activeContext = newContext;
	/* begin fetchContextRegisters: */
	tmp = longAt((newContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	if ((tmp & 1)) {
		tmp = longAt((newContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
		if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
			beRootIfOld(tmp);
		}
	} else {
		tmp = newContext;
	}
	foo->theHomeContext = tmp;
	foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
	foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	tmp = ((longAt((newContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->instructionPointer = ((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2;
	tmp = ((longAt((newContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->stackPointer = (newContext + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD));
	return null;
}

sqInt activateNewMethod(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt initialIP;
    sqInt methodHeader;
    sqInt newContext;
    sqInt nilOop;
    sqInt tempCount;
    sqInt where;
    sqInt tmp;
    sqInt valuePointer;

	methodHeader = longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD)));
	newContext = allocateOrRecycleContext(methodHeader & LargeContextBit);
	initialIP = ((LiteralStart + ((((usqInt) methodHeader) >> 10) & 0xFF)) * (BYTES_PER_WORD)) + 1;

	/* Assume: newContext will be recorded as a root if necessary by the
	 call to newActiveContext: below, so we can use unchecked stores. */

	tempCount = (((usqInt) methodHeader) >> 19) & 0x3F;
	where = newContext + (BASE_HEADER_SIZE);
	longAtput(where + (SenderIndex << (SHIFT_FOR_WORD)), foo->activeContext);
	longAtput(where + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((initialIP << 1) | 1));
	longAtput(where + (StackPointerIndex << (SHIFT_FOR_WORD)), ((tempCount << 1) | 1));
	longAtput(where + (MethodIndex << (SHIFT_FOR_WORD)), foo->newMethod);
	longAtput(where + (ClosureIndex << (SHIFT_FOR_WORD)), foo->nilObj);
	for (i = 0; i <= foo->argumentCount; i += 1) {
		longAtput(where + ((ReceiverIndex + i) << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - ((foo->argumentCount - i) * (BYTES_PER_WORD))));
	}
	nilOop = foo->nilObj;
	for (i = ((foo->argumentCount + 1) + ReceiverIndex); i <= (tempCount + ReceiverIndex); i += 1) {
		longAtput(where + (i << (SHIFT_FOR_WORD)), nilOop);
	}
	/* begin pop: */
	foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
	foo->reclaimableContextCount += 1;
	/* begin newActiveContext: */
	/* begin storeContextRegisters: */
	longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
	longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
	if ((((usqInt) newContext)) < (((usqInt) foo->youngStart))) {
		beRootIfOld(newContext);
	}
	foo->activeContext = newContext;
	/* begin fetchContextRegisters: */
	tmp = longAt((newContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	if ((tmp & 1)) {
		tmp = longAt((newContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
		if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
			beRootIfOld(tmp);
		}
	} else {
		tmp = newContext;
	}
	foo->theHomeContext = tmp;
	foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
	foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	tmp = ((longAt((newContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->instructionPointer = ((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2;
	tmp = ((longAt((newContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->stackPointer = (newContext + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD));
	return null;
}


/*	Declared in Cross/sqVirtualMachine but not implemented in platform support */
/*	void  (*addHighPriorityTickee)(void (*ticker)(void), unsigned periodms); */

EXPORT(sqInt) addHighPriorityTickee(void *ticker, unsigned periodms) {
	flag("FIXME");
	return 1;
}


/*	Declared in Cross/sqVirtualMachine but not implemented in platform support */
/*	void  (*addSynchronousTickee)(void (*ticker)(void), unsigned periodms, unsigned roundms); */

EXPORT(sqInt) addSynchronousTickee(void *ticker, unsigned periodms, unsigned roundms) {
	flag("FIXME");
	return 1;
}


/*	Add the given process to the front of the given linked list
	 and set the backpointer of process to its new list. */

sqInt addFirstLinktoList(sqInt proc, sqInt aList) {
register struct foo * foo = &fum;
    sqInt firstLink;

	assert((fetchPointerofObject(NextLinkIndex, proc)) == (nilObject()));
	firstLink = longAt((aList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)));
	assert(firstLink != proc);
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) aList)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(aList, proc);
	}
	longAtput((aList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)), proc);
	if (firstLink == foo->nilObj) {

		/* a.k.a. (self isEmptyList: aList) */

		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) aList)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(aList, proc);
		}
		longAtput((aList + (BASE_HEADER_SIZE)) + (LastLinkIndex << (SHIFT_FOR_WORD)), proc);
	} else {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) proc)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(proc, firstLink);
		}
		longAtput((proc + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)), firstLink);
	}
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) proc)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(proc, aList);
	}
	longAtput((proc + (BASE_HEADER_SIZE)) + (MyListIndex << (SHIFT_FOR_WORD)), aList);
	return null;
}


/*	Add the given variable location to the extra roots table */

EXPORT(sqInt) addGCRoot(sqInt *varLoc) {
register struct foo * foo = &fum;
	if (foo->extraRootCount >= ExtraRootSize) {
		return 0;
	}
	foo->extraRoots[(foo->extraRootCount += 1)] = varLoc;
	return 1;
}


/*	Add the given process to the end of the given linked list
	 and set the backpointer of process to its new list. */

sqInt addLastLinktoList(sqInt proc, sqInt aList) {
register struct foo * foo = &fum;
    sqInt lastLink;

	assert((fetchPointerofObject(NextLinkIndex, proc)) == (nilObject()));
	if ((longAt((aList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)))) == foo->nilObj) {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) aList)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(aList, proc);
		}
		longAtput((aList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)), proc);
	} else {
		lastLink = longAt((aList + (BASE_HEADER_SIZE)) + (LastLinkIndex << (SHIFT_FOR_WORD)));
		assert(lastLink != proc);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) lastLink)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(lastLink, proc);
		}
		longAtput((lastLink + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)), proc);
	}
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) aList)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(aList, proc);
	}
	longAtput((aList + (BASE_HEADER_SIZE)) + (LastLinkIndex << (SHIFT_FOR_WORD)), proc);
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) proc)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(proc, aList);
	}
	longAtput((proc + (BASE_HEADER_SIZE)) + (MyListIndex << (SHIFT_FOR_WORD)), aList);
	return null;
}


/*	Add the given entry to the method cache.
	The policy is as follows:
		Look for an empty entry anywhere in the reprobe chain.
		If found, install the new entry there.
		If not found, then install the new entry at the first probe position
			and delete the entries in the rest of the reprobe chain.
		This has two useful purposes:
			If there is active contention over the first slot, the second
				or third will likely be free for reentry after ejection.
			Also, flushing is good when reprobe chains are getting full. */

sqInt addNewMethodToCache(void) {
register struct foo * foo = &fum;
    sqInt hash;
    sqInt p;
    sqInt probe;

	foo->compilerInitialized && (compilerTranslateMethod());

	/* drop low-order zeros from addresses */

	hash = foo->messageSelector ^ foo->lkupClass;
	primitiveFunctionPointer = primitiveTable[foo->primitiveIndex];
	for (p = 0; p <= (CacheProbeMax - 1); p += 1) {
		probe = (((usqInt) hash) >> p) & MethodCacheMask;
		if ((foo->methodCache[probe + MethodCacheSelector]) == 0) {

			/* Found an empty entry -- use it */

			foo->methodCache[probe + MethodCacheSelector] = foo->messageSelector;
			foo->methodCache[probe + MethodCacheClass] = foo->lkupClass;
			foo->methodCache[probe + MethodCacheMethod] = foo->newMethod;
			foo->methodCache[probe + MethodCachePrim] = foo->primitiveIndex;
			foo->methodCache[probe + MethodCacheNative] = foo->newNativeMethod;
			foo->methodCache[probe + MethodCachePrimFunction] = (((long) primitiveFunctionPointer));
			return null;
		}
	}

	/* first probe */

	probe = hash & MethodCacheMask;
	foo->methodCache[probe + MethodCacheSelector] = foo->messageSelector;
	foo->methodCache[probe + MethodCacheClass] = foo->lkupClass;
	foo->methodCache[probe + MethodCacheMethod] = foo->newMethod;
	foo->methodCache[probe + MethodCachePrim] = foo->primitiveIndex;
	foo->methodCache[probe + MethodCacheNative] = foo->newNativeMethod;
	foo->methodCache[probe + MethodCachePrimFunction] = (((long) primitiveFunctionPointer));
	for (p = 1; p <= (CacheProbeMax - 1); p += 1) {
		probe = (((usqInt) hash) >> p) & MethodCacheMask;
		foo->methodCache[probe + MethodCacheSelector] = 0;
	}
	return null;
}


/*	Add the given function address to the external primitive table and return the index where it's stored. This function doesn't need to be fast since it is only called when an external primitive has been looked up (which takes quite a bit of time itself). So there's nothing specifically complicated here.
	Note: Return index will be one-based (ST convention) */

sqInt addToExternalPrimitiveTable(void (*functionAddress)(void)) {
    sqInt i;

	for (i = 0; i <= (MaxExternalPrimitiveTableSize - 1); i += 1) {
		if ((externalPrimitiveTable[i]) == 0) {
			externalPrimitiveTable[i] = functionAddress;
			return i + 1;
		}
	}
	return 0;
}


/*	Answer if address appears to be that of an object, which implies it is
	 safe to fetch the class and size. For code disassembly and assertions. */

sqInt addressCouldBeObj(sqInt address) {
	return ((address & 3) == 0) && (((((usqInt)address)) >= memory) && (((((usqInt)address)) < foo->freeBlock) && (((longAt(address)) & TypeMask) != HeaderTypeGC)));
}


/*	Adjust all oop references by the given number of bytes. This 
	is done just after reading in an image when the new base 
	address of the object heap is different from the base address 
	in the image. */
/*	di 11/18/2000 - return number of objects found */

sqInt adjustAllOopsBy(sqInt bytesToShift) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt totalObjects;
    sqInt classHeader;
    sqInt fieldAddr;
    sqInt fieldOop;
    sqInt newClassOop;
    sqInt sz;
    sqInt header;

	if (bytesToShift == 0) {
		return 300000;
	}
	totalObjects = 0;
	oop = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) oop)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
			totalObjects += 1;
			/* begin adjustFieldsAndClassOf:by: */
			if (bytesToShift == 0) {
				goto l1;
			}
			fieldAddr = oop + (lastPointerOf(oop));
			while ((((usqInt) fieldAddr)) > (((usqInt) oop))) {
				fieldOop = longAt(fieldAddr);
				if (!((fieldOop & 1))) {
					longAtput(fieldAddr, fieldOop + bytesToShift);
				}
				fieldAddr -= BYTES_PER_WORD;
			}
			if (((longAt(oop)) & TypeMask) != HeaderTypeShort) {
				classHeader = longAt(oop - (BYTES_PER_WORD));
				newClassOop = (classHeader & (ALL_BUT_TYPE_MASK)) + bytesToShift;
				longAtput(oop - (BYTES_PER_WORD), newClassOop | (classHeader & TypeMask));
			}
		l1:	/* end adjustFieldsAndClassOf:by: */;
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header = longAt(oop);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l2;
			} else {
				sz = header & (SIZE_MASK);
				goto l2;
			}
		l2:	/* end sizeBitsOf: */;
		}
		oop = (oop + sz) + (foo->headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
	}
	return totalObjects;
}


/*	Return true if all the oops in both arrays, and the arrays 
	themselves, are in the young object space. */

sqInt allYoungand(sqInt array1, sqInt array2) {
register struct foo * foo = &fum;
    sqInt fieldOffset;
    sqInt contextSize;
    sqInt fmt;
    sqInt header;
    sqInt methodHeader;
    sqInt sz;
    sqInt sp;
    sqInt header1;
    sqInt type;

	if ((((usqInt) array1)) < (((usqInt) foo->youngStart))) {
		return 0;
	}
	if ((((usqInt) array2)) < (((usqInt) foo->youngStart))) {
		return 0;
	}
	/* begin lastPointerOf: */
	header = longAt(array1);
	fmt = (((usqInt) header) >> 8) & 15;
	if (fmt <= 4) {
		if ((fmt == 3) && ((((((usqInt) header) >> 12) & 0x1F) == 13) || ((((((usqInt) header) >> 12) & 0x1F) == 14) || (((((usqInt) header) >> 12) & 0x1F) == 4)))) {
			/* begin fetchStackPointerOf: */
			sp = longAt((array1 + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
			if (!((sp & 1))) {
				contextSize = 0;
				goto l1;
			}
			contextSize = (sp >> 1);
		l1:	/* end fetchStackPointerOf: */;
			fieldOffset = (CtxtTempFrameStart + contextSize) * (BYTES_PER_WORD);
			goto l2;
		}
		/* begin sizeBitsOfSafe: */
		header1 = longAt(array1);
		/* begin rightType: */
		if ((header1 & (SIZE_MASK)) == 0) {
			type = HeaderTypeSizeAndClass;
			goto l3;
		} else {
			if ((header1 & CompactClassMask) == 0) {
				type = HeaderTypeClass;
				goto l3;
			} else {
				type = HeaderTypeShort;
				goto l3;
			}
		}
	l3:	/* end rightType: */;
		if (type == HeaderTypeSizeAndClass) {
			sz = (longAt(array1 - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
			goto l4;
		} else {
			sz = header1 & (SIZE_MASK);
			goto l4;
		}
	l4:	/* end sizeBitsOfSafe: */;
		fieldOffset = sz - (BASE_HEADER_SIZE);
		goto l2;
	}
	if (fmt < 12) {
		fieldOffset = 0;
		goto l2;
	}
	methodHeader = longAt(array1 + (BASE_HEADER_SIZE));
	fieldOffset = (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
l2:	/* end lastPointerOf: */;
	while (fieldOffset >= (BASE_HEADER_SIZE)) {
		if ((((usqInt) (longAt(array1 + fieldOffset)))) < (((usqInt) foo->youngStart))) {
			return 0;
		}
		if ((((usqInt) (longAt(array2 + fieldOffset)))) < (((usqInt) foo->youngStart))) {
			return 0;
		}
		fieldOffset -= BYTES_PER_WORD;
	}
	return 1;
}


/*	Allocate a chunk of the given size. Sender must be sure that  the requested size includes enough space for the header  word(s).  */
/*	Details: To limit the time per incremental GC, do one every so many allocations. The number is settable via primitiveVMParameter to tune your memory system */

sqInt allocateChunk(sqInt byteSize) {
register struct foo * foo = &fum;
    sqInt enoughSpace;
    sqInt newChunk;
    sqInt newFreeSize;
    usqInt minFree;
    sqInt currentProc;
    sqInt lastSavedProcess;
    sqInt sched;
    sqInt oop;

	if (foo->allocationCount >= foo->allocationsBetweenGCs) {

		/* do an incremental GC every so many allocations to  keep pauses short */

		incrementalGC();
	}
	/* begin sufficientSpaceToAllocate: */
	minFree = (foo->lowSpaceThreshold + byteSize) + (BASE_HEADER_SIZE);
	if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree)) {
		enoughSpace = 1;
		goto l1;
	} else {
		enoughSpace = sufficientSpaceAfterGC(minFree);
		goto l1;
	}
l1:	/* end sufficientSpaceToAllocate: */;
	if (!(enoughSpace)) {

		/* signal that space is running low, but proceed with allocation if possible */

		foo->signalLowSpace = 1;

		/* disable additional interrupts until lowSpaceThreshold is reset by image */

		foo->lowSpaceThreshold = 0;
		/* begin saveProcessSignalingLowSpace */
		lastSavedProcess = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ProcessSignalingLowSpace << (SHIFT_FOR_WORD)));
		if (lastSavedProcess == foo->nilObj) {
			/* begin fetchPointer:ofObject: */
			oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
			sched = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
			currentProc = longAt((sched + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(foo->specialObjectsOop, currentProc);
			}
			longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ProcessSignalingLowSpace << (SHIFT_FOR_WORD)), currentProc);
		}
		/* begin forceInterruptCheck */
		foo->interruptCheckCounter = -1000;
		foo->nextPollTick = 0;
	}
	if (oopisLessThan((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), byteSize + (BASE_HEADER_SIZE))) {
		error("out of memory");
	}
	newFreeSize = ((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK)) - byteSize;
	newChunk = foo->freeBlock;

	/* Assume: client will initialize object header of free chunk, so following is not needed: */
	/* self setSizeOfFree: newChunk to: byteSize. */

	foo->freeBlock += byteSize;
	/* begin setSizeOfFree:to: */
	longAtput(foo->freeBlock, (newFreeSize & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);
	foo->allocationCount += 1;
	return newChunk;
}


/*	Allocate memory space sufficient to contain object memory data from an image snapshot. */

usqInt allocateMemoryheapSize(size_t  dataSize, usqInt desiredHeapSize) {
register struct foo * foo = &fum;
    sqInt heapSize;
    sqInt minimumMemory;
    sqInt unusedFileReference;
    sqInt unusedHeaderSize;

	unusedFileReference = null;
	flag("FIXME");
	unusedHeaderSize = null;
	flag("FIXME");
	heapSize = reserveExtraCHeapBytes(desiredHeapSize, extraVMMemory);

	/* need at least 100K of breathing room */

	minimumMemory = dataSize + 100000;
	if (heapSize < minimumMemory) {
		insufficientMemorySpecifiedError();
	}
	if (((memory = allocateMemoryMinimumImageFileHeaderSize(heapSize, minimumMemory, unusedFileReference, unusedHeaderSize))) == null) {
		insufficientMemoryAvailableError();
	}
	/* begin setMemoryLimit: */
	foo->memoryLimit = (memory + heapSize) - 24;
	/* begin setEndOfMemory: */
	foo->endOfMemory = memory + dataSize;
	return null;
}


/*	Return a recycled context or a newly allocated one if none is available for recycling. */

sqInt allocateOrRecycleContext(sqInt needsLarge) {
register struct foo * foo = &fum;
    sqInt cntxt;

	if (needsLarge == 0) {
		if (foo->freeContexts != NilContext) {
			cntxt = foo->freeContexts;
			foo->freeContexts = longAt((cntxt + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
			return cntxt;
		}
	} else {
		if (foo->freeLargeContexts != NilContext) {
			cntxt = foo->freeLargeContexts;
			foo->freeLargeContexts = longAt((cntxt + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
			return cntxt;
		}
	}
	if (needsLarge == 0) {
		cntxt = instantiateContextsizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassMethodContext << (SHIFT_FOR_WORD))), SMALL_CONTEXT_SIZE);
	} else {
		cntxt = instantiateContextsizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassMethodContext << (SHIFT_FOR_WORD))), LARGE_CONTEXT_SIZE);
	}
	longAtput((cntxt + (BASE_HEADER_SIZE)) + (4 << (SHIFT_FOR_WORD)), foo->nilObj);
	return cntxt;
}


/*	Declared in Cross/sqVirtualMachine but not implemented in platform support */
/*	extern sqInt amInVMThread(void); */

EXPORT(sqInt) amInVMThread(void) {
	flag("FIXME");
	return 1;
}

sqInt argumentCountOf(sqInt methodPointer) {
	return (((usqInt) (longAt((methodPointer + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 25) & 15;
}


/*	Return the address of first indexable field of resulting array object, or fail if the instance variable does not contain an indexable bytes or words object. */
/*	Note: May be called by translated primitive code. */

void * arrayValueOf(sqInt arrayOop) {
register struct foo * foo = &fum;
	if ((!((arrayOop & 1))) && (((arrayOop & 1) == 0) && (isWordsOrBytesNonInt(arrayOop)))) {
		return pointerForOop(arrayOop + (BASE_HEADER_SIZE));
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return null;
}


/*	Returns an integer object */

sqInt asciiOfCharacter(sqInt characterObj) {
register struct foo * foo = &fum;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop1;

	/* begin assertClassOf:is: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassCharacter << (SHIFT_FOR_WORD)));
	if ((characterObj & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(characterObj))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		cl = (longAt(characterObj - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl == classOop)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l1:	/* end assertClassOf:is: */;
	if (!foo->primFailCode) {
		return longAt((characterObj + (BASE_HEADER_SIZE)) + (CharacterValueIndex << (SHIFT_FOR_WORD)));
	} else {
		return ConstZero;
	}
	return null;
}


/*	Return true if the stack is still balanced after executing primitive primIndex with nArgs args. Delta is 'stackPointer - activeContext' which is a relative measure for the stack pointer (so we don't have to relocate it during the primitive) */

sqInt balancedStackafterPrimitivewithArgs(sqInt delta, sqInt primIdx, sqInt nArgs) {
register struct foo * foo = &fum;
	if ((primIdx >= 81) && (primIdx <= 88)) {
		return 1;
	}
	if (!foo->primFailCode) {

		/* Successful prim, stack must have exactly nArgs arguments popped off */

		return ((foo->stackPointer - foo->activeContext) + (nArgs * (BYTES_PER_WORD))) == delta;
	}
	return (foo->stackPointer - foo->activeContext) == delta;
}


/*	If this object is old, mark it as a root (because a new object 
	may be stored into it) */

sqInt beRootIfOld(sqInt oop) {
register struct foo * foo = &fum;
    sqInt header;

	if (((((usqInt) oop)) < (((usqInt) foo->youngStart))) && (!((oop & 1)))) {

		/* Yes, oop is an old object */

		/* begin noteAsRoot:headerLoc: */
		header = longAt(oop);
		if ((header & (ROOT_BIT)) == 0) {
			if (foo->rootTableCount < RootTableRedZone) {
				foo->rootTableCount += 1;
				foo->rootTable[foo->rootTableCount] = oop;
				longAtput(oop, header | (ROOT_BIT));
			} else {
				if (foo->rootTableCount < RootTableSize) {
					foo->rootTableCount += 1;
					foo->rootTable[foo->rootTableCount] = oop;
					longAtput(oop, header | (ROOT_BIT));
					foo->allocationCount = foo->allocationsBetweenGCs + 1;
				}
			}
		}
	}
	return null;
}


/*	Record that the given oop in the old object area points to an object in the young area when oop may be forwarded. */
/*	Warning: No young objects should be recorded as roots. Callers are responsible for ensuring this constraint is not violated. */

sqInt beRootWhileForwarding(sqInt oop) {
register struct foo * foo = &fum;
    sqInt fwdBlock;
    sqInt header;
    sqInt header1;
    sqInt header2;

	header = longAt(oop);
	if ((header & (MARK_BIT)) != 0) {

		/* This oop is forwarded */

		fwdBlock = (header & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
		if (DoAssertionChecks) {
			/* begin fwdBlockValidate: */
			if (!(((((usqInt) fwdBlock)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock & 3) == 0)))) {
				error("invalid fwd table entry");
			}
		}
		/* begin noteAsRoot:headerLoc: */
		header1 = longAt(fwdBlock + (BYTES_PER_WORD));
		if ((header1 & (ROOT_BIT)) == 0) {
			if (foo->rootTableCount < RootTableRedZone) {
				foo->rootTableCount += 1;
				foo->rootTable[foo->rootTableCount] = oop;
				longAtput(fwdBlock + (BYTES_PER_WORD), header1 | (ROOT_BIT));
			} else {
				if (foo->rootTableCount < RootTableSize) {
					foo->rootTableCount += 1;
					foo->rootTable[foo->rootTableCount] = oop;
					longAtput(fwdBlock + (BYTES_PER_WORD), header1 | (ROOT_BIT));
					foo->allocationCount = foo->allocationsBetweenGCs + 1;
				}
			}
		}
	} else {

		/* Normal -- no forwarding */

		/* begin noteAsRoot:headerLoc: */
		header2 = longAt(oop);
		if ((header2 & (ROOT_BIT)) == 0) {
			if (foo->rootTableCount < RootTableRedZone) {
				foo->rootTableCount += 1;
				foo->rootTable[foo->rootTableCount] = oop;
				longAtput(oop, header2 | (ROOT_BIT));
			} else {
				if (foo->rootTableCount < RootTableSize) {
					foo->rootTableCount += 1;
					foo->rootTable[foo->rootTableCount] = oop;
					longAtput(oop, header2 | (ROOT_BIT));
					foo->allocationCount = foo->allocationsBetweenGCs + 1;
				}
			}
		}
	}
	return null;
}

sqInt becomewith(sqInt array1, sqInt array2) {
	return becomewithtwoWaycopyHash(array1, array2, 1, 1);
}


/*	All references to each object in array1 are swapped with all references to the corresponding object in array2. That is, all pointers to one object are replaced with with pointers to the other. The arguments must be arrays of the same length. 
	Returns true if the primitive succeeds. */
/*	Implementation: Uses forwarding blocks to update references as done in compaction. */

sqInt becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt copyHashFlag) {
register struct foo * foo = &fum;
    sqInt fieldOffset;
    sqInt hdr1;
    sqInt hdr2;
    sqInt oop1;
    sqInt oop2;
    sqInt fwdBlock;
    sqInt hdr11;
    sqInt hdr21;
    sqInt oop11;
    sqInt oop21;
    sqInt contextSize;
    sqInt fmt;
    sqInt header;
    sqInt methodHeader;
    sqInt sz;
    sqInt sp;
    sqInt header1;
    sqInt type;

	if (!(((array1 & 1) == 0) && (((((usqInt) (longAt(array1))) >> 8) & 15) == 2))) {
		return 0;
	}
	if (!(((array2 & 1) == 0) && (((((usqInt) (longAt(array2))) >> 8) & 15) == 2))) {
		return 0;
	}
	if (!((lastPointerOf(array1)) == (lastPointerOf(array2)))) {
		return 0;
	}
	if (!(containOnlyOopsand(array1, array2))) {
		return 0;
	}
	if (!(prepareForwardingTableForBecomingwithtwoWay(array1, array2, twoWayFlag))) {
		return 0;
	}
	if (allYoungand(array1, array2)) {

		/* sweep only the young objects plus the roots */

		mapPointersInObjectsFromto((sqInt)foo->youngStart, (sqInt)foo->endOfMemory);
	} else {

		/* sweep all objects */

		mapPointersInObjectsFromto((sqInt)memory, (sqInt)foo->endOfMemory);
	}
	if (twoWayFlag) {
		/* begin restoreHeadersAfterBecoming:with: */
		/* begin lastPointerOf: */
		header = longAt(array1);
		fmt = (((usqInt) header) >> 8) & 15;
		if (fmt <= 4) {
			if ((fmt == 3) && ((((((usqInt) header) >> 12) & 0x1F) == 13) || ((((((usqInt) header) >> 12) & 0x1F) == 14) || (((((usqInt) header) >> 12) & 0x1F) == 4)))) {
				/* begin fetchStackPointerOf: */
				sp = longAt((array1 + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
				if (!((sp & 1))) {
					contextSize = 0;
					goto l1;
				}
				contextSize = (sp >> 1);
			l1:	/* end fetchStackPointerOf: */;
				fieldOffset = (CtxtTempFrameStart + contextSize) * (BYTES_PER_WORD);
				goto l2;
			}
			/* begin sizeBitsOfSafe: */
			header1 = longAt(array1);
			/* begin rightType: */
			if ((header1 & (SIZE_MASK)) == 0) {
				type = HeaderTypeSizeAndClass;
				goto l3;
			} else {
				if ((header1 & CompactClassMask) == 0) {
					type = HeaderTypeClass;
					goto l3;
				} else {
					type = HeaderTypeShort;
					goto l3;
				}
			}
		l3:	/* end rightType: */;
			if (type == HeaderTypeSizeAndClass) {
				sz = (longAt(array1 - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
				goto l4;
			} else {
				sz = header1 & (SIZE_MASK);
				goto l4;
			}
		l4:	/* end sizeBitsOfSafe: */;
			fieldOffset = sz - (BASE_HEADER_SIZE);
			goto l2;
		}
		if (fmt < 12) {
			fieldOffset = 0;
			goto l2;
		}
		methodHeader = longAt(array1 + (BASE_HEADER_SIZE));
		fieldOffset = (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
	l2:	/* end lastPointerOf: */;
		while (fieldOffset >= (BASE_HEADER_SIZE)) {
			oop1 = longAt(array1 + fieldOffset);
			oop2 = longAt(array2 + fieldOffset);
			if (!(oop1 == oop2)) {
				restoreHeaderOf(oop1);
				restoreHeaderOf(oop2);
				hdr1 = longAt(oop1);
				hdr2 = longAt(oop2);
				longAtput(oop1, (hdr1 & (ALL_BUT_HASH_BITS)) | (hdr2 & HashBits));
				longAtput(oop2, (hdr2 & (ALL_BUT_HASH_BITS)) | (hdr1 & HashBits));
			}
			fieldOffset -= BYTES_PER_WORD;
		}
	} else {
		/* begin restoreHeadersAfterForwardBecome: */
		fwdBlock = ((foo->endOfMemory + (BASE_HEADER_SIZE)) + 7) & ((WORD_MASK) - 7);
		flag("Dan");
		fwdBlock += (BYTES_PER_WORD) * 4;
		while ((((usqInt) fwdBlock)) <= (((usqInt) foo->fwdTableNext))) {
			oop11 = longAt(fwdBlock + ((BYTES_PER_WORD) * 2));
			oop21 = longAt(fwdBlock);
			restoreHeaderOf(oop11);
			if (copyHashFlag) {
				hdr11 = longAt(oop11);
				hdr21 = longAt(oop21);
				longAtput(oop21, (hdr21 & (ALL_BUT_HASH_BITS)) | (hdr11 & HashBits));
			}
			fwdBlock += (BYTES_PER_WORD) * 4;
		}
	}
	initializeMemoryFirstFree(foo->freeBlock);
	/* begin forceInterruptCheck */
	foo->interruptCheckCounter = -1000;
	foo->nextPollTick = 0;
	return 1;
}

sqInt biasToGrow(void) {
register struct foo * foo = &fum;
    usqInt growSize;

	growSize = (((sqInt) (foo->growHeadroom * 3) >> 1)) - ((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK));
	if (growSize > 0) {
		growObjectMemory(growSize);
	}
	return null;
}


/*	convert true and false (Smalltalk) to true or false(C) */

sqInt booleanValueOf(sqInt obj) {
register struct foo * foo = &fum;
	if (obj == foo->trueObj) {
		return 1;
	}
	if (obj == foo->falseObj) {
		return 0;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return null;
}

sqInt byteSizeOf(sqInt oop) {
    sqInt slots;
    sqInt header;
    sqInt sz;

	flag("Dan");
	if ((oop & 1)) {
		return 0;
	}
	/* begin slotSizeOf: */
	if ((oop & 1)) {
		slots = 0;
		goto l1;
	}
	/* begin lengthOf: */
	header = longAt(oop);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = header & (SIZE_MASK);
	}
	sz -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		slots = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l2;
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		slots = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l2;
	} else {
		slots = (sz - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
		goto l2;
	}
l2:	/* end lengthOf:baseHeader:format: */;
l1:	/* end slotSizeOf: */;
	if (((((usqInt) (longAt(oop))) >> 8) & 15) >= 8) {
		return slots;
	} else {
		return slots * 4;
	}
	return null;
}


/*	Byte-swap the words of all bytes objects in a range of the 
	image, including Strings, ByteArrays, and CompiledMethods. 
	This returns these objects to their original byte ordering 
	after blindly byte-swapping the entire image. For compiled 
	methods, byte-swap only their bytecodes part. */

sqInt byteSwapByteObjectsFromto(sqInt startOop, sqInt stopAddr) {
register struct foo * foo = &fum;
    sqInt fmt;
    sqInt methodHeader;
    sqInt oop;
    sqInt wordAddr;
    sqInt stopAddr1;
    sqInt addr;
    sqInt stopAddr2;
    sqInt addr1;
    sqInt sz;
    sqInt header;

	oop = startOop;
	while ((((usqInt) oop)) < (((usqInt) stopAddr))) {
		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
			fmt = (((usqInt) (longAt(oop))) >> 8) & 15;
			if (fmt >= 8) {

				/* oop contains bytes */

				wordAddr = oop + (BASE_HEADER_SIZE);
				if (fmt >= 12) {

					/* compiled method; start after methodHeader and literals */

					methodHeader = longAt(oop + (BASE_HEADER_SIZE));
					wordAddr = (wordAddr + (BYTES_PER_WORD)) + (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD));
				}
				/* begin reverseBytesFrom:to: */
				stopAddr1 = oop + (sizeBitsOf(oop));
				flag("Dan");
				addr = wordAddr;
				while ((((usqInt) addr)) < (((usqInt) stopAddr1))) {
					longAtput(addr, byteSwapped(longAt(addr)));
					addr += BYTES_PER_WORD;
				}
			}
			if ((fmt == 6) && ((BYTES_PER_WORD) == 8)) {

				/* Object contains 32-bit half-words packed into 64-bit machine words. */

				wordAddr = oop + (BASE_HEADER_SIZE);
				/* begin reverseWordsFrom:to: */
				stopAddr2 = oop + (sizeBitsOf(oop));
				addr1 = wordAddr;
				while ((((usqInt) addr1)) < (((usqInt) stopAddr2))) {
					longAtput(addr1, wordSwapped(longAt(addr1)));
					addr1 += BYTES_PER_WORD;
				}
			}
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header = longAt(oop);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
		}
		oop = (oop + sz) + (foo->headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
	}
	return null;
}


/*	Answer the given integer with its bytes in the reverse order. */

sqInt byteSwapped(sqInt w) {
	
# if (BYTES_PER_WORD == 4)  // swap bytes in an object word
	return ((((((usqInt) w >> 24)) & Byte0Mask) + ((((usqInt) w >> 8)) & Byte1Mask)) + ((((usqInt) w << 8)) & Byte2Mask)) + ((((usqInt) w << 24)) & Byte3Mask);
# else
	return ((((((((((usqInt) w >> 56)) & Byte0Mask) + ((((usqInt) w >> 40)) & Byte1Mask)) + ((((usqInt) w >> 24)) & Byte2Mask)) + ((((usqInt) w >> 8)) & Byte3Mask)) + ((((usqInt) w << 8)) & Byte4Mask)) + ((((usqInt) w << 24)) & Byte5Mask)) + ((((usqInt) w << 40)) & Byte6Mask)) + ((((usqInt) w << 56)) & Byte7Mask);
# endif  // BYTES_PER_WORD == 4
	
	return null;
}


/*	Call the external plugin function identified. In the VM this is an address, see 	InterpreterSimulator for it's version.  */

sqInt callExternalPrimitive(void (*functionID)(void)) {
	dispatchFunctionPointer(functionID);
	return null;
}


/*	External call into the interpreter */

EXPORT(sqInt) callInterpreter(void) {
	interpret();
	return null;
}


/*	Re-enter the interpreter for executing a callback */

EXPORT(sqInt) callbackEnter(sqInt *callbackID) {
register struct foo * foo = &fum;
    sqInt activeProc;
    sqInt result;
    sqInt oop;
    sqInt oop1;
    sqInt oop2;
    sqInt oop3;
    sqInt priority;
    sqInt processList;
    sqInt processLists;
    sqInt oop4;
    sqInt oop11;


	/* For now, do not allow a callback unless we're in a primitiveResponse */

	if (foo->primitiveIndex == 0) {
		return 0;
	}
	if (foo->jmpDepth >= foo->jmpMax) {
		return 0;
	}

	/* Suspend the currently active process */

	foo->jmpDepth += 1;
	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop2 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop = longAt((oop2 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	foo->suspendedCallbacks[foo->jmpDepth] = activeProc;
	foo->suspendedMethods[foo->jmpDepth] = foo->newMethod;
	transferTo(wakeHighestPriority());
	/* begin forceInterruptCheck */
	foo->interruptCheckCounter = -1000;
	foo->nextPollTick = 0;
	result = setjmp(foo->jmpBuf[foo->jmpDepth]);
	if (result == 0) {

		/* Fill in callbackID */

		callbackID[0] = foo->jmpDepth;
		interpret();
	}
	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop3 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop1 = longAt((oop3 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	activeProc = longAt((oop1 + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	/* begin putToSleep: */
	priority = ((longAt((activeProc + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop4 = longAt((oop11 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	processLists = longAt((oop4 + (BASE_HEADER_SIZE)) + (ProcessListsIndex << (SHIFT_FOR_WORD)));
	processList = longAt((processLists + (BASE_HEADER_SIZE)) + ((priority - 1) << (SHIFT_FOR_WORD)));
	addLastLinktoList(activeProc, processList);
	activeProc = foo->suspendedCallbacks[foo->jmpDepth];

	/* see comment above */

	foo->newMethod = foo->suspendedMethods[foo->jmpDepth];
	transferTo(activeProc);
	foo->jmpDepth -= 1;
	return 1;
}


/*	Leave from a previous callback */
/*	For now, do not allow a callback unless we're in a primitiveResponse */

EXPORT(sqInt) callbackLeave(sqInt cbID) {
register struct foo * foo = &fum;
	if (foo->primitiveIndex == 0) {
		return 0;
	}
	if (!(cbID == foo->jmpDepth)) {
		return 0;
	}
	if (cbID < 1) {
		return 0;
	}
	longjmp(foo->jmpBuf[foo->jmpDepth], 1);
	return null;
}


/*	Attempt to change the class of the receiver to the argument given that the
	 format of the receiver matches the format of the argument.  If successful,
	 answer 0, otherwise answer an error code indicating the reason for failure. 
	 Fail if the receiver is an instance of a compact class and the argument isn't,
	 or if the format of the receiver is incompatible with the format of the argument,
	 or if the argument is a fixed class and the receiver's size differs from the size
	 that an instance of the argument should have. */
/*	Check what the format of the class says */

sqInt changeClassOfto(sqInt rcvr, sqInt argClass) {
    sqInt argClassInstByteSize;
    sqInt argFormat;
    sqInt ccIndex;
    sqInt classHdr;
    sqInt rcvrFormat;
    sqInt rcvrHdr;
    sqInt sizeHiBits;


	/* Low 2 bits are 0 */
	/* Compute the size of instances of the class (used for fixed field classes only) */

	classHdr = (longAt((argClass + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	sizeHiBits = ((usqInt) (classHdr & 393216)) >> 9;
	classHdr = classHdr & 0x1FFFF;

	/* size in bytes -- low 2 bits are 0 */
	/* Check the receiver's format against that of the class */

	argClassInstByteSize = (classHdr & (SIZE_MASK)) + sizeHiBits;
	argFormat = (((usqInt) classHdr) >> 8) & 15;
	rcvrHdr = longAt(rcvr);

	/* If the receiver is a byte object we need to clear the number of odd bytes from the format. */

	rcvrFormat = (((usqInt) rcvrHdr) >> 8) & 15;
	if (rcvrFormat > 8) {
		rcvrFormat = rcvrFormat & 12;
	}
	if (!(argFormat == rcvrFormat)) {
		return PrimErrInappropriate;
	}
	if (argFormat < 2) {
		if ((argClassInstByteSize - (BASE_HEADER_SIZE)) != (numBytesOf(rcvr))) {
			return PrimErrBadReceiver;
		}
	} else {
		if (argFormat == 3) {

			/* For indexable plus fixed fields the receiver must be at least big enough. */

			if ((argClassInstByteSize - (BASE_HEADER_SIZE)) > (numBytesOf(rcvr))) {
				return PrimErrBadReceiver;
			}
		}
	}
	if ((rcvrHdr & TypeMask) == HeaderTypeShort) {

		/* Compact classes. Check if the arg's class is compact and exchange ccIndex */

		ccIndex = classHdr & CompactClassMask;
		if (ccIndex == 0) {
			return PrimErrInappropriate;
		}
		longAtput(rcvr, (((rcvrHdr | CompactClassMask) - CompactClassMask)) | ccIndex);
	} else {

		/* Exchange the class pointer, which could make rcvr a root for argClass */
		/* self cppIf: IMMUTABILITY
				ifTrue: [(rcvrHdr bitAnd: ImmutabilityBit) ~= 0 ifTrue:
							[^PrimErrNoModification]]. */
		/* N.B. the recursive scan-mark algorithm uses the header word's size and compact class
			 fields to determine the header type when it reuses the header type bits for the mark
			 state.  So it is alas an invariant that non-compact headers have a 0 compact class field. */

		if (((((usqInt) rcvrHdr) >> 12) & 0x1F) != 0) {
			longAtput(rcvr, ((rcvrHdr | CompactClassMask) - CompactClassMask));
		}
		longAtput(rcvr - (BASE_HEADER_SIZE), argClass | (rcvrHdr & TypeMask));
		if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(rcvr, argClass);
		}
	}
	return 0;
}


/*	Arg must lie in range 0-255! */

sqInt characterForAscii(sqInt ascii) {
    sqInt oop;

	/* begin fetchPointer:ofObject: */
	oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CharacterTable << (SHIFT_FOR_WORD)));
	return longAt((oop + (BASE_HEADER_SIZE)) + (ascii << (SHIFT_FOR_WORD)));
}

sqInt characterObjectOf(sqInt characterCode) {
register struct foo * foo = &fum;
    sqInt oop;

	return (((characterCode >= 0) && (characterCode <= 0xFF))
		? /* begin fetchPointer:ofObject: */(oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CharacterTable << (SHIFT_FOR_WORD)))),longAt((oop + (BASE_HEADER_SIZE)) + (characterCode << (SHIFT_FOR_WORD)))
		: foo->nilObj);
}

sqInt characterTable(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CharacterTable << (SHIFT_FOR_WORD)));
}


/*	Check for possible interrupts and handle one if necessary. */

sqInt checkForInterrupts(void) {
register struct foo * foo = &fum;
    sqInt now;
    sqInt sema;
    sqInt i;
    sqInt index;
    sqInt sema1;
    sqInt xArray;
    sqInt xSize;


	/* Mask so same wrapping as primitiveMillisecondClock */

	now = (ioMSecs()) & MillisecondClockMask;
	if (!(foo->interruptCheckCounter < -100)) {

		/* don't play with the feedback if we forced a check. It only makes life difficult */

		if ((now - foo->lastTick) < foo->interruptChecksEveryNms) {

			/* wrapping is not a concern, it'll get caught quickly  
				enough. This clause is trying to keep a reasonable  
				guess of how many times per 	interruptChecksEveryNms we are calling  
				quickCheckForInterrupts. Not sure how effective it really is. */

			foo->interruptCheckCounterFeedBackReset += 10;
		} else {
			if (foo->interruptCheckCounterFeedBackReset <= 1000) {
				foo->interruptCheckCounterFeedBackReset = 1000;
			} else {
				foo->interruptCheckCounterFeedBackReset -= 12;
			}
		}
	}
	foo->interruptCheckCounter = foo->interruptCheckCounterFeedBackReset;
	if (foo->signalLowSpace) {
		/* begin setSignalLowSpace: */
		foo->signalLowSpace = 0;
		sema = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheLowSpaceSemaphore << (SHIFT_FOR_WORD)));
		if (!(sema == foo->nilObj)) {
			synchronousSignal(sema);
		}
	}
	if (now < foo->lastTick) {

		/* millisecond clock wrapped so correct the nextPollTick */

		foo->nextPollTick = (foo->nextPollTick - MillisecondClockMask) - 1;
	}
	if (now >= foo->nextPollTick) {
		ioProcessEvents();

		/* msecs to wait before next call to ioProcessEvents.  
			Note that strictly speaking we might need to update  
			'now' at this point since ioProcessEvents could take a  
			very long time on some platforms */

		foo->nextPollTick = now + 200;
	}
	if (foo->interruptPending) {

		/* reset interrupt flag */

		foo->interruptPending = 0;
		sema = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheInterruptSemaphore << (SHIFT_FOR_WORD)));
		if (!(sema == foo->nilObj)) {
			synchronousSignal(sema);
		}
	}
	if (foo->nextWakeupTick != 0) {
		if (now < foo->lastTick) {

			/* the clock has wrapped. Subtract the wrap  
					interval from nextWakeupTick - this might just  
					possibly result in 0. Since this is used as a flag  
					value for 'no timer' we do the 0 check above */

			foo->nextWakeupTick = (foo->nextWakeupTick - MillisecondClockMask) - 1;
		}
		if (now >= foo->nextWakeupTick) {

			/* set timer interrupt to 0 for 'no timer' */

			foo->nextWakeupTick = 0;
			sema = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheTimerSemaphore << (SHIFT_FOR_WORD)));
			if (!(sema == foo->nilObj)) {
				synchronousSignal(sema);
			}
		}
	}
	if (foo->pendingFinalizationSignals > 0) {
		sema = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheFinalizationSemaphore << (SHIFT_FOR_WORD)));
		if ((fetchClassOf(sema)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD))))) {
			synchronousSignal(sema);
		}
		foo->pendingFinalizationSignals = 0;
	}
	if ((foo->semaphoresToSignalCountA > 0) || (foo->semaphoresToSignalCountB > 0)) {
		/* begin signalExternalSemaphores */
		foo->semaphoresUseBufferA = !foo->semaphoresUseBufferA;
		xArray = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ExternalObjectsArray << (SHIFT_FOR_WORD)));
		xSize = stSizeOf(xArray);
		if (foo->semaphoresUseBufferA) {
			for (i = 1; i <= foo->semaphoresToSignalCountB; i += 1) {
				index = foo->semaphoresToSignalB[i];
				if (index <= xSize) {
					sema1 = longAt((xArray + (BASE_HEADER_SIZE)) + ((index - 1) << (SHIFT_FOR_WORD)));
					if ((fetchClassOf(sema1)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD))))) {
						synchronousSignal(sema1);
					}
				}
			}
			foo->semaphoresToSignalCountB = 0;
		} else {
			for (i = 1; i <= foo->semaphoresToSignalCountA; i += 1) {
				index = foo->semaphoresToSignalA[i];
				if (index <= xSize) {
					sema1 = longAt((xArray + (BASE_HEADER_SIZE)) + ((index - 1) << (SHIFT_FOR_WORD)));
					if ((fetchClassOf(sema1)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD))))) {
						synchronousSignal(sema1);
					}
				}
			}
			foo->semaphoresToSignalCountA = 0;
		}
	}
	foo->lastTick = now;
	return null;
}


/*	Read and verify the image file version number and return true if the the given image file needs to be byte-swapped. As a side effect, position the file stream just after the version number of the image header. This code prints a warning and does a hard-exit if it cannot find a valid version number. */
/*	This code is based on C code by Ian Piumarta. */

sqInt checkImageVersionFromstartingAt(sqImageFile  f, squeakFileOffsetType  imageOffset) {
    sqInt firstVersion;


	/* check the version number */

	sqImageFileSeek(f, imageOffset);
	imageFormatInitialVersion = (firstVersion = getLongFromFileswap(f, 0));
	if (readableFormat(imageFormatInitialVersion)) {
		return 0;
	}
	sqImageFileSeek(f, imageOffset);
	imageFormatInitialVersion = getLongFromFileswap(f, 1);
	if (readableFormat(imageFormatInitialVersion)) {
		return 1;
	}
	if (imageOffset == 0) {

		/* try skipping the first 512 bytes (prepended by certain Mac file transfer utilities) */

		sqImageFileSeek(f, 512);
		imageFormatInitialVersion = getLongFromFileswap(f, 0);
		if (readableFormat(imageFormatInitialVersion)) {
			return 0;
		}
		sqImageFileSeek(f, 512);
		imageFormatInitialVersion = getLongFromFileswap(f, 1);
		if (readableFormat(imageFormatInitialVersion)) {
			return 1;
		}
	}
	/* begin printVersionWarning: */
	print("This interpreter supports image formats up to ");
	printNum(imageFormatSupportableVersion());
	print(", cannot read file format ");
	printNum(firstVersion);
	/* begin cr */
	printf("\n");
	ioExit();
	ioExit();
	return null;
}


/*	Note: May be called by translated primitive code. */

sqInt checkedIntegerValueOf(sqInt intOop) {
register struct foo * foo = &fum;
	if ((intOop & 1)) {
		return (intOop >> 1);
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return 0;
	}
	return null;
}


/*	Assumes zero-based array indexing. For testing in Smalltalk, this method should be overridden in a subclass. */

sqInt checkedLongAt(sqInt byteAddress) {
register struct foo * foo = &fum;
	/* begin checkAddress: */
	if ((((usqInt) byteAddress)) < (((usqInt) memory))) {
		error("bad address: negative");
	}
	if ((((usqInt) byteAddress)) >= (((usqInt) foo->memoryLimit))) {
		error("bad address: past end of heap");
	}
	/* begin checkAddress: */
	if ((((usqInt) (byteAddress + 3))) < (((usqInt) memory))) {
		error("bad address: negative");
	}
	if ((((usqInt) (byteAddress + 3))) >= (((usqInt) foo->memoryLimit))) {
		error("bad address: past end of heap");
	}
	return longAt(byteAddress);
}

sqInt classAlien(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassAlien << (SHIFT_FOR_WORD)));
}

sqInt classArray(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD)));
}

sqInt classBitmap(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBitmap << (SHIFT_FOR_WORD)));
}

sqInt classByteArray(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassByteArray << (SHIFT_FOR_WORD)));
}

sqInt classCharacter(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassCharacter << (SHIFT_FOR_WORD)));
}

sqInt classExternalAddress(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassExternalAddress << (SHIFT_FOR_WORD)));
}

sqInt classExternalData(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassExternalData << (SHIFT_FOR_WORD)));
}

sqInt classExternalFunction(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassExternalFunction << (SHIFT_FOR_WORD)));
}

sqInt classExternalLibrary(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassExternalLibrary << (SHIFT_FOR_WORD)));
}

sqInt classExternalStructure(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassExternalStructure << (SHIFT_FOR_WORD)));
}

sqInt classFloat(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD)));
}

sqInt classLargeNegativeInteger(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargeNegativeInteger << (SHIFT_FOR_WORD)));
}

sqInt classLargePositiveInteger(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD)));
}


/*	Check if aClass's name is className */

sqInt classNameOfIs(sqInt aClass, char *className) {
    sqInt i;
    sqInt length;
    sqInt name;
    char *srcName;

	if ((lengthOf(aClass)) <= 6) {
		return 0;
	}
	name = longAt((aClass + (BASE_HEADER_SIZE)) + (6 << (SHIFT_FOR_WORD)));
	if (!(((name & 1) == 0) && (((((usqInt) (longAt(name))) >> 8) & 15) >= 8))) {
		return 0;
	}
	length = stSizeOf(name);
	srcName = ((char *) (arrayValueOf(name)));
	for (i = 0; i <= (length - 1); i += 1) {
		if (!((srcName[i]) == (className[i]))) {
			return 0;
		}
	}
	return (className[length]) == 0;
}

sqInt classPoint(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD)));
}

sqInt classSemaphore(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD)));
}

sqInt classSmallInteger(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
}

sqInt classString(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassString << (SHIFT_FOR_WORD)));
}

sqInt classUnsafeAlien(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassUnsafeAlien << (SHIFT_FOR_WORD)));
}


/*	Return a shallow copy of the given object. May cause GC */
/*	Assume: Oop is a real object, not a small integer. */

sqInt clone(sqInt oop) {
register struct foo * foo = &fum;
    usqInt bytes;
    sqInt extraHdrBytes;
    usqInt fromIndex;
    sqInt hash;
    sqInt header;
    usqInt lastFrom;
    sqInt newChunk;
    sqInt newOop;
    sqInt remappedOop;
    sqInt toIndex;
    sqInt header1;
    sqInt oop1;
    sqInt enoughSpace;
    sqInt newChunk1;
    sqInt newFreeSize;
    usqInt minFree;
    sqInt currentProc;
    sqInt lastSavedProcess;
    sqInt sched;
    sqInt oop2;

	extraHdrBytes = foo->headerTypeBytes[(longAt(oop)) & TypeMask];
	/* begin sizeBitsOf: */
	header1 = longAt(oop);
	if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
		bytes = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l1;
	} else {
		bytes = header1 & (SIZE_MASK);
		goto l1;
	}
l1:	/* end sizeBitsOf: */;

	/* allocate space for the copy, remapping oop in case of a GC */

	bytes += extraHdrBytes;
	/* begin pushRemappableOop: */
	foo->remapBuffer[(foo->remapBufferCount += 1)] = oop;
	if (!(sufficientSpaceToAllocate(2500 + bytes))) {
		return 0;
	}
	/* begin allocateChunk: */
	if (foo->allocationCount >= foo->allocationsBetweenGCs) {
		incrementalGC();
	}
	/* begin sufficientSpaceToAllocate: */
	minFree = (foo->lowSpaceThreshold + bytes) + (BASE_HEADER_SIZE);
	if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree)) {
		enoughSpace = 1;
		goto l2;
	} else {
		enoughSpace = sufficientSpaceAfterGC(minFree);
		goto l2;
	}
l2:	/* end sufficientSpaceToAllocate: */;
	if (!(enoughSpace)) {
		foo->signalLowSpace = 1;
		foo->lowSpaceThreshold = 0;
		/* begin saveProcessSignalingLowSpace */
		lastSavedProcess = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ProcessSignalingLowSpace << (SHIFT_FOR_WORD)));
		if (lastSavedProcess == foo->nilObj) {
			/* begin fetchPointer:ofObject: */
			oop2 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
			sched = longAt((oop2 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
			currentProc = longAt((sched + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(foo->specialObjectsOop, currentProc);
			}
			longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ProcessSignalingLowSpace << (SHIFT_FOR_WORD)), currentProc);
		}
		/* begin forceInterruptCheck */
		foo->interruptCheckCounter = -1000;
		foo->nextPollTick = 0;
	}
	if (oopisLessThan((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), bytes + (BASE_HEADER_SIZE))) {
		error("out of memory");
	}
	newFreeSize = ((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK)) - bytes;
	newChunk1 = foo->freeBlock;
	foo->freeBlock += bytes;
	/* begin setSizeOfFree:to: */
	longAtput(foo->freeBlock, (newFreeSize & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);
	foo->allocationCount += 1;
	newChunk = newChunk1;
	/* begin popRemappableOop */
	oop1 = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	remappedOop = oop1;

	/* loop below uses pre-increment */

	toIndex = newChunk - (BYTES_PER_WORD);
	fromIndex = (remappedOop - extraHdrBytes) - (BYTES_PER_WORD);
	lastFrom = fromIndex + bytes;
	while (fromIndex < lastFrom) {
		longAtput((toIndex += BYTES_PER_WORD), longAt((fromIndex += BYTES_PER_WORD)));
	}

	/* convert from chunk to oop */
	/* fix base header: compute new hash and clear Mark and Root bits */

	newOop = newChunk + extraHdrBytes;
	/* begin newObjectHash */
	foo->lastHash = (13849 + (27181 * foo->lastHash)) & 0xFFFF;
	hash = foo->lastHash;

	/* use old ccIndex, format, size, and header-type fields */

	header = (longAt(newOop)) & 0x1FFFF;
	header = header | ((hash << 17) & 0x1FFE0000);
	longAtput(newOop, header);
	return newOop;
}


/*	This code is called if the receiver responds primitively to at:.
	If this is so, it will be installed in the atCache so that subsequent calls of at:
	or next may be handled immediately in bytecode primitive routines. */

sqInt commonAt(sqInt stringy) {
register struct foo * foo = &fum;
    sqInt atIx;
    sqInt index;
    sqInt rcvr;
    sqInt result;
    sqInt sp;
    sqInt oop;
    sqInt sp1;
    sqInt fixedFields;
    sqInt fmt;
    sqInt hdr;
    sqInt stSize;
    sqInt totalLength;
    sqInt sp2;
    sqInt sz;
    sqInt class;
    sqInt classFormat;
    sqInt ccIndex;
    sqInt oop1;


	/* Sets primFailCode */

	index = positive32BitValueOf(longAt(foo->stackPointer));
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if (!((!foo->primFailCode) && (!((rcvr & 1))))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	if ((foo->messageSelector == (fetchPointerofObject(16 * 2, longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)))))) && (foo->lkupClass == (fetchClassOfNonInt(rcvr)))) {

		/* OK -- look in the at-cache */


		/* Index into atCache = 4N, for N = 0 ... 7 */

		atIx = rcvr & AtCacheMask;
		if (!((foo->atCache[atIx + AtCacheOop]) == rcvr)) {

			/* Rcvr not in cache.  Install it... */

			installinAtCacheatstring(rcvr, (sqInt  *)foo->atCache, atIx, stringy);
		}
		if (!foo->primFailCode) {
			result = commonVariableatcacheIndex(rcvr, index, atIx);
		}
		if (!foo->primFailCode) {
			/* begin pop:thenPush: */
			longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), result);
			foo->stackPointer = sp;
			return null;
		}
	}
	/* begin initPrimCall */
	foo->primFailCode = 0;
	/* begin stObject:at: */
	hdr = longAt(rcvr);
	fmt = (((usqInt) hdr) >> 8) & 15;
	/* begin lengthOf:baseHeader:format: */
	if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(rcvr - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = hdr & (SIZE_MASK);
	}
	sz -= hdr & (SIZE_4_BIT);
	if (fmt <= 4) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l2;
	}
	if (fmt < 8) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l2;
	} else {
		totalLength = (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
		goto l2;
	}
l2:	/* end lengthOf:baseHeader:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt > 4) || (fmt == 2)) {
		fixedFields = 0;
		goto l3;
	}
	if (fmt < 2) {
		fixedFields = totalLength;
		goto l3;
	}
	/* begin fetchClassOf: */
	if ((rcvr & 1)) {
		class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l4;
	}
	ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		class = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l4;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l4;
	}
l4:	/* end fetchClassOf: */;
	classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
l3:	/* end fixedFieldsOf:format:length: */;
	if (((fmt == 3) && (!foo->allowAccessBeyondSP)) && ((((((usqInt) hdr) >> 12) & 0x1F) == 13) || ((((((usqInt) hdr) >> 12) & 0x1F) == 14) || (((((usqInt) hdr) >> 12) & 0x1F) == 4)))) {
		/* begin fetchStackPointerOf: */
		sp2 = longAt((rcvr + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
		if (!((sp2 & 1))) {
			stSize = 0;
			goto l1;
		}
		stSize = (sp2 >> 1);
	l1:	/* end fetchStackPointerOf: */;
	} else {
		stSize = totalLength - fixedFields;
	}
	if (((((usqInt) index)) >= (((usqInt) 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) {
		/* begin subscript:with:format: */
		if (fmt <= 4) {
			result = longAt((rcvr + (BASE_HEADER_SIZE)) + (((index + fixedFields) - 1) << (SHIFT_FOR_WORD)));
			goto l5;
		}
		if (fmt < 8) {
			result = positive32BitIntegerFor(long32At((rcvr + (BASE_HEADER_SIZE)) + (((index + fixedFields) - 1) << 2)));
			goto l5;
		} else {
			result = (((byteAt((rcvr + (BASE_HEADER_SIZE)) + ((index + fixedFields) - 1))) << 1) | 1);
			goto l5;
		}
		result = null;
		goto l5;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		result = 0;
		goto l5;
	}
l5:	/* end stObject:at: */;
	if (!foo->primFailCode) {
		if (stringy) {
			/* begin fetchPointer:ofObject: */
			oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CharacterTable << (SHIFT_FOR_WORD)));
			result = longAt((oop + (BASE_HEADER_SIZE)) + (((result >> 1)) << (SHIFT_FOR_WORD)));
		}
		/* begin pop:thenPush: */
		longAtput((sp1 = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), result);
		foo->stackPointer = sp1;
		return null;
	}
	return null;
}


/*	This code is called if the receiver responds primitively to at:Put:.
	If this is so, it will be installed in the atPutCache so that subsequent calls of at:
	or  next may be handled immediately in bytecode primitive routines. */

sqInt commonAtPut(sqInt stringy) {
register struct foo * foo = &fum;
    sqInt atIx;
    sqInt index;
    sqInt rcvr;
    sqInt value;
    sqInt sp;
    sqInt sp1;
    sqInt fixedFields;
    sqInt fmt;
    sqInt stSize;
    sqInt valToPut;

	value = longAt(foo->stackPointer);

	/* Sets primFailCode */

	index = positive32BitValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	rcvr = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	if (!((!foo->primFailCode) && (!((rcvr & 1))))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	if ((foo->messageSelector == (fetchPointerofObject(17 * 2, longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)))))) && (foo->lkupClass == (fetchClassOfNonInt(rcvr)))) {

		/* OK -- look in the at-cache */


		/* Index into atPutCache */

		atIx = (rcvr & AtCacheMask) + AtPutBase;
		if (!((foo->atCache[atIx + AtCacheOop]) == rcvr)) {

			/* Rcvr not in cache.  Install it... */

			installinAtCacheatstring(rcvr, (sqInt  *)foo->atCache, atIx, stringy);
		}
		if (!foo->primFailCode) {
			/* begin commonVariable:at:put:cacheIndex: */
			stSize = foo->atCache[atIx + AtCacheSize];
			if (((((usqInt) index)) >= (((usqInt) 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) {
				fmt = foo->atCache[atIx + AtCacheFmt];
				if (fmt <= 4) {
					fixedFields = foo->atCache[atIx + AtCacheFixedFields];
					/* begin storePointer:ofObject:withValue: */
					if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
						possibleRootStoreIntovalue(rcvr, value);
					}
					longAtput((rcvr + (BASE_HEADER_SIZE)) + (((index + fixedFields) - 1) << (SHIFT_FOR_WORD)), value);
					goto l1;
				}
				if (fmt < 8) {
					valToPut = positive32BitValueOf(value);
					if (!foo->primFailCode) {
						long32Atput((rcvr + (BASE_HEADER_SIZE)) + ((index - 1) << 2), valToPut);
					}
					goto l1;
				}
				if (fmt >= 16) {
					valToPut = asciiOfCharacter(value);
					if (!(!foo->primFailCode)) {
						goto l1;
					}
				} else {
					valToPut = value;
				}
				if ((valToPut & 1)) {
					valToPut = (valToPut >> 1);
					if (!((valToPut >= 0) && (valToPut <= 0xFF))) {
						/* begin primitiveFail */
						if (foo->primFailCode == 0) {
							foo->primFailCode = 1;
						}
						goto l1;
					}
					byteAtput((rcvr + (BASE_HEADER_SIZE)) + (index - 1), valToPut);
					goto l1;
				}
			}
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		l1:	/* end commonVariable:at:put:cacheIndex: */;
		}
		if (!foo->primFailCode) {
			/* begin pop:thenPush: */
			longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), value);
			foo->stackPointer = sp;
			return null;
		}
	}
	/* begin initPrimCall */
	foo->primFailCode = 0;
	if (stringy) {
		stObjectatput(rcvr, index, asciiOfCharacter(value));
	} else {
		stObjectatput(rcvr, index, value);
	}
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp1 = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), value);
		foo->stackPointer = sp1;
		return null;
	}
	return null;
}


/*	This code assumes the receiver has been identified at location atIx in the atCache. */

sqInt commonVariableatcacheIndex(sqInt rcvr, sqInt index, sqInt atIx) {
register struct foo * foo = &fum;
    sqInt fixedFields;
    sqInt fmt;
    sqInt result;
    sqInt stSize;
    sqInt oop;

	stSize = foo->atCache[atIx + AtCacheSize];
	if (((((usqInt) index)) >= (((usqInt) 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) {
		fmt = foo->atCache[atIx + AtCacheFmt];
		if (fmt <= 4) {
			fixedFields = foo->atCache[atIx + AtCacheFixedFields];
			return longAt((rcvr + (BASE_HEADER_SIZE)) + (((index + fixedFields) - 1) << (SHIFT_FOR_WORD)));
		}
		if (fmt < 8) {

			/* Bitmap */

			result = long32At((rcvr + (BASE_HEADER_SIZE)) + ((index - 1) << 2));
			result = positive32BitIntegerFor(result);
			return result;
		}
		if (fmt >= 16) {

			/* Note fmt >= 16 is an artificial flag for strings */
			/* String */

			/* begin fetchPointer:ofObject: */
			oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CharacterTable << (SHIFT_FOR_WORD)));
			return longAt((oop + (BASE_HEADER_SIZE)) + ((byteAt((rcvr + (BASE_HEADER_SIZE)) + (index - 1))) << (SHIFT_FOR_WORD)));
		} else {

			/* ByteArray */

			return (((byteAt((rcvr + (BASE_HEADER_SIZE)) + (index - 1))) << 1) | 1);
		}
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return null;
}


/*	May set success to false */
/*	First compare two ST integers... */

sqInt compare31or32Bitsequal(sqInt obj1, sqInt obj2) {
	if (((obj1 & 1)) && ((obj2 & 1))) {
		return obj1 == obj2;
	}
	return (positive32BitValueOf(obj1)) == (positive32BitValueOf(obj2));
}

sqInt compilerCreateActualMessagestoringArgs(sqInt aMessage, sqInt argArray) {
	return compilerHooks[14](aMessage, argArray);
}

sqInt compilerFlushCache(sqInt aCompiledMethod) {
	return compilerHooks[2](aCompiledMethod);
}

sqInt compilerMapFromto(sqInt memStart, sqInt memEnd) {
	return compilerHooks[4](memStart, memEnd);
}

sqInt compilerMark(void) {
	return compilerHooks[9]();
}

sqInt compilerPostGC(void) {
	return compilerHooks[5]();
}

sqInt compilerPostSnapshot(void) {
	return compilerHooks[8]();
}

sqInt compilerPreGC(sqInt fullGCFlag) {
	return compilerHooks[3](fullGCFlag);
}

sqInt compilerPreSnapshot(void) {
	return compilerHooks[7]();
}

sqInt compilerProcessChange(void) {
	return compilerHooks[6]();
}

sqInt compilerProcessChangeto(sqInt oldProc, sqInt newProc) {
	return compilerHooks[6](oldProc, newProc);
}

sqInt compilerTranslateMethod(void) {
	return compilerHooks[1]();
}


/*	Return true if neither array contains a small integer. You 
	can't become: integers! */

sqInt containOnlyOopsand(sqInt array1, sqInt array2) {
    sqInt fieldOffset;
    sqInt contextSize;
    sqInt fmt;
    sqInt header;
    sqInt methodHeader;
    sqInt sz;
    sqInt sp;
    sqInt header1;
    sqInt type;

	/* begin lastPointerOf: */
	header = longAt(array1);
	fmt = (((usqInt) header) >> 8) & 15;
	if (fmt <= 4) {
		if ((fmt == 3) && ((((((usqInt) header) >> 12) & 0x1F) == 13) || ((((((usqInt) header) >> 12) & 0x1F) == 14) || (((((usqInt) header) >> 12) & 0x1F) == 4)))) {
			/* begin fetchStackPointerOf: */
			sp = longAt((array1 + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
			if (!((sp & 1))) {
				contextSize = 0;
				goto l1;
			}
			contextSize = (sp >> 1);
		l1:	/* end fetchStackPointerOf: */;
			fieldOffset = (CtxtTempFrameStart + contextSize) * (BYTES_PER_WORD);
			goto l2;
		}
		/* begin sizeBitsOfSafe: */
		header1 = longAt(array1);
		/* begin rightType: */
		if ((header1 & (SIZE_MASK)) == 0) {
			type = HeaderTypeSizeAndClass;
			goto l3;
		} else {
			if ((header1 & CompactClassMask) == 0) {
				type = HeaderTypeClass;
				goto l3;
			} else {
				type = HeaderTypeShort;
				goto l3;
			}
		}
	l3:	/* end rightType: */;
		if (type == HeaderTypeSizeAndClass) {
			sz = (longAt(array1 - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
			goto l4;
		} else {
			sz = header1 & (SIZE_MASK);
			goto l4;
		}
	l4:	/* end sizeBitsOfSafe: */;
		fieldOffset = sz - (BASE_HEADER_SIZE);
		goto l2;
	}
	if (fmt < 12) {
		fieldOffset = 0;
		goto l2;
	}
	methodHeader = longAt(array1 + (BASE_HEADER_SIZE));
	fieldOffset = (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
l2:	/* end lastPointerOf: */;
	while (fieldOffset >= (BASE_HEADER_SIZE)) {
		if (((longAt(array1 + fieldOffset)) & 1)) {
			return 0;
		}
		if (((longAt(array2 + fieldOffset)) & 1)) {
			return 0;
		}
		fieldOffset -= BYTES_PER_WORD;
	}
	return 1;
}


/*	Does thisCntx have aContext in its sender chain? */

sqInt contexthasSender(sqInt thisCntx, sqInt aContext) {
    sqInt nilOop;
    sqInt s;

	if (thisCntx == aContext) {
		return 0;
	}
	nilOop = foo->nilObj;
	s = longAt((thisCntx + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
	while (!(s == nilOop)) {
		if (s == aContext) {
			return 1;
		}
		s = longAt((s + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
	}
	return 0;
}


/*	This entry point needs to be implemented for the interpreter proxy.
	Since BitBlt is now a plugin we need to look up BitBltPlugin:=copyBits
	and call it. This entire mechanism should eventually go away and be
	replaced with a dynamic lookup from BitBltPlugin itself but for backward
	compatibility this stub is provided */

sqInt copyBits(void) {
register struct foo * foo = &fum;
    void *fn;

	fn = ioLoadFunctionFrom("copyBits", "BitBltPlugin");
	if (fn == 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	return ((sqInt (*)(void))fn)();
}


/*	This entry point needs to be implemented for the interpreter proxy.
	Since BitBlt is now a plugin we need to look up BitBltPlugin:=copyBitsFrom:to:at:
	and call it. This entire mechanism should eventually go away and be
	replaced with a dynamic lookup from BitBltPlugin itself but for backward
	compatibility this stub is provided */

sqInt copyBitsFromtoat(sqInt x0, sqInt x1, sqInt y) {
register struct foo * foo = &fum;
    void *fn;

	fn = ioLoadFunctionFrom("copyBitsFromtoat", "BitBltPlugin");
	if (fn == 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	return ((sqInt (*)(sqInt, sqInt, sqInt))fn)(x0, x1, y);
}


/*	Copy this object into the segment beginning at lastSeg.
	Install a forwarding pointer, and save oop and header.
	Fail if out of space.  Return the next segmentAddr if successful. */
/*	Copy the object... */

sqInt copyObjtoSegmentaddrstopAtsaveOopAtheaderAt(sqInt oop, sqInt segmentWordArray, sqInt lastSeg, sqInt stopAddr, sqInt oopPtr, sqInt hdrPtr) {
register struct foo * foo = &fum;
    sqInt bodySize;
    sqInt extraSize;
    sqInt hdrAddr;
    sqInt header;
    sqInt in;
    sqInt lastIn;
    sqInt out;

	flag("Dan");
	if (!(!foo->primFailCode)) {
		return lastSeg;
	}
	extraSize = foo->headerTypeBytes[(longAt(oop)) & TypeMask];
	/* begin sizeBitsOf: */
	header = longAt(oop);
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		bodySize = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l1;
	} else {
		bodySize = header & (SIZE_MASK);
		goto l1;
	}
l1:	/* end sizeBitsOf: */;
	if ((((usqInt) ((lastSeg + extraSize) + bodySize))) >= (((usqInt) stopAddr))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	/* begin transfer:from:to: */
	flag("Dan");
	in = (oop - extraSize) - (BYTES_PER_WORD);
	lastIn = in + (((extraSize + bodySize) / (BYTES_PER_WORD)) * (BYTES_PER_WORD));
	out = (lastSeg + (BYTES_PER_WORD)) - (BYTES_PER_WORD);
	while ((((usqInt) in)) < (((usqInt) lastIn))) {
		longAtput((out += BYTES_PER_WORD), longAt((in += BYTES_PER_WORD)));
	}
	hdrAddr = (lastSeg + (BYTES_PER_WORD)) + extraSize;
	longAtput(hdrAddr, (longAt(hdrAddr)) & ((ALL_BUT_ROOT_BIT) - (MARK_BIT)));
	/* begin forward:to:savingOopAt:andHeaderAt: */
	longAtput(oopPtr, oop);
	longAtput(hdrPtr, longAt(oop));
	longAtput(oop, (((lastSeg + (BYTES_PER_WORD)) + extraSize) - segmentWordArray) + HeaderTypeFree);
	return (lastSeg + extraSize) + bodySize;
}


/*	Bundle up the selector, arguments and lookupClass into a Message object. 
	In the process it pops the arguments off the stack, and pushes the message object. 
	This can then be presented as the argument of e.g. #doesNotUnderstand:. 
	ikp 11/20/1999 03:59 -- added hook for external runtime compilers. */
/*	remap lookupClass in case GC happens during allocation */

sqInt createActualMessageTo(sqInt aClass) {
register struct foo * foo = &fum;
    sqInt argumentArray;
    sqInt lookupClass;
    sqInt message;
    sqInt in;
    sqInt lastIn;
    sqInt out;
    sqInt sp;
    sqInt oop;
    sqInt oop1;

	/* begin pushRemappableOop: */
	foo->remapBuffer[(foo->remapBufferCount += 1)] = aClass;

	/* remap argumentArray in case GC happens during allocation */

	argumentArray = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))), foo->argumentCount);
	/* begin pushRemappableOop: */
	foo->remapBuffer[(foo->remapBufferCount += 1)] = argumentArray;
	message = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassMessage << (SHIFT_FOR_WORD))), 0);
	/* begin popRemappableOop */
	oop = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	argumentArray = oop;
	/* begin popRemappableOop */
	oop1 = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	lookupClass = oop1;
	beRootIfOld(argumentArray);
	if (foo->compilerInitialized) {
		compilerCreateActualMessagestoringArgs(message, argumentArray);
	} else {
		/* begin transfer:from:to: */
		flag("Dan");
		in = (foo->stackPointer - ((foo->argumentCount - 1) * (BYTES_PER_WORD))) - (BYTES_PER_WORD);
		lastIn = in + (foo->argumentCount * (BYTES_PER_WORD));
		out = (argumentArray + (BASE_HEADER_SIZE)) - (BYTES_PER_WORD);
		while ((((usqInt) in)) < (((usqInt) lastIn))) {
			longAtput((out += BYTES_PER_WORD), longAt((in += BYTES_PER_WORD)));
		}
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((foo->argumentCount - 1) * (BYTES_PER_WORD))), message);
		foo->stackPointer = sp;
	}
	foo->argumentCount = 1;
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) message)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(message, foo->messageSelector);
	}
	longAtput((message + (BASE_HEADER_SIZE)) + (MessageSelectorIndex << (SHIFT_FOR_WORD)), foo->messageSelector);
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) message)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(message, argumentArray);
	}
	longAtput((message + (BASE_HEADER_SIZE)) + (MessageArgumentsIndex << (SHIFT_FOR_WORD)), argumentArray);
	if ((lastPointerOf(message)) >= ((MessageLookupClassIndex * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE))) {

		/* Only store lookupClass if message has 3 fields (old images don't) */

		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) message)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(message, lookupClass);
		}
		longAtput((message + (BASE_HEADER_SIZE)) + (MessageLookupClassIndex << (SHIFT_FOR_WORD)), lookupClass);
	}
	return null;
}

sqInt dispatchFunctionPointer(void (*aFunctionPointer)(void)) {
	(aFunctionPointer)();
	return null;
}


/*	Call the primitive at index primIdx in the primitiveTable. */

sqInt dispatchFunctionPointerOnin(sqInt primIdx, void (*primTable[])(void)) {
	return dispatchFunctionPointer(primTable[primIdx]);
}


/*	Repaint the portion of the Smalltalk screen bounded by the affected rectangle. Used to synchronize the screen after a Bitblt to the Smalltalk Display object. */

sqInt displayBitsOfLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b) {
register struct foo * foo = &fum;
    sqInt bottom;
    sqInt d;
    sqInt dispBits;
    sqInt dispBitsIndex;
    sqInt displayObj;
    sqInt h;
    sqInt left;
    sqInt right;
    sqInt surfaceHandle;
    sqInt top;
    sqInt w;
    sqInt successBoolean;

	displayObj = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheDisplay << (SHIFT_FOR_WORD)));
	if (!(aForm == displayObj)) {
		return null;
	}
	/* begin success: */
	successBoolean = (((displayObj & 1) == 0) && (((((usqInt) (longAt(displayObj))) >> 8) & 15) <= 4)) && ((lengthOf(displayObj)) >= 4);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		dispBits = longAt((displayObj + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
		w = fetchIntegerofObject(1, displayObj);
		h = fetchIntegerofObject(2, displayObj);
		d = fetchIntegerofObject(3, displayObj);
	}
	if (l < 0) {
		left = 0;
	} else {
		left = l;
	}
	if (r > w) {
		right = w;
	} else {
		right = r;
	}
	if (t < 0) {
		top = 0;
	} else {
		top = t;
	}
	if (b > h) {
		bottom = h;
	} else {
		bottom = b;
	}
	if (!((left <= right) && (top <= bottom))) {
		return null;
	}
	if (!foo->primFailCode) {
		if ((dispBits & 1)) {
			surfaceHandle = (dispBits >> 1);
			if (showSurfaceFn == 0) {
				showSurfaceFn = ioLoadFunctionFrom("ioShowSurface", "SurfacePlugin");
				if (showSurfaceFn == 0) {
					/* begin success: */
					if (!(0)) {
						if (!foo->primFailCode) {
							foo->primFailCode = 1;
						}
					}
					return null;
				}
			}
			((sqInt (*)(sqInt, sqInt, sqInt, sqInt, sqInt))showSurfaceFn)(surfaceHandle, left, top, right-left, bottom-top);
		} else {

			/* index in memory byte array */

			dispBitsIndex = dispBits + (BASE_HEADER_SIZE);
			ioShowDisplay(dispBitsIndex, w, h, d, left, right, top, bottom);
		}
	}
	return null;
}

sqInt displayObject(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheDisplay << (SHIFT_FOR_WORD)));
}


/*	Rounds negative results towards negative infinity, rather than zero. */

sqInt doPrimitiveDivby(sqInt rcvr, sqInt arg) {
register struct foo * foo = &fum;
    sqInt integerArg;
    sqInt integerRcvr;
    sqInt posArg;
    sqInt posRcvr;
    sqInt result;
    sqInt successBoolean;

	if (((rcvr & arg) & 1) != 0) {
		integerRcvr = (rcvr >> 1);
		integerArg = (arg >> 1);
		/* begin success: */
		if (!(integerArg != 0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return 1;
	}
	if (integerRcvr > 0) {
		if (integerArg > 0) {
			result = integerRcvr / integerArg;
		} else {

			/* round negative result toward negative infinity */

			posArg = 0 - integerArg;
			result = 0 - ((integerRcvr + (posArg - 1)) / posArg);
		}
	} else {
		posRcvr = 0 - integerRcvr;
		if (integerArg > 0) {

			/* round negative result toward negative infinity */

			result = 0 - ((posRcvr + (integerArg - 1)) / integerArg);
		} else {
			posArg = 0 - integerArg;
			result = posRcvr / posArg;
		}
	}
	/* begin success: */
	successBoolean = 
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
		(((((int) result)) ^ ((((int) result)) << 1)) >= 0)
# else
		((result >= -1073741824) && (result <= 0x3FFFFFFF))
# endif  // SQ_HOST32
	;
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	return result;
}

sqInt doPrimitiveModby(sqInt rcvr, sqInt arg) {
register struct foo * foo = &fum;
    sqInt integerArg;
    sqInt integerRcvr;
    sqInt integerResult;
    sqInt successBoolean;

	if (((rcvr & arg) & 1) != 0) {
		integerRcvr = (rcvr >> 1);
		integerArg = (arg >> 1);
		/* begin success: */
		if (!(integerArg != 0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return 1;
	}

	/* ensure that the result has the same sign as the integerArg */

	integerResult = integerRcvr % integerArg;
	if (integerArg < 0) {
		if (integerResult > 0) {
			integerResult += integerArg;
		}
	} else {
		if (integerResult < 0) {
			integerResult += integerArg;
		}
	}
	/* begin success: */
	successBoolean = 
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
		(((((int) integerResult)) ^ ((((int) integerResult)) << 1)) >= 0)
# else
		((integerResult >= -1073741824) && (integerResult <= 0x3FFFFFFF))
# endif  // SQ_HOST32
	;
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	return integerResult;
}

sqInt dummyReferToProxy(void) {
	interpreterProxy = interpreterProxy;
	return null;
}


/*	Dump the entire image out to the given file. Intended for debugging only. */

EXPORT(sqInt) dumpImage(char *fileName) {
    sqInt dataSize;
    sqImageFile f;
    sqInt result;

	f = sqImageFileOpen(fileName, "wb");
	if (f == null) {
		return -1;
	}
	dataSize = foo->endOfMemory - memory;
	result = sqImageFileWrite(pointerForOop(memory), sizeof(unsigned char), dataSize, f);
	sqImageFileClose(f);
	return result;
}


/*	execute a method found in the mCache - which means that 
	primitiveIndex & primitiveFunctionPointer are already set. Any sender 
	needs to have previously sent findMethodInClass: or equivalent */

sqInt executeNewMethodFromCache(void) {
register struct foo * foo = &fum;
    sqInt delta;
    sqInt nArgs;

	if (foo->primitiveIndex > 0) {
		if (DoBalanceChecks) {

			/* check stack balance */

			nArgs = foo->argumentCount;
			delta = foo->stackPointer - foo->activeContext;
		}
		/* begin initPrimCall */
		foo->primFailCode = 0;
		dispatchFunctionPointer(primitiveFunctionPointer);
		if (DoBalanceChecks) {
			if (!(balancedStackafterPrimitivewithArgs(delta, foo->primitiveIndex, nArgs))) {
				printUnbalancedStack(foo->primitiveIndex);
			}
		}
		if (!foo->primFailCode) {
			return null;
		}
	}
	activateNewMethod();
	/* begin quickCheckForInterrupts */
	if (((foo->interruptCheckCounter -= 1)) <= 0) {
		checkForInterrupts();
	}
	return null;
}


/*	Return the number of extra bytes used by the given object's header. */
/*	Warning: This method should not be used during marking, when the header type bits of an object may be incorrect. */
/*	JMM should be an array lookup! */

EXPORT(sqInt) extraHeaderBytes(sqInt oopOrChunk) {
	return foo->headerTypeBytes[(longAt(oopOrChunk)) & TypeMask];
}


/*	In C, non-zero is true, so avoid computation by simply answering primFailCode in the C version. */

sqInt failed(void) {
	return foo->primFailCode;
}

sqInt falseObject(void) {
	return foo->falseObj;
}


/*	Fetch the instance variable at the given index of the given object. Return the address of first indexable field of resulting array object, or fail if the instance variable does not contain an indexable bytes or words object. */
/*	Note: May be called by translated primitive code. */

void * fetchArrayofObject(sqInt fieldIndex, sqInt objectPointer) {
register struct foo * foo = &fum;
    sqInt arrayOop;

	arrayOop = longAt((objectPointer + (BASE_HEADER_SIZE)) + (fieldIndex << (SHIFT_FOR_WORD)));
	/* begin arrayValueOf: */
	if ((!((arrayOop & 1))) && (((arrayOop & 1) == 0) && (isWordsOrBytesNonInt(arrayOop)))) {
		return pointerForOop(arrayOop + (BASE_HEADER_SIZE));
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return null;
}

sqInt fetchClassOf(sqInt oop) {
register struct foo * foo = &fum;
    sqInt ccIndex;
    sqInt oop1;

	if ((oop & 1)) {
		return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		return (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {

		/* look up compact class */

		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		return longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	return null;
}

sqInt fetchClassOfNonInt(sqInt oop) {
    sqInt ccIndex;
    sqInt oop1;

	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		return (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {

		/* look up compact class */

		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		return longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	return null;
}


/*	Fetch the instance variable at the given index of the given object. Return the C double precision floating point value of that instance variable, or fail if it is not a Float. */
/*	Note: May be called by translated primitive code. */

double fetchFloatofObject(sqInt fieldIndex, sqInt objectPointer) {
    sqInt floatOop;

	floatOop = longAt((objectPointer + (BASE_HEADER_SIZE)) + (fieldIndex << (SHIFT_FOR_WORD)));
	return floatValueOf(floatOop);
}


/*	Note: May be called by translated primitive code. */

sqInt fetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer) {
register struct foo * foo = &fum;
    sqInt intOop;

	intOop = longAt((objectPointer + (BASE_HEADER_SIZE)) + (fieldIndex << (SHIFT_FOR_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((intOop & 1)) {
		return (intOop >> 1);
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return 0;
	}
	return null;
}


/*	 index by 32-bit units, and return a 32-bit value. Intended to replace fetchWord:ofObject: */

sqInt fetchLong32ofObject(sqInt fieldIndex, sqInt oop) {
	return long32At((oop + (BASE_HEADER_SIZE)) + (fieldIndex << 2));
}

sqLong fetchLong64ofObject(sqInt longIndex, sqInt oop) {
	return ((BYTES_PER_WORD) == 8
		? long64At((oop + (BASE_HEADER_SIZE)) + (longIndex << 3))
		: (isBigEnder()
	? ((((unsigned long long)(long32At((oop + (BASE_HEADER_SIZE)) + (longIndex << 3))))) << 32) + (((unsigned int) (long32At((oop + (BASE_HEADER_SIZE)) + ((longIndex << 3) + 4)))))
	: (((unsigned int) (long32At((oop + (BASE_HEADER_SIZE)) + (longIndex << 3))))) + ((((unsigned long long)(long32At((oop + (BASE_HEADER_SIZE)) + ((longIndex << 3) + 4))))) << 32)));
}


/*	index by word size, and return a pointer as long as the word size */

sqInt fetchPointerofObject(sqInt fieldIndex, sqInt oop) {
	return longAt((oop + (BASE_HEADER_SIZE)) + (fieldIndex << (SHIFT_FOR_WORD)));
}


/*	Return the stackPointer of a Context or BlockContext. */

sqInt fetchStackPointerOf(sqInt aContext) {
    sqInt sp;

	sp = longAt((aContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
	if (!((sp & 1))) {
		return 0;
	}
	return (sp >> 1);
}


/*	NOTE: this gives size appropriate for fetchPointer: n, but not in general for, eg, fetchLong32, etc. */

sqInt fetchWordLengthOf(sqInt objectPointer) {
    sqInt sz;
    sqInt header;

	/* begin sizeBitsOf: */
	header = longAt(objectPointer);
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(objectPointer - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l1;
	} else {
		sz = header & (SIZE_MASK);
		goto l1;
	}
l1:	/* end sizeBitsOf: */;
	return ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
}


/*	During sweep phase we have encountered a weak reference. 
	Check if  its object has gone away (or is about to) and if so, signal a 
	semaphore.  */
/*	Do *not* inline this in sweepPhase - it is quite an unlikely 
	case to run into a weak reference */

sqInt finalizeReference(usqInt oop) {
register struct foo * foo = &fum;
    sqInt chunk;
    sqInt firstField;
    sqInt i;
    sqInt lastField;
    sqInt nonWeakCnt;
    sqInt oopGone;
    usqInt weakOop;
    sqInt listItemOop;
    sqInt listOop;
    sqInt contextSize;
    sqInt fmt;
    sqInt header;
    sqInt methodHeader;
    sqInt sz;
    sqInt sp;
    sqInt header1;
    sqInt type;

	nonWeakCnt = nonWeakFieldsOf(oop);
	firstField = (BASE_HEADER_SIZE) + (nonWeakCnt << (SHIFT_FOR_WORD));
	/* begin lastPointerOf: */
	header = longAt(oop);
	fmt = (((usqInt) header) >> 8) & 15;
	if (fmt <= 4) {
		if ((fmt == 3) && ((((((usqInt) header) >> 12) & 0x1F) == 13) || ((((((usqInt) header) >> 12) & 0x1F) == 14) || (((((usqInt) header) >> 12) & 0x1F) == 4)))) {
			/* begin fetchStackPointerOf: */
			sp = longAt((oop + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
			if (!((sp & 1))) {
				contextSize = 0;
				goto l1;
			}
			contextSize = (sp >> 1);
		l1:	/* end fetchStackPointerOf: */;
			lastField = (CtxtTempFrameStart + contextSize) * (BYTES_PER_WORD);
			goto l2;
		}
		/* begin sizeBitsOfSafe: */
		header1 = longAt(oop);
		/* begin rightType: */
		if ((header1 & (SIZE_MASK)) == 0) {
			type = HeaderTypeSizeAndClass;
			goto l3;
		} else {
			if ((header1 & CompactClassMask) == 0) {
				type = HeaderTypeClass;
				goto l3;
			} else {
				type = HeaderTypeShort;
				goto l3;
			}
		}
	l3:	/* end rightType: */;
		if (type == HeaderTypeSizeAndClass) {
			sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
			goto l4;
		} else {
			sz = header1 & (SIZE_MASK);
			goto l4;
		}
	l4:	/* end sizeBitsOfSafe: */;
		lastField = sz - (BASE_HEADER_SIZE);
		goto l2;
	}
	if (fmt < 12) {
		lastField = 0;
		goto l2;
	}
	methodHeader = longAt(oop + (BASE_HEADER_SIZE));
	lastField = (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
l2:	/* end lastPointerOf: */;
	for (i = firstField; i <= lastField; i += (BYTES_PER_WORD)) {

		/* ar 1/18/2005: Added oop < youngStart test to make sure we're not testing
			objects in non-GCable region. This could lead to a forward reference in
			old space with the oop pointed to not being marked and thus treated as free. */

		weakOop = longAt(oop + i);
		if (!((weakOop == foo->nilObj) || (((weakOop & 1)) || (weakOop < foo->youngStart)))) {

			/* Check if the object is being collected. 
					If the weak reference points  
					* backward: check if the weakOops chunk is free
					* forward: check if the weakOoop has been marked by GC */

			if (weakOop < oop) {
				chunk = weakOop - (foo->headerTypeBytes[(longAt(weakOop)) & TypeMask]);
				oopGone = ((longAt(chunk)) & TypeMask) == HeaderTypeFree;
			} else {
				oopGone = ((longAt(weakOop)) & (MARK_BIT)) == 0;
			}
			if (oopGone) {

				/* Store nil in the pointer and signal the  interpreter  */

				longAtput(oop + i, foo->nilObj);
				if (nonWeakCnt >= 2) {
					/* begin weakFinalizerCheck: */
					listOop = longAt((oop + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
					if ((fetchClassOf(listOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassWeakFinalizer << (SHIFT_FOR_WORD))))) {
						listItemOop = longAt((listOop + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
						/* begin storePointer:ofObject:withValue: */
						if ((((usqInt) oop)) < (((usqInt) foo->youngStart))) {
							possibleRootStoreIntovalue(oop, listItemOop);
						}
						longAtput((oop + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), listItemOop);
						/* begin storePointer:ofObject:withValue: */
						if ((((usqInt) listOop)) < (((usqInt) foo->youngStart))) {
							possibleRootStoreIntovalue(listOop, oop);
						}
						longAtput((listOop + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), oop);
					}
				}
				/* begin signalFinalization: */
				/* begin forceInterruptCheck */
				foo->interruptCheckCounter = -1000;
				foo->nextPollTick = 0;
				foo->pendingFinalizationSignals += 1;
			}
		}
	}
	return null;
}

sqInt findClassOfMethodforReceiver(sqInt meth, sqInt rcvr) {
register struct foo * foo = &fum;
    sqInt classDict;
    sqInt classDictSize;
    sqInt currClass;
    sqInt done;
    sqInt i;
    sqInt methodArray;
    sqInt sz;
    sqInt header;
    sqInt ccIndex;
    sqInt oop1;
    sqInt ccIndex1;
    sqInt oop11;

	/* begin fetchClassOf: */
	if ((rcvr & 1)) {
		currClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l2;
	}
	ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		currClass = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l2;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		currClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l2;
	}
l2:	/* end fetchClassOf: */;
	done = 0;
	while (!(done)) {
		classDict = longAt((currClass + (BASE_HEADER_SIZE)) + (MessageDictionaryIndex << (SHIFT_FOR_WORD)));
		/* begin fetchWordLengthOf: */
		/* begin sizeBitsOf: */
		header = longAt(classDict);
		if ((header & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(classDict - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
			goto l1;
		} else {
			sz = header & (SIZE_MASK);
			goto l1;
		}
	l1:	/* end sizeBitsOf: */;
		classDictSize = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		methodArray = longAt((classDict + (BASE_HEADER_SIZE)) + (MethodArrayIndex << (SHIFT_FOR_WORD)));
		i = 0;
		while (i < (classDictSize - SelectorStart)) {
			if (meth == (longAt((methodArray + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD))))) {
				return currClass;
			}
			i += 1;
		}
		currClass = longAt((currClass + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
		done = currClass == foo->nilObj;
	}
	/* begin fetchClassOf: */
	if ((rcvr & 1)) {
		return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
	}
	ccIndex1 = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
	if (ccIndex1 == 0) {
		return (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		return longAt((oop11 + (BASE_HEADER_SIZE)) + ((ccIndex1 - 1) << (SHIFT_FOR_WORD)));
	}
	return null;
}


/*	Find the compiled method to be run when the current 
	messageSelector is sent to the given class, setting the values 
	of 'newMethod' and 'primitiveIndex'. */

sqInt findNewMethodInClass(sqInt class) {
register struct foo * foo = &fum;
    sqInt ok;
    sqInt hash;
    sqInt probe;

	/* begin lookupInMethodCacheSel:class: */
	hash = foo->messageSelector ^ class;
	probe = hash & MethodCacheMask;
	if (((foo->methodCache[probe + MethodCacheSelector]) == foo->messageSelector) && ((foo->methodCache[probe + MethodCacheClass]) == class)) {
		foo->newMethod = foo->methodCache[probe + MethodCacheMethod];
		foo->primitiveIndex = foo->methodCache[probe + MethodCachePrim];
		foo->newNativeMethod = foo->methodCache[probe + MethodCacheNative];
		primitiveFunctionPointer = ((void (*)(void)) (foo->methodCache[probe + MethodCachePrimFunction]));
		ok = 1;
		goto l1;
	}
	probe = (((usqInt) hash) >> 1) & MethodCacheMask;
	if (((foo->methodCache[probe + MethodCacheSelector]) == foo->messageSelector) && ((foo->methodCache[probe + MethodCacheClass]) == class)) {
		foo->newMethod = foo->methodCache[probe + MethodCacheMethod];
		foo->primitiveIndex = foo->methodCache[probe + MethodCachePrim];
		foo->newNativeMethod = foo->methodCache[probe + MethodCacheNative];
		primitiveFunctionPointer = ((void (*)(void)) (foo->methodCache[probe + MethodCachePrimFunction]));
		ok = 1;
		goto l1;
	}
	probe = (((usqInt) hash) >> 2) & MethodCacheMask;
	if (((foo->methodCache[probe + MethodCacheSelector]) == foo->messageSelector) && ((foo->methodCache[probe + MethodCacheClass]) == class)) {
		foo->newMethod = foo->methodCache[probe + MethodCacheMethod];
		foo->primitiveIndex = foo->methodCache[probe + MethodCachePrim];
		foo->newNativeMethod = foo->methodCache[probe + MethodCacheNative];
		primitiveFunctionPointer = ((void (*)(void)) (foo->methodCache[probe + MethodCachePrimFunction]));
		ok = 1;
		goto l1;
	}
	ok = 0;
l1:	/* end lookupInMethodCacheSel:class: */;
	if (!(ok)) {

		/* entry was not found in the cache; look it up the hard way  */

		lookupMethodInClass(class);
		foo->lkupClass = class;
		addNewMethodToCache();
	}
	return null;
}

sqInt findSelectorOfMethodforReceiver(sqInt meth, sqInt rcvr) {
register struct foo * foo = &fum;
    sqInt classDict;
    sqInt classDictSize;
    sqInt currClass;
    sqInt done;
    sqInt i;
    sqInt methodArray;
    sqInt sz;
    sqInt header;
    sqInt ccIndex;
    sqInt oop1;

	/* begin fetchClassOf: */
	if ((rcvr & 1)) {
		currClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l2;
	}
	ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		currClass = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l2;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		currClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l2;
	}
l2:	/* end fetchClassOf: */;
	done = 0;
	while (!(done)) {
		classDict = longAt((currClass + (BASE_HEADER_SIZE)) + (MessageDictionaryIndex << (SHIFT_FOR_WORD)));
		/* begin fetchWordLengthOf: */
		/* begin sizeBitsOf: */
		header = longAt(classDict);
		if ((header & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(classDict - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
			goto l1;
		} else {
			sz = header & (SIZE_MASK);
			goto l1;
		}
	l1:	/* end sizeBitsOf: */;
		classDictSize = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		methodArray = longAt((classDict + (BASE_HEADER_SIZE)) + (MethodArrayIndex << (SHIFT_FOR_WORD)));
		i = 0;
		while (i <= (classDictSize - SelectorStart)) {
			if (meth == (longAt((methodArray + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD))))) {
				return longAt((classDict + (BASE_HEADER_SIZE)) + ((i + SelectorStart) << (SHIFT_FOR_WORD)));
			}
			i += 1;
		}
		currClass = longAt((currClass + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
		done = currClass == foo->nilObj;
	}
	return foo->nilObj;
}


/*	Return the first accessible object in the heap. */

sqInt firstAccessibleObject(void) {
register struct foo * foo = &fum;
    sqInt obj;
    sqInt sz;
    sqInt header;

	obj = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) obj)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(obj)) & TypeMask) == HeaderTypeFree)) {
			return obj;
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) obj)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(obj)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(obj)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header = longAt(obj);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(obj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
		}
		obj = (obj + sz) + (foo->headerTypeBytes[(longAt(obj + sz)) & TypeMask]);
	}
	error("heap is empty");
	return null;
}

sqInt firstByteFormat(void) {
	return 8;
}

char * firstFixedField(sqInt oop) {
	return pointerForOop(oop + (BASE_HEADER_SIZE));
}


/*	NOTE: copied in InterpreterSimulator, so please duplicate any changes */

char * firstIndexableField(sqInt oop) {
register struct foo * foo = &fum;
    sqInt fixedFields;
    sqInt fmt;
    sqInt hdr;
    sqInt totalLength;
    sqInt sz;
    sqInt class;
    sqInt classFormat;
    sqInt ccIndex;
    sqInt oop1;

	hdr = longAt(oop);
	fmt = (((usqInt) hdr) >> 8) & 15;
	/* begin lengthOf:baseHeader:format: */
	if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = hdr & (SIZE_MASK);
	}
	sz -= hdr & (SIZE_4_BIT);
	if (fmt <= 4) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l1;
	}
	if (fmt < 8) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l1;
	} else {
		totalLength = (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
		goto l1;
	}
l1:	/* end lengthOf:baseHeader:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt > 4) || (fmt == 2)) {
		fixedFields = 0;
		goto l2;
	}
	if (fmt < 2) {
		fixedFields = totalLength;
		goto l2;
	}
	/* begin fetchClassOf: */
	if ((oop & 1)) {
		class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l3;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		class = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l3;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l3;
	}
l3:	/* end fetchClassOf: */;
	classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
l2:	/* end fixedFieldsOf:format:length: */;
	if (fmt < 8) {
		if (fmt == 6) {

			/* 32 bit field objects */

			return pointerForOop((oop + (BASE_HEADER_SIZE)) + (fixedFields << 2));
		}
		return pointerForOop((oop + (BASE_HEADER_SIZE)) + (fixedFields << (SHIFT_FOR_WORD)));
	} else {

		/* Byte objects */

		return pointerForOop((oop + (BASE_HEADER_SIZE)) + fixedFields);
	}
	return null;
}


/*	Like #stackFloatValue: but access method arguments left-to-right */

double floatArg(sqInt index) {
    sqInt oop;

	oop = methodArg(index);
	if (oop == 0) {
		return 0.0;
	}
	return floatValueOf(oop);
}

sqInt floatObjectOf(double  aFloat) {
    sqInt newFloatObj;

	flag("Dan");
	newFloatObj = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))), 8 + (BASE_HEADER_SIZE));
	storeFloatAtfrom(newFloatObj + (BASE_HEADER_SIZE), aFloat);
	return newFloatObj;
}


/*	Answer numerator divided by denominator as an Integer if possible, or
	as aFloat if the result is a fractional value. The numerator (a sqLong) and
	the denominator are both integer values, not object pointers. */

sqInt floatOrIntegerObjectOfLongdividedBy(sqLong numerator, sqInt denominator) {
    double  floatValue;
    sqLong  intValue;

	floatValue = numerator;
	floatValue = floatValue / denominator;
	intValue = numerator / denominator;
	if (intValue == floatValue) {
		return positive64BitIntegerFor(intValue);
	} else {
		return floatObjectOf(floatValue);
	}
	return null;
}


/*	Fetch the instance variable at the given index of the given object. Return the C double precision floating point value of that instance variable, or fail if it is not a Float. */
/*	Note: May be called by translated primitive code. */

double floatValueOf(sqInt oop) {
register struct foo * foo = &fum;
    double  result;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop1;

	flag("Dan");
	/* begin assertClassOf:is: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD)));
	if ((oop & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		cl = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl == classOop)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l1:	/* end assertClassOf:is: */;
	if (!foo->primFailCode) {
		;
		fetchFloatAtinto(oop + (BASE_HEADER_SIZE), result);
	} else {
		result = 0.0;
	}
	return result;
}


/*	methodPtr is a CompiledMethod containing an external primitive. Flush the function address and session ID of the CM */

sqInt flushExternalPrimitiveOf(sqInt methodPtr) {
    sqInt lit;

	if (!((literalCountOfHeader(longAt((methodPtr + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) > 0)) {
		return null;
	}
	lit = longAt((methodPtr + (BASE_HEADER_SIZE)) + ((0 + LiteralStart) << (SHIFT_FOR_WORD)));
	if (!((((lit & 1) == 0) && (((((usqInt) (longAt(lit))) >> 8) & 15) == 2)) && ((lengthOf(lit)) == 4))) {
		return null;
	}
	longAtput((lit + (BASE_HEADER_SIZE)) + (2 << (SHIFT_FOR_WORD)), ConstZero);
	longAtput((lit + (BASE_HEADER_SIZE)) + (3 << (SHIFT_FOR_WORD)), ConstZero);
	return null;
}


/*	Flush the references to external functions from plugin 
	primitives. This will force a reload of those primitives when 
	accessed next. 
	Note: We must flush the method cache here so that any 
	failed primitives are looked up again. */

sqInt flushExternalPrimitives(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt primIdx;
    sqInt primBits;
    sqInt i;
    sqInt i1;
    sqInt i2;
    sqInt sz;
    sqInt header;

	oop = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) oop)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
			if (((((usqInt) (longAt(oop))) >> 8) & 15) >= 12) {

				/* This is a compiled method */

				/* begin primitiveIndexOf: */
				primBits = (((usqInt) (longAt((oop + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 1) & 268435967;
				primIdx = (primBits & 0x1FF) + (((usqInt) primBits) >> 19);
				if (primIdx == PrimitiveExternalCallIndex) {

					/* It's primitiveExternalCall */

					flushExternalPrimitiveOf(oop);
				}
			}
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header = longAt(oop);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
		}
		oop = (oop + sz) + (foo->headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
	}
	/* begin flushMethodCache */
	for (i = 1; i <= MethodCacheSize; i += 1) {
		foo->methodCache[i] = 0;
	}
	/* begin flushAtCache */
	for (i1 = 1; i1 <= AtCacheTotalSize; i1 += 1) {
		foo->atCache[i1] = 0;
	}
	/* begin flushExternalPrimitiveTable */
	for (i2 = 0; i2 <= (MaxExternalPrimitiveTableSize - 1); i2 += 1) {
		externalPrimitiveTable[i2] = 0;
	}
	return null;
}


/*	self shouldNotImplement. */

sqInt followForwarded(sqInt objOop) {
	return 0;
}


/*	force an interrupt check ASAP - setting interruptCheckCounter to a large -ve number is used as a flag to skip messing with the feedback mechanism and nextPollTick resetting makes sure that ioProcess gets called as near immediately as we can manage */

sqInt forceInterruptCheck(void) {
register struct foo * foo = &fum;
	foo->interruptCheckCounter = -1000;
	foo->nextPollTick = 0;
	return null;
}


/*	Repaint the entire smalltalk screen, ignoring the affected rectangle. Used in some platform's code when the Smalltalk window is brought to the front or uncovered. */

sqInt fullDisplayUpdate(void) {
    sqInt displayObj;
    sqInt h;
    sqInt w;

	displayObj = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheDisplay << (SHIFT_FOR_WORD)));
	if ((((displayObj & 1) == 0) && (((((usqInt) (longAt(displayObj))) >> 8) & 15) <= 4)) && ((lengthOf(displayObj)) >= 4)) {
		w = fetchIntegerofObject(1, displayObj);
		h = fetchIntegerofObject(2, displayObj);
		displayBitsOfLeftTopRightBottom(displayObj, 0, 0, w, h);
		ioForceDisplayUpdate();
	}
	return null;
}


/*	Do a mark/sweep garbage collection of the entire object memory. Free inaccessible objects but do not move them. */

sqInt fullGC(void) {
register struct foo * foo = &fum;
    sqLong startTime;
    sqInt i;
    sqInt oop;
    sqInt sz;
    sqInt valuePointer;

	if (DoAssertionChecks) {
		reverseDisplayFromto(0, 7);
	}
	/* begin preGCAction: */
	if (foo->compilerInitialized) {
		compilerPreGC(1);
	} else {
		/* begin storeContextRegisters: */
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
	}
	startTime = ioMicroSecondClock();
	foo->statSweepCount = (foo->statMarkCount = (foo->statMkFwdCount = (foo->statCompMoveCount = 0)));
	/* begin clearRootsTable */
	for (i = 1; i <= foo->rootTableCount; i += 1) {
		oop = foo->rootTable[i];
		longAtput(oop, (longAt(oop)) & (ALL_BUT_ROOT_BIT));
		foo->rootTable[i] = 0;
	}
	foo->rootTableCount = 0;

	/* process all of memory */

	foo->youngStart = memory;
	markPhase();
	foo->totalObjectCount = sweepPhase();
	/* begin fullCompaction */
	foo->compStart = (usqInt)lowestFreeAfter((sqInt)memory);
	if (foo->compStart == foo->freeBlock) {
		initializeMemoryFirstFree(foo->freeBlock);
		goto l1;
	}
	if (((sz = fwdTableSize(8))) < foo->totalObjectCount) {
		growObjectMemory(((foo->totalObjectCount - sz) + 10000) * 8);
	}
	while (foo->compStart < foo->freeBlock) {
		foo->compStart = (usqInt)incCompBody();
	}
l1:	/* end fullCompaction */;
	foo->allocationCount = 0;
	foo->statFullGCs += 1;
	foo->statGCTime = ioMicroSecondClock();
	foo->statFullGCMSecs += foo->statGCTime - startTime;
	/* begin capturePendingFinalizationSignals */
	/* begin setStatpendingFinalizationSignals: */
	foo->statpendingFinalizationSignals = foo->pendingFinalizationSignals;

	/* reset the young object boundary */

	foo->youngStart = foo->freeBlock;
	postGCAction();
	if (DoAssertionChecks) {
		reverseDisplayFromto(0, 7);
	}
	return null;
}


/*	Answer if the given address is a valid forward table entry. */

sqInt fwdBlockValid(sqInt addr) {
register struct foo * foo = &fum;
	return ((((usqInt) addr)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) addr)) <= (((usqInt) foo->fwdTableNext))) && ((addr & 3) == 0));
}


/*	Set the limits for a table of two- or three-word forwarding blocks above the last used oop. The pointer fwdTableNext moves up to fwdTableLast. Used for compaction of memory and become-ing objects. Returns the number of forwarding blocks available. */

sqInt fwdTableInit(sqInt blkSize) {
register struct foo * foo = &fum;

	/* set endOfMemory to just after a minimum-sized free block */

	/* begin setSizeOfFree:to: */
	longAtput(foo->freeBlock, ((BASE_HEADER_SIZE) & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);

	/* make a fake free chunk at endOfMemory for use as a sentinal in memory scans */

	foo->endOfMemory = foo->freeBlock + (BASE_HEADER_SIZE);
	/* begin setSizeOfFree:to: */
	longAtput(foo->endOfMemory, ((BASE_HEADER_SIZE) & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);
	foo->fwdTableNext = ((foo->endOfMemory + (BASE_HEADER_SIZE)) + 7) & ((WORD_MASK) - 7);
	flag("Dan");

	/* last forwarding table entry */
	/* return the number of forwarding blocks available */

	foo->fwdTableLast = foo->memoryLimit - blkSize;
	return (foo->fwdTableLast - foo->fwdTableNext) / blkSize;
}


/*	Estimate the number of forwarding blocks available for compaction */

sqInt fwdTableSize(sqInt blkSize) {
register struct foo * foo = &fum;
    sqInt eom;
    sqInt fwdFirst;
    sqInt fwdLast;


	/* use all memory free between freeBlock and memoryLimit for forwarding table */
	/* Note: Forward blocks must be quadword aligned. */

	eom = foo->freeBlock + (BASE_HEADER_SIZE);
	fwdFirst = ((eom + (BASE_HEADER_SIZE)) + 7) & ((WORD_MASK) - 7);
	flag("Dan");

	/* last forwarding table entry */
	/* return the number of forwarding blocks available */

	fwdLast = foo->memoryLimit - blkSize;
	return (fwdLast - fwdFirst) / blkSize;
}


/*	currentBytecode will be private to the main dispatch loop in the generated code. This method allows the currentBytecode to be retrieved from global variables. */

sqInt getCurrentBytecode(void) {
	return byteAt(foo->instructionPointer);
}

sqInt getFullScreenFlag(void) {
	return foo->fullScreenFlag;
}

sqInt getInterruptCheckCounter(void) {
	return foo->interruptCheckCounter;
}

sqInt getInterruptKeycode(void) {
	return foo->interruptKeycode;
}

sqInt getInterruptPending(void) {
	return foo->interruptPending;
}


/*	Answer the next word read from aFile, byte-swapped according to the swapFlag. */

sqInt getLongFromFileswap(sqImageFile  aFile, sqInt swapFlag) {
    sqInt w;

	w = 0;
	sqImageFileRead(&w, sizeof(w), 1, aFile);
	if (swapFlag) {
		/* begin byteSwapped: */
		
# if (BYTES_PER_WORD == 4)  // swap bytes in an object word
		return ((((((usqInt) w >> 24)) & Byte0Mask) + ((((usqInt) w >> 8)) & Byte1Mask)) + ((((usqInt) w << 8)) & Byte2Mask)) + ((((usqInt) w << 24)) & Byte3Mask);
# else
		return ((((((((((usqInt) w >> 56)) & Byte0Mask) + ((((usqInt) w >> 40)) & Byte1Mask)) + ((((usqInt) w >> 24)) & Byte2Mask)) + ((((usqInt) w >> 8)) & Byte3Mask)) + ((((usqInt) w << 8)) & Byte4Mask)) + ((((usqInt) w << 24)) & Byte5Mask)) + ((((usqInt) w << 40)) & Byte6Mask)) + ((((usqInt) w << 56)) & Byte7Mask);
# endif  // BYTES_PER_WORD == 4
		
		return null;
	} else {
		return w;
	}
	return null;
}

sqInt getNextWakeupTick(void) {
	return foo->nextWakeupTick;
}

sqInt getSavedWindowSize(void) {
	return foo->savedWindowSize;
}


/*	For Newsqueak FFI */

EXPORT(sqInt) getStackPointer(void) {
	return foo->stackPointer;
}


/*	return the global session ID value */

sqInt getThisSessionID(void) {
	return foo->globalSessionID;
}


/*	Attempt to grow the object memory by the given delta 
	amount  */

sqInt growObjectMemory(usqInt delta) {
register struct foo * foo = &fum;
    usqInt limit;

	if (!(isExcessiveAllocationRequestshift(delta, 0))) {
		foo->statGrowMemory += 1;
		limit = sqGrowMemoryBy(foo->memoryLimit, delta);
		if (!(limit == foo->memoryLimit)) {

			/* remove a tad for safety */

			foo->memoryLimit = limit - 24;
			initializeMemoryFirstFree(foo->freeBlock);
		}
	}
	return null;
}


/*	Answer a snapshot copy of the current object memory and header information. The
	object memory will be saved as and object of type class */

sqInt headerAndSnapshotOfSizeclass(size_t size, sqInt class) {
register struct foo * foo = &fum;
    sqInt bytesPerElement;
    void *copy;
    sqInt oop;
    void *ptr;
    sqInt result;
    usqInt start;
    sqInt oop1;
    sqInt valuePointer;
    sqInt valuePointer1;
    sqInt oop2;
    sqInt oop3;


	/* Expect class Bitmap or ByteArray */

	if ((longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassByteArray << (SHIFT_FOR_WORD)))) == class) {
		bytesPerElement = 1;
	} else {
		if ((longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBitmap << (SHIFT_FOR_WORD)))) == class) {
			bytesPerElement = 4;
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
	}
	start = memory;
	copy = malloc(size);
	if (copy == null) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	memcpy(copy, pointerForOop(start), size);
	/* begin pushRemappableOop: */
	oop1 = memoryHeaderState(size);
	foo->remapBuffer[(foo->remapBufferCount += 1)] = oop1;
	oop = instantiateClassindexableSize(class, size / bytesPerElement);
	if (!(!foo->primFailCode)) {
		free(copy);
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	ptr = firstIndexableField(oop);
	memcpy(ptr, copy, size);
	free(copy);
	/* begin pushRemappableOop: */
	foo->remapBuffer[(foo->remapBufferCount += 1)] = oop;
	result = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))), 2);
	/* begin storePointer:ofObject:withValue: */
	/* begin popRemappableOop */
	oop2 = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	valuePointer = oop2;
	if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(result, valuePointer);
	}
	longAtput((result + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), valuePointer);
	/* begin storePointer:ofObject:withValue: */
	/* begin popRemappableOop */
	oop3 = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	valuePointer1 = oop3;
	if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(result, valuePointer1);
	}
	longAtput((result + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), valuePointer1);
	return result;
}


/*	Implemented in support code for Cog branch in Cross/vm/sqHeapMap.c and
	stubbed out here for use with trunk platform sources */

sqInt heapMapAtWord(sqInt wordPointer) {
	flag("FIXME");
	return 1;
}


/*	Answer the most recent image format version that can be supported by this
	interpreter.. The image may be saved as a different format. For example, format
	6505 has different float byte ordering and can be loaded by the interpreter
	for 32 bit images, but that same image will be stored in the 6504 format. Thus
	a 6505 format image may be loaded and run, then saved in format 6504. */

sqInt imageFormatSupportableVersion(void) {
	if ((BYTES_PER_WORD) == 4) {
		return 6505;
	} else {
		return 68003;
	}
	return null;
}


/*	a more complex version that tells both the word reversal and the endianness of the machine it came from.  Low half of word is 6502.  Top byte is top byte of #doesNotUnderstand: on this machine. ($d on the Mac or $s on the PC) */

sqInt imageSegmentVersion(void) {
    sqInt wholeWord;


	/* first data word, 'does'  */

	wholeWord = longAt((longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorDoesNotUnderstand << (SHIFT_FOR_WORD)))) + (BASE_HEADER_SIZE));
	return imageFormatVersionNumber | (wholeWord & 0xFF000000U);
}


/*	Move objects to consolidate free space into one big chunk. Return the newly created free chunk. */

sqInt incCompBody(void) {
register struct foo * foo = &fum;
    sqInt bytesFreed;


	/* reserve memory for forwarding table */

	fwdTableInit((BYTES_PER_WORD) * 2);

	/* update pointers to point at new oops */

	bytesFreed = incCompMakeFwd();
	mapPointersInObjectsFromto((sqInt)foo->youngStart, (sqInt)foo->endOfMemory);
	return incCompMove(bytesFreed);
}


/*	Create and initialize forwarding blocks for all non-free objects  
	following compStart. If the supply of forwarding blocks is exhausted,  
	set compEnd to the first chunk above the area to be 
	compacted; otherwise, set it to endOfMemory. Return the number of 
	bytes to be freed. */

sqInt incCompMakeFwd(void) {
register struct foo * foo = &fum;
    sqInt bytesFreed;
    sqInt fwdBlock;
    sqInt newOop;
    sqInt oop;
    sqInt originalHeader;
    sqInt originalHeaderType;
    sqInt fwdBlock1;
    sqInt header;
    sqInt realHeader;
    sqInt sz;
    sqInt sz1;
    sqInt header1;

	bytesFreed = 0;
	oop = foo->compStart + (foo->headerTypeBytes[(longAt(foo->compStart)) & TypeMask]);
	while ((((usqInt) oop)) < (((usqInt) foo->endOfMemory))) {
		foo->statMkFwdCount += 1;
		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
			bytesFreed += (longAt(oop)) & (ALL_BUT_TYPE_MASK);
		} else {

			/* create a forwarding block for oop */

			/* begin fwdBlockGet: */
			foo->fwdTableNext += (BYTES_PER_WORD) * 2;
			if (foo->fwdTableNext <= foo->fwdTableLast) {
				fwdBlock = foo->fwdTableNext;
				goto l1;
			} else {
				fwdBlock = null;
				goto l1;
			}
		l1:	/* end fwdBlockGet: */;
			if (fwdBlock == null) {

				/* stop; we have used all available forwarding blocks */

				foo->compEnd = oop - (foo->headerTypeBytes[(longAt(oop)) & TypeMask]);
				return bytesFreed;
			}
			newOop = oop - bytesFreed;
			/* begin initForwardBlock:mapping:to:withBackPtr: */
			originalHeader = longAt(oop);
			if (DoAssertionChecks) {
				if (fwdBlock == null) {
					error("ran out of forwarding blocks in become");
				}
				if ((originalHeader & (MARK_BIT)) != 0) {
					error("object already has a forwarding table entry");
				}
			}
			originalHeaderType = originalHeader & TypeMask;
			longAtput(fwdBlock, newOop);
			longAtput(fwdBlock + (BYTES_PER_WORD), originalHeader);
			if (0) {
				longAtput(fwdBlock + ((BYTES_PER_WORD) * 2), oop);
			}
			longAtput(oop, (((usqInt) fwdBlock) >> 1) | ((MARK_BIT) | originalHeaderType));
		}
		/* begin objectAfterWhileForwarding: */
		header = longAt(oop);
		if ((header & (MARK_BIT)) == 0) {
			/* begin objectAfter: */
			if (DoAssertionChecks) {
				if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
					error("no objects after the end of memory");
				}
			}
			if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
				sz1 = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
			} else {
				/* begin sizeBitsOf: */
				header1 = longAt(oop);
				if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
					sz1 = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
					goto l3;
				} else {
					sz1 = header1 & (SIZE_MASK);
					goto l3;
				}
			l3:	/* end sizeBitsOf: */;
			}
			oop = (oop + sz1) + (foo->headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
			goto l2;
		}
		fwdBlock1 = (header & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
		if (DoAssertionChecks) {
			/* begin fwdBlockValidate: */
			if (!(((((usqInt) fwdBlock1)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock1)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock1 & 3) == 0)))) {
				error("invalid fwd table entry");
			}
		}
		realHeader = longAt(fwdBlock1 + (BYTES_PER_WORD));
		if ((realHeader & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		} else {
			sz = realHeader & (SIZE_MASK);
		}
		oop = (oop + sz) + (foo->headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
	l2:	/* end objectAfterWhileForwarding: */;
	}
	foo->compEnd = foo->endOfMemory;
	return bytesFreed;
}


/*	Move all non-free objects between compStart and compEnd to their new  
	locations, restoring their headers in the process. Create a new free  
	block at the end of memory. Return the newly created free chunk.  */
/*	Note: The free block used by the allocator always must be the last free  
	block in memory. It may take several compaction passes to make all  
	free space bubble up to the end of memory. */

sqInt incCompMove(sqInt bytesFreed) {
register struct foo * foo = &fum;
    sqInt bytesToMove;
    usqInt firstWord;
    sqInt fwdBlock;
    sqInt header;
    usqInt lastWord;
    sqInt newFreeChunk;
    sqInt newOop;
    sqInt next;
    sqInt oop;
    sqInt sz;
    sqInt target;
    usqInt w;
    sqInt header1;
    sqInt fwdBlock1;
    sqInt header2;
    sqInt realHeader;
    sqInt sz1;
    sqInt sz2;
    sqInt header3;

	newOop = null;
	oop = foo->compStart + (foo->headerTypeBytes[(longAt(foo->compStart)) & TypeMask]);
	while ((((usqInt) oop)) < (((usqInt) foo->compEnd))) {
		foo->statCompMoveCount += 1;
		/* begin objectAfterWhileForwarding: */
		header2 = longAt(oop);
		if ((header2 & (MARK_BIT)) == 0) {
			/* begin objectAfter: */
			if (DoAssertionChecks) {
				if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
					error("no objects after the end of memory");
				}
			}
			if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
				sz2 = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
			} else {
				/* begin sizeBitsOf: */
				header3 = longAt(oop);
				if ((header3 & TypeMask) == HeaderTypeSizeAndClass) {
					sz2 = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
					goto l3;
				} else {
					sz2 = header3 & (SIZE_MASK);
					goto l3;
				}
			l3:	/* end sizeBitsOf: */;
			}
			next = (oop + sz2) + (foo->headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
			goto l2;
		}
		fwdBlock1 = (header2 & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
		if (DoAssertionChecks) {
			/* begin fwdBlockValidate: */
			if (!(((((usqInt) fwdBlock1)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock1)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock1 & 3) == 0)))) {
				error("invalid fwd table entry");
			}
		}
		realHeader = longAt(fwdBlock1 + (BYTES_PER_WORD));
		if ((realHeader & TypeMask) == HeaderTypeSizeAndClass) {
			sz1 = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		} else {
			sz1 = realHeader & (SIZE_MASK);
		}
		next = (oop + sz1) + (foo->headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
	l2:	/* end objectAfterWhileForwarding: */;
		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {

			/* a moving object; unwind its forwarding block */

			fwdBlock = ((longAt(oop)) & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
			if (DoAssertionChecks) {
				/* begin fwdBlockValidate: */
				if (!(((((usqInt) fwdBlock)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock & 3) == 0)))) {
					error("invalid fwd table entry");
				}
			}
			newOop = longAt(fwdBlock);
			header = longAt(fwdBlock + (BYTES_PER_WORD));
			longAtput(oop, header);

			/* move the oop (including any extra header words)  */

			bytesToMove = oop - newOop;
			/* begin sizeBitsOf: */
			header1 = longAt(oop);
			if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header1 & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
			firstWord = oop - (foo->headerTypeBytes[(longAt(oop)) & TypeMask]);
			lastWord = (oop + sz) - (BASE_HEADER_SIZE);
			target = firstWord - bytesToMove;
			for (w = firstWord; w <= lastWord; w += (BYTES_PER_WORD)) {
				longAtput(target, longAt(w));
				target += BYTES_PER_WORD;
			}
		}
		oop = next;
	}
	if (newOop == null) {

		/* no objects moved */

		oop = foo->compStart + (foo->headerTypeBytes[(longAt(foo->compStart)) & TypeMask]);
		if ((((longAt(oop)) & TypeMask) == HeaderTypeFree) && ((objectAfter(oop)) == (foo->compEnd + (foo->headerTypeBytes[(longAt(foo->compEnd)) & TypeMask])))) {
			newFreeChunk = oop;
		} else {
			newFreeChunk = foo->freeBlock;
		}
	} else {

		/* initialize the newly freed memory chunk */
		/* newOop is the last object moved; free chunk starts 
			right after it */

		newFreeChunk = newOop + (sizeBitsOf(newOop));
		/* begin setSizeOfFree:to: */
		longAtput(newFreeChunk, (bytesFreed & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);
	}
	if (DoAssertionChecks) {
		if (!((objectAfter(newFreeChunk)) == (foo->compEnd + (foo->headerTypeBytes[(longAt(foo->compEnd)) & TypeMask])))) {
			error("problem creating free chunk after compaction");
		}
	}
	if ((objectAfter(newFreeChunk)) == foo->endOfMemory) {
		initializeMemoryFirstFree(newFreeChunk);
	} else {

		/* newFreeChunk is not at end of memory; re-install freeBlock  */

		initializeMemoryFirstFree(foo->freeBlock);
	}
	return newFreeChunk;
}


/*	Return the equivalent of 
		aClass includesBehavior: aSuperclass.
	Note: written for efficiency and better inlining (only 1 temp) */

sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass) {
register struct foo * foo = &fum;
    sqInt theClass;

	if (aSuperclass == foo->nilObj) {
		return 0;
	}
	theClass = aClass;
	while (1) {
		if (theClass == aSuperclass) {
			return 1;
		}
		if (!(theClass != foo->nilObj)) break;
		theClass = longAt((theClass + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
	}
	return 0;
}


/*	Do a mark/sweep garbage collection of just the young object 
	area of object memory (i.e., objects above youngStart), using 
	the root table to identify objects containing pointers to 
	young objects from the old object area. */

sqInt incrementalGC(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqLong startTime;
    sqInt survivorCount;
    sqInt weDidGrow;
    sqInt growth;
    sqInt i1;
    sqInt oop;
    sqInt valuePointer;

	if (foo->rootTableCount >= RootTableSize) {

		/* root table overflow; cannot do an incremental GC (this should be very rare) */

		foo->statRootTableOverflows += 1;
		return fullGC();
	}
	if (DoAssertionChecks) {
		reverseDisplayFromto(8, 15);
		validateRoots();
		/* begin validate */
	}
	/* begin preGCAction: */
	if (foo->compilerInitialized) {
		compilerPreGC(0);
	} else {
		/* begin storeContextRegisters: */
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
	}
	startTime = ioMicroSecondClock();
	foo->weakRootCount = 0;
	foo->statSweepCount = (foo->statMarkCount = (foo->statMkFwdCount = (foo->statCompMoveCount = 0)));
	markPhase();
	for (i = 1; i <= foo->weakRootCount; i += 1) {
		finalizeReference(foo->weakRoots[i]);
	}
	survivorCount = sweepPhase();
	/* begin incrementalCompaction */
	if (foo->compStart == foo->freeBlock) {
		initializeMemoryFirstFree(foo->freeBlock);
	} else {
		incCompBody();
	}
	foo->statAllocationCount = foo->allocationCount;
	foo->allocationCount = 0;
	foo->statIncrGCs += 1;
	foo->statGCTime = ioMicroSecondClock();
	foo->statIGCDeltaTime = foo->statGCTime - startTime;
	foo->statIncrGCMSecs += foo->statIGCDeltaTime;
	/* begin capturePendingFinalizationSignals */
	/* begin setStatpendingFinalizationSignals: */
	foo->statpendingFinalizationSignals = foo->pendingFinalizationSignals;
	/* begin forceInterruptCheck */
	foo->interruptCheckCounter = -1000;
	foo->nextPollTick = 0;
	foo->statRootTableCount = foo->rootTableCount;
	foo->statSurvivorCount = survivorCount;
	weDidGrow = 0;
	if (((survivorCount > foo->tenuringThreshold) || (foo->rootTableCount >= RootTableRedZone)) || (foo->forceTenureFlag == 1)) {

		/* move up the young space boundary if 
			* there are too many survivors: 
			this limits the number of objects that must be 
			processed on future incremental GC's 
			* we're about to overflow the roots table 
			this limits the number of full GCs that may be caused 
			by root table overflows in the near future */

		foo->forceTenureFlag = 0;
		foo->statTenures += 1;
		/* begin clearRootsTable */
		for (i1 = 1; i1 <= foo->rootTableCount; i1 += 1) {
			oop = foo->rootTable[i1];
			longAtput(oop, (longAt(oop)) & (ALL_BUT_ROOT_BIT));
			foo->rootTable[i1] = 0;
		}
		foo->rootTableCount = 0;
		if ((foo->freeBlock < foo->growHeadroom) && (foo->gcBiasToGrow > 0)) {
			biasToGrow();
			weDidGrow = 1;
		}
		foo->youngStart = foo->freeBlock;
	}
	postGCAction();
	if (DoAssertionChecks) {
		validateRoots();
		/* begin validate */
		reverseDisplayFromto(8, 15);
	}
	if (weDidGrow) {
		/* begin biasToGrowCheckGCLimit */
		growth = (foo->youngStart - memory) - foo->gcBiasToGrowThreshold;
		if (growth < 0) {
			foo->gcBiasToGrowThreshold = foo->youngStart - memory;
		}
		if (growth > foo->gcBiasToGrowGCLimit) {
			fullGC();
			foo->gcBiasToGrowThreshold = foo->youngStart - memory;
		}
	}
	return null;
}


/*	Initialize hooks for the 'null compiler' */

sqInt initCompilerHooks(void) {
	compilerHooks[1]= nullCompilerHook;
	compilerHooks[2]= nullCompilerHook;
	compilerHooks[3]= nullCompilerHook;
	compilerHooks[4]= nullCompilerHook;
	compilerHooks[5]= nullCompilerHook;
	compilerHooks[6]= nullCompilerHook;
	compilerHooks[7]= nullCompilerHook;
	compilerHooks[8]= nullCompilerHook;
	compilerHooks[9]= nullCompilerHook;
	compilerHooks[10]= nullCompilerHook;
	compilerHooks[11]= nullCompilerHook;
	compilerHooks[12]= nullCompilerHook;
	compilerHooks[13]= nullCompilerHook;
	compilerHooks[14]= nullCompilerHook;
	foo->compilerInitialized = 0;
	return null;
}


/*	Set the imageFormatVersionNumber. The imageFormatInitialVersion will
	have been set at image load time. The imageFormatVerison may later by
	updated by pushClosureCopyCopiedValuesBytecode in the case of a
	non-closure image that is being updated automatically to use closures. */

sqInt initializeImageFormatVersion(void) {
	if (imageFormatVersionNumber == 0) {
		
		switch (imageFormatInitialVersion) {
		case 6502:
						imageFormatVersionNumber = 6502;
			break;
		case 6504:
		case 6505:
						imageFormatVersionNumber = 6504;
			break;
		case 68000:
						imageFormatVersionNumber = 68000;
			break;
		case 68002:
		case 68003:
						imageFormatVersionNumber = 68002;
			break;
		default:
			error("Case not found and no otherwise clause");
		}
	}
	return null;
}


/*	Initialize endOfMemory to the top of oop storage space, reserving some space for forwarding blocks, and create the freeBlock from which space is allocated. Also create a fake free chunk at endOfMemory to act as a sentinal for memory scans.  */
/*	Note: The amount of space reserved for forwarding blocks should be chosen to ensure that incremental compactions can usually be done in a single pass. However, there should be enough forwarding blocks so a full compaction can be done in a reasonable number of passes, say ten. (A full compaction requires N object-moving passes, where N = number of non-garbage objects / number of forwarding blocks). 
	di 11/18/2000 Re totalObjectCount: Provide a margin of one byte per object to be used for forwarding pointers at GC time. Since fwd blocks are 8 bytes, this means an absolute worst case of 8 passes to compact memory. In most cases it will be adequate to do compaction in a single pass.  */

sqInt initializeMemoryFirstFree(usqInt firstFree) {
register struct foo * foo = &fum;
    usqInt fwdBlockBytes;


	/* reserve space for forwarding blocks */

	fwdBlockBytes = foo->totalObjectCount & (((WORD_MASK) - (BYTES_PER_WORD)) + 1);
	if (!((((usqInt) (foo->memoryLimit - fwdBlockBytes))) >= (((usqInt) (firstFree + (BASE_HEADER_SIZE)))))) {

		/* reserve enough space for a minimal free block of BaseHeaderSize bytes */

		fwdBlockBytes = foo->memoryLimit - (firstFree + (BASE_HEADER_SIZE));
	}
	foo->endOfMemory = foo->memoryLimit - fwdBlockBytes;
	foo->freeBlock = firstFree;
	/* begin setSizeOfFree:to: */
	longAtput(foo->freeBlock, ((foo->endOfMemory - firstFree) & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);
	/* begin setSizeOfFree:to: */
	longAtput(foo->endOfMemory, ((BASE_HEADER_SIZE) & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);
	if (DoAssertionChecks) {
		if (!((foo->freeBlock < foo->endOfMemory) && (foo->endOfMemory < foo->memoryLimit))) {
			error("error in free space computation");
		}
		if (!((foo->endOfMemory + (foo->headerTypeBytes[(longAt(foo->endOfMemory)) & TypeMask])) == foo->endOfMemory)) {
			error("header format must have changed");
		}
		if (!((objectAfter((sqInt)foo->freeBlock)) == foo->endOfMemory)) {
			error("free block not properly initialized");
		}
	}
	return null;
}


/*	Initialize object memory variables at startup time. Assume endOfMemory is initially set (by the image-reading code) to the end of the last object in the image. Initialization redefines endOfMemory to be the end of the object allocation area based on the total available memory, but reserving some space for forwarding blocks. */
/*	Assume: image reader initializes the following variables:
		memory
		endOfMemory
		memoryLimit
		specialObjectsOop
		lastHash
	 */
/*	di 11/18/2000 fix slow full GC */
/*	set the start of the young object space */

sqInt initializeObjectMemory(sqInt bytesToShift) {
register struct foo * foo = &fum;

	/* image may be at a different address; adjust oops for new location */

	foo->youngStart = foo->endOfMemory;
	foo->totalObjectCount = adjustAllOopsBy(bytesToShift);
	initializeMemoryFirstFree(foo->endOfMemory);

	/* heavily used special objects */

	foo->specialObjectsOop += bytesToShift;
	foo->nilObj = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (NilObject << (SHIFT_FOR_WORD)));
	foo->falseObj = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (FalseObject << (SHIFT_FOR_WORD)));
	foo->trueObj = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TrueObject << (SHIFT_FOR_WORD)));
	foo->rootTableCount = 0;
	foo->freeContexts = NilContext;
	foo->freeLargeContexts = NilContext;
	foo->allocationCount = 0;
	foo->lowSpaceThreshold = 0;
	foo->signalLowSpace = 0;
	foo->compStart = 0;
	foo->compEnd = 0;
	foo->fwdTableNext = 0;
	foo->fwdTableLast = 0;
	foo->remapBufferCount = 0;

	/* do incremental GC after this many allocations */

	foo->allocationsBetweenGCs = 4000;

	/* tenure all suriving objects if count is over this threshold */

	foo->tenuringThreshold = 2000;

	/* four megabyte of headroom when growing */

	foo->growHeadroom = (4 * 1024) * 1024;

	/* eight megabyte of free space before shrinking */
	/* garbage collection statistics */

	foo->shrinkThreshold = (8 * 1024) * 1024;
	foo->statFullGCs = 0;
	foo->statFullGCMSecs = 0;
	foo->statIncrGCs = 0;
	foo->statIncrGCMSecs = 0;
	foo->statTenures = 0;
	foo->statRootTableOverflows = 0;
	foo->statGrowMemory = 0;
	foo->statShrinkMemory = 0;
	foo->forceTenureFlag = 0;
	foo->gcBiasToGrow = 0;
	foo->gcBiasToGrowGCLimit = 0;
	foo->extraRootCount = 0;
	return null;
}

sqInt initializeSessionID(void) {
register struct foo * foo = &fum;
	foo->globalSessionID = 0;
	while (foo->globalSessionID == 0) {
		foo->globalSessionID = time(NULL) + ioMSecs();
	}
	return null;
}


/*	Install the oop of this object in the given cache (at or atPut), along with
	its size, format and fixedSize */

sqInt installinAtCacheatstring(sqInt rcvr, sqInt *cache, sqInt atIx, sqInt stringy) {
register struct foo * foo = &fum;
    sqInt fixedFields;
    sqInt fmt;
    sqInt hdr;
    sqInt totalLength;
    sqInt class;
    sqInt classFormat;
    sqInt sz;
    sqInt ccIndex;
    sqInt oop1;

	hdr = longAt(rcvr);
	fmt = (((usqInt) hdr) >> 8) & 15;
	if ((fmt == 3) && ((((((usqInt) hdr) >> 12) & 0x1F) == 13) || ((((((usqInt) hdr) >> 12) & 0x1F) == 14) || (((((usqInt) hdr) >> 12) & 0x1F) == 4)))) {

		/* Contexts must not be put in the atCache, since their size is not constant */

		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	/* begin lengthOf:baseHeader:format: */
	if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(rcvr - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = hdr & (SIZE_MASK);
	}
	sz -= hdr & (SIZE_4_BIT);
	if (fmt <= 4) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l2;
	}
	if (fmt < 8) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l2;
	} else {
		totalLength = (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
		goto l2;
	}
l2:	/* end lengthOf:baseHeader:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt > 4) || (fmt == 2)) {
		fixedFields = 0;
		goto l1;
	}
	if (fmt < 2) {
		fixedFields = totalLength;
		goto l1;
	}
	/* begin fetchClassOf: */
	if ((rcvr & 1)) {
		class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l3;
	}
	ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		class = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l3;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l3;
	}
l3:	/* end fetchClassOf: */;
	classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
l1:	/* end fixedFieldsOf:format:length: */;
	cache[atIx + AtCacheOop] = rcvr;
	if (stringy) {
		cache[atIx + AtCacheFmt] = (fmt + 16);
	} else {
		cache[atIx + AtCacheFmt] = fmt;
	}
	cache[atIx + AtCacheFixedFields] = fixedFields;
	cache[atIx + AtCacheSize] = (totalLength - fixedFields);
	return null;
}


/*	The primitive table is normally initialized at compile time. This allows an entry
	in the table to be istalled at runtime. */
/*	for readability */

sqInt installPrimitiveat(void *selector, sqInt anInteger) {
	primitiveTable[anInteger] = selector;
	return null;
}


/*	The primitive table is normally initialized at compile time. This allows an entry
	in the table to be istalled at runtime. If the function cannot be loaded from the
	named module, then let the numbered primitive fail. */
/*	for readability */

sqInt installPrimitivefromat(void *selector, void *moduleName, sqInt anInteger) {
    void (*fn)(void);

	fn = ioLoadFunctionFrom(selector, moduleName);
	if (fn == null) {
		primitiveTable[anInteger] = primitiveFail;
	} else {
		primitiveTable[anInteger] = fn;
	}
	return null;
}

sqInt installPrimitiveTable(void) {
    sqInt i;
    void (*primitiveTableDefaults[578] )(void)= {
	/* 0*/ (void (*)(void))primitiveFail,
	/* 1*/ (void (*)(void))primitiveAdd,
	/* 2*/ (void (*)(void))primitiveSubtract,
	/* 3*/ (void (*)(void))primitiveLessThan,
	/* 4*/ (void (*)(void))primitiveGreaterThan,
	/* 5*/ (void (*)(void))primitiveLessOrEqual,
	/* 6*/ (void (*)(void))primitiveGreaterOrEqual,
	/* 7*/ (void (*)(void))primitiveEqual,
	/* 8*/ (void (*)(void))primitiveNotEqual,
	/* 9*/ (void (*)(void))primitiveMultiply,
	/* 10*/ (void (*)(void))primitiveDivide,
	/* 11*/ (void (*)(void))primitiveMod,
	/* 12*/ (void (*)(void))primitiveDiv,
	/* 13*/ (void (*)(void))primitiveQuo,
	/* 14*/ (void (*)(void))primitiveBitAnd,
	/* 15*/ (void (*)(void))primitiveBitOr,
	/* 16*/ (void (*)(void))primitiveBitXor,
	/* 17*/ (void (*)(void))primitiveBitShift,
	/* 18*/ (void (*)(void))primitiveMakePoint,
	/* 19*/ (void (*)(void))primitiveFail,
	/* 20*/ (void (*)(void))primitiveRemLargeIntegers,
	/* 21*/ (void (*)(void))primitiveAddLargeIntegers,
	/* 22*/ (void (*)(void))primitiveSubtractLargeIntegers,
	/* 23*/ (void (*)(void))primitiveLessThanLargeIntegers,
	/* 24*/ (void (*)(void))primitiveGreaterThanLargeIntegers,
	/* 25*/ (void (*)(void))primitiveLessOrEqualLargeIntegers,
	/* 26*/ (void (*)(void))primitiveGreaterOrEqualLargeIntegers,
	/* 27*/ (void (*)(void))primitiveEqualLargeIntegers,
	/* 28*/ (void (*)(void))primitiveNotEqualLargeIntegers,
	/* 29*/ (void (*)(void))primitiveMultiplyLargeIntegers,
	/* 30*/ (void (*)(void))primitiveDivideLargeIntegers,
	/* 31*/ (void (*)(void))primitiveModLargeIntegers,
	/* 32*/ (void (*)(void))primitiveDivLargeIntegers,
	/* 33*/ (void (*)(void))primitiveQuoLargeIntegers,
	/* 34*/ (void (*)(void))primitiveBitAndLargeIntegers,
	/* 35*/ (void (*)(void))primitiveBitOrLargeIntegers,
	/* 36*/ (void (*)(void))primitiveBitXorLargeIntegers,
	/* 37*/ (void (*)(void))primitiveBitShiftLargeIntegers,
	/* 38*/ (void (*)(void))primitiveFloatAt,
	/* 39*/ (void (*)(void))primitiveFloatAtPut,
	/* 40*/ (void (*)(void))primitiveAsFloat,
	/* 41*/ (void (*)(void))primitiveFloatAdd,
	/* 42*/ (void (*)(void))primitiveFloatSubtract,
	/* 43*/ (void (*)(void))primitiveFloatLessThan,
	/* 44*/ (void (*)(void))primitiveFloatGreaterThan,
	/* 45*/ (void (*)(void))primitiveFloatLessOrEqual,
	/* 46*/ (void (*)(void))primitiveFloatGreaterOrEqual,
	/* 47*/ (void (*)(void))primitiveFloatEqual,
	/* 48*/ (void (*)(void))primitiveFloatNotEqual,
	/* 49*/ (void (*)(void))primitiveFloatMultiply,
	/* 50*/ (void (*)(void))primitiveFloatDivide,
	/* 51*/ (void (*)(void))primitiveTruncated,
	/* 52*/ (void (*)(void))primitiveFractionalPart,
	/* 53*/ (void (*)(void))primitiveExponent,
	/* 54*/ (void (*)(void))primitiveTimesTwoPower,
	/* 55*/ (void (*)(void))primitiveSquareRoot,
	/* 56*/ (void (*)(void))primitiveSine,
	/* 57*/ (void (*)(void))primitiveArctan,
	/* 58*/ (void (*)(void))primitiveLogN,
	/* 59*/ (void (*)(void))primitiveExp,
	/* 60*/ (void (*)(void))primitiveAt,
	/* 61*/ (void (*)(void))primitiveAtPut,
	/* 62*/ (void (*)(void))primitiveSize,
	/* 63*/ (void (*)(void))primitiveStringAt,
	/* 64*/ (void (*)(void))primitiveStringAtPut,
	/* 65*/ (void (*)(void))primitiveFail,
	/* 66*/ (void (*)(void))primitiveFail,
	/* 67*/ (void (*)(void))primitiveFail,
	/* 68*/ (void (*)(void))primitiveObjectAt,
	/* 69*/ (void (*)(void))primitiveObjectAtPut,
	/* 70*/ (void (*)(void))primitiveNew,
	/* 71*/ (void (*)(void))primitiveNewWithArg,
	/* 72*/ (void (*)(void))primitiveArrayBecomeOneWay,
	/* 73*/ (void (*)(void))primitiveInstVarAt,
	/* 74*/ (void (*)(void))primitiveInstVarAtPut,
	/* 75*/ (void (*)(void))primitiveAsOop,
	/* 76*/ (void (*)(void))primitiveStoreStackp,
	/* 77*/ (void (*)(void))primitiveSomeInstance,
	/* 78*/ (void (*)(void))primitiveNextInstance,
	/* 79*/ (void (*)(void))primitiveNewMethod,
	/* 80*/ (void (*)(void))primitiveFail,
	/* 81*/ (void (*)(void))primitiveFail,
	/* 82*/ (void (*)(void))primitiveFail,
	/* 83*/ (void (*)(void))primitivePerform,
	/* 84*/ (void (*)(void))primitivePerformWithArgs,
	/* 85*/ (void (*)(void))primitiveSignal,
	/* 86*/ (void (*)(void))primitiveWait,
	/* 87*/ (void (*)(void))primitiveResume,
	/* 88*/ (void (*)(void))primitiveSuspend,
	/* 89*/ (void (*)(void))primitiveFlushCache,
	/* 90*/ (void (*)(void))primitiveMousePoint,
	/* 91*/ (void (*)(void))primitiveTestDisplayDepth,
	/* 92*/ (void (*)(void))primitiveSetDisplayMode,
	/* 93*/ (void (*)(void))primitiveInputSemaphore,
	/* 94*/ (void (*)(void))primitiveGetNextEvent,
	/* 95*/ (void (*)(void))primitiveInputWord,
	/* 96*/ (void (*)(void))primitiveFail,
	/* 97*/ (void (*)(void))primitiveSnapshot,
	/* 98*/ (void (*)(void))primitiveStoreImageSegment,
	/* 99*/ (void (*)(void))primitiveLoadImageSegment,
	/* 100*/ (void (*)(void))primitivePerformInSuperclass,
	/* 101*/ (void (*)(void))primitiveBeCursor,
	/* 102*/ (void (*)(void))primitiveBeDisplay,
	/* 103*/ (void (*)(void))primitiveScanCharacters,
	/* 104*/ (void (*)(void))primitiveFail,
	/* 105*/ (void (*)(void))primitiveStringReplace,
	/* 106*/ (void (*)(void))primitiveScreenSize,
	/* 107*/ (void (*)(void))primitiveMouseButtons,
	/* 108*/ (void (*)(void))primitiveKbdNext,
	/* 109*/ (void (*)(void))primitiveKbdPeek,
	/* 110*/ (void (*)(void))primitiveIdentical,
	/* 111*/ (void (*)(void))primitiveClass,
	/* 112*/ (void (*)(void))primitiveBytesLeft,
	/* 113*/ (void (*)(void))primitiveQuit,
	/* 114*/ (void (*)(void))primitiveExitToDebugger,
	/* 115*/ (void (*)(void))primitiveChangeClass,
	/* 116*/ (void (*)(void))primitiveFlushCacheByMethod,
	/* 117*/ (void (*)(void))primitiveExternalCall,
	/* 118*/ (void (*)(void))primitiveDoPrimitiveWithArgs,
	/* 119*/ (void (*)(void))primitiveFlushCacheBySelector,
	/* 120*/ (void (*)(void))primitiveCalloutToFFI,
	/* 121*/ (void (*)(void))primitiveImageName,
	/* 122*/ (void (*)(void))primitiveNoop,
	/* 123*/ (void (*)(void))primitiveFail,
	/* 124*/ (void (*)(void))primitiveLowSpaceSemaphore,
	/* 125*/ (void (*)(void))primitiveSignalAtBytesLeft,
	/* 126*/ (void (*)(void))primitiveDeferDisplayUpdates,
	/* 127*/ (void (*)(void))primitiveShowDisplayRect,
	/* 128*/ (void (*)(void))primitiveArrayBecome,
	/* 129*/ (void (*)(void))primitiveSpecialObjectsOop,
	/* 130*/ (void (*)(void))primitiveFullGC,
	/* 131*/ (void (*)(void))primitiveIncrementalGC,
	/* 132*/ (void (*)(void))primitiveObjectPointsTo,
	/* 133*/ (void (*)(void))primitiveSetInterruptKey,
	/* 134*/ (void (*)(void))primitiveInterruptSemaphore,
	/* 135*/ (void (*)(void))primitiveMillisecondClock,
	/* 136*/ (void (*)(void))primitiveSignalAtMilliseconds,
	/* 137*/ (void (*)(void))primitiveSecondsClock,
	/* 138*/ (void (*)(void))primitiveSomeObject,
	/* 139*/ (void (*)(void))primitiveNextObject,
	/* 140*/ (void (*)(void))primitiveBeep,
	/* 141*/ (void (*)(void))primitiveClipboardText,
	/* 142*/ (void (*)(void))primitiveVMPath,
	/* 143*/ (void (*)(void))primitiveShortAt,
	/* 144*/ (void (*)(void))primitiveShortAtPut,
	/* 145*/ (void (*)(void))primitiveConstantFill,
	/* 146*/ (void (*)(void))primitiveFail,
	/* 147*/ (void (*)(void))primitiveFail,
	/* 148*/ (void (*)(void))primitiveClone,
	/* 149*/ (void (*)(void))primitiveGetAttribute,
	/* 150*/ (void (*)(void))primitiveCosine,
	/* 151*/ (void (*)(void))primitiveFail,
	/* 152*/ (void (*)(void))primitiveFail,
	/* 153*/ (void (*)(void))primitiveFail,
	/* 154*/ (void (*)(void))primitiveFail,
	/* 155*/ (void (*)(void))primitiveFail,
	/* 156*/ (void (*)(void))primitiveFail,
	/* 157*/ (void (*)(void))primitiveFail,
	/* 158*/ (void (*)(void))primitiveFail,
	/* 159*/ (void (*)(void))primitiveFail,
	/* 160*/ (void (*)(void))primitiveAdoptInstance,
	/* 161*/ (void (*)(void))primitiveSetIdentityHash,
	/* 162*/ (void (*)(void))primitiveFail,
	/* 163*/ (void (*)(void))primitiveFail,
	/* 164*/ (void (*)(void))primitiveFail,
	/* 165*/ (void (*)(void))primitiveIntegerAt,
	/* 166*/ (void (*)(void))primitiveIntegerAtPut,
	/* 167*/ (void (*)(void))primitiveYield,
	/* 168*/ (void (*)(void))primitiveCopyObject,
	/* 169*/ (void (*)(void))primitiveNotIdentical,
	/* 170*/ (void (*)(void))primitiveFail,
	/* 171*/ (void (*)(void))primitiveFail,
	/* 172*/ (void (*)(void))primitiveFail,
	/* 173*/ (void (*)(void))primitiveFail,
	/* 174*/ (void (*)(void))primitiveFail,
	/* 175*/ (void (*)(void))primitiveBehaviorHash,
	/* 176*/ (void (*)(void))primitiveMaxIdentityHash,
	/* 177*/ (void (*)(void))primitiveFail,
	/* 178*/ (void (*)(void))primitiveFail,
	/* 179*/ (void (*)(void))primitiveFail,
	/* 180*/ (void (*)(void))primitiveFail,
	/* 181*/ (void (*)(void))primitiveFail,
	/* 182*/ (void (*)(void))primitiveFail,
	/* 183*/ (void (*)(void))primitiveFail,
	/* 184*/ (void (*)(void))primitiveFail,
	/* 185*/ (void (*)(void))primitiveExitCriticalSection,
	/* 186*/ (void (*)(void))primitiveEnterCriticalSection,
	/* 187*/ (void (*)(void))primitiveTestAndSetOwnershipOfCriticalSection,
	/* 188*/ (void (*)(void))primitiveExecuteMethodArgsArray,
	/* 189*/ (void (*)(void))primitiveExecuteMethod,
	/* 190*/ (void (*)(void))primitiveFail,
	/* 191*/ (void (*)(void))primitiveFail,
	/* 192*/ (void (*)(void))primitiveFail,
	/* 193*/ (void (*)(void))primitiveFail,
	/* 194*/ (void (*)(void))primitiveFail,
	/* 195*/ (void (*)(void))primitiveFindNextUnwindContext,
	/* 196*/ (void (*)(void))primitiveTerminateTo,
	/* 197*/ (void (*)(void))primitiveFindHandlerContext,
	/* 198*/ (void (*)(void))primitiveMarkUnwindMethod,
	/* 199*/ (void (*)(void))primitiveMarkHandlerMethod,
	/* 200*/ (void (*)(void))primitiveClosureCopyWithCopiedValues,
	/* 201*/ (void (*)(void))primitiveClosureValue,
	/* 202*/ (void (*)(void))primitiveClosureValue,
	/* 203*/ (void (*)(void))primitiveClosureValue,
	/* 204*/ (void (*)(void))primitiveClosureValue,
	/* 205*/ (void (*)(void))primitiveClosureValue,
	/* 206*/ (void (*)(void))primitiveClosureValueWithArgs,
	/* 207*/ (void (*)(void))primitiveFail,
	/* 208*/ (void (*)(void))primitiveFail,
	/* 209*/ (void (*)(void))primitiveFail,
	/* 210*/ (void (*)(void))primitiveAt,
	/* 211*/ (void (*)(void))primitiveAtPut,
	/* 212*/ (void (*)(void))primitiveSize,
	/* 213*/ (void (*)(void))primitiveFail,
	/* 214*/ (void (*)(void))primitiveFail,
	/* 215*/ (void (*)(void))primitiveFail,
	/* 216*/ (void (*)(void))primitiveFail,
	/* 217*/ (void (*)(void))primitiveFail,
	/* 218*/ (void (*)(void))primitiveFail,
	/* 219*/ (void (*)(void))primitiveFail,
	/* 220*/ (void (*)(void))primitiveFail,
	/* 221*/ (void (*)(void))primitiveClosureValueNoContextSwitch,
	/* 222*/ (void (*)(void))primitiveClosureValueNoContextSwitch,
	/* 223*/ (void (*)(void))primitiveFail,
	/* 224*/ (void (*)(void))primitiveFail,
	/* 225*/ (void (*)(void))primitiveFail,
	/* 226*/ (void (*)(void))primitiveFail,
	/* 227*/ (void (*)(void))primitiveFail,
	/* 228*/ (void (*)(void))primitiveFail,
	/* 229*/ (void (*)(void))primitiveFail,
	/* 230*/ (void (*)(void))primitiveRelinquishProcessor,
	/* 231*/ (void (*)(void))primitiveForceDisplayUpdate,
	/* 232*/ (void (*)(void))primitiveFormPrint,
	/* 233*/ (void (*)(void))primitiveSetFullScreen,
	/* 234*/ (void (*)(void))primitiveFail,
	/* 235*/ (void (*)(void))primitiveFail,
	/* 236*/ (void (*)(void))primitiveFail,
	/* 237*/ (void (*)(void))primitiveFail,
	/* 238*/ (void (*)(void))primitiveFail,
	/* 239*/ (void (*)(void))primitiveFail,
	/* 240*/ (void (*)(void))primitiveUTCMicrosecondClock,
	/* 241*/ (void (*)(void))primitiveLocalMicrosecondClock,
	/* 242*/ (void (*)(void))primitiveSignalAtUTCMicroseconds,
	/* 243*/ (void (*)(void))primitiveFail,
	/* 244*/ (void (*)(void))primitiveFail,
	/* 245*/ (void (*)(void))primitiveFail,
	/* 246*/ (void (*)(void))primitiveFail,
	/* 247*/ (void (*)(void))primitiveSnapshotEmbedded,
	/* 248*/ (void (*)(void))primitiveArrayBecomeOneWayNoCopyHash,
	/* 249*/ (void (*)(void))primitiveArrayBecomeOneWayCopyHash,
	/* 250*/ (void (*)(void))clearProfile,
	/* 251*/ (void (*)(void))dumpProfile,
	/* 252*/ (void (*)(void))startProfiling,
	/* 253*/ (void (*)(void))stopProfiling,
	/* 254*/ (void (*)(void))primitiveVMParameter,
	/* 255*/ (void (*)(void))primitiveFail,
	/* 256*/ (void (*)(void))primitivePushSelf,
	/* 257*/ (void (*)(void))primitivePushTrue,
	/* 258*/ (void (*)(void))primitivePushFalse,
	/* 259*/ (void (*)(void))primitivePushNil,
	/* 260*/ (void (*)(void))primitivePushMinusOne,
	/* 261*/ (void (*)(void))primitivePushZero,
	/* 262*/ (void (*)(void))primitivePushOne,
	/* 263*/ (void (*)(void))primitivePushTwo,
	/* 264*/ (void (*)(void))primitiveLoadInstVar,
	/* 265*/ (void (*)(void))primitiveLoadInstVar,
	/* 266*/ (void (*)(void))primitiveLoadInstVar,
	/* 267*/ (void (*)(void))primitiveLoadInstVar,
	/* 268*/ (void (*)(void))primitiveLoadInstVar,
	/* 269*/ (void (*)(void))primitiveLoadInstVar,
	/* 270*/ (void (*)(void))primitiveLoadInstVar,
	/* 271*/ (void (*)(void))primitiveLoadInstVar,
	/* 272*/ (void (*)(void))primitiveLoadInstVar,
	/* 273*/ (void (*)(void))primitiveLoadInstVar,
	/* 274*/ (void (*)(void))primitiveLoadInstVar,
	/* 275*/ (void (*)(void))primitiveLoadInstVar,
	/* 276*/ (void (*)(void))primitiveLoadInstVar,
	/* 277*/ (void (*)(void))primitiveLoadInstVar,
	/* 278*/ (void (*)(void))primitiveLoadInstVar,
	/* 279*/ (void (*)(void))primitiveLoadInstVar,
	/* 280*/ (void (*)(void))primitiveLoadInstVar,
	/* 281*/ (void (*)(void))primitiveLoadInstVar,
	/* 282*/ (void (*)(void))primitiveLoadInstVar,
	/* 283*/ (void (*)(void))primitiveLoadInstVar,
	/* 284*/ (void (*)(void))primitiveLoadInstVar,
	/* 285*/ (void (*)(void))primitiveLoadInstVar,
	/* 286*/ (void (*)(void))primitiveLoadInstVar,
	/* 287*/ (void (*)(void))primitiveLoadInstVar,
	/* 288*/ (void (*)(void))primitiveLoadInstVar,
	/* 289*/ (void (*)(void))primitiveLoadInstVar,
	/* 290*/ (void (*)(void))primitiveLoadInstVar,
	/* 291*/ (void (*)(void))primitiveLoadInstVar,
	/* 292*/ (void (*)(void))primitiveLoadInstVar,
	/* 293*/ (void (*)(void))primitiveLoadInstVar,
	/* 294*/ (void (*)(void))primitiveLoadInstVar,
	/* 295*/ (void (*)(void))primitiveLoadInstVar,
	/* 296*/ (void (*)(void))primitiveLoadInstVar,
	/* 297*/ (void (*)(void))primitiveLoadInstVar,
	/* 298*/ (void (*)(void))primitiveLoadInstVar,
	/* 299*/ (void (*)(void))primitiveLoadInstVar,
	/* 300*/ (void (*)(void))primitiveLoadInstVar,
	/* 301*/ (void (*)(void))primitiveLoadInstVar,
	/* 302*/ (void (*)(void))primitiveLoadInstVar,
	/* 303*/ (void (*)(void))primitiveLoadInstVar,
	/* 304*/ (void (*)(void))primitiveLoadInstVar,
	/* 305*/ (void (*)(void))primitiveLoadInstVar,
	/* 306*/ (void (*)(void))primitiveLoadInstVar,
	/* 307*/ (void (*)(void))primitiveLoadInstVar,
	/* 308*/ (void (*)(void))primitiveLoadInstVar,
	/* 309*/ (void (*)(void))primitiveLoadInstVar,
	/* 310*/ (void (*)(void))primitiveLoadInstVar,
	/* 311*/ (void (*)(void))primitiveLoadInstVar,
	/* 312*/ (void (*)(void))primitiveLoadInstVar,
	/* 313*/ (void (*)(void))primitiveLoadInstVar,
	/* 314*/ (void (*)(void))primitiveLoadInstVar,
	/* 315*/ (void (*)(void))primitiveLoadInstVar,
	/* 316*/ (void (*)(void))primitiveLoadInstVar,
	/* 317*/ (void (*)(void))primitiveLoadInstVar,
	/* 318*/ (void (*)(void))primitiveLoadInstVar,
	/* 319*/ (void (*)(void))primitiveLoadInstVar,
	/* 320*/ (void (*)(void))primitiveLoadInstVar,
	/* 321*/ (void (*)(void))primitiveLoadInstVar,
	/* 322*/ (void (*)(void))primitiveLoadInstVar,
	/* 323*/ (void (*)(void))primitiveLoadInstVar,
	/* 324*/ (void (*)(void))primitiveLoadInstVar,
	/* 325*/ (void (*)(void))primitiveLoadInstVar,
	/* 326*/ (void (*)(void))primitiveLoadInstVar,
	/* 327*/ (void (*)(void))primitiveLoadInstVar,
	/* 328*/ (void (*)(void))primitiveLoadInstVar,
	/* 329*/ (void (*)(void))primitiveLoadInstVar,
	/* 330*/ (void (*)(void))primitiveLoadInstVar,
	/* 331*/ (void (*)(void))primitiveLoadInstVar,
	/* 332*/ (void (*)(void))primitiveLoadInstVar,
	/* 333*/ (void (*)(void))primitiveLoadInstVar,
	/* 334*/ (void (*)(void))primitiveLoadInstVar,
	/* 335*/ (void (*)(void))primitiveLoadInstVar,
	/* 336*/ (void (*)(void))primitiveLoadInstVar,
	/* 337*/ (void (*)(void))primitiveLoadInstVar,
	/* 338*/ (void (*)(void))primitiveLoadInstVar,
	/* 339*/ (void (*)(void))primitiveLoadInstVar,
	/* 340*/ (void (*)(void))primitiveLoadInstVar,
	/* 341*/ (void (*)(void))primitiveLoadInstVar,
	/* 342*/ (void (*)(void))primitiveLoadInstVar,
	/* 343*/ (void (*)(void))primitiveLoadInstVar,
	/* 344*/ (void (*)(void))primitiveLoadInstVar,
	/* 345*/ (void (*)(void))primitiveLoadInstVar,
	/* 346*/ (void (*)(void))primitiveLoadInstVar,
	/* 347*/ (void (*)(void))primitiveLoadInstVar,
	/* 348*/ (void (*)(void))primitiveLoadInstVar,
	/* 349*/ (void (*)(void))primitiveLoadInstVar,
	/* 350*/ (void (*)(void))primitiveLoadInstVar,
	/* 351*/ (void (*)(void))primitiveLoadInstVar,
	/* 352*/ (void (*)(void))primitiveLoadInstVar,
	/* 353*/ (void (*)(void))primitiveLoadInstVar,
	/* 354*/ (void (*)(void))primitiveLoadInstVar,
	/* 355*/ (void (*)(void))primitiveLoadInstVar,
	/* 356*/ (void (*)(void))primitiveLoadInstVar,
	/* 357*/ (void (*)(void))primitiveLoadInstVar,
	/* 358*/ (void (*)(void))primitiveLoadInstVar,
	/* 359*/ (void (*)(void))primitiveLoadInstVar,
	/* 360*/ (void (*)(void))primitiveLoadInstVar,
	/* 361*/ (void (*)(void))primitiveLoadInstVar,
	/* 362*/ (void (*)(void))primitiveLoadInstVar,
	/* 363*/ (void (*)(void))primitiveLoadInstVar,
	/* 364*/ (void (*)(void))primitiveLoadInstVar,
	/* 365*/ (void (*)(void))primitiveLoadInstVar,
	/* 366*/ (void (*)(void))primitiveLoadInstVar,
	/* 367*/ (void (*)(void))primitiveLoadInstVar,
	/* 368*/ (void (*)(void))primitiveLoadInstVar,
	/* 369*/ (void (*)(void))primitiveLoadInstVar,
	/* 370*/ (void (*)(void))primitiveLoadInstVar,
	/* 371*/ (void (*)(void))primitiveLoadInstVar,
	/* 372*/ (void (*)(void))primitiveLoadInstVar,
	/* 373*/ (void (*)(void))primitiveLoadInstVar,
	/* 374*/ (void (*)(void))primitiveLoadInstVar,
	/* 375*/ (void (*)(void))primitiveLoadInstVar,
	/* 376*/ (void (*)(void))primitiveLoadInstVar,
	/* 377*/ (void (*)(void))primitiveLoadInstVar,
	/* 378*/ (void (*)(void))primitiveLoadInstVar,
	/* 379*/ (void (*)(void))primitiveLoadInstVar,
	/* 380*/ (void (*)(void))primitiveLoadInstVar,
	/* 381*/ (void (*)(void))primitiveLoadInstVar,
	/* 382*/ (void (*)(void))primitiveLoadInstVar,
	/* 383*/ (void (*)(void))primitiveLoadInstVar,
	/* 384*/ (void (*)(void))primitiveLoadInstVar,
	/* 385*/ (void (*)(void))primitiveLoadInstVar,
	/* 386*/ (void (*)(void))primitiveLoadInstVar,
	/* 387*/ (void (*)(void))primitiveLoadInstVar,
	/* 388*/ (void (*)(void))primitiveLoadInstVar,
	/* 389*/ (void (*)(void))primitiveLoadInstVar,
	/* 390*/ (void (*)(void))primitiveLoadInstVar,
	/* 391*/ (void (*)(void))primitiveLoadInstVar,
	/* 392*/ (void (*)(void))primitiveLoadInstVar,
	/* 393*/ (void (*)(void))primitiveLoadInstVar,
	/* 394*/ (void (*)(void))primitiveLoadInstVar,
	/* 395*/ (void (*)(void))primitiveLoadInstVar,
	/* 396*/ (void (*)(void))primitiveLoadInstVar,
	/* 397*/ (void (*)(void))primitiveLoadInstVar,
	/* 398*/ (void (*)(void))primitiveLoadInstVar,
	/* 399*/ (void (*)(void))primitiveLoadInstVar,
	/* 400*/ (void (*)(void))primitiveLoadInstVar,
	/* 401*/ (void (*)(void))primitiveLoadInstVar,
	/* 402*/ (void (*)(void))primitiveLoadInstVar,
	/* 403*/ (void (*)(void))primitiveLoadInstVar,
	/* 404*/ (void (*)(void))primitiveLoadInstVar,
	/* 405*/ (void (*)(void))primitiveLoadInstVar,
	/* 406*/ (void (*)(void))primitiveLoadInstVar,
	/* 407*/ (void (*)(void))primitiveLoadInstVar,
	/* 408*/ (void (*)(void))primitiveLoadInstVar,
	/* 409*/ (void (*)(void))primitiveLoadInstVar,
	/* 410*/ (void (*)(void))primitiveLoadInstVar,
	/* 411*/ (void (*)(void))primitiveLoadInstVar,
	/* 412*/ (void (*)(void))primitiveLoadInstVar,
	/* 413*/ (void (*)(void))primitiveLoadInstVar,
	/* 414*/ (void (*)(void))primitiveLoadInstVar,
	/* 415*/ (void (*)(void))primitiveLoadInstVar,
	/* 416*/ (void (*)(void))primitiveLoadInstVar,
	/* 417*/ (void (*)(void))primitiveLoadInstVar,
	/* 418*/ (void (*)(void))primitiveLoadInstVar,
	/* 419*/ (void (*)(void))primitiveLoadInstVar,
	/* 420*/ (void (*)(void))primitiveLoadInstVar,
	/* 421*/ (void (*)(void))primitiveLoadInstVar,
	/* 422*/ (void (*)(void))primitiveLoadInstVar,
	/* 423*/ (void (*)(void))primitiveLoadInstVar,
	/* 424*/ (void (*)(void))primitiveLoadInstVar,
	/* 425*/ (void (*)(void))primitiveLoadInstVar,
	/* 426*/ (void (*)(void))primitiveLoadInstVar,
	/* 427*/ (void (*)(void))primitiveLoadInstVar,
	/* 428*/ (void (*)(void))primitiveLoadInstVar,
	/* 429*/ (void (*)(void))primitiveLoadInstVar,
	/* 430*/ (void (*)(void))primitiveLoadInstVar,
	/* 431*/ (void (*)(void))primitiveLoadInstVar,
	/* 432*/ (void (*)(void))primitiveLoadInstVar,
	/* 433*/ (void (*)(void))primitiveLoadInstVar,
	/* 434*/ (void (*)(void))primitiveLoadInstVar,
	/* 435*/ (void (*)(void))primitiveLoadInstVar,
	/* 436*/ (void (*)(void))primitiveLoadInstVar,
	/* 437*/ (void (*)(void))primitiveLoadInstVar,
	/* 438*/ (void (*)(void))primitiveLoadInstVar,
	/* 439*/ (void (*)(void))primitiveLoadInstVar,
	/* 440*/ (void (*)(void))primitiveLoadInstVar,
	/* 441*/ (void (*)(void))primitiveLoadInstVar,
	/* 442*/ (void (*)(void))primitiveLoadInstVar,
	/* 443*/ (void (*)(void))primitiveLoadInstVar,
	/* 444*/ (void (*)(void))primitiveLoadInstVar,
	/* 445*/ (void (*)(void))primitiveLoadInstVar,
	/* 446*/ (void (*)(void))primitiveLoadInstVar,
	/* 447*/ (void (*)(void))primitiveLoadInstVar,
	/* 448*/ (void (*)(void))primitiveLoadInstVar,
	/* 449*/ (void (*)(void))primitiveLoadInstVar,
	/* 450*/ (void (*)(void))primitiveLoadInstVar,
	/* 451*/ (void (*)(void))primitiveLoadInstVar,
	/* 452*/ (void (*)(void))primitiveLoadInstVar,
	/* 453*/ (void (*)(void))primitiveLoadInstVar,
	/* 454*/ (void (*)(void))primitiveLoadInstVar,
	/* 455*/ (void (*)(void))primitiveLoadInstVar,
	/* 456*/ (void (*)(void))primitiveLoadInstVar,
	/* 457*/ (void (*)(void))primitiveLoadInstVar,
	/* 458*/ (void (*)(void))primitiveLoadInstVar,
	/* 459*/ (void (*)(void))primitiveLoadInstVar,
	/* 460*/ (void (*)(void))primitiveLoadInstVar,
	/* 461*/ (void (*)(void))primitiveLoadInstVar,
	/* 462*/ (void (*)(void))primitiveLoadInstVar,
	/* 463*/ (void (*)(void))primitiveLoadInstVar,
	/* 464*/ (void (*)(void))primitiveLoadInstVar,
	/* 465*/ (void (*)(void))primitiveLoadInstVar,
	/* 466*/ (void (*)(void))primitiveLoadInstVar,
	/* 467*/ (void (*)(void))primitiveLoadInstVar,
	/* 468*/ (void (*)(void))primitiveLoadInstVar,
	/* 469*/ (void (*)(void))primitiveLoadInstVar,
	/* 470*/ (void (*)(void))primitiveLoadInstVar,
	/* 471*/ (void (*)(void))primitiveLoadInstVar,
	/* 472*/ (void (*)(void))primitiveLoadInstVar,
	/* 473*/ (void (*)(void))primitiveLoadInstVar,
	/* 474*/ (void (*)(void))primitiveLoadInstVar,
	/* 475*/ (void (*)(void))primitiveLoadInstVar,
	/* 476*/ (void (*)(void))primitiveLoadInstVar,
	/* 477*/ (void (*)(void))primitiveLoadInstVar,
	/* 478*/ (void (*)(void))primitiveLoadInstVar,
	/* 479*/ (void (*)(void))primitiveLoadInstVar,
	/* 480*/ (void (*)(void))primitiveLoadInstVar,
	/* 481*/ (void (*)(void))primitiveLoadInstVar,
	/* 482*/ (void (*)(void))primitiveLoadInstVar,
	/* 483*/ (void (*)(void))primitiveLoadInstVar,
	/* 484*/ (void (*)(void))primitiveLoadInstVar,
	/* 485*/ (void (*)(void))primitiveLoadInstVar,
	/* 486*/ (void (*)(void))primitiveLoadInstVar,
	/* 487*/ (void (*)(void))primitiveLoadInstVar,
	/* 488*/ (void (*)(void))primitiveLoadInstVar,
	/* 489*/ (void (*)(void))primitiveLoadInstVar,
	/* 490*/ (void (*)(void))primitiveLoadInstVar,
	/* 491*/ (void (*)(void))primitiveLoadInstVar,
	/* 492*/ (void (*)(void))primitiveLoadInstVar,
	/* 493*/ (void (*)(void))primitiveLoadInstVar,
	/* 494*/ (void (*)(void))primitiveLoadInstVar,
	/* 495*/ (void (*)(void))primitiveLoadInstVar,
	/* 496*/ (void (*)(void))primitiveLoadInstVar,
	/* 497*/ (void (*)(void))primitiveLoadInstVar,
	/* 498*/ (void (*)(void))primitiveLoadInstVar,
	/* 499*/ (void (*)(void))primitiveLoadInstVar,
	/* 500*/ (void (*)(void))primitiveLoadInstVar,
	/* 501*/ (void (*)(void))primitiveLoadInstVar,
	/* 502*/ (void (*)(void))primitiveLoadInstVar,
	/* 503*/ (void (*)(void))primitiveLoadInstVar,
	/* 504*/ (void (*)(void))primitiveLoadInstVar,
	/* 505*/ (void (*)(void))primitiveLoadInstVar,
	/* 506*/ (void (*)(void))primitiveLoadInstVar,
	/* 507*/ (void (*)(void))primitiveLoadInstVar,
	/* 508*/ (void (*)(void))primitiveLoadInstVar,
	/* 509*/ (void (*)(void))primitiveLoadInstVar,
	/* 510*/ (void (*)(void))primitiveLoadInstVar,
	/* 511*/ (void (*)(void))primitiveLoadInstVar,
	/* 512*/ (void (*)(void))primitiveLoadInstVar,
	/* 513*/ (void (*)(void))primitiveLoadInstVar,
	/* 514*/ (void (*)(void))primitiveLoadInstVar,
	/* 515*/ (void (*)(void))primitiveLoadInstVar,
	/* 516*/ (void (*)(void))primitiveLoadInstVar,
	/* 517*/ (void (*)(void))primitiveLoadInstVar,
	/* 518*/ (void (*)(void))primitiveLoadInstVar,
	/* 519*/ (void (*)(void))primitiveLoadInstVar,
	/* 520*/ (void (*)(void))primitiveFail,
	/* 521*/ (void (*)(void))primitiveFail,
	/* 522*/ (void (*)(void))primitiveFail,
	/* 523*/ (void (*)(void))primitiveFail,
	/* 524*/ (void (*)(void))primitiveFail,
	/* 525*/ (void (*)(void))primitiveFail,
	/* 526*/ (void (*)(void))primitiveFail,
	/* 527*/ (void (*)(void))primitiveFail,
	/* 528*/ (void (*)(void))primitiveFail,
	/* 529*/ (void (*)(void))primitiveFail,
	/* 530*/ (void (*)(void))primitiveFail,
	/* 531*/ (void (*)(void))primitiveFail,
	/* 532*/ (void (*)(void))primitiveFail,
	/* 533*/ (void (*)(void))primitiveFail,
	/* 534*/ (void (*)(void))primitiveFail,
	/* 535*/ (void (*)(void))primitiveFail,
	/* 536*/ (void (*)(void))primitiveFail,
	/* 537*/ (void (*)(void))primitiveFail,
	/* 538*/ (void (*)(void))primitiveFail,
	/* 539*/ (void (*)(void))primitiveFail,
	/* 540*/ (void (*)(void))primitiveFail,
	/* 541*/ (void (*)(void))primitiveFail,
	/* 542*/ (void (*)(void))primitiveFail,
	/* 543*/ (void (*)(void))primitiveFail,
	/* 544*/ (void (*)(void))primitiveFail,
	/* 545*/ (void (*)(void))primitiveFail,
	/* 546*/ (void (*)(void))primitiveFail,
	/* 547*/ (void (*)(void))primitiveFail,
	/* 548*/ (void (*)(void))primitiveFail,
	/* 549*/ (void (*)(void))primitiveFail,
	/* 550*/ (void (*)(void))primitiveFail,
	/* 551*/ (void (*)(void))primitiveFail,
	/* 552*/ (void (*)(void))primitiveFail,
	/* 553*/ (void (*)(void))primitiveFail,
	/* 554*/ (void (*)(void))primitiveFail,
	/* 555*/ (void (*)(void))primitiveFail,
	/* 556*/ (void (*)(void))primitiveFail,
	/* 557*/ (void (*)(void))primitiveFail,
	/* 558*/ (void (*)(void))primitiveFail,
	/* 559*/ (void (*)(void))primitiveFail,
	/* 560*/ (void (*)(void))primitiveFail,
	/* 561*/ (void (*)(void))primitiveFail,
	/* 562*/ (void (*)(void))primitiveFail,
	/* 563*/ (void (*)(void))primitiveFail,
	/* 564*/ (void (*)(void))primitiveFail,
	/* 565*/ (void (*)(void))primitiveFail,
	/* 566*/ (void (*)(void))primitiveFail,
	/* 567*/ (void (*)(void))primitiveFail,
	/* 568*/ (void (*)(void))primitiveFail,
	/* 569*/ (void (*)(void))primitiveFail,
	/* 570*/ (void (*)(void))primitiveFlushExternalPrimitives,
	/* 571*/ (void (*)(void))primitiveUnloadModule,
	/* 572*/ (void (*)(void))primitiveListBuiltinModule,
	/* 573*/ (void (*)(void))primitiveListExternalModule,
	/* 574*/ (void (*)(void))primitiveFail,
	/* 575*/ (void (*)(void))primitiveFail,
	/* 576*/ (void (*)(void))primitiveInvokeObjectAsMethod,
 0 };

	for (i = 0; i <= (MaxPrimitiveIndex + ProtectedPrimitiveCount); i += 1) {
		primitiveTable[i] = (primitiveTableDefaults[i]);
	}
	updatePrimitiveTable();
	return null;
}


/*	Answer the number of slots in a class.  For example the instanceSizeOf: 
	 ClassPoint is 2, for the x & y slots. The instance size of non-pointer classes is 0. */

sqInt instanceSizeOf(sqInt classObj) {
    sqInt byteSize;
    sqInt classHdr;
    sqInt sizeHiBits;

	assert(addressCouldBeObj(classObj));

	/* Low 2 bits are 0 */
	/* Compute the size of instances of the class (used for fixed field classes only) */

	classHdr = (longAt((classObj + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	sizeHiBits = (((usqInt) classHdr) >> 9) & 768;

	/* size in bytes -- low 2 bits are 0 */

	byteSize = (classHdr & (SIZE_MASK)) + sizeHiBits;
	return (byteSize - (BASE_HEADER_SIZE)) / (BYTES_PER_WORD);
}


/*	NOTE: This method supports the backward-compatible split instSize field of the 
	class format word. The sizeHiBits will go away and other shifts change by 2 
	when the split fields get merged in an (incompatible) image change. */

sqInt instantiateClassindexableSize(sqInt classPointer, sqInt size) {
register struct foo * foo = &fum;
    sqInt binc;
    sqInt bm1;
    sqInt byteSize;
    sqInt cClass;
    sqInt classFormat;
    sqInt fillWord;
    sqInt format;
    sqInt hash;
    sqInt hdrSize;
    sqInt header1;
    sqInt header2;
    sqInt header3;
    sqInt newObj;
    sqInt sizeHiBits;
    usqInt end;
    usqInt i;
    sqInt newObj1;
    sqInt remappedClassOop;
    sqInt oop;
    sqInt enoughSpace;
    sqInt newChunk;
    sqInt newFreeSize;
    usqInt minFree;
    sqInt currentProc;
    sqInt lastSavedProcess;
    sqInt sched;
    sqInt oop1;

	if (DoAssertionChecks) {
		if (size < 0) {
			error("cannot have a negative indexable field count");
		}
	}
	/* begin newObjectHash */
	foo->lastHash = (13849 + (27181 * foo->lastHash)) & 0xFFFF;
	hash = foo->lastHash;

	/* Low 2 bits are 0 */

	classFormat = (longAt((classPointer + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	header1 = (classFormat & 0x1FF00) | ((hash << HashBitsOffset) & HashBits);
	header2 = classPointer;
	header3 = 0;
	sizeHiBits = ((usqInt) (classFormat & 393216)) >> 9;

	/* compact class field from format word */

	cClass = header1 & CompactClassMask;

	/* size in bytes -- low 2 bits are 0 */
	/* Note this byteSize comes from the format word of the class which is pre-shifted
		to 4 bytes per field.  Need another shift for 8 bytes per word... */

	byteSize = (classFormat & 0xFC) + sizeHiBits;
	byteSize = byteSize << ((SHIFT_FOR_WORD) - 2);
	format = (((usqInt) classFormat) >> 8) & 15;
	flag("sizeLowBits");
	if (format < 8) {
		if (format == 6) {

			/* long32 bitmaps */

			bm1 = (BYTES_PER_WORD) - 1;

			/* round up */

			byteSize = ((byteSize + (size * 4)) + bm1) & (LONG_SIZE_MASK);

			/* odd bytes */
			/* extra low bit (4) for 64-bit VM goes in 4-bit (betw hdr bits and sizeBits) */

			binc = bm1 - (((size * 4) + bm1) & bm1);
			header1 = header1 | (binc & 4);
		} else {

			/* Arrays and 64-bit bitmaps */

			byteSize += size * (BYTES_PER_WORD);
		}
	} else {

		/* Strings and Methods */

		bm1 = (BYTES_PER_WORD) - 1;

		/* round up */

		byteSize = ((byteSize + size) + bm1) & (LONG_SIZE_MASK);

		/* odd bytes */
		/* low bits of byte size go in format field */

		binc = bm1 - ((size + bm1) & bm1);

		/* extra low bit (4) for 64-bit VM goes in 4-bit (betw hdr bits and sizeBits) */

		header1 = header1 | ((binc & 3) << 8);
		header1 = header1 | (binc & 4);
	}
	if (byteSize > 0xFF) {

		/* requires size header word */

		header3 = byteSize;
		header1 = header1;
	} else {
		header1 = header1 | byteSize;
	}
	if (header3 > 0) {

		/* requires full header */

		hdrSize = 3;
	} else {
		if (cClass == 0) {
			hdrSize = 2;
		} else {
			hdrSize = 1;
		}
	}
	if (format <= 4) {

		/* if pointers, fill with nil oop */

		fillWord = foo->nilObj;
	} else {
		fillWord = 0;
	}
	/* begin allocate:headerSize:h1:h2:h3:doFill:with: */
	if (hdrSize > 1) {
		/* begin pushRemappableOop: */
		foo->remapBuffer[(foo->remapBufferCount += 1)] = header2;
	}
	/* begin allocateChunk: */
	if (foo->allocationCount >= foo->allocationsBetweenGCs) {
		incrementalGC();
	}
	/* begin sufficientSpaceToAllocate: */
	minFree = (foo->lowSpaceThreshold + (byteSize + ((hdrSize - 1) * (BYTES_PER_WORD)))) + (BASE_HEADER_SIZE);
	if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree)) {
		enoughSpace = 1;
		goto l1;
	} else {
		enoughSpace = sufficientSpaceAfterGC(minFree);
		goto l1;
	}
l1:	/* end sufficientSpaceToAllocate: */;
	if (!(enoughSpace)) {
		foo->signalLowSpace = 1;
		foo->lowSpaceThreshold = 0;
		/* begin saveProcessSignalingLowSpace */
		lastSavedProcess = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ProcessSignalingLowSpace << (SHIFT_FOR_WORD)));
		if (lastSavedProcess == foo->nilObj) {
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
			sched = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
			currentProc = longAt((sched + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(foo->specialObjectsOop, currentProc);
			}
			longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ProcessSignalingLowSpace << (SHIFT_FOR_WORD)), currentProc);
		}
		/* begin forceInterruptCheck */
		foo->interruptCheckCounter = -1000;
		foo->nextPollTick = 0;
	}
	if (oopisLessThan((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), (byteSize + ((hdrSize - 1) * (BYTES_PER_WORD))) + (BASE_HEADER_SIZE))) {
		error("out of memory");
	}
	newFreeSize = ((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK)) - (byteSize + ((hdrSize - 1) * (BYTES_PER_WORD)));
	newChunk = foo->freeBlock;
	foo->freeBlock += byteSize + ((hdrSize - 1) * (BYTES_PER_WORD));
	/* begin setSizeOfFree:to: */
	longAtput(foo->freeBlock, (newFreeSize & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);
	foo->allocationCount += 1;
	newObj1 = newChunk;
	if (hdrSize > 1) {
		/* begin popRemappableOop */
		oop = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		remappedClassOop = oop;
	}
	if (hdrSize == 3) {
		longAtput(newObj1, header3 | HeaderTypeSizeAndClass);
		longAtput(newObj1 + (BYTES_PER_WORD), remappedClassOop | HeaderTypeSizeAndClass);
		longAtput(newObj1 + ((BYTES_PER_WORD) * 2), header1 | HeaderTypeSizeAndClass);
		newObj1 += (BYTES_PER_WORD) * 2;
	}
	if (hdrSize == 2) {
		longAtput(newObj1, remappedClassOop | HeaderTypeClass);
		longAtput(newObj1 + (BYTES_PER_WORD), header1 | HeaderTypeClass);
		newObj1 += BYTES_PER_WORD;
	}
	if (hdrSize == 1) {
		longAtput(newObj1, header1 | HeaderTypeShort);
	}
	if (1) {
		end = newObj1 + byteSize;
		i = newObj1 + (BYTES_PER_WORD);
		while (i < end) {
			longAtput(i, fillWord);
			i += BYTES_PER_WORD;
		}
	}
	if (DoAssertionChecks) {
		okayOop(newObj1);
		oopHasOkayClass(newObj1);
		if (!((objectAfter(newObj1)) == foo->freeBlock)) {
			error("allocate bug: did not set header of new oop correctly");
		}
		if (!((objectAfter((sqInt)foo->freeBlock)) == foo->endOfMemory)) {
			error("allocate bug: did not set header of freeBlock correctly");
		}
	}
	newObj = newObj1;
	return newObj;
}


/*	This version of instantiateClass assumes that the total object 
	size is under 256 bytes, the limit for objects with only one or 
	two header words. Note that the size is specified in bytes 
	and should include four bytes for the base header word. */

sqInt instantiateContextsizeInBytes(sqInt classPointer, sqInt sizeInBytes) {
register struct foo * foo = &fum;
    sqInt hash;
    sqInt hdrSize;
    sqInt header1;
    sqInt header2;
    sqInt extendedSize;
    usqInt end;
    usqInt i;
    sqInt newObj;
    sqInt remappedClassOop;
    sqInt oop;
    sqInt enoughSpace;
    sqInt newChunk;
    sqInt newFreeSize;
    usqInt minFree;
    sqInt currentProc;
    sqInt lastSavedProcess;
    sqInt sched;
    sqInt oop1;

	/* begin newObjectHash */
	foo->lastHash = (13849 + (27181 * foo->lastHash)) & 0xFFFF;
	hash = foo->lastHash;
	header1 = ((hash << HashBitsOffset) & HashBits) | ((longAt((classPointer + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1);
	header2 = classPointer;
	if ((header1 & CompactClassMask) > 0) {

		/* are contexts compact? */

		hdrSize = 1;
	} else {
		hdrSize = 2;
	}
	if (sizeInBytes <= (SIZE_MASK)) {

		/* OR size into header1.  Must not do this if size > SizeMask */

		header1 += sizeInBytes - (header1 & (SIZE_MASK));
	} else {

		/* Zero the size field of header1 if large */

		hdrSize = 3;
		header1 -= header1 & (SIZE_MASK);
	}
	flag("Dan");
	/* begin allocate:headerSize:h1:h2:h3:doFill:with: */
	extendedSize = LARGE_CONTEXT_SIZE;
	if (hdrSize > 1) {
		/* begin pushRemappableOop: */
		foo->remapBuffer[(foo->remapBufferCount += 1)] = header2;
	}
	/* begin allocateChunk: */
	if (foo->allocationCount >= foo->allocationsBetweenGCs) {
		incrementalGC();
	}
	/* begin sufficientSpaceToAllocate: */
	minFree = (foo->lowSpaceThreshold + (sizeInBytes + ((hdrSize - 1) * (BYTES_PER_WORD)))) + (BASE_HEADER_SIZE);
	if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree)) {
		enoughSpace = 1;
		goto l1;
	} else {
		enoughSpace = sufficientSpaceAfterGC(minFree);
		goto l1;
	}
l1:	/* end sufficientSpaceToAllocate: */;
	if (!(enoughSpace)) {
		foo->signalLowSpace = 1;
		foo->lowSpaceThreshold = 0;
		/* begin saveProcessSignalingLowSpace */
		lastSavedProcess = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ProcessSignalingLowSpace << (SHIFT_FOR_WORD)));
		if (lastSavedProcess == foo->nilObj) {
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
			sched = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
			currentProc = longAt((sched + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(foo->specialObjectsOop, currentProc);
			}
			longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ProcessSignalingLowSpace << (SHIFT_FOR_WORD)), currentProc);
		}
		/* begin forceInterruptCheck */
		foo->interruptCheckCounter = -1000;
		foo->nextPollTick = 0;
	}
	if (oopisLessThan((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), (sizeInBytes + ((hdrSize - 1) * (BYTES_PER_WORD))) + (BASE_HEADER_SIZE))) {
		error("out of memory");
	}
	newFreeSize = ((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK)) - (sizeInBytes + ((hdrSize - 1) * (BYTES_PER_WORD)));
	newChunk = foo->freeBlock;
	foo->freeBlock += sizeInBytes + ((hdrSize - 1) * (BYTES_PER_WORD));
	/* begin setSizeOfFree:to: */
	longAtput(foo->freeBlock, (newFreeSize & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);
	foo->allocationCount += 1;
	newObj = newChunk;
	if (hdrSize > 1) {
		/* begin popRemappableOop */
		oop = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		remappedClassOop = oop;
	}
	if (hdrSize == 3) {
		longAtput(newObj, extendedSize | HeaderTypeSizeAndClass);
		longAtput(newObj + (BYTES_PER_WORD), remappedClassOop | HeaderTypeSizeAndClass);
		longAtput(newObj + ((BYTES_PER_WORD) * 2), header1 | HeaderTypeSizeAndClass);
		newObj += (BYTES_PER_WORD) * 2;
	}
	if (hdrSize == 2) {
		longAtput(newObj, remappedClassOop | HeaderTypeClass);
		longAtput(newObj + (BYTES_PER_WORD), header1 | HeaderTypeClass);
		newObj += BYTES_PER_WORD;
	}
	if (hdrSize == 1) {
		longAtput(newObj, header1 | HeaderTypeShort);
	}
	if (0) {
		end = newObj + sizeInBytes;
		i = newObj + (BYTES_PER_WORD);
		while (i < end) {
			longAtput(i, 0);
			i += BYTES_PER_WORD;
		}
	}
	if (DoAssertionChecks) {
		okayOop(newObj);
		oopHasOkayClass(newObj);
		if (!((objectAfter(newObj)) == foo->freeBlock)) {
			error("allocate bug: did not set header of new oop correctly");
		}
		if (!((objectAfter((sqInt)foo->freeBlock)) == foo->endOfMemory)) {
			error("allocate bug: did not set header of freeBlock correctly");
		}
	}
	return newObj;
}


/*	This version of instantiateClass assumes that the total object 
	size is under 256 bytes, the limit for objects with only one or 
	two header words. Note that the size is specified in bytes 
	and should include 4 or 8 bytes for the base header word. 
	NOTE this code will only work for sizes that are an integral number of words
		(like not a 32-bit LargeInteger in a 64-bit system). 
	May cause a GC.
	Note that the created small object IS NOT FILLED and must be completed before returning it to Squeak. Since this call is used in routines that do jsut that we are safe. Break this rule and die. */

sqInt instantiateSmallClasssizeInBytes(sqInt classPointer, sqInt sizeInBytes) {
register struct foo * foo = &fum;
    sqInt hash;
    sqInt hdrSize;
    sqInt header1;
    sqInt header2;
    usqInt end;
    usqInt i;
    sqInt newObj;
    sqInt remappedClassOop;
    sqInt oop;
    sqInt enoughSpace;
    sqInt newChunk;
    sqInt newFreeSize;
    usqInt minFree;
    sqInt currentProc;
    sqInt lastSavedProcess;
    sqInt sched;
    sqInt oop1;

	if (!((sizeInBytes & ((BYTES_PER_WORD) - 1)) == 0)) {
		error("size must be integral number of words");
	}
	/* begin newObjectHash */
	foo->lastHash = (13849 + (27181 * foo->lastHash)) & 0xFFFF;
	hash = foo->lastHash;
	header1 = ((hash << HashBitsOffset) & HashBits) | ((longAt((classPointer + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1);
	header2 = classPointer;
	if ((header1 & CompactClassMask) > 0) {

		/* is this a compact class */

		hdrSize = 1;
	} else {
		hdrSize = 2;
	}
	header1 += sizeInBytes - (header1 & 0xFC);
	/* begin allocate:headerSize:h1:h2:h3:doFill:with: */
	if (hdrSize > 1) {
		/* begin pushRemappableOop: */
		foo->remapBuffer[(foo->remapBufferCount += 1)] = header2;
	}
	/* begin allocateChunk: */
	if (foo->allocationCount >= foo->allocationsBetweenGCs) {
		incrementalGC();
	}
	/* begin sufficientSpaceToAllocate: */
	minFree = (foo->lowSpaceThreshold + (sizeInBytes + ((hdrSize - 1) * (BYTES_PER_WORD)))) + (BASE_HEADER_SIZE);
	if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree)) {
		enoughSpace = 1;
		goto l1;
	} else {
		enoughSpace = sufficientSpaceAfterGC(minFree);
		goto l1;
	}
l1:	/* end sufficientSpaceToAllocate: */;
	if (!(enoughSpace)) {
		foo->signalLowSpace = 1;
		foo->lowSpaceThreshold = 0;
		/* begin saveProcessSignalingLowSpace */
		lastSavedProcess = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ProcessSignalingLowSpace << (SHIFT_FOR_WORD)));
		if (lastSavedProcess == foo->nilObj) {
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
			sched = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
			currentProc = longAt((sched + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(foo->specialObjectsOop, currentProc);
			}
			longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ProcessSignalingLowSpace << (SHIFT_FOR_WORD)), currentProc);
		}
		/* begin forceInterruptCheck */
		foo->interruptCheckCounter = -1000;
		foo->nextPollTick = 0;
	}
	if (oopisLessThan((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), (sizeInBytes + ((hdrSize - 1) * (BYTES_PER_WORD))) + (BASE_HEADER_SIZE))) {
		error("out of memory");
	}
	newFreeSize = ((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK)) - (sizeInBytes + ((hdrSize - 1) * (BYTES_PER_WORD)));
	newChunk = foo->freeBlock;
	foo->freeBlock += sizeInBytes + ((hdrSize - 1) * (BYTES_PER_WORD));
	/* begin setSizeOfFree:to: */
	longAtput(foo->freeBlock, (newFreeSize & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);
	foo->allocationCount += 1;
	newObj = newChunk;
	if (hdrSize > 1) {
		/* begin popRemappableOop */
		oop = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		remappedClassOop = oop;
	}
	if (hdrSize == 3) {
		longAtput(newObj, 0 | HeaderTypeSizeAndClass);
		longAtput(newObj + (BYTES_PER_WORD), remappedClassOop | HeaderTypeSizeAndClass);
		longAtput(newObj + ((BYTES_PER_WORD) * 2), header1 | HeaderTypeSizeAndClass);
		newObj += (BYTES_PER_WORD) * 2;
	}
	if (hdrSize == 2) {
		longAtput(newObj, remappedClassOop | HeaderTypeClass);
		longAtput(newObj + (BYTES_PER_WORD), header1 | HeaderTypeClass);
		newObj += BYTES_PER_WORD;
	}
	if (hdrSize == 1) {
		longAtput(newObj, header1 | HeaderTypeShort);
	}
	if (0) {
		end = newObj + sizeInBytes;
		i = newObj + (BYTES_PER_WORD);
		while (i < end) {
			longAtput(i, 0);
			i += BYTES_PER_WORD;
		}
	}
	if (DoAssertionChecks) {
		okayOop(newObj);
		oopHasOkayClass(newObj);
		if (!((objectAfter(newObj)) == foo->freeBlock)) {
			error("allocate bug: did not set header of new oop correctly");
		}
		if (!((objectAfter((sqInt)foo->freeBlock)) == foo->endOfMemory)) {
			error("allocate bug: did not set header of freeBlock correctly");
		}
	}
	return newObj;
}


/*	Like #stackIntegerValue: but access method arguments left-to-right */

sqInt integerArg(sqInt index) {
register struct foo * foo = &fum;
    sqInt oop;

	oop = methodArg(index);
	if (oop == 0) {
		return 0.0;
	}
	/* begin checkedIntegerValueOf: */
	if ((oop & 1)) {
		return (oop >> 1);
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return 0;
	}
	return null;
}

sqInt integerObjectOf(sqInt value) {
	return (value << 1) + 1;
}


/*	Translator produces 'objectPointer >> 1' */

sqInt integerValueOf(sqInt objectPointer) {
	if ((objectPointer & 0x80000000U) != 0) {

		/* negative */

		return ((((usqInt) (objectPointer & 0x7FFFFFFFU)) >> 1) - 0x3FFFFFFF) - 1;
	} else {

		/* positive */

		return ((usqInt) objectPointer) >> 1;
	}
	return null;
}

EXPORT(sqInt) internalIsImmutable(sqInt oop) {
	return 0;
}

EXPORT(sqInt) internalIsMutable(sqInt oop) {
	return 1;
}


/*	This is the main interpreter loop. It normally loops forever, fetching and executing bytecodes. When running in the context of a browser plugin VM, however, it must return control to the browser periodically. This should done only when the state of the currently running Squeak thread is safely stored in the object heap. Since this is the case at the moment that a check for interrupts is performed, that is when we return to the browser if it is time to do so. Interrupt checks happen quite frequently. */
/*	should not be inlined into any senders */

sqInt interpret(void) {
register struct foo * foo = &fum;
    sqInt localReturnValue;
    sqInt localReturnContext;
    sqInt localHomeContext;
    char * localSP;
    char * localIP;
    sqInt currentBytecode;

	initializeImageFormatVersion();
	installPrimitiveTable();

	/* some old images must disable stack bounds check */

	foo->allowAccessBeyondSP = !((imageFormatVersionNumber != 6502) && (imageFormatVersionNumber != 68000));
	browserPluginInitialiseIfNeeded();
	/* begin internalizeIPandSP */
	localIP = pointerForOop(foo->instructionPointer);
	localSP = pointerForOop(foo->stackPointer);
	localHomeContext = foo->theHomeContext;
	/* begin fetchNextBytecode */
	currentBytecode = byteAtPointer(++localIP);
	while (1) {
		switch (currentBytecode) {
		case 0:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((0 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 1:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((1 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 2:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((2 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 3:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((3 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 4:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((4 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 5:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((5 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 6:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((6 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 7:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((7 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 8:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((8 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 9:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((9 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 10:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((10 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 11:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((11 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 12:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((12 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 13:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((13 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 14:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((14 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 15:
			/* pushReceiverVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushReceiverVariable: */
				/* begin internalPush: */
				object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + ((15 & 15) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 16:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((16 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 17:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((17 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 18:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((18 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 19:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((19 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 20:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((20 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 21:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((21 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 22:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((22 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 23:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((23 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 24:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((24 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 25:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((25 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 26:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((26 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 27:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((27 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 28:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((28 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 29:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((29 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 30:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((30 & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 31:
			/* pushTemporaryVariableBytecode */
			{
				sqInt object;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushTemporaryVariable: */
				/* begin internalPush: */
				object = longAt((localHomeContext + (BASE_HEADER_SIZE)) + (((0x1F & 15) + TempFrameStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 32:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((32 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 33:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((33 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 34:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((34 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 35:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((35 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 36:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((36 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 37:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((37 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 38:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((38 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 39:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((39 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 40:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((40 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 41:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((41 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 42:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((42 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 43:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((43 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 44:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((44 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 45:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((45 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 46:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((46 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 47:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((47 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 48:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((48 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 49:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((49 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 50:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((50 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 51:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((51 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 52:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((52 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 53:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((53 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 54:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((54 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 55:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((55 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 56:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((56 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 57:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((57 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 58:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((58 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 59:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((59 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 60:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((60 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 61:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((61 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 62:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((0x3E & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 63:
			/* pushLiteralConstantBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralConstant: */
				/* begin internalPush: */
				object = longAt((foo->method + (BASE_HEADER_SIZE)) + (((0x3F & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 64:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((64 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 65:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((65 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 66:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((66 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 67:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((67 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 68:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((68 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 69:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((69 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 70:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((70 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 71:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((71 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 72:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((72 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 73:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((73 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 74:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((74 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 75:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((75 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 76:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((76 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 77:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((77 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 78:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((78 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 79:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((79 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 80:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((80 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 81:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((81 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 82:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((82 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 83:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((83 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 84:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((84 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 85:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((85 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 86:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((86 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 87:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((87 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 88:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((88 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 89:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((89 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 90:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((90 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 91:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((91 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 92:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((92 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 93:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((93 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 94:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((94 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 95:
			/* pushLiteralVariableBytecode */
			{
				sqInt object;
				sqInt oop;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushLiteralVariable: */
				/* begin internalPush: */
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + (((95 & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				object = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 96:
			/* storeAndPopReceiverVariableBytecode */
			{
				sqInt rcvr;
				sqInt top;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				rcvr = foo->receiver;
				top = longAtPointer(localSP);
				if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(rcvr, top);
				}
				longAtput((rcvr + (BASE_HEADER_SIZE)) + ((96 & 7) << (SHIFT_FOR_WORD)), top);
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 97:
			/* storeAndPopReceiverVariableBytecode */
			{
				sqInt rcvr;
				sqInt top;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				rcvr = foo->receiver;
				top = longAtPointer(localSP);
				if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(rcvr, top);
				}
				longAtput((rcvr + (BASE_HEADER_SIZE)) + ((97 & 7) << (SHIFT_FOR_WORD)), top);
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 98:
			/* storeAndPopReceiverVariableBytecode */
			{
				sqInt rcvr;
				sqInt top;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				rcvr = foo->receiver;
				top = longAtPointer(localSP);
				if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(rcvr, top);
				}
				longAtput((rcvr + (BASE_HEADER_SIZE)) + ((98 & 7) << (SHIFT_FOR_WORD)), top);
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 99:
			/* storeAndPopReceiverVariableBytecode */
			{
				sqInt rcvr;
				sqInt top;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				rcvr = foo->receiver;
				top = longAtPointer(localSP);
				if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(rcvr, top);
				}
				longAtput((rcvr + (BASE_HEADER_SIZE)) + ((99 & 7) << (SHIFT_FOR_WORD)), top);
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 100:
			/* storeAndPopReceiverVariableBytecode */
			{
				sqInt rcvr;
				sqInt top;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				rcvr = foo->receiver;
				top = longAtPointer(localSP);
				if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(rcvr, top);
				}
				longAtput((rcvr + (BASE_HEADER_SIZE)) + ((100 & 7) << (SHIFT_FOR_WORD)), top);
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 101:
			/* storeAndPopReceiverVariableBytecode */
			{
				sqInt rcvr;
				sqInt top;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				rcvr = foo->receiver;
				top = longAtPointer(localSP);
				if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(rcvr, top);
				}
				longAtput((rcvr + (BASE_HEADER_SIZE)) + ((101 & 7) << (SHIFT_FOR_WORD)), top);
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 102:
			/* storeAndPopReceiverVariableBytecode */
			{
				sqInt rcvr;
				sqInt top;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				rcvr = foo->receiver;
				top = longAtPointer(localSP);
				if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(rcvr, top);
				}
				longAtput((rcvr + (BASE_HEADER_SIZE)) + ((102 & 7) << (SHIFT_FOR_WORD)), top);
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 103:
			/* storeAndPopReceiverVariableBytecode */
			{
				sqInt rcvr;
				sqInt top;
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				rcvr = foo->receiver;
				top = longAtPointer(localSP);
				if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(rcvr, top);
				}
				longAtput((rcvr + (BASE_HEADER_SIZE)) + ((103 & 7) << (SHIFT_FOR_WORD)), top);
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 104:
			/* storeAndPopTemporaryVariableBytecode */
			{
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				longAtput((localHomeContext + (BASE_HEADER_SIZE)) + (((104 & 7) + TempFrameStart) << (SHIFT_FOR_WORD)), longAtPointer(localSP));
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 105:
			/* storeAndPopTemporaryVariableBytecode */
			{
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				longAtput((localHomeContext + (BASE_HEADER_SIZE)) + (((105 & 7) + TempFrameStart) << (SHIFT_FOR_WORD)), longAtPointer(localSP));
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 106:
			/* storeAndPopTemporaryVariableBytecode */
			{
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				longAtput((localHomeContext + (BASE_HEADER_SIZE)) + (((106 & 7) + TempFrameStart) << (SHIFT_FOR_WORD)), longAtPointer(localSP));
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 107:
			/* storeAndPopTemporaryVariableBytecode */
			{
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				longAtput((localHomeContext + (BASE_HEADER_SIZE)) + (((107 & 7) + TempFrameStart) << (SHIFT_FOR_WORD)), longAtPointer(localSP));
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 108:
			/* storeAndPopTemporaryVariableBytecode */
			{
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				longAtput((localHomeContext + (BASE_HEADER_SIZE)) + (((108 & 7) + TempFrameStart) << (SHIFT_FOR_WORD)), longAtPointer(localSP));
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 109:
			/* storeAndPopTemporaryVariableBytecode */
			{
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				longAtput((localHomeContext + (BASE_HEADER_SIZE)) + (((109 & 7) + TempFrameStart) << (SHIFT_FOR_WORD)), longAtPointer(localSP));
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 110:
			/* storeAndPopTemporaryVariableBytecode */
			{
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				longAtput((localHomeContext + (BASE_HEADER_SIZE)) + (((110 & 7) + TempFrameStart) << (SHIFT_FOR_WORD)), longAtPointer(localSP));
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 111:
			/* storeAndPopTemporaryVariableBytecode */
			{
				flag("requires currentBytecode to be expanded to a constant");
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				longAtput((localHomeContext + (BASE_HEADER_SIZE)) + (((111 & 7) + TempFrameStart) << (SHIFT_FOR_WORD)), longAtPointer(localSP));
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 112:
			/* pushReceiverBytecode */
			{
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), foo->receiver);
			}
;
			break;
		case 113:
			/* pushConstantTrueBytecode */
			{
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
			}
;
			break;
		case 114:
			/* pushConstantFalseBytecode */
			{
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
			}
;
			break;
		case 115:
			/* pushConstantNilBytecode */
			{
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), foo->nilObj);
			}
;
			break;
		case 116:
			/* pushConstantMinusOneBytecode */
			{
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), ConstMinusOne);
			}
;
			break;
		case 117:
			/* pushConstantZeroBytecode */
			{
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), ConstZero);
			}
;
			break;
		case 118:
			/* pushConstantOneBytecode */
			{
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), ConstOne);
			}
;
			break;
		case 119:
			/* pushConstantTwoBytecode */
			{
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), ConstTwo);
			}
;
			break;
		case 120:
			/* returnReceiver */
			{
				sqInt closureOrNil;
				sqInt context;
				/* begin sender */
				context = localHomeContext;
				while (((closureOrNil = longAt((context + (BASE_HEADER_SIZE)) + (ClosureIndex << (SHIFT_FOR_WORD))))) != foo->nilObj) {
					context = longAt((closureOrNil + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)));
				}
				localReturnContext = longAt((context + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
				localReturnValue = foo->receiver;
				/* goto commonReturn */
			}
;
			
		commonReturn:
			/* commonReturn */
			{
				sqInt contextOfCaller;
				sqInt localCntx;
				sqInt localVal;
				sqInt nilOop;
				sqInt thisCntx;
				sqInt unwindMarked;
				sqInt header;
				sqInt meth;
				sqInt pIndex;
				sqInt primBits;
				sqInt header1;
				sqInt tmp;
				nilOop = foo->nilObj;
				thisCntx = foo->activeContext;
				localCntx = localReturnContext;
				localVal = localReturnValue;
				if ((localCntx == nilOop) || ((longAt((localCntx + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) == nilOop)) {
					/* begin internalCannotReturn: */
					foo->reclaimableContextCount = 0;
					/* begin internalPush: */
					longAtPointerput((localSP += BYTES_PER_WORD), foo->activeContext);
					/* begin internalPush: */
					longAtPointerput((localSP += BYTES_PER_WORD), localVal);
					foo->messageSelector = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorCannotReturn << (SHIFT_FOR_WORD)));
					foo->argumentCount = 1;
					goto normalSend;
					goto l41;
				}
				thisCntx = longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
				while (!(thisCntx == localCntx)) {
					if (thisCntx == nilOop) {
						/* begin internalCannotReturn: */
						foo->reclaimableContextCount = 0;
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->activeContext);
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), localVal);
						foo->messageSelector = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorCannotReturn << (SHIFT_FOR_WORD)));
						foo->argumentCount = 1;
						goto normalSend;
						goto l41;
					}
					/* begin isUnwindMarked: */
					header = longAt(thisCntx);
					if (!(((((usqInt) header) >> 12) & 0x1F) == 14)) {
						unwindMarked = 0;
						goto l42;
					}
					meth = longAt((thisCntx + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
					/* begin primitiveIndexOf: */
					primBits = (((usqInt) (longAt((meth + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 1) & 268435967;
					pIndex = (primBits & 0x1FF) + (((usqInt) primBits) >> 19);
					unwindMarked = pIndex == 198;
				l42:	/* end isUnwindMarked: */;
					if (unwindMarked) {
						/* begin internalAboutToReturn:through: */
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->activeContext);
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), localVal);
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), thisCntx);
						foo->messageSelector = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorAboutToReturn << (SHIFT_FOR_WORD)));
						foo->argumentCount = 2;
						goto normalSend;
						goto l41;
					}
					thisCntx = longAt((thisCntx + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
				}
				thisCntx = foo->activeContext;
				while (!(thisCntx == localCntx)) {
					contextOfCaller = longAt((thisCntx + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
					longAtput((thisCntx + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)), nilOop);
					longAtput((thisCntx + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), nilOop);
					if (foo->reclaimableContextCount > 0) {
						foo->reclaimableContextCount -= 1;
						/* begin recycleContextIfPossible: */
						if ((((usqInt) thisCntx)) >= (((usqInt) foo->youngStart))) {
							header1 = longAt(thisCntx);
							if (((((usqInt) header1) >> 12) & 0x1F) == 14) {
								if ((header1 & (SIZE_MASK)) == (SMALL_CONTEXT_SIZE)) {
									longAtput((thisCntx + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), foo->freeContexts);
									foo->freeContexts = thisCntx;
								}
								if ((header1 & (SIZE_MASK)) == (LARGE_CONTEXT_SIZE)) {
									longAtput((thisCntx + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), foo->freeLargeContexts);
									foo->freeLargeContexts = thisCntx;
								}
							}
						}
					}
					thisCntx = contextOfCaller;
				}
				foo->activeContext = thisCntx;
				if ((((usqInt) thisCntx)) < (((usqInt) foo->youngStart))) {
					beRootIfOld(thisCntx);
				}
				/* begin internalFetchContextRegisters: */
				tmp = longAt((thisCntx + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
				if ((tmp & 1)) {
					tmp = longAt((thisCntx + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
					if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
						beRootIfOld(tmp);
					}
				} else {
					tmp = thisCntx;
				}
				localHomeContext = tmp;
				foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
				foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
				tmp = ((longAt((thisCntx + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
				localIP = pointerForOop(((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2);
				tmp = ((longAt((thisCntx + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
				localSP = pointerForOop((thisCntx + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD)));
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), localVal);
			}
;
		l41:	/* end case */;
			break;
		case 121:
			/* returnTrue */
			{
				sqInt closureOrNil;
				sqInt context;
				/* begin sender */
				context = localHomeContext;
				while (((closureOrNil = longAt((context + (BASE_HEADER_SIZE)) + (ClosureIndex << (SHIFT_FOR_WORD))))) != foo->nilObj) {
					context = longAt((closureOrNil + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)));
				}
				localReturnContext = longAt((context + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
				localReturnValue = foo->trueObj;
				goto commonReturn;
			}
;
			break;
		case 122:
			/* returnFalse */
			{
				sqInt closureOrNil;
				sqInt context;
				/* begin sender */
				context = localHomeContext;
				while (((closureOrNil = longAt((context + (BASE_HEADER_SIZE)) + (ClosureIndex << (SHIFT_FOR_WORD))))) != foo->nilObj) {
					context = longAt((closureOrNil + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)));
				}
				localReturnContext = longAt((context + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
				localReturnValue = foo->falseObj;
				goto commonReturn;
			}
;
			break;
		case 123:
			/* returnNil */
			{
				sqInt closureOrNil;
				sqInt context;
				/* begin sender */
				context = localHomeContext;
				while (((closureOrNil = longAt((context + (BASE_HEADER_SIZE)) + (ClosureIndex << (SHIFT_FOR_WORD))))) != foo->nilObj) {
					context = longAt((closureOrNil + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)));
				}
				localReturnContext = longAt((context + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
				localReturnValue = foo->nilObj;
				goto commonReturn;
			}
;
			break;
		case 124:
			/* returnTopFromMethod */
			{
				sqInt closureOrNil;
				sqInt context;
				/* begin sender */
				context = localHomeContext;
				while (((closureOrNil = longAt((context + (BASE_HEADER_SIZE)) + (ClosureIndex << (SHIFT_FOR_WORD))))) != foo->nilObj) {
					context = longAt((closureOrNil + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)));
				}
				localReturnContext = longAt((context + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
				localReturnValue = longAtPointer(localSP);
				goto commonReturn;
			}
;
			break;
		case 125:
			/* returnTopFromBlock */
			{
				localReturnContext = longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (CallerIndex << (SHIFT_FOR_WORD)));
				localReturnValue = longAtPointer(localSP);
				goto commonReturn;
			}
;
			break;
		case 126:
		case 127:
			/* unknownBytecode */
			{
				error("Unknown bytecode");
			}
;
			break;
		case 128:
			/* extendedPushBytecode */
			{
				sqInt descriptor;
				sqInt variableIndex;
				sqInt variableType;
				sqInt object;
				sqInt object1;
				sqInt object2;
				sqInt object3;
				sqInt oop;
				descriptor = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				variableType = (((usqInt) descriptor) >> 6) & 3;
				variableIndex = descriptor & 0x3F;
				if (variableType == 0) {
					/* begin pushReceiverVariable: */
					/* begin internalPush: */
					object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + (variableIndex << (SHIFT_FOR_WORD)));
					longAtPointerput((localSP += BYTES_PER_WORD), object);
					goto l1;
				}
				if (variableType == 1) {
					/* begin pushTemporaryVariable: */
					/* begin internalPush: */
					object1 = longAt((localHomeContext + (BASE_HEADER_SIZE)) + ((variableIndex + TempFrameStart) << (SHIFT_FOR_WORD)));
					longAtPointerput((localSP += BYTES_PER_WORD), object1);
					goto l1;
				}
				if (variableType == 2) {
					/* begin pushLiteralConstant: */
					/* begin internalPush: */
					object2 = longAt((foo->method + (BASE_HEADER_SIZE)) + ((variableIndex + LiteralStart) << (SHIFT_FOR_WORD)));
					longAtPointerput((localSP += BYTES_PER_WORD), object2);
					goto l1;
				}
				if (variableType == 3) {
					/* begin pushLiteralVariable: */
					/* begin internalPush: */
					/* begin fetchPointer:ofObject: */
					oop = longAt((foo->method + (BASE_HEADER_SIZE)) + ((variableIndex + LiteralStart) << (SHIFT_FOR_WORD)));
					object3 = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
					longAtPointerput((localSP += BYTES_PER_WORD), object3);
					goto l1;
				}
			}
;
		l1:	/* end case */;
			break;
		case 129:
			/* extendedStoreBytecode */
			{
				sqInt association;
				sqInt descriptor;
				sqInt variableIndex;
				sqInt variableType;
				descriptor = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				variableType = (((usqInt) descriptor) >> 6) & 3;
				variableIndex = descriptor & 0x3F;
				if (variableType == 0) {
					/* begin storePointer:ofObject:withValue: */
					if ((((usqInt) foo->receiver)) < (((usqInt) foo->youngStart))) {
						possibleRootStoreIntovalue(foo->receiver, longAtPointer(localSP));
					}
					longAtput((foo->receiver + (BASE_HEADER_SIZE)) + (variableIndex << (SHIFT_FOR_WORD)), longAtPointer(localSP));
					goto l2;
				}
				if (variableType == 1) {
					longAtput((localHomeContext + (BASE_HEADER_SIZE)) + ((variableIndex + TempFrameStart) << (SHIFT_FOR_WORD)), longAtPointer(localSP));
					goto l2;
				}
				if (variableType == 2) {
					error("illegal store");
				}
				if (variableType == 3) {
					association = longAt((foo->method + (BASE_HEADER_SIZE)) + ((variableIndex + LiteralStart) << (SHIFT_FOR_WORD)));
					/* begin storePointer:ofObject:withValue: */
					if ((((usqInt) association)) < (((usqInt) foo->youngStart))) {
						possibleRootStoreIntovalue(association, longAtPointer(localSP));
					}
					longAtput((association + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)), longAtPointer(localSP));
					goto l2;
				}
			}
;
		l2:	/* end case */;
			break;
		case 130:
			/* extendedStoreAndPopBytecode */
			{
				sqInt association;
				sqInt descriptor;
				sqInt variableIndex;
				sqInt variableType;
				/* begin extendedStoreBytecode */
				descriptor = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				variableType = (((usqInt) descriptor) >> 6) & 3;
				variableIndex = descriptor & 0x3F;
				if (variableType == 0) {
					/* begin storePointer:ofObject:withValue: */
					if ((((usqInt) foo->receiver)) < (((usqInt) foo->youngStart))) {
						possibleRootStoreIntovalue(foo->receiver, longAtPointer(localSP));
					}
					longAtput((foo->receiver + (BASE_HEADER_SIZE)) + (variableIndex << (SHIFT_FOR_WORD)), longAtPointer(localSP));
					goto l3;
				}
				if (variableType == 1) {
					longAtput((localHomeContext + (BASE_HEADER_SIZE)) + ((variableIndex + TempFrameStart) << (SHIFT_FOR_WORD)), longAtPointer(localSP));
					goto l3;
				}
				if (variableType == 2) {
					error("illegal store");
				}
				if (variableType == 3) {
					association = longAt((foo->method + (BASE_HEADER_SIZE)) + ((variableIndex + LiteralStart) << (SHIFT_FOR_WORD)));
					/* begin storePointer:ofObject:withValue: */
					if ((((usqInt) association)) < (((usqInt) foo->youngStart))) {
						possibleRootStoreIntovalue(association, longAtPointer(localSP));
					}
					longAtput((association + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)), longAtPointer(localSP));
					goto l3;
				}
			l3:	/* end extendedStoreBytecode */;
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 131:
			/* singleExtendedSendBytecode */
			{
				sqInt descriptor;
				descriptor = byteAtPointer(++localIP);
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((descriptor & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((usqInt) descriptor) >> 5;
				/* goto normalSend */
			}
;
			
		normalSend:
			/* normalSend */
			{
				sqInt rcvr;
				sqInt ccIndex;
				sqInt oop1;
				rcvr = longAtPointer(localSP - (foo->argumentCount * (BYTES_PER_WORD)));
				/* begin fetchClassOf: */
				if ((rcvr & 1)) {
					foo->lkupClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
					goto l43;
				}
				ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
				if (ccIndex == 0) {
					foo->lkupClass = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
					goto l43;
				} else {
					/* begin fetchPointer:ofObject: */
					oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
					foo->lkupClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
					goto l43;
				}
			l43:	/* end fetchClassOf: */;
				foo->receiverClass = foo->lkupClass;
				/* goto commonSend */
			}
;
			
		commonSend:
			/* commonSend */
			{
				sqInt ok;
				sqInt hash;
				sqInt probe;
				sqInt delta;
				sqInt localPrimIndex;
				sqInt nArgs;
				sqInt oop;
				sqInt argCount2;
				sqInt i;
				sqInt methodHeader;
				sqInt needsLarge;
				sqInt newContext;
				sqInt tempCount;
				sqInt where;
				sqInt tmp;
				sqInt valuePointer;
				/* begin internalFindNewMethod */
				/* begin lookupInMethodCacheSel:class: */
				hash = foo->messageSelector ^ foo->lkupClass;
				probe = hash & MethodCacheMask;
				if (((foo->methodCache[probe + MethodCacheSelector]) == foo->messageSelector) && ((foo->methodCache[probe + MethodCacheClass]) == foo->lkupClass)) {
					foo->newMethod = foo->methodCache[probe + MethodCacheMethod];
					foo->primitiveIndex = foo->methodCache[probe + MethodCachePrim];
					foo->newNativeMethod = foo->methodCache[probe + MethodCacheNative];
					primitiveFunctionPointer = ((void (*)(void)) (foo->methodCache[probe + MethodCachePrimFunction]));
					ok = 1;
					goto l44;
				}
				probe = (((usqInt) hash) >> 1) & MethodCacheMask;
				if (((foo->methodCache[probe + MethodCacheSelector]) == foo->messageSelector) && ((foo->methodCache[probe + MethodCacheClass]) == foo->lkupClass)) {
					foo->newMethod = foo->methodCache[probe + MethodCacheMethod];
					foo->primitiveIndex = foo->methodCache[probe + MethodCachePrim];
					foo->newNativeMethod = foo->methodCache[probe + MethodCacheNative];
					primitiveFunctionPointer = ((void (*)(void)) (foo->methodCache[probe + MethodCachePrimFunction]));
					ok = 1;
					goto l44;
				}
				probe = (((usqInt) hash) >> 2) & MethodCacheMask;
				if (((foo->methodCache[probe + MethodCacheSelector]) == foo->messageSelector) && ((foo->methodCache[probe + MethodCacheClass]) == foo->lkupClass)) {
					foo->newMethod = foo->methodCache[probe + MethodCacheMethod];
					foo->primitiveIndex = foo->methodCache[probe + MethodCachePrim];
					foo->newNativeMethod = foo->methodCache[probe + MethodCacheNative];
					primitiveFunctionPointer = ((void (*)(void)) (foo->methodCache[probe + MethodCachePrimFunction]));
					ok = 1;
					goto l44;
				}
				ok = 0;
			l44:	/* end lookupInMethodCacheSel:class: */;
				if (!(ok)) {
					/* begin externalizeIPandSP */
					foo->instructionPointer = oopForPointer(localIP);
					foo->stackPointer = oopForPointer(localSP);
					foo->theHomeContext = localHomeContext;
					lookupMethodInClass(foo->lkupClass);
					/* begin internalizeIPandSP */
					localIP = pointerForOop(foo->instructionPointer);
					localSP = pointerForOop(foo->stackPointer);
					localHomeContext = foo->theHomeContext;
					addNewMethodToCache();
				}
				/* begin internalExecuteNewMethod */
				localPrimIndex = foo->primitiveIndex;
				if (localPrimIndex > 0) {
					if ((localPrimIndex > 0xFF) && (localPrimIndex < 520)) {
						if (localPrimIndex >= 264) {
							/* begin internalPop:thenPush: */
							oop = longAt(((longAtPointer(localSP)) + (BASE_HEADER_SIZE)) + ((localPrimIndex - 264) << (SHIFT_FOR_WORD)));
							longAtPointerput((localSP -= (1 - 1) * (BYTES_PER_WORD)), oop);
							goto l45;
						} else {
							if (localPrimIndex == 256) {
								goto l45;
							}
							if (localPrimIndex == 257) {
								/* begin internalPop:thenPush: */
								longAtPointerput((localSP -= (1 - 1) * (BYTES_PER_WORD)), foo->trueObj);
								goto l45;
							}
							if (localPrimIndex == 258) {
								/* begin internalPop:thenPush: */
								longAtPointerput((localSP -= (1 - 1) * (BYTES_PER_WORD)), foo->falseObj);
								goto l45;
							}
							if (localPrimIndex == 259) {
								/* begin internalPop:thenPush: */
								longAtPointerput((localSP -= (1 - 1) * (BYTES_PER_WORD)), foo->nilObj);
								goto l45;
							}
							/* begin internalPop:thenPush: */
							longAtPointerput((localSP -= (1 - 1) * (BYTES_PER_WORD)), (((localPrimIndex - 261) << 1) | 1));
							goto l45;
						}
					} else {
						/* begin externalizeIPandSP */
						foo->instructionPointer = oopForPointer(localIP);
						foo->stackPointer = oopForPointer(localSP);
						foo->theHomeContext = localHomeContext;
						if (DoBalanceChecks) {
							nArgs = foo->argumentCount;
							delta = foo->stackPointer - foo->activeContext;
						}
						/* begin initPrimCall */
						foo->primFailCode = 0;
						dispatchFunctionPointer(primitiveFunctionPointer);
						if (DoBalanceChecks) {
							if (!(balancedStackafterPrimitivewithArgs(delta, localPrimIndex, nArgs))) {
								printUnbalancedStack(localPrimIndex);
							}
						}
						/* begin internalizeIPandSP */
						localIP = pointerForOop(foo->instructionPointer);
						localSP = pointerForOop(foo->stackPointer);
						localHomeContext = foo->theHomeContext;
						if (!foo->primFailCode) {
							browserPluginReturnIfNeeded();
							goto l45;
						}
					}
				}
				/* begin internalActivateNewMethod */
				methodHeader = longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD)));
				needsLarge = methodHeader & LargeContextBit;
				if ((needsLarge == 0) && (foo->freeContexts != NilContext)) {
					newContext = foo->freeContexts;
					/* begin setFreeContextsAfter: */
					foo->freeContexts = longAt((newContext + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
				} else {
					/* begin externalizeIPandSP */
					foo->instructionPointer = oopForPointer(localIP);
					foo->stackPointer = oopForPointer(localSP);
					foo->theHomeContext = localHomeContext;
					newContext = allocateOrRecycleContext(needsLarge);
					/* begin internalizeIPandSP */
					localIP = pointerForOop(foo->instructionPointer);
					localSP = pointerForOop(foo->stackPointer);
					localHomeContext = foo->theHomeContext;
				}
				tempCount = (((usqInt) methodHeader) >> 19) & 0x3F;
				where = newContext + (BASE_HEADER_SIZE);
				longAtput(where + (SenderIndex << (SHIFT_FOR_WORD)), foo->activeContext);
				longAtput(where + (InstructionPointerIndex << (SHIFT_FOR_WORD)), (((((LiteralStart + ((((usqInt) methodHeader) >> 10) & 0xFF)) * (BYTES_PER_WORD)) + 1) << 1) | 1));
				longAtput(where + (StackPointerIndex << (SHIFT_FOR_WORD)), ((tempCount << 1) | 1));
				longAtput(where + (MethodIndex << (SHIFT_FOR_WORD)), foo->newMethod);
				longAtput(where + (ClosureIndex << (SHIFT_FOR_WORD)), foo->nilObj);
				argCount2 = foo->argumentCount;
				for (i = 0; i <= argCount2; i += 1) {
					longAtput(where + ((ReceiverIndex + i) << (SHIFT_FOR_WORD)), longAtPointer(localSP - ((argCount2 - i) * (BYTES_PER_WORD))));
				}
				methodHeader = foo->nilObj;
				for (i = ((argCount2 + 1) + ReceiverIndex); i <= (tempCount + ReceiverIndex); i += 1) {
					longAtput(where + (i << (SHIFT_FOR_WORD)), methodHeader);
				}
				/* begin internalPop: */
				localSP -= (argCount2 + 1) * (BYTES_PER_WORD);
				foo->reclaimableContextCount += 1;
				/* begin internalNewActiveContext: */
				/* begin internalStoreContextRegisters: */
				longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), (((((oopForPointer(localIP)) + 2) - (foo->method + (BASE_HEADER_SIZE))) << 1) | 1));
				/* begin storePointerUnchecked:ofObject:withValue: */
				valuePointer = (((((((usqInt) ((oopForPointer(localSP)) - (foo->activeContext + (BASE_HEADER_SIZE)))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
				longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
				if ((((usqInt) newContext)) < (((usqInt) foo->youngStart))) {
					beRootIfOld(newContext);
				}
				foo->activeContext = newContext;
				/* begin internalFetchContextRegisters: */
				tmp = longAt((newContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
				if ((tmp & 1)) {
					tmp = longAt((newContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
					if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
						beRootIfOld(tmp);
					}
				} else {
					tmp = newContext;
				}
				localHomeContext = tmp;
				foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
				foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
				tmp = ((longAt((newContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
				localIP = pointerForOop(((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2);
				tmp = ((longAt((newContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
				localSP = pointerForOop((newContext + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD)));
				/* begin internalQuickCheckForInterrupts */
				if (((foo->interruptCheckCounter -= 1)) <= 0) {
					/* begin externalizeIPandSP */
					foo->instructionPointer = oopForPointer(localIP);
					foo->stackPointer = oopForPointer(localSP);
					foo->theHomeContext = localHomeContext;
					checkForInterrupts();
					browserPluginReturnIfNeeded();
					/* begin internalizeIPandSP */
					localIP = pointerForOop(foo->instructionPointer);
					localSP = pointerForOop(foo->stackPointer);
					localHomeContext = foo->theHomeContext;
				}
			l45:	/* end internalExecuteNewMethod */;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
			}
;
			break;
		case 132:
			/* doubleExtendedDoAnythingBytecode */
			{
				sqInt byte2;
				sqInt byte3;
				sqInt opType;
				sqInt top;
				sqInt oop;
				sqInt object;
				sqInt object1;
				sqInt object2;
				sqInt oop1;
				byte2 = byteAtPointer(++localIP);
				byte3 = byteAtPointer(++localIP);
				opType = ((usqInt) byte2) >> 5;
				if (opType == 0) {
					foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + ((byte3 + LiteralStart) << (SHIFT_FOR_WORD)));
					foo->argumentCount = byte2 & 0x1F;
					goto normalSend;
					goto l4;
				}
				if (opType == 1) {
					foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + ((byte3 + LiteralStart) << (SHIFT_FOR_WORD)));
					foo->argumentCount = byte2 & 0x1F;
					goto commonSupersend;
					goto l4;
				}
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				if (opType == 2) {
					/* begin pushReceiverVariable: */
					/* begin internalPush: */
					object = longAt((foo->receiver + (BASE_HEADER_SIZE)) + (byte3 << (SHIFT_FOR_WORD)));
					longAtPointerput((localSP += BYTES_PER_WORD), object);
					goto l4;
				}
				if (opType == 3) {
					/* begin pushLiteralConstant: */
					/* begin internalPush: */
					object1 = longAt((foo->method + (BASE_HEADER_SIZE)) + ((byte3 + LiteralStart) << (SHIFT_FOR_WORD)));
					longAtPointerput((localSP += BYTES_PER_WORD), object1);
					goto l4;
				}
				if (opType == 4) {
					/* begin pushLiteralVariable: */
					/* begin internalPush: */
					/* begin fetchPointer:ofObject: */
					oop1 = longAt((foo->method + (BASE_HEADER_SIZE)) + ((byte3 + LiteralStart) << (SHIFT_FOR_WORD)));
					object2 = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
					longAtPointerput((localSP += BYTES_PER_WORD), object2);
					goto l4;
				}
				if (opType == 5) {
					top = longAtPointer(localSP);
					/* begin storePointer:ofObject:withValue: */
					if ((((usqInt) foo->receiver)) < (((usqInt) foo->youngStart))) {
						possibleRootStoreIntovalue(foo->receiver, top);
					}
					longAtput((foo->receiver + (BASE_HEADER_SIZE)) + (byte3 << (SHIFT_FOR_WORD)), top);
					goto l4;
				}
				if (opType == 6) {
					top = longAtPointer(localSP);
					/* begin internalPop: */
					localSP -= 1 * (BYTES_PER_WORD);
					/* begin storePointer:ofObject:withValue: */
					if ((((usqInt) foo->receiver)) < (((usqInt) foo->youngStart))) {
						possibleRootStoreIntovalue(foo->receiver, top);
					}
					longAtput((foo->receiver + (BASE_HEADER_SIZE)) + (byte3 << (SHIFT_FOR_WORD)), top);
					goto l4;
				}
				if (opType == 7) {
					top = longAtPointer(localSP);
					/* begin storePointer:ofObject:withValue: */
					oop = longAt((foo->method + (BASE_HEADER_SIZE)) + ((byte3 + LiteralStart) << (SHIFT_FOR_WORD)));
					if ((((usqInt) oop)) < (((usqInt) foo->youngStart))) {
						possibleRootStoreIntovalue(oop, top);
					}
					longAtput((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)), top);
					goto l4;
				}
			}
;
		l4:	/* end case */;
			break;
		case 133:
			/* singleExtendedSuperBytecode */
			{
				sqInt descriptor;
				descriptor = byteAtPointer(++localIP);
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((descriptor & 0x1F) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((usqInt) descriptor) >> 5;
				/* goto commonSupersend */
			}
;
			
		commonSupersend:
			/* superclassSend */
			{
				sqInt rcvr;
				sqInt classPointer;
				sqInt oop;
				sqInt offset;
				sqInt ccIndex;
				sqInt oop1;
				/* begin superclassOf: */
				/* begin fetchPointer:ofObject: */
				/* begin literal:ofMethod: */
				offset = (literalCountOfHeader(longAt((foo->method + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) - 1;
				oop = longAt((foo->method + (BASE_HEADER_SIZE)) + ((offset + LiteralStart) << (SHIFT_FOR_WORD)));
				classPointer = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
				foo->lkupClass = longAt((classPointer + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
				rcvr = longAtPointer(localSP - (foo->argumentCount * (BYTES_PER_WORD)));
				/* begin fetchClassOf: */
				if ((rcvr & 1)) {
					foo->receiverClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
					goto l46;
				}
				ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
				if (ccIndex == 0) {
					foo->receiverClass = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
					goto l46;
				} else {
					/* begin fetchPointer:ofObject: */
					oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
					foo->receiverClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
					goto l46;
				}
			l46:	/* end fetchClassOf: */;
				goto commonSend;
			}
;
			break;
		case 134:
			/* secondExtendedSendBytecode */
			{
				sqInt descriptor;
				descriptor = byteAtPointer(++localIP);
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((descriptor & 0x3F) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((usqInt) descriptor) >> 6;
				goto normalSend;
			}
;
			break;
		case 135:
			/* popStackBytecode */
			{
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 136:
			/* duplicateTopBytecode */
			{
				sqInt object;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				object = longAtPointer(localSP);
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 137:
			/* pushActiveContextBytecode */
			{
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				foo->reclaimableContextCount = 0;
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), foo->activeContext);
			}
;
			break;
		case 138:
			/* pushNewArrayBytecode */
			{
				sqInt array;
				sqInt i;
				sqInt popValues;
				sqInt size;
				size = byteAtPointer(++localIP);
				popValues = size > 0x7F;
				size = size & 0x7F;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin externalizeIPandSP */
				foo->instructionPointer = oopForPointer(localIP);
				foo->stackPointer = oopForPointer(localSP);
				foo->theHomeContext = localHomeContext;
				array = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))), size);
				/* begin internalizeIPandSP */
				localIP = pointerForOop(foo->instructionPointer);
				localSP = pointerForOop(foo->stackPointer);
				localHomeContext = foo->theHomeContext;
				if (popValues) {
					for (i = 0; i <= (size - 1); i += 1) {
						longAtput((array + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)), longAtPointer(localSP - (((size - i) - 1) * (BYTES_PER_WORD))));
					}
					/* begin internalPop: */
					localSP -= size * (BYTES_PER_WORD);
				}
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), array);
			}
;
			break;
		case 139:
			/* unknownBytecode */
			{
				error("Unknown bytecode");
			}
;
			break;
		case 140:
			/* pushRemoteTempLongBytecode */
			{
				sqInt remoteTempIndex;
				sqInt tempVectorIndex;
				sqInt tempVector;
				sqInt object;
				remoteTempIndex = byteAtPointer(++localIP);
				tempVectorIndex = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin pushRemoteTemp:inVectorAt: */
				tempVector = longAt((localHomeContext + (BASE_HEADER_SIZE)) + ((tempVectorIndex + TempFrameStart) << (SHIFT_FOR_WORD)));
				/* begin internalPush: */
				object = longAt((tempVector + (BASE_HEADER_SIZE)) + (remoteTempIndex << (SHIFT_FOR_WORD)));
				longAtPointerput((localSP += BYTES_PER_WORD), object);
			}
;
			break;
		case 141:
			/* storeRemoteTempLongBytecode */
			{
				sqInt remoteTempIndex;
				sqInt tempVectorIndex;
				sqInt tempVector;
				remoteTempIndex = byteAtPointer(++localIP);
				tempVectorIndex = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin storeRemoteTemp:inVectorAt: */
				tempVector = longAt((localHomeContext + (BASE_HEADER_SIZE)) + ((tempVectorIndex + TempFrameStart) << (SHIFT_FOR_WORD)));
				/* begin storePointer:ofObject:withValue: */
				if ((((usqInt) tempVector)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(tempVector, longAtPointer(localSP));
				}
				longAtput((tempVector + (BASE_HEADER_SIZE)) + (remoteTempIndex << (SHIFT_FOR_WORD)), longAtPointer(localSP));
			}
;
			break;
		case 142:
			/* storeAndPopRemoteTempLongBytecode */
			{
				sqInt remoteTempIndex;
				sqInt tempVectorIndex;
				sqInt tempVector;
				/* begin storeRemoteTempLongBytecode */
				remoteTempIndex = byteAtPointer(++localIP);
				tempVectorIndex = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin storeRemoteTemp:inVectorAt: */
				tempVector = longAt((localHomeContext + (BASE_HEADER_SIZE)) + ((tempVectorIndex + TempFrameStart) << (SHIFT_FOR_WORD)));
				/* begin storePointer:ofObject:withValue: */
				if ((((usqInt) tempVector)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(tempVector, longAtPointer(localSP));
				}
				longAtput((tempVector + (BASE_HEADER_SIZE)) + (remoteTempIndex << (SHIFT_FOR_WORD)), longAtPointer(localSP));
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			}
;
			break;
		case 143:
			/* pushClosureCopyCopiedValuesBytecode */
			{
				sqInt blockSize;
				sqInt i;
				sqInt newClosure;
				sqInt numArgs;
				sqInt numArgsNumCopied;
				sqInt numCopied;
				sqInt initialIP;
				sqInt newClosure1;
				if ((BYTES_PER_WORD) == 4) {
					imageFormatVersionNumber = 6504;
				} else {
					imageFormatVersionNumber = 68002;
				}
				numArgsNumCopied = byteAtPointer(++localIP);
				numArgs = numArgsNumCopied & 15;
				numCopied = ((usqInt) numArgsNumCopied >> 4);
				blockSize = (byteAtPointer(++localIP)) << 8;
				blockSize += byteAtPointer(++localIP);
				/* begin externalizeIPandSP */
				foo->instructionPointer = oopForPointer(localIP);
				foo->stackPointer = oopForPointer(localSP);
				foo->theHomeContext = localHomeContext;
				/* begin closureNumArgs:instructionPointer:numCopiedValues: */
				initialIP = ((oopForPointer(localIP)) + 2) - (foo->method + (BASE_HEADER_SIZE));
				newClosure1 = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBlockClosure << (SHIFT_FOR_WORD))), ((BYTES_PER_WORD) * (ClosureFirstCopiedValueIndex + numCopied)) + (BASE_HEADER_SIZE));
				longAtput((newClosure1 + (BASE_HEADER_SIZE)) + (ClosureStartPCIndex << (SHIFT_FOR_WORD)), ((initialIP << 1) | 1));
				longAtput((newClosure1 + (BASE_HEADER_SIZE)) + (ClosureNumArgsIndex << (SHIFT_FOR_WORD)), ((numArgs << 1) | 1));
				newClosure = newClosure1;
				/* begin internalizeIPandSP */
				localIP = pointerForOop(foo->instructionPointer);
				localSP = pointerForOop(foo->stackPointer);
				localHomeContext = foo->theHomeContext;
				longAtput((newClosure + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)), foo->activeContext);
				foo->reclaimableContextCount = 0;
				if (numCopied > 0) {
					for (i = 0; i <= (numCopied - 1); i += 1) {
						longAtput((newClosure + (BASE_HEADER_SIZE)) + ((i + ClosureFirstCopiedValueIndex) << (SHIFT_FOR_WORD)), longAtPointer(localSP - (((numCopied - i) - 1) * (BYTES_PER_WORD))));
					}
					/* begin internalPop: */
					localSP -= numCopied * (BYTES_PER_WORD);
				}
				localIP += blockSize;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				/* begin internalPush: */
				longAtPointerput((localSP += BYTES_PER_WORD), newClosure);
			}
;
			break;
		case 144:
			/* shortUnconditionalJump */
			{
				sqInt offset;
				/* begin jump: */
				offset = (144 & 7) + 1;
				localIP = (localIP + offset) + 1;
				currentBytecode = byteAtPointer(localIP);
			}
;
			break;
		case 145:
			/* shortUnconditionalJump */
			{
				sqInt offset;
				/* begin jump: */
				offset = (145 & 7) + 1;
				localIP = (localIP + offset) + 1;
				currentBytecode = byteAtPointer(localIP);
			}
;
			break;
		case 146:
			/* shortUnconditionalJump */
			{
				sqInt offset;
				/* begin jump: */
				offset = (146 & 7) + 1;
				localIP = (localIP + offset) + 1;
				currentBytecode = byteAtPointer(localIP);
			}
;
			break;
		case 147:
			/* shortUnconditionalJump */
			{
				sqInt offset;
				/* begin jump: */
				offset = (147 & 7) + 1;
				localIP = (localIP + offset) + 1;
				currentBytecode = byteAtPointer(localIP);
			}
;
			break;
		case 148:
			/* shortUnconditionalJump */
			{
				sqInt offset;
				/* begin jump: */
				offset = (148 & 7) + 1;
				localIP = (localIP + offset) + 1;
				currentBytecode = byteAtPointer(localIP);
			}
;
			break;
		case 149:
			/* shortUnconditionalJump */
			{
				sqInt offset;
				/* begin jump: */
				offset = (149 & 7) + 1;
				localIP = (localIP + offset) + 1;
				currentBytecode = byteAtPointer(localIP);
			}
;
			break;
		case 150:
			/* shortUnconditionalJump */
			{
				sqInt offset;
				/* begin jump: */
				offset = (150 & 7) + 1;
				localIP = (localIP + offset) + 1;
				currentBytecode = byteAtPointer(localIP);
			}
;
			break;
		case 151:
			/* shortUnconditionalJump */
			{
				sqInt offset;
				/* begin jump: */
				offset = (151 & 7) + 1;
				localIP = (localIP + offset) + 1;
				currentBytecode = byteAtPointer(localIP);
			}
;
			break;
		case 152:
		case 153:
		case 154:
		case 155:
		case 156:
		case 157:
		case 158:
		case 159:
			/* shortConditionalJump */
			{
				sqInt offset;
				sqInt boolean;
				/* begin jumplfFalseBy: */
				offset = (currentBytecode & 7) + 1;
				boolean = longAtPointer(localSP);
				if (boolean == foo->falseObj) {
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					currentBytecode = byteAtPointer(localIP);
				} else {
					if (!(boolean == foo->trueObj)) {
						foo->messageSelector = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorMustBeBoolean << (SHIFT_FOR_WORD)));
						foo->argumentCount = 0;
						goto normalSend;
						goto l5;
					}
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
				}
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			l5:	/* end jumplfFalseBy: */;
			}
;
			break;
		case 160:
		case 161:
		case 162:
		case 163:
		case 164:
		case 165:
		case 166:
		case 167:
			/* longUnconditionalJump */
			{
				sqInt offset;
				offset = (((currentBytecode & 7) - 4) * 256) + (byteAtPointer(++localIP));
				localIP += offset;
				if (offset < 0) {
					/* begin internalQuickCheckForInterrupts */
					if (((foo->interruptCheckCounter -= 1)) <= 0) {
						/* begin externalizeIPandSP */
						foo->instructionPointer = oopForPointer(localIP);
						foo->stackPointer = oopForPointer(localSP);
						foo->theHomeContext = localHomeContext;
						checkForInterrupts();
						browserPluginReturnIfNeeded();
						/* begin internalizeIPandSP */
						localIP = pointerForOop(foo->instructionPointer);
						localSP = pointerForOop(foo->stackPointer);
						localHomeContext = foo->theHomeContext;
					}
				}
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
			}
;
			break;
		case 168:
		case 169:
		case 170:
		case 171:
			/* longJumpIfTrue */
			{
				sqInt offset;
				sqInt boolean;
				/* begin jumplfTrueBy: */
				offset = ((currentBytecode & 3) * 256) + (byteAtPointer(++localIP));
				boolean = longAtPointer(localSP);
				if (boolean == foo->trueObj) {
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					currentBytecode = byteAtPointer(localIP);
				} else {
					if (!(boolean == foo->falseObj)) {
						foo->messageSelector = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorMustBeBoolean << (SHIFT_FOR_WORD)));
						foo->argumentCount = 0;
						goto normalSend;
						goto l6;
					}
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
				}
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			l6:	/* end jumplfTrueBy: */;
			}
;
			break;
		case 172:
		case 173:
		case 174:
		case 175:
			/* longJumpIfFalse */
			{
				sqInt offset;
				sqInt boolean;
				/* begin jumplfFalseBy: */
				offset = ((currentBytecode & 3) * 256) + (byteAtPointer(++localIP));
				boolean = longAtPointer(localSP);
				if (boolean == foo->falseObj) {
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					currentBytecode = byteAtPointer(localIP);
				} else {
					if (!(boolean == foo->trueObj)) {
						foo->messageSelector = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorMustBeBoolean << (SHIFT_FOR_WORD)));
						foo->argumentCount = 0;
						goto normalSend;
						goto l7;
					}
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
				}
				/* begin internalPop: */
				localSP -= 1 * (BYTES_PER_WORD);
			l7:	/* end jumplfFalseBy: */;
			}
;
			break;
		case 176:
			/* bytecodePrimAdd */
			{
				sqInt arg;
				sqInt rcvr;
				sqInt result;
				sqInt oop;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				if (((rcvr & arg) & 1) != 0) {
					result = ((rcvr >> 1)) + ((arg >> 1));
					if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
						(((((int) result)) ^ ((((int) result)) << 1)) >= 0)
# else
						((result >= -1073741824) && (result <= 0x3FFFFFFF))
# endif  // SQ_HOST32
					) {
						/* begin internalPop:thenPush: */
						longAtPointerput((localSP -= (2 - 1) * (BYTES_PER_WORD)), ((result << 1) | 1));
						/* begin fetchNextBytecode */
						currentBytecode = byteAtPointer(++localIP);
						goto l8;
					}
				} else {
					/* begin initPrimCall */
					foo->primFailCode = 0;
					/* begin externalizeIPandSP */
					foo->instructionPointer = oopForPointer(localIP);
					foo->stackPointer = oopForPointer(localSP);
					foo->theHomeContext = localHomeContext;
					primitiveFloatAddtoArg(rcvr, arg);
					/* begin internalizeIPandSP */
					localIP = pointerForOop(foo->instructionPointer);
					localSP = pointerForOop(foo->stackPointer);
					localHomeContext = foo->theHomeContext;
					if (!foo->primFailCode) {
						/* begin fetchNextBytecode */
						currentBytecode = byteAtPointer(++localIP);
						goto l8;
					}
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((0 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l8:	/* end case */;
			break;
		case 177:
			/* bytecodePrimSubtract */
			{
				sqInt arg;
				sqInt rcvr;
				sqInt result;
				sqInt oop;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				if (((rcvr & arg) & 1) != 0) {
					result = ((rcvr >> 1)) - ((arg >> 1));
					if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
						(((((int) result)) ^ ((((int) result)) << 1)) >= 0)
# else
						((result >= -1073741824) && (result <= 0x3FFFFFFF))
# endif  // SQ_HOST32
					) {
						/* begin internalPop:thenPush: */
						longAtPointerput((localSP -= (2 - 1) * (BYTES_PER_WORD)), ((result << 1) | 1));
						/* begin fetchNextBytecode */
						currentBytecode = byteAtPointer(++localIP);
						goto l9;
					}
				} else {
					/* begin initPrimCall */
					foo->primFailCode = 0;
					/* begin externalizeIPandSP */
					foo->instructionPointer = oopForPointer(localIP);
					foo->stackPointer = oopForPointer(localSP);
					foo->theHomeContext = localHomeContext;
					primitiveFloatSubtractfromArg(rcvr, arg);
					/* begin internalizeIPandSP */
					localIP = pointerForOop(foo->instructionPointer);
					localSP = pointerForOop(foo->stackPointer);
					localHomeContext = foo->theHomeContext;
					if (!foo->primFailCode) {
						/* begin fetchNextBytecode */
						currentBytecode = byteAtPointer(++localIP);
						goto l9;
					}
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((1 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l9:	/* end case */;
			break;
		case 178:
			/* bytecodePrimLessThan */
			{
				sqInt aBool;
				sqInt arg;
				sqInt rcvr;
				sqInt oop;
				sqInt bytecode;
				sqInt offset;
				sqInt bytecode1;
				sqInt offset1;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				if (((rcvr & arg) & 1) != 0) {
					;
					/* begin booleanCheat: */
					bytecode = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode < 160) && (bytecode > 151)) {
						if (rcvr < arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l10;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l10;
						}
					}
					if (bytecode == 172) {
						offset = byteAtPointer(++localIP);
						if (rcvr < arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l10;
						} else {
							/* begin jump: */
							localIP = (localIP + offset) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l10;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (rcvr < arg) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l10;
				}
				/* begin initPrimCall */
				foo->primFailCode = 0;
				aBool = primitiveFloatLessthanArg(rcvr, arg);
				if (!foo->primFailCode) {
					/* begin booleanCheat: */
					bytecode1 = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode1 < 160) && (bytecode1 > 151)) {
						if (aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l10;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode1 - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l10;
						}
					}
					if (bytecode1 == 172) {
						offset1 = byteAtPointer(++localIP);
						if (aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l10;
						} else {
							/* begin jump: */
							localIP = (localIP + offset1) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l10;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (aBool) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l10;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((2 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l10:	/* end case */;
			break;
		case 179:
			/* bytecodePrimGreaterThan */
			{
				sqInt aBool;
				sqInt arg;
				sqInt rcvr;
				sqInt oop;
				sqInt bytecode;
				sqInt offset;
				sqInt bytecode1;
				sqInt offset1;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				if (((rcvr & arg) & 1) != 0) {
					;
					/* begin booleanCheat: */
					bytecode = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode < 160) && (bytecode > 151)) {
						if (rcvr > arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l11;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l11;
						}
					}
					if (bytecode == 172) {
						offset = byteAtPointer(++localIP);
						if (rcvr > arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l11;
						} else {
							/* begin jump: */
							localIP = (localIP + offset) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l11;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (rcvr > arg) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l11;
				}
				/* begin initPrimCall */
				foo->primFailCode = 0;
				aBool = primitiveFloatGreaterthanArg(rcvr, arg);
				if (!foo->primFailCode) {
					/* begin booleanCheat: */
					bytecode1 = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode1 < 160) && (bytecode1 > 151)) {
						if (aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l11;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode1 - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l11;
						}
					}
					if (bytecode1 == 172) {
						offset1 = byteAtPointer(++localIP);
						if (aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l11;
						} else {
							/* begin jump: */
							localIP = (localIP + offset1) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l11;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (aBool) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l11;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((3 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l11:	/* end case */;
			break;
		case 180:
			/* bytecodePrimLessOrEqual */
			{
				sqInt aBool;
				sqInt arg;
				sqInt rcvr;
				sqInt oop;
				sqInt bytecode;
				sqInt offset;
				sqInt bytecode1;
				sqInt offset1;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				if (((rcvr & arg) & 1) != 0) {
					;
					/* begin booleanCheat: */
					bytecode = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode < 160) && (bytecode > 151)) {
						if (rcvr <= arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l12;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l12;
						}
					}
					if (bytecode == 172) {
						offset = byteAtPointer(++localIP);
						if (rcvr <= arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l12;
						} else {
							/* begin jump: */
							localIP = (localIP + offset) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l12;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (rcvr <= arg) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l12;
				}
				/* begin initPrimCall */
				foo->primFailCode = 0;
				aBool = primitiveFloatLessOrEqualtoArg(rcvr, arg);
				if (!foo->primFailCode) {
					/* begin booleanCheat: */
					bytecode1 = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode1 < 160) && (bytecode1 > 151)) {
						if (aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l12;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode1 - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l12;
						}
					}
					if (bytecode1 == 172) {
						offset1 = byteAtPointer(++localIP);
						if (aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l12;
						} else {
							/* begin jump: */
							localIP = (localIP + offset1) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l12;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (aBool) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l12;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((4 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l12:	/* end case */;
			break;
		case 181:
			/* bytecodePrimGreaterOrEqual */
			{
				sqInt aBool;
				sqInt arg;
				sqInt rcvr;
				sqInt oop;
				sqInt bytecode;
				sqInt offset;
				sqInt bytecode1;
				sqInt offset1;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				if (((rcvr & arg) & 1) != 0) {
					/* begin booleanCheat: */
					bytecode = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode < 160) && (bytecode > 151)) {
						if (rcvr >= arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l13;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l13;
						}
					}
					if (bytecode == 172) {
						offset = byteAtPointer(++localIP);
						if (rcvr >= arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l13;
						} else {
							/* begin jump: */
							localIP = (localIP + offset) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l13;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (rcvr >= arg) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l13;
				}
				/* begin initPrimCall */
				foo->primFailCode = 0;
				aBool = primitiveFloatGreaterOrEqualtoArg(rcvr, arg);
				if (!foo->primFailCode) {
					/* begin booleanCheat: */
					bytecode1 = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode1 < 160) && (bytecode1 > 151)) {
						if (aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l13;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode1 - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l13;
						}
					}
					if (bytecode1 == 172) {
						offset1 = byteAtPointer(++localIP);
						if (aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l13;
						} else {
							/* begin jump: */
							localIP = (localIP + offset1) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l13;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (aBool) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l13;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((5 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l13:	/* end case */;
			break;
		case 182:
			/* bytecodePrimEqual */
			{
				sqInt aBool;
				sqInt arg;
				sqInt rcvr;
				sqInt oop;
				sqInt bytecode;
				sqInt offset;
				sqInt bytecode1;
				sqInt offset1;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				if (((rcvr & arg) & 1) != 0) {
					/* begin booleanCheat: */
					bytecode = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode < 160) && (bytecode > 151)) {
						if (rcvr == arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l14;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l14;
						}
					}
					if (bytecode == 172) {
						offset = byteAtPointer(++localIP);
						if (rcvr == arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l14;
						} else {
							/* begin jump: */
							localIP = (localIP + offset) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l14;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (rcvr == arg) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l14;
				}
				/* begin initPrimCall */
				foo->primFailCode = 0;
				aBool = primitiveFloatEqualtoArg(rcvr, arg);
				if (!foo->primFailCode) {
					/* begin booleanCheat: */
					bytecode1 = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode1 < 160) && (bytecode1 > 151)) {
						if (aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l14;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode1 - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l14;
						}
					}
					if (bytecode1 == 172) {
						offset1 = byteAtPointer(++localIP);
						if (aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l14;
						} else {
							/* begin jump: */
							localIP = (localIP + offset1) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l14;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (aBool) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l14;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((6 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l14:	/* end case */;
			break;
		case 183:
			/* bytecodePrimNotEqual */
			{
				sqInt aBool;
				sqInt arg;
				sqInt rcvr;
				sqInt oop;
				sqInt bytecode;
				sqInt offset;
				sqInt bytecode1;
				sqInt offset1;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				if (((rcvr & arg) & 1) != 0) {
					/* begin booleanCheat: */
					bytecode = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode < 160) && (bytecode > 151)) {
						if (rcvr != arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l15;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l15;
						}
					}
					if (bytecode == 172) {
						offset = byteAtPointer(++localIP);
						if (rcvr != arg) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l15;
						} else {
							/* begin jump: */
							localIP = (localIP + offset) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l15;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (rcvr != arg) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l15;
				}
				/* begin initPrimCall */
				foo->primFailCode = 0;
				aBool = primitiveFloatEqualtoArg(rcvr, arg);
				if (!foo->primFailCode) {
					/* begin booleanCheat: */
					bytecode1 = byteAtPointer(++localIP);
					/* begin internalPop: */
					localSP -= 2 * (BYTES_PER_WORD);
					if ((bytecode1 < 160) && (bytecode1 > 151)) {
						if (!aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l15;
						} else {
							/* begin jump: */
							localIP = (localIP + (bytecode1 - 151)) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l15;
						}
					}
					if (bytecode1 == 172) {
						offset1 = byteAtPointer(++localIP);
						if (!aBool) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l15;
						} else {
							/* begin jump: */
							localIP = (localIP + offset1) + 1;
							currentBytecode = byteAtPointer(localIP);
							goto l15;
						}
					}
					localIP -= 1;
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					if (!aBool) {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
					} else {
						/* begin internalPush: */
						longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
					}
					goto l15;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((7 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l15:	/* end case */;
			break;
		case 184:
			/* bytecodePrimMultiply */
			{
				sqInt arg;
				sqInt overflow;
				sqInt rcvr;
				sqInt result;
				sqInt oop;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				if (((rcvr & arg) & 1) != 0) {
					rcvr = (rcvr >> 1);
					arg = (arg >> 1);
					overflow = (rcvr > 0
						? (arg > 0
	? rcvr > (0x3FFFFFFF / arg)
	: arg < (-1073741824 / rcvr))
						: (arg > 0
	? rcvr < (-1073741824 / arg)
	: (rcvr < 0) && (arg < (0x3FFFFFFF / rcvr))));
					if (!(overflow)) {
						result = rcvr * arg;
						if ((arg == 0) || (((result / arg) == rcvr) && (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
	(((((int) result)) ^ ((((int) result)) << 1)) >= 0)
# else
	((result >= -1073741824) && (result <= 0x3FFFFFFF))
# endif  // SQ_HOST32
))) {
							/* begin internalPop:thenPush: */
							longAtPointerput((localSP -= (2 - 1) * (BYTES_PER_WORD)), ((result << 1) | 1));
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l16;
						}
					}
				} else {
					/* begin initPrimCall */
					foo->primFailCode = 0;
					/* begin externalizeIPandSP */
					foo->instructionPointer = oopForPointer(localIP);
					foo->stackPointer = oopForPointer(localSP);
					foo->theHomeContext = localHomeContext;
					primitiveFloatMultiplybyArg(rcvr, arg);
					/* begin internalizeIPandSP */
					localIP = pointerForOop(foo->instructionPointer);
					localSP = pointerForOop(foo->stackPointer);
					localHomeContext = foo->theHomeContext;
					if (!foo->primFailCode) {
						/* begin fetchNextBytecode */
						currentBytecode = byteAtPointer(++localIP);
						goto l16;
					}
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((8 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l16:	/* end case */;
			break;
		case 185:
			/* bytecodePrimDivide */
			{
				sqInt arg;
				sqInt rcvr;
				sqInt result;
				sqInt oop;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				if (((rcvr & arg) & 1) != 0) {
					rcvr = (rcvr >> 1);
					arg = (arg >> 1);
					if ((arg != 0) && ((rcvr % arg) == 0)) {
						result = rcvr / arg;
						if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
							(((((int) result)) ^ ((((int) result)) << 1)) >= 0)
# else
							((result >= -1073741824) && (result <= 0x3FFFFFFF))
# endif  // SQ_HOST32
						) {
							/* begin internalPop:thenPush: */
							longAtPointerput((localSP -= (2 - 1) * (BYTES_PER_WORD)), ((result << 1) | 1));
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							goto l17;
						}
					}
				} else {
					/* begin initPrimCall */
					foo->primFailCode = 0;
					/* begin externalizeIPandSP */
					foo->instructionPointer = oopForPointer(localIP);
					foo->stackPointer = oopForPointer(localSP);
					foo->theHomeContext = localHomeContext;
					primitiveFloatDividebyArg(rcvr, arg);
					/* begin internalizeIPandSP */
					localIP = pointerForOop(foo->instructionPointer);
					localSP = pointerForOop(foo->stackPointer);
					localHomeContext = foo->theHomeContext;
					if (!foo->primFailCode) {
						/* begin fetchNextBytecode */
						currentBytecode = byteAtPointer(++localIP);
						goto l17;
					}
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((9 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l17:	/* end case */;
			break;
		case 186:
			/* bytecodePrimMod */
			{
				sqInt mod;
				sqInt oop;
				/* begin initPrimCall */
				foo->primFailCode = 0;
				mod = doPrimitiveModby(longAtPointer(localSP - (1 * (BYTES_PER_WORD))), longAtPointer(localSP - (0 * (BYTES_PER_WORD))));
				if (!foo->primFailCode) {
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP -= (2 - 1) * (BYTES_PER_WORD)), ((mod << 1) | 1));
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					goto l18;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((10 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l18:	/* end case */;
			break;
		case 187:
			/* bytecodePrimMakePoint */
			{
				sqInt oop;
				sqInt argument;
				sqInt pt;
				sqInt rcvr;
				sqInt pointResult;
				sqInt pointResult1;
				sqInt pointResult2;
				sqInt sp;
				/* begin initPrimCall */
				foo->primFailCode = 0;
				/* begin externalizeIPandSP */
				foo->instructionPointer = oopForPointer(localIP);
				foo->stackPointer = oopForPointer(localSP);
				foo->theHomeContext = localHomeContext;
				/* begin primitiveMakePoint */
				argument = longAt(foo->stackPointer);
				rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
				if ((rcvr & 1)) {
					if ((argument & 1)) {
						/* begin makePointwithxValue:yValue: */
						pointResult = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD))), 3 * (BYTES_PER_WORD));
						longAtput((pointResult + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)), ((((rcvr >> 1)) << 1) | 1));
						longAtput((pointResult + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)), ((((argument >> 1)) << 1) | 1));
						pt = pointResult;
					} else {
						/* begin makePointwithxValue:yValue: */
						pointResult1 = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD))), 3 * (BYTES_PER_WORD));
						longAtput((pointResult1 + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)), ((((rcvr >> 1)) << 1) | 1));
						longAtput((pointResult1 + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
						pt = pointResult1;
						/* begin storePointer:ofObject:withValue: */
						if ((((usqInt) pt)) < (((usqInt) foo->youngStart))) {
							possibleRootStoreIntovalue(pt, longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
						}
						longAtput((pt + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
					}
				} else {
					if (!((fetchClassOf(rcvr)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD)))))) {
						/* begin success: */
						if (!(0)) {
							if (!foo->primFailCode) {
								foo->primFailCode = 1;
							}
						}
						goto l20;
					}
					/* begin makePointwithxValue:yValue: */
					pointResult2 = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD))), 3 * (BYTES_PER_WORD));
					longAtput((pointResult2 + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
					longAtput((pointResult2 + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
					pt = pointResult2;
					/* begin storePointer:ofObject:withValue: */
					if ((((usqInt) pt)) < (((usqInt) foo->youngStart))) {
						possibleRootStoreIntovalue(pt, longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
					}
					longAtput((pt + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
					/* begin storePointer:ofObject:withValue: */
					if ((((usqInt) pt)) < (((usqInt) foo->youngStart))) {
						possibleRootStoreIntovalue(pt, longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
					}
					longAtput((pt + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
				}
				/* begin pop:thenPush: */
				longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), pt);
				foo->stackPointer = sp;
			l20:	/* end primitiveMakePoint */;
				/* begin internalizeIPandSP */
				localIP = pointerForOop(foo->instructionPointer);
				localSP = pointerForOop(foo->stackPointer);
				localHomeContext = foo->theHomeContext;
				if (!foo->primFailCode) {
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					goto l19;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((11 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l19:	/* end case */;
			break;
		case 188:
			/* bytecodePrimBitShift */
			{
				sqInt oop;
				/* begin initPrimCall */
				foo->primFailCode = 0;
				/* begin externalizeIPandSP */
				foo->instructionPointer = oopForPointer(localIP);
				foo->stackPointer = oopForPointer(localSP);
				foo->theHomeContext = localHomeContext;
				primitiveBitShift();
				/* begin internalizeIPandSP */
				localIP = pointerForOop(foo->instructionPointer);
				localSP = pointerForOop(foo->stackPointer);
				localHomeContext = foo->theHomeContext;
				if (!foo->primFailCode) {
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					goto l21;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((12 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l21:	/* end case */;
			break;
		case 189:
			/* bytecodePrimDiv */
			{
				sqInt quotient;
				sqInt oop;
				/* begin initPrimCall */
				foo->primFailCode = 0;
				quotient = doPrimitiveDivby(longAtPointer(localSP - (1 * (BYTES_PER_WORD))), longAtPointer(localSP - (0 * (BYTES_PER_WORD))));
				if (!foo->primFailCode) {
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP -= (2 - 1) * (BYTES_PER_WORD)), ((quotient << 1) | 1));
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					goto l22;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((13 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l22:	/* end case */;
			break;
		case 190:
			/* bytecodePrimBitAnd */
			{
				sqInt oop;
				sqInt integerArgument;
				sqInt integerReceiver;
				sqInt object;
				sqInt sp;
				sqInt top;
				sqInt top1;
				sqInt top2;
				sqInt top11;
				/* begin initPrimCall */
				foo->primFailCode = 0;
				/* begin externalizeIPandSP */
				foo->instructionPointer = oopForPointer(localIP);
				foo->stackPointer = oopForPointer(localSP);
				foo->theHomeContext = localHomeContext;
				/* begin primitiveBitAnd */
				/* begin popPos32BitInteger */
				/* begin popStack */
				top1 = longAt(foo->stackPointer);
				foo->stackPointer -= BYTES_PER_WORD;
				top = top1;
				integerArgument = positive32BitValueOf(top);
				/* begin popPos32BitInteger */
				/* begin popStack */
				top11 = longAt(foo->stackPointer);
				foo->stackPointer -= BYTES_PER_WORD;
				top2 = top11;
				integerReceiver = positive32BitValueOf(top2);
				if (!foo->primFailCode) {
					/* begin push: */
					object = positive32BitIntegerFor(integerReceiver & integerArgument);
					longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
					foo->stackPointer = sp;
				} else {
					/* begin unPop: */
					foo->stackPointer += 2 * (BYTES_PER_WORD);
				}
				/* begin internalizeIPandSP */
				localIP = pointerForOop(foo->instructionPointer);
				localSP = pointerForOop(foo->stackPointer);
				localHomeContext = foo->theHomeContext;
				if (!foo->primFailCode) {
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					goto l23;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((14 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l23:	/* end case */;
			break;
		case 191:
			/* bytecodePrimBitOr */
			{
				sqInt oop;
				sqInt integerArgument;
				sqInt integerReceiver;
				sqInt object;
				sqInt sp;
				sqInt top;
				sqInt top1;
				sqInt top2;
				sqInt top11;
				/* begin initPrimCall */
				foo->primFailCode = 0;
				/* begin externalizeIPandSP */
				foo->instructionPointer = oopForPointer(localIP);
				foo->stackPointer = oopForPointer(localSP);
				foo->theHomeContext = localHomeContext;
				/* begin primitiveBitOr */
				/* begin popPos32BitInteger */
				/* begin popStack */
				top1 = longAt(foo->stackPointer);
				foo->stackPointer -= BYTES_PER_WORD;
				top = top1;
				integerArgument = positive32BitValueOf(top);
				/* begin popPos32BitInteger */
				/* begin popStack */
				top11 = longAt(foo->stackPointer);
				foo->stackPointer -= BYTES_PER_WORD;
				top2 = top11;
				integerReceiver = positive32BitValueOf(top2);
				if (!foo->primFailCode) {
					/* begin push: */
					object = positive32BitIntegerFor(integerReceiver | integerArgument);
					longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
					foo->stackPointer = sp;
				} else {
					/* begin unPop: */
					foo->stackPointer += 2 * (BYTES_PER_WORD);
				}
				/* begin internalizeIPandSP */
				localIP = pointerForOop(foo->instructionPointer);
				localSP = pointerForOop(foo->stackPointer);
				localHomeContext = foo->theHomeContext;
				if (!foo->primFailCode) {
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					goto l24;
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((15 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l24:	/* end case */;
			break;
		case 192:
			/* bytecodePrimAt */
			{
				sqInt atIx;
				sqInt index;
				sqInt rcvr;
				sqInt result;
				sqInt oop;
				sqInt fixedFields;
				sqInt fmt;
				sqInt result1;
				sqInt stSize;
				sqInt oop1;
				index = longAtPointer(localSP);
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				if ((!((rcvr & 1))) && ((index & 1))) {
					atIx = rcvr & AtCacheMask;
					if ((foo->atCache[atIx + AtCacheOop]) == rcvr) {
						/* begin commonVariableInternal:at:cacheIndex: */
						stSize = foo->atCache[atIx + AtCacheSize];
						if (((((usqInt) ((index >> 1)))) >= (((usqInt) 1))) && ((((usqInt) ((index >> 1)))) <= (((usqInt) stSize)))) {
							fmt = foo->atCache[atIx + AtCacheFmt];
							if (fmt <= 4) {
								fixedFields = foo->atCache[atIx + AtCacheFixedFields];
								result = longAt((rcvr + (BASE_HEADER_SIZE)) + (((((index >> 1)) + fixedFields) - 1) << (SHIFT_FOR_WORD)));
								goto l26;
							}
							if (fmt < 8) {
								result1 = long32At((rcvr + (BASE_HEADER_SIZE)) + ((((index >> 1)) - 1) << 2));
								/* begin externalizeIPandSP */
								foo->instructionPointer = oopForPointer(localIP);
								foo->stackPointer = oopForPointer(localSP);
								foo->theHomeContext = localHomeContext;
								result1 = positive32BitIntegerFor(result1);
								/* begin internalizeIPandSP */
								localIP = pointerForOop(foo->instructionPointer);
								localSP = pointerForOop(foo->stackPointer);
								localHomeContext = foo->theHomeContext;
								result = result1;
								goto l26;
							}
							if (fmt >= 16) {
								/* begin fetchPointer:ofObject: */
								oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CharacterTable << (SHIFT_FOR_WORD)));
								result = longAt((oop1 + (BASE_HEADER_SIZE)) + ((byteAt((rcvr + (BASE_HEADER_SIZE)) + (((index >> 1)) - 1))) << (SHIFT_FOR_WORD)));
								goto l26;
							} else {
								result = (((byteAt((rcvr + (BASE_HEADER_SIZE)) + (((index >> 1)) - 1))) << 1) | 1);
								goto l26;
							}
						}
						/* begin primitiveFail */
						if (foo->primFailCode == 0) {
							foo->primFailCode = 1;
						}
					l26:	/* end commonVariableInternal:at:cacheIndex: */;
						if (!foo->primFailCode) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							/* begin internalPop:thenPush: */
							longAtPointerput((localSP -= (2 - 1) * (BYTES_PER_WORD)), result);
							goto l25;
						}
					}
				} else {
					/* begin primitiveFail */
					if (foo->primFailCode == 0) {
						foo->primFailCode = 1;
					}
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((16 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
		l25:	/* end case */;
			break;
		case 193:
			/* bytecodePrimAtPut */
			{
				sqInt atIx;
				sqInt index;
				sqInt rcvr;
				sqInt value;
				sqInt oop;
				sqInt fixedFields;
				sqInt fmt;
				sqInt stSize;
				sqInt valToPut;
				value = longAtPointer(localSP);
				index = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				rcvr = longAtPointer(localSP - (2 * (BYTES_PER_WORD)));
				if ((!((rcvr & 1))) && ((index & 1))) {
					atIx = (rcvr & AtCacheMask) + AtPutBase;
					if ((foo->atCache[atIx + AtCacheOop]) == rcvr) {
						/* begin commonVariable:at:put:cacheIndex: */
						stSize = foo->atCache[atIx + AtCacheSize];
						if (((((usqInt) ((index >> 1)))) >= (((usqInt) 1))) && ((((usqInt) ((index >> 1)))) <= (((usqInt) stSize)))) {
							fmt = foo->atCache[atIx + AtCacheFmt];
							if (fmt <= 4) {
								fixedFields = foo->atCache[atIx + AtCacheFixedFields];
								/* begin storePointer:ofObject:withValue: */
								if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
									possibleRootStoreIntovalue(rcvr, value);
								}
								longAtput((rcvr + (BASE_HEADER_SIZE)) + (((((index >> 1)) + fixedFields) - 1) << (SHIFT_FOR_WORD)), value);
								goto l28;
							}
							if (fmt < 8) {
								valToPut = positive32BitValueOf(value);
								if (!foo->primFailCode) {
									long32Atput((rcvr + (BASE_HEADER_SIZE)) + ((((index >> 1)) - 1) << 2), valToPut);
								}
								goto l28;
							}
							if (fmt >= 16) {
								valToPut = asciiOfCharacter(value);
								if (!(!foo->primFailCode)) {
									goto l28;
								}
							} else {
								valToPut = value;
							}
							if ((valToPut & 1)) {
								valToPut = (valToPut >> 1);
								if (!((valToPut >= 0) && (valToPut <= 0xFF))) {
									/* begin primitiveFail */
									if (foo->primFailCode == 0) {
										foo->primFailCode = 1;
									}
									goto l28;
								}
								byteAtput((rcvr + (BASE_HEADER_SIZE)) + (((index >> 1)) - 1), valToPut);
								goto l28;
							}
						}
						/* begin primitiveFail */
						if (foo->primFailCode == 0) {
							foo->primFailCode = 1;
						}
					l28:	/* end commonVariable:at:put:cacheIndex: */;
						if (!foo->primFailCode) {
							/* begin fetchNextBytecode */
							currentBytecode = byteAtPointer(++localIP);
							/* begin internalPop:thenPush: */
							longAtPointerput((localSP -= (3 - 1) * (BYTES_PER_WORD)), value);
							goto l27;
						}
					}
				} else {
					/* begin primitiveFail */
					if (foo->primFailCode == 0) {
						foo->primFailCode = 1;
					}
				}
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((17 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 2;
				goto normalSend;
			}
;
		l27:	/* end case */;
			break;
		case 194:
			/* bytecodePrimSize */
			{
				sqInt oop;
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((18 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 0;
				goto normalSend;
			}
;
			break;
		case 195:
			/* bytecodePrimNext */
			{
				sqInt oop;
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((19 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 0;
				goto normalSend;
			}
;
			break;
		case 196:
			/* bytecodePrimNextPut */
			{
				sqInt oop;
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((20 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
			break;
		case 197:
			/* bytecodePrimAtEnd */
			{
				sqInt oop;
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((21 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 0;
				goto normalSend;
			}
;
			break;
		case 198:
			/* bytecodePrimEquivalent */
			{
				sqInt arg;
				sqInt rcvr;
				sqInt bytecode;
				sqInt offset;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				arg = longAtPointer(localSP - (0 * (BYTES_PER_WORD)));
				/* begin booleanCheat: */
				bytecode = byteAtPointer(++localIP);
				/* begin internalPop: */
				localSP -= 2 * (BYTES_PER_WORD);
				if ((bytecode < 160) && (bytecode > 151)) {
					if (rcvr == arg) {
						/* begin fetchNextBytecode */
						currentBytecode = byteAtPointer(++localIP);
						goto l29;
					} else {
						/* begin jump: */
						localIP = (localIP + (bytecode - 151)) + 1;
						currentBytecode = byteAtPointer(localIP);
						goto l29;
					}
				}
				if (bytecode == 172) {
					offset = byteAtPointer(++localIP);
					if (rcvr == arg) {
						/* begin fetchNextBytecode */
						currentBytecode = byteAtPointer(++localIP);
						goto l29;
					} else {
						/* begin jump: */
						localIP = (localIP + offset) + 1;
						currentBytecode = byteAtPointer(localIP);
						goto l29;
					}
				}
				localIP -= 1;
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
				if (rcvr == arg) {
					/* begin internalPush: */
					longAtPointerput((localSP += BYTES_PER_WORD), foo->trueObj);
				} else {
					/* begin internalPush: */
					longAtPointerput((localSP += BYTES_PER_WORD), foo->falseObj);
				}
			l29:	/* end booleanCheat: */;
			}
;
			break;
		case 199:
			/* bytecodePrimClass */
			{
				sqInt rcvr;
				sqInt oop;
				sqInt ccIndex;
				sqInt oop1;
				rcvr = longAtPointer(localSP);
				/* begin internalPop:thenPush: */
				/* begin fetchClassOf: */
				if ((rcvr & 1)) {
					oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
					goto l30;
				}
				ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
				if (ccIndex == 0) {
					oop = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
					goto l30;
				} else {
					/* begin fetchPointer:ofObject: */
					oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
					oop = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
					goto l30;
				}
			l30:	/* end fetchClassOf: */;
				longAtPointerput((localSP -= (1 - 1) * (BYTES_PER_WORD)), oop);
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
			}
;
			break;
		case 200:
			/* bytecodePrimBlockCopy */
			{
				sqInt hdr;
				sqInt rcvr;
				sqInt oop;
				sqInt successBoolean;
				sqInt context;
				sqInt contextSize;
				sqInt initialIP;
				sqInt methodContext;
				sqInt newContext;
				sqInt header;
				sqInt oop1;
				sqInt sp;
				rcvr = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				/* begin initPrimCall */
				foo->primFailCode = 0;
				hdr = longAt(rcvr);
				/* begin success: */
				successBoolean = (((((usqInt) hdr) >> 12) & 0x1F) == 13) || ((((((usqInt) hdr) >> 12) & 0x1F) == 14) || (((((usqInt) hdr) >> 12) & 0x1F) == 4));
				if (!(successBoolean)) {
					if (!foo->primFailCode) {
						foo->primFailCode = 1;
					}
				}
				if (!foo->primFailCode) {
					/* begin externalizeIPandSP */
					foo->instructionPointer = oopForPointer(localIP);
					foo->stackPointer = oopForPointer(localSP);
					foo->theHomeContext = localHomeContext;
					/* begin primitiveBlockCopy */
					context = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
					if (((longAt((context + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)))) & 1)) {
						methodContext = longAt((context + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
					} else {
						methodContext = context;
					}
					/* begin sizeBitsOf: */
					header = longAt(methodContext);
					if ((header & TypeMask) == HeaderTypeSizeAndClass) {
						contextSize = (longAt(methodContext - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
						goto l32;
					} else {
						contextSize = header & (SIZE_MASK);
						goto l32;
					}
				l32:	/* end sizeBitsOf: */;
					context = null;
					/* begin pushRemappableOop: */
					foo->remapBuffer[(foo->remapBufferCount += 1)] = methodContext;
					newContext = instantiateContextsizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBlockContext << (SHIFT_FOR_WORD))), contextSize);
					/* begin popRemappableOop */
					oop1 = foo->remapBuffer[foo->remapBufferCount];
					foo->remapBufferCount -= 1;
					methodContext = oop1;
					initialIP = (((((foo->instructionPointer + 1) + 3) - (foo->method + (BASE_HEADER_SIZE))) << 1) | 1);
					longAtput((newContext + (BASE_HEADER_SIZE)) + (InitialIPIndex << (SHIFT_FOR_WORD)), initialIP);
					longAtput((newContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), initialIP);
					/* begin storeStackPointerValue:inContext: */
					longAtput((newContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
					longAtput((newContext + (BASE_HEADER_SIZE)) + (BlockArgumentCountIndex << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
					longAtput((newContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)), methodContext);
					longAtput((newContext + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)), foo->nilObj);
					/* begin pop:thenPush: */
					longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), newContext);
					foo->stackPointer = sp;
					/* begin internalizeIPandSP */
					localIP = pointerForOop(foo->instructionPointer);
					localSP = pointerForOop(foo->stackPointer);
					localHomeContext = foo->theHomeContext;
				}
				if (!(!foo->primFailCode)) {
					/* begin fetchPointer:ofObject: */
					oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
					foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((24 * 2) << (SHIFT_FOR_WORD)));
					foo->argumentCount = 1;
					goto normalSend;
					goto l31;
				}
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
			}
;
		l31:	/* end case */;
			break;
		case 201:
			/* bytecodePrimValue */
			{
				sqInt maybeBlock;
				sqInt rcvrClass;
				sqInt oop;
				sqInt ccIndex;
				sqInt oop1;
				maybeBlock = longAtPointer(localSP);
				foo->argumentCount = 0;
				/* begin initPrimCall */
				foo->primFailCode = 0;
				if ((maybeBlock & 1) == 0) {
					/* begin fetchClassOfNonInt: */
					ccIndex = (((usqInt) (longAt(maybeBlock))) >> 12) & 0x1F;
					if (ccIndex == 0) {
						rcvrClass = (longAt(maybeBlock - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
						goto l34;
					} else {
						/* begin fetchPointer:ofObject: */
						oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
						rcvrClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
						goto l34;
					}
				l34:	/* end fetchClassOfNonInt: */;
					if (rcvrClass == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBlockClosure << (SHIFT_FOR_WORD))))) {
						/* begin externalizeIPandSP */
						foo->instructionPointer = oopForPointer(localIP);
						foo->stackPointer = oopForPointer(localSP);
						foo->theHomeContext = localHomeContext;
						primitiveClosureValue();
						/* begin internalizeIPandSP */
						localIP = pointerForOop(foo->instructionPointer);
						localSP = pointerForOop(foo->stackPointer);
						localHomeContext = foo->theHomeContext;
					} else {
						if (rcvrClass == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBlockContext << (SHIFT_FOR_WORD))))) {
							/* begin externalizeIPandSP */
							foo->instructionPointer = oopForPointer(localIP);
							foo->stackPointer = oopForPointer(localSP);
							foo->theHomeContext = localHomeContext;
							primitiveValue();
							/* begin internalizeIPandSP */
							localIP = pointerForOop(foo->instructionPointer);
							localSP = pointerForOop(foo->stackPointer);
							localHomeContext = foo->theHomeContext;
						} else {
							/* begin primitiveFail */
							if (foo->primFailCode == 0) {
								foo->primFailCode = 1;
							}
						}
					}
				}
				if (!(!foo->primFailCode)) {
					/* begin fetchPointer:ofObject: */
					oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
					foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((25 * 2) << (SHIFT_FOR_WORD)));
					goto normalSend;
					goto l33;
				}
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
			}
;
		l33:	/* end case */;
			break;
		case 202:
			/* bytecodePrimValueWithArg */
			{
				sqInt maybeBlock;
				sqInt rcvrClass;
				sqInt oop;
				sqInt ccIndex;
				sqInt oop1;
				maybeBlock = longAtPointer(localSP - (1 * (BYTES_PER_WORD)));
				foo->argumentCount = 1;
				/* begin initPrimCall */
				foo->primFailCode = 0;
				if ((maybeBlock & 1) == 0) {
					/* begin fetchClassOfNonInt: */
					ccIndex = (((usqInt) (longAt(maybeBlock))) >> 12) & 0x1F;
					if (ccIndex == 0) {
						rcvrClass = (longAt(maybeBlock - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
						goto l36;
					} else {
						/* begin fetchPointer:ofObject: */
						oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
						rcvrClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
						goto l36;
					}
				l36:	/* end fetchClassOfNonInt: */;
					if (rcvrClass == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBlockClosure << (SHIFT_FOR_WORD))))) {
						/* begin externalizeIPandSP */
						foo->instructionPointer = oopForPointer(localIP);
						foo->stackPointer = oopForPointer(localSP);
						foo->theHomeContext = localHomeContext;
						primitiveClosureValue();
						/* begin internalizeIPandSP */
						localIP = pointerForOop(foo->instructionPointer);
						localSP = pointerForOop(foo->stackPointer);
						localHomeContext = foo->theHomeContext;
					} else {
						if (rcvrClass == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBlockContext << (SHIFT_FOR_WORD))))) {
							/* begin externalizeIPandSP */
							foo->instructionPointer = oopForPointer(localIP);
							foo->stackPointer = oopForPointer(localSP);
							foo->theHomeContext = localHomeContext;
							primitiveValue();
							/* begin internalizeIPandSP */
							localIP = pointerForOop(foo->instructionPointer);
							localSP = pointerForOop(foo->stackPointer);
							localHomeContext = foo->theHomeContext;
						} else {
							/* begin primitiveFail */
							if (foo->primFailCode == 0) {
								foo->primFailCode = 1;
							}
						}
					}
				}
				if (!(!foo->primFailCode)) {
					/* begin fetchPointer:ofObject: */
					oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
					foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((26 * 2) << (SHIFT_FOR_WORD)));
					goto normalSend;
					goto l35;
				}
				/* begin fetchNextBytecode */
				currentBytecode = byteAtPointer(++localIP);
			}
;
		l35:	/* end case */;
			break;
		case 203:
			/* bytecodePrimDo */
			{
				sqInt oop;
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((27 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
			break;
		case 204:
			/* bytecodePrimNew */
			{
				sqInt oop;
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((28 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 0;
				goto normalSend;
			}
;
			break;
		case 205:
			/* bytecodePrimNewWithArg */
			{
				sqInt oop;
				/* begin fetchPointer:ofObject: */
				oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop + (BASE_HEADER_SIZE)) + ((29 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 1;
				goto normalSend;
			}
;
			break;
		case 206:
			/* bytecodePrimPointX */
			{
				sqInt rcvr;
				sqInt oop;
				sqInt oop1;
				sqInt classOop;
				sqInt ccIndex;
				sqInt cl;
				sqInt oop11;
				/* begin initPrimCall */
				foo->primFailCode = 0;
				rcvr = longAtPointer(localSP);
				/* begin assertClassOf:is: */
				classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD)));
				if ((rcvr & 1)) {
					/* begin primitiveFail */
					if (foo->primFailCode == 0) {
						foo->primFailCode = 1;
					}
					goto l38;
				}
				ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
				if (ccIndex == 0) {
					cl = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
				} else {
					/* begin fetchPointer:ofObject: */
					oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
					cl = longAt((oop11 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
				}
				/* begin success: */
				if (!(cl == classOop)) {
					if (!foo->primFailCode) {
						foo->primFailCode = 1;
					}
				}
			l38:	/* end assertClassOf:is: */;
				if (!foo->primFailCode) {
					/* begin internalPop:thenPush: */
					oop = longAt((rcvr + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)));
					longAtPointerput((localSP -= (1 - 1) * (BYTES_PER_WORD)), oop);
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					goto l37;
				}
				/* begin fetchPointer:ofObject: */
				oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop1 + (BASE_HEADER_SIZE)) + ((30 * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 0;
				goto normalSend;
			}
;
		l37:	/* end case */;
			break;
		case 207:
			/* bytecodePrimPointY */
			{
				sqInt rcvr;
				sqInt oop;
				sqInt oop1;
				sqInt classOop;
				sqInt ccIndex;
				sqInt cl;
				sqInt oop11;
				/* begin initPrimCall */
				foo->primFailCode = 0;
				rcvr = longAtPointer(localSP);
				/* begin assertClassOf:is: */
				classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD)));
				if ((rcvr & 1)) {
					/* begin primitiveFail */
					if (foo->primFailCode == 0) {
						foo->primFailCode = 1;
					}
					goto l40;
				}
				ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
				if (ccIndex == 0) {
					cl = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
				} else {
					/* begin fetchPointer:ofObject: */
					oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
					cl = longAt((oop11 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
				}
				/* begin success: */
				if (!(cl == classOop)) {
					if (!foo->primFailCode) {
						foo->primFailCode = 1;
					}
				}
			l40:	/* end assertClassOf:is: */;
				if (!foo->primFailCode) {
					/* begin internalPop:thenPush: */
					oop = longAt((rcvr + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)));
					longAtPointerput((localSP -= (1 - 1) * (BYTES_PER_WORD)), oop);
					/* begin fetchNextBytecode */
					currentBytecode = byteAtPointer(++localIP);
					goto l39;
				}
				/* begin fetchPointer:ofObject: */
				oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)));
				foo->messageSelector = longAt((oop1 + (BASE_HEADER_SIZE)) + ((0x1F * 2) << (SHIFT_FOR_WORD)));
				foo->argumentCount = 0;
				goto normalSend;
			}
;
		l39:	/* end case */;
			break;
		case 208:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((208 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 208) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 209:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((209 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 209) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 210:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((210 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 210) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 211:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((211 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 211) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 212:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((212 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 212) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 213:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((213 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 213) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 214:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((214 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 214) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 215:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((215 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 215) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 216:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((216 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 216) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 217:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((217 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 217) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 218:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((218 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 218) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 219:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((219 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 219) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 220:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((220 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 220) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 221:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((221 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 221) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 222:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((222 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 222) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 223:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((223 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 223) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 224:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((224 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 224) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 225:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((225 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 225) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 226:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((226 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 226) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 227:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((227 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 227) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 228:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((228 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 228) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 229:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((229 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 229) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 230:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((230 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 230) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 231:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((231 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 231) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 232:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((232 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 232) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 233:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((233 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 233) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 234:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((234 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 234) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 235:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((235 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 235) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 236:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((236 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 236) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 237:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((237 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 237) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 238:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((238 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 238) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 239:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((239 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 239) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 240:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((240 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 240) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 241:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((241 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 241) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 242:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((242 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 242) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 243:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((243 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 243) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 244:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((244 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 244) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 245:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((245 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 245) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 246:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((246 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 246) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 247:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((247 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 247) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 248:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((0xF8 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 0xF8) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 249:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((249 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 249) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 250:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((250 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 250) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 251:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((251 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 251) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 252:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((0xFC & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 0xFC) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 253:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((253 & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 253) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 254:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((0xFE & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 0xFE) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		case 255:
			/* sendLiteralSelectorBytecode */
			{
				foo->messageSelector = longAt((foo->method + (BASE_HEADER_SIZE)) + (((0xFF & 15) + LiteralStart) << (SHIFT_FOR_WORD)));
				foo->argumentCount = ((((usqInt) 0xFF) >> 4) & 3) - 1;
				goto normalSend;
			}
;
			break;
		}
	}

	/* undo the pre-increment of IP before returning */

	localIP -= 1;
	/* begin externalizeIPandSP */
	foo->instructionPointer = oopForPointer(localIP);
	foo->stackPointer = oopForPointer(localSP);
	foo->theHomeContext = localHomeContext;
	return null;
}


/*	the vm has to convert aFilenameString via any canonicalization and char-mapping and put the result in aCharBuffer.
Note the resolveAliases flag - this is an awful artefact of OSX and Apples demented alias handling. When opening a file, the flag must be  true, when closing or renaming it must be false. Sigh. */

sqInt ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean) {
	sqGetFilenameFromString(aCharBuffer, aFilenameString, filenameLength, aBoolean);
	return null;
}


/*	Answer the UTC microseconds since the Smalltalk epoch. The value is
	derived from the Posix epoch (see primitiveUTCMicrosecondClock) with a
	constant offset corresponding to elapsed microseconds between the two
	epochs according to RFC 868. */
/*	Added to Cross/vm/sqVirtualMachine but incompatible with existing timer
	support in Cross. Implemented here to provide the function not present in
	the support code. See also primitiveUTCMicrosecondClock. */

EXPORT(usqLong) ioUTCMicroseconds(void) {
register struct foo * foo = &fum;
    sqLong clock;
    static usqLong epochDelta= 2177452800000000ULL;
    int offset;

	flag("FIXME");
	if ((ioUtcWithOffset(&clock, &offset)) == -1) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	return clock + epochDelta;
}


/*	Support for external primitives. */

sqInt isKindOf(sqInt oop, char *className) {
register struct foo * foo = &fum;
    sqInt oopClass;
    sqInt ccIndex;
    sqInt oop1;

	/* begin fetchClassOf: */
	if ((oop & 1)) {
		oopClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		oopClass = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		oopClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	while (!(oopClass == foo->nilObj)) {
		if (classNameOfIs(oopClass, className)) {
			return 1;
		}
		oopClass = longAt((oopClass + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
	}
	return 0;
}


/*	Support for external primitives. */

sqInt isKindOfClass(sqInt oop, sqInt aClass) {
register struct foo * foo = &fum;
    sqInt oopClass;
    sqInt ccIndex;
    sqInt oop1;

	/* begin fetchClassOf: */
	if ((oop & 1)) {
		oopClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		oopClass = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		oopClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	while (!(oopClass == foo->nilObj)) {
		if (oopClass == aClass) {
			return 1;
		}
		oopClass = longAt((oopClass + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
	}
	return 0;
}


/*	Support for external primitives */

sqInt isMemberOf(sqInt oop, char *className) {
register struct foo * foo = &fum;
    sqInt oopClass;
    sqInt ccIndex;
    sqInt oop1;

	/* begin fetchClassOf: */
	if ((oop & 1)) {
		oopClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		oopClass = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		oopClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	return classNameOfIs(oopClass, className);
}


/*	Answer true if this is an indexable object with pointer elements, e.g., an array */

sqInt isArray(sqInt oop) {
	return ((oop & 1) == 0) && (((((usqInt) (longAt(oop))) >> 8) & 15) == 2);
}


/*	Answer true (non-zero) if running on a big endian machine. */

sqInt isBigEnder(void) {
    sqInt anInt;
    char *cString;
    static sqInt endianness = -1;
    sqInt i;
    sqInt len;

	if (!(endianness == -1)) {
		return endianness;
	}
	len = sizeof(anInt);
	cString = (char *) &anInt;
	i = 0;
	while (i < len) {
		cString[i] = i;
		i += 1;
	}
	endianness = anInt & 0xFF;
	return endianness;
}


/*	Answer true if the argument contains indexable bytes. See comment in formatOf: */
/*	Note: Includes CompiledMethods. */

sqInt isBytes(sqInt oop) {
	return ((oop & 1) == 0) && (((((usqInt) (longAt(oop))) >> 8) & 15) >= 8);
}

sqInt isContext(sqInt oop) {
	return ((oop & 1) == 0) && ((((((usqInt) (longAt(oop))) >> 12) & 0x1F) == 13) || ((((((usqInt) (longAt(oop))) >> 12) & 0x1F) == 14) || (((((usqInt) (longAt(oop))) >> 12) & 0x1F) == 4)));
}


/*	Answer true if size is greater than (((2 raisedTo: 31) - 1) >> bits). Used
	to limit size of allocation requests to 31 bit integer maximum to prevent
	arithmetic overflow in subsequent calculations. Always answers false
	in interpreter simulation.
	
	In the case of a 64-bit object memory running on a 64-bit host platform,
	allow larger allocation requests.

	Assumes that sizeof(int) is 4 for all platforms. */

sqInt isExcessiveAllocationRequestshift(sqInt size, sqInt bits) {
    int int32;
    sqInt int64;
    sqInt shiftCount;


	/* 32 bit signed integer */

	
# ifdef SQ_IMAGE64  // a 64-bit object memory word size
	
# ifdef SQ_HOST64  // running on a 64-bit host platform

	/* use 64 bit check if both image and host are 64 bits */

	int64 = size;
	shiftCount = 0;
	if (int64 < 0) {
		return 1;
	}
	while (shiftCount < bits) {
		int64 = int64 << 1;
		if (int64 < 0) {
			return 1;
		}
		shiftCount += 1;
	}
	return 0;
# else

	/* if sqInt is 64 bit, size parameter may overflow int32 */

	if (size > 0xFFFFFFFFU) {
		return 0;
	}
# endif  // SQ_HOST64
	
# else

	/* common case of 32 bit image on either 32 or 64 bit host */

	int32 = size;
	shiftCount = 0;
	if (int32 < 0) {
		return 1;
	}
	while (shiftCount < bits) {
		int32 = int32 << 1;
		if (int32 < 0) {
			return 1;
		}
		shiftCount += 1;
	}
	return 0;
# endif  // SQ_IMAGE64
	
	return null;
}

sqInt isFloatObject(sqInt oop) {
	return (fetchClassOf(oop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))));
}


/*	Is this a MethodContext whose meth has a primitive number of 199? */
/*	NB: the use of a primitive number for marking the method is pretty grungy, but it is simple to use for a test sytem, not too expensive and we don't actually have the two spare method header bits we need. We can probably obtain them when the method format is changed.
	NB 2: actually, the jitter will probably implement the prim to actually mark the volatile frame by changing the return function pointer. */

sqInt isHandlerMarked(sqInt aContext) {
    sqInt header;
    sqInt meth;
    sqInt pIndex;
    sqInt primBits;

	header = longAt(aContext);
	if (!(((((usqInt) header) >> 12) & 0x1F) == 14)) {
		return 0;
	}
	meth = longAt((aContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	/* begin primitiveIndexOf: */
	primBits = (((usqInt) (longAt((meth + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 1) & 268435967;
	pIndex = (primBits & 0x1FF) + (((usqInt) primBits) >> 19);
	return pIndex == 199;
}


/*	Return true if the given address is in ST object memory */

sqInt isInMemory(sqInt address) {
	return ((((usqInt) address)) >= (((usqInt) memory))) && ((((usqInt) address)) < (((usqInt) foo->endOfMemory)));
}

sqInt isIndexable(sqInt oop) {
	return ((((usqInt) (longAt(oop))) >> 8) & 15) >= 2;
}

sqInt isIntegerObject(sqInt objectPointer) {
	return (objectPointer & 1) > 0;
}


/*	Return true if the given value can be represented as a Smalltalk integer value. */
/*	Use a shift and XOR to set the sign bit if and only if the top two bits of the given
	value are the same, then test the sign bit. Note that the top two bits are equal for
	exactly those integers in the range that can be represented in 31-bits or 63-bits.

	Operands are coerced to machine integer size so the test will work with 64 bit
	images on 32 bit hosts. When running on a 32 bit host, the cast to int has little
	or no performance impact for either 32 bit or 64 bit images.

	On a 64 bit host, the shift and XOR test is replaced by an explicit range check,
	which provides the best performance for both 32 bit and 64 bit images.

	If the range of small integers is enlarged for 64 bit images, this method must
	be updated accordingly. */

sqInt isIntegerValue(sqInt intValue) {
	return 
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
		(((((int) intValue)) ^ ((((int) intValue)) << 1)) >= 0)
# else
		((intValue >= -1073741824) && (intValue <= 0x3FFFFFFF))
# endif  // SQ_HOST32
	;
}


/*	Answer true if integer object is negative.
	Fail if object pointed by oop i not an integer. */

sqInt isNegativeIntegerValueOf(sqInt oop) {
register struct foo * foo = &fum;
    sqInt ok;
    sqInt smallInt;
    sqInt classOop;
    sqInt ccIndex;
    sqInt classOop1;
    sqInt ccIndex1;

	if ((oop & 1)) {
		smallInt = (oop >> 1);
		return smallInt < 0;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD)));
	assert(!((oop & 1)));
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	ok = (ClassLargePositiveIntegerCompactIndex == 0
		? (ccIndex == 0
	? ((longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK)) == classOop
	: 0)
		: ClassLargePositiveIntegerCompactIndex == ccIndex);
	if (ok) {
		return 0;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	classOop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargeNegativeInteger << (SHIFT_FOR_WORD)));
	assert(!((oop & 1)));
	ccIndex1 = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	ok = (ClassLargeNegativeIntegerCompactIndex == 0
		? (ccIndex1 == 0
	? ((longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK)) == classOop1
	: 0)
		: ClassLargeNegativeIntegerCompactIndex == ccIndex1);
	if (ok) {
		return 1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return 0;
}

sqInt isNonImmediate(sqInt anOop) {
	return (anOop & 1) == 0;
}


/*	Answer true if the argument has only fields that can hold oops. See comment in formatOf: */

sqInt isPointers(sqInt oop) {
	return ((oop & 1) == 0) && (((((usqInt) (longAt(oop))) >> 8) & 15) <= 4);
}


/*	Answer true if the argument has only weak fields that can hold oops. See comment in formatOf: */

sqInt isWeak(sqInt oop) {
	return ((oop & 1) == 0) && (((((usqInt) (longAt(oop))) >> 8) & 15) == 4);
}


/*	Answer true if the argument contains only indexable words (no oops). See comment in formatOf: */

sqInt isWords(sqInt oop) {
	return ((oop & 1) == 0) && (((((usqInt) (longAt(oop))) >> 8) & 15) == 6);
}


/*	Answer true if the contains only indexable words or bytes (no oops). See comment in formatOf: */
/*	Note: Excludes CompiledMethods. */

sqInt isWordsOrBytes(sqInt oop) {
	return ((oop & 1) == 0) && (isWordsOrBytesNonInt(oop));
}


/*	Answer true if the contains only indexable words or bytes (no oops). See comment in formatOf: */
/*	Note: Excludes CompiledMethods. */

sqInt isWordsOrBytesNonInt(sqInt oop) {
    sqInt fmt;

	fmt = (((usqInt) (longAt(oop))) >> 8) & 15;
	return (fmt == 6) || ((fmt >= 8) && (fmt <= 11));
}

sqInt isYoung(sqInt oop) {
	return ((oop & 1) == 0) && ((((usqInt) oop)) >= (((usqInt) foo->youngStart)));
}


/*	Return the byte offset of the last pointer field of the given object.  
	Works with CompiledMethods, as well as ordinary objects. 
	Can be used even when the type bits are not correct. */

sqInt lastPointerOf(sqInt oop) {
    sqInt contextSize;
    sqInt fmt;
    sqInt header;
    sqInt methodHeader;
    sqInt sz;
    sqInt sp;
    sqInt header1;
    sqInt type;

	header = longAt(oop);
	fmt = (((usqInt) header) >> 8) & 15;
	if (fmt <= 4) {
		if ((fmt == 3) && ((((((usqInt) header) >> 12) & 0x1F) == 13) || ((((((usqInt) header) >> 12) & 0x1F) == 14) || (((((usqInt) header) >> 12) & 0x1F) == 4)))) {

			/* contexts end at the stack pointer */

			/* begin fetchStackPointerOf: */
			sp = longAt((oop + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
			if (!((sp & 1))) {
				contextSize = 0;
				goto l1;
			}
			contextSize = (sp >> 1);
		l1:	/* end fetchStackPointerOf: */;
			return (CtxtTempFrameStart + contextSize) * (BYTES_PER_WORD);
		}
		/* begin sizeBitsOfSafe: */
		header1 = longAt(oop);
		/* begin rightType: */
		if ((header1 & (SIZE_MASK)) == 0) {
			type = HeaderTypeSizeAndClass;
			goto l2;
		} else {
			if ((header1 & CompactClassMask) == 0) {
				type = HeaderTypeClass;
				goto l2;
			} else {
				type = HeaderTypeShort;
				goto l2;
			}
		}
	l2:	/* end rightType: */;
		if (type == HeaderTypeSizeAndClass) {
			sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
			goto l3;
		} else {
			sz = header1 & (SIZE_MASK);
			goto l3;
		}
	l3:	/* end sizeBitsOfSafe: */;
		return sz - (BASE_HEADER_SIZE);
	}
	if (fmt < 12) {
		return 0;
	}
	methodHeader = longAt(oop + (BASE_HEADER_SIZE));
	return (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
}


/*	Return the number of indexable bytes or words in the given object. Assume the argument is not an integer. For a CompiledMethod, the size of the method header (in bytes) should be subtracted from the result. */

sqInt lengthOf(sqInt oop) {
    sqInt header;
    sqInt sz;

	header = longAt(oop);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = header & (SIZE_MASK);
	}
	sz -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		return ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		return ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
	} else {
		return (sz - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
	}
	return null;
}

sqInt literalofMethod(sqInt offset, sqInt methodPointer) {
	return longAt((methodPointer + (BASE_HEADER_SIZE)) + ((offset + LiteralStart) << (SHIFT_FOR_WORD)));
}

sqInt literalCountOf(sqInt methodPointer) {
    sqInt headerPointer;

	/* begin literalCountOfHeader: */
	headerPointer = longAt((methodPointer + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD)));
	return (((usqInt) headerPointer) >> 10) & 0xFF;
}

sqInt literalCountOfHeader(sqInt headerPointer) {
	return (((usqInt) headerPointer) >> 10) & 0xFF;
}


/*	This entry point needs to be implemented for the interpreter proxy.
	Since BitBlt is now a plugin we need to look up BitBltPlugin:=loadBitBltFrom
	and call it. This entire mechanism should eventually go away and be
	replaced with a dynamic lookup from BitBltPlugin itself but for backward
	compatibility this stub is provided */

sqInt loadBitBltFrom(sqInt bb) {
register struct foo * foo = &fum;
    void *fn;

	fn = ioLoadFunctionFrom("loadBitBltFrom", "BitBltPlugin");
	if (fn == 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	return ((sqInt (*)(sqInt))fn)(bb);
}

sqInt loadInitialContext(void) {
register struct foo * foo = &fum;
    sqInt proc;
    sqInt sched;
    sqInt oop;
    sqInt tmp;

	/* begin fetchPointer:ofObject: */
	oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	sched = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	proc = longAt((sched + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	foo->activeContext = longAt((proc + (BASE_HEADER_SIZE)) + (SuspendedContextIndex << (SHIFT_FOR_WORD)));
	if ((((usqInt) foo->activeContext)) < (((usqInt) foo->youngStart))) {
		beRootIfOld((sqInt)foo->activeContext);
	}
	/* begin fetchContextRegisters: */
	tmp = longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	if ((tmp & 1)) {
		tmp = longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
		if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
			beRootIfOld(tmp);
		}
	} else {
		tmp = foo->activeContext;
	}
	foo->theHomeContext = tmp;
	foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
	foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	tmp = ((longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->instructionPointer = ((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2;
	tmp = ((longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->stackPointer = (foo->activeContext + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD));
	foo->reclaimableContextCount = 0;
	return null;
}


/*	This method implements a simple method lookup cache. If an entry for the given selector and class is found in the cache, set the values of 'newMethod' and 'primitiveIndex' and return true. Otherwise, return false. */
/*	About the re-probe scheme: The hash is the low bits of the XOR of two large addresses, minus their useless lowest two bits. If a probe doesn't get a hit, the hash is shifted right one bit to compute the next probe, introducing a new randomish bit. The cache is probed CacheProbeMax times before giving up. */
/*	WARNING: Since the hash computation is based on the object addresses of the class and selector, we must rehash or flush when compacting storage. We've chosen to flush, since that also saves the trouble of updating the addresses of the objects in the cache. */

sqInt lookupInMethodCacheSelclass(sqInt selector, sqInt class) {
register struct foo * foo = &fum;
    sqInt hash;
    sqInt probe;


	/* shift drops two low-order zeros from addresses */

	hash = selector ^ class;

	/* first probe */

	probe = hash & MethodCacheMask;
	if (((foo->methodCache[probe + MethodCacheSelector]) == selector) && ((foo->methodCache[probe + MethodCacheClass]) == class)) {
		foo->newMethod = foo->methodCache[probe + MethodCacheMethod];
		foo->primitiveIndex = foo->methodCache[probe + MethodCachePrim];
		foo->newNativeMethod = foo->methodCache[probe + MethodCacheNative];
		primitiveFunctionPointer = ((void (*)(void)) (foo->methodCache[probe + MethodCachePrimFunction]));
		return 1;
	}

	/* second probe */

	probe = (((usqInt) hash) >> 1) & MethodCacheMask;
	if (((foo->methodCache[probe + MethodCacheSelector]) == selector) && ((foo->methodCache[probe + MethodCacheClass]) == class)) {
		foo->newMethod = foo->methodCache[probe + MethodCacheMethod];
		foo->primitiveIndex = foo->methodCache[probe + MethodCachePrim];
		foo->newNativeMethod = foo->methodCache[probe + MethodCacheNative];
		primitiveFunctionPointer = ((void (*)(void)) (foo->methodCache[probe + MethodCachePrimFunction]));
		return 1;
	}
	probe = (((usqInt) hash) >> 2) & MethodCacheMask;
	if (((foo->methodCache[probe + MethodCacheSelector]) == selector) && ((foo->methodCache[probe + MethodCacheClass]) == class)) {
		foo->newMethod = foo->methodCache[probe + MethodCacheMethod];
		foo->primitiveIndex = foo->methodCache[probe + MethodCachePrim];
		foo->newNativeMethod = foo->methodCache[probe + MethodCacheNative];
		primitiveFunctionPointer = ((void (*)(void)) (foo->methodCache[probe + MethodCachePrimFunction]));
		return 1;
	}
	return 0;
}

sqInt lookupMethodInClass(sqInt class) {
register struct foo * foo = &fum;
    sqInt currentClass;
    sqInt dictionary;
    sqInt found;
    sqInt rclass;
    sqInt oop;
    sqInt oop1;
    sqInt index;
    sqInt length;
    sqInt mask;
    sqInt methodArray;
    sqInt nextSelector;
    sqInt wrapAround;
    sqInt sz;
    sqInt primBits;
    sqInt header;

	currentClass = class;
	while (currentClass != foo->nilObj) {
		dictionary = longAt((currentClass + (BASE_HEADER_SIZE)) + (MessageDictionaryIndex << (SHIFT_FOR_WORD)));
		if (dictionary == foo->nilObj) {

			/* MethodDict pointer is nil (hopefully due a swapped out stub)
				-- raise exception #cannotInterpret:. */

			/* begin pushRemappableOop: */
			foo->remapBuffer[(foo->remapBufferCount += 1)] = currentClass;
			createActualMessageTo(class);
			/* begin popRemappableOop */
			oop = foo->remapBuffer[foo->remapBufferCount];
			foo->remapBufferCount -= 1;
			currentClass = oop;
			foo->messageSelector = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorCannotInterpret << (SHIFT_FOR_WORD)));
			return lookupMethodInClass(longAt((currentClass + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD))));
		}
		/* begin lookupMethodInDictionary: */
		/* begin fetchWordLengthOf: */
		/* begin sizeBitsOf: */
		header = longAt(dictionary);
		if ((header & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(dictionary - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
			goto l1;
		} else {
			sz = header & (SIZE_MASK);
			goto l1;
		}
	l1:	/* end sizeBitsOf: */;
		length = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		mask = (length - SelectorStart) - 1;
		if ((foo->messageSelector & 1)) {
			index = (mask & ((foo->messageSelector >> 1))) + SelectorStart;
		} else {
			index = (mask & ((((usqInt) (longAt(foo->messageSelector))) >> 17) & 0xFFF)) + SelectorStart;
		}
		wrapAround = 0;
		while (1) {
			nextSelector = longAt((dictionary + (BASE_HEADER_SIZE)) + (index << (SHIFT_FOR_WORD)));
			if (nextSelector == foo->nilObj) {
				found = 0;
				goto l2;
			}
			if (nextSelector == foo->messageSelector) {
				methodArray = longAt((dictionary + (BASE_HEADER_SIZE)) + (MethodArrayIndex << (SHIFT_FOR_WORD)));
				foo->newMethod = longAt((methodArray + (BASE_HEADER_SIZE)) + ((index - SelectorStart) << (SHIFT_FOR_WORD)));
				if (((((usqInt) (longAt(foo->newMethod))) >> 8) & 15) >= 12) {
					/* begin primitiveIndexOf: */
					primBits = (((usqInt) (longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 1) & 268435967;
					foo->primitiveIndex = (primBits & 0x1FF) + (((usqInt) primBits) >> 19);
					if (foo->primitiveIndex > MaxPrimitiveIndex) {
						foo->primitiveIndex = 0;
					}
				} else {
					flag("primitiveInvokeObjectAsMethod");
					foo->primitiveIndex = MaxPrimitiveIndex + 1;
				}
				found = 1;
				goto l2;
			}
			index += 1;
			if (index == length) {
				if (wrapAround) {
					found = 0;
					goto l2;
				}
				wrapAround = 1;
				index = SelectorStart;
			}
		}
	l2:	/* end lookupMethodInDictionary: */;
		if (found) {
			return (foo->methodClass = currentClass);
		}
		currentClass = longAt((currentClass + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
	}
	if (foo->messageSelector == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorDoesNotUnderstand << (SHIFT_FOR_WORD))))) {
		error("Recursive not understood error encountered");
	}
	/* begin pushRemappableOop: */
	foo->remapBuffer[(foo->remapBufferCount += 1)] = class;
	createActualMessageTo(class);
	/* begin popRemappableOop */
	oop1 = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	rclass = oop1;
	foo->messageSelector = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorDoesNotUnderstand << (SHIFT_FOR_WORD)));
	return lookupMethodInClass(rclass);
}


/*	This method lookup tolerates integers as Dictionary keys to 
	support execution of images in which Symbols have been 
	compacted out */

sqInt lookupMethodInDictionary(sqInt dictionary) {
register struct foo * foo = &fum;
    sqInt index;
    sqInt length;
    sqInt mask;
    sqInt methodArray;
    sqInt nextSelector;
    sqInt wrapAround;
    sqInt sz;
    sqInt primBits;
    sqInt header;

	/* begin fetchWordLengthOf: */
	/* begin sizeBitsOf: */
	header = longAt(dictionary);
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(dictionary - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l1;
	} else {
		sz = header & (SIZE_MASK);
		goto l1;
	}
l1:	/* end sizeBitsOf: */;
	length = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
	mask = (length - SelectorStart) - 1;
	if ((foo->messageSelector & 1)) {
		index = (mask & ((foo->messageSelector >> 1))) + SelectorStart;
	} else {
		index = (mask & ((((usqInt) (longAt(foo->messageSelector))) >> 17) & 0xFFF)) + SelectorStart;
	}
	wrapAround = 0;
	while (1) {
		nextSelector = longAt((dictionary + (BASE_HEADER_SIZE)) + (index << (SHIFT_FOR_WORD)));
		if (nextSelector == foo->nilObj) {
			return 0;
		}
		if (nextSelector == foo->messageSelector) {
			methodArray = longAt((dictionary + (BASE_HEADER_SIZE)) + (MethodArrayIndex << (SHIFT_FOR_WORD)));

			/* Check if newMethod is a CompiledMethod. */

			foo->newMethod = longAt((methodArray + (BASE_HEADER_SIZE)) + ((index - SelectorStart) << (SHIFT_FOR_WORD)));
			if (((((usqInt) (longAt(foo->newMethod))) >> 8) & 15) >= 12) {
				/* begin primitiveIndexOf: */
				primBits = (((usqInt) (longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 1) & 268435967;
				foo->primitiveIndex = (primBits & 0x1FF) + (((usqInt) primBits) >> 19);
				if (foo->primitiveIndex > MaxPrimitiveIndex) {

					/* If primitiveIndex is out of range, set to zero before putting in 
									cache. This is equiv to primFail, and avoids the need to check on 
									every send. */

					foo->primitiveIndex = 0;
				}
			} else {

				/* indicate that this is no compiled method - use primitiveInvokeObjectAsMethod */

				flag("primitiveInvokeObjectAsMethod");
				foo->primitiveIndex = MaxPrimitiveIndex + 1;
			}
			return 1;
		}
		index += 1;
		if (index == length) {
			if (wrapAround) {
				return 0;
			}
			wrapAround = 1;
			index = SelectorStart;
		}
	}
	return null;
}


/*	Lookup.  Answer false on failure father than performing MNU processing etc. */

sqInt lookupMethodNoMNUEtcInClass(sqInt class) {
register struct foo * foo = &fum;
    sqInt currentClass;
    sqInt dictionary;

	currentClass = class;
	while (currentClass != foo->nilObj) {
		dictionary = longAt((currentClass + (BASE_HEADER_SIZE)) + (MessageDictionaryIndex << (SHIFT_FOR_WORD)));
		if ((dictionary != foo->nilObj) && (lookupMethodInDictionary(dictionary))) {
			foo->methodClass = currentClass;
			return 1;
		}
		currentClass = longAt((currentClass + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
	}
	return 0;
}


/*	Return the first free block after the given chunk in memory. */

sqInt lowestFreeAfter(sqInt chunk) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt oopHeader;
    sqInt oopHeaderType;
    sqInt oopSize;

	oop = chunk + (foo->headerTypeBytes[(longAt(chunk)) & TypeMask]);
	while ((((usqInt) oop)) < (((usqInt) foo->endOfMemory))) {
		oopHeader = longAt(oop);
		oopHeaderType = oopHeader & TypeMask;
		if (oopHeaderType == HeaderTypeFree) {
			return oop;
		} else {
			if (oopHeaderType == HeaderTypeSizeAndClass) {
				oopSize = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
			} else {
				oopSize = oopHeader & (SIZE_MASK);
			}
		}
		oop = (oop + oopSize) + (foo->headerTypeBytes[(longAt(oop + oopSize)) & TypeMask]);
	}
	error("expected to find at least one free object");
	return null;
}


/*	Return a Large Integer object for the given integer magnitude and sign */

sqInt magnitude64BitIntegerForneg(usqLong magnitude, sqInt isNegative) {
register struct foo * foo = &fum;
    usqInt highWord;
    sqInt i;
    sqInt intValue;
    sqInt isSmall;
    sqInt largeClass;
    sqInt newLargeInteger;
    sqInt smallVal;
    sqInt sz;

	isSmall = (isNegative
		? magnitude <= 0x40000000
		: magnitude < 0x40000000);
	if (isSmall) {
		smallVal = ((sqInt) magnitude);
		if (isNegative) {
			smallVal = 0 - smallVal;
		}
		return ((smallVal << 1) | 1);
	}
	if (isNegative) {
		largeClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargeNegativeInteger << (SHIFT_FOR_WORD)));
	} else {
		largeClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD)));
	}

	/* shift is coerced to usqInt otherwise */

	highWord = magnitude >> 32;
	if (highWord == 0) {
		sz = 4;
	} else {
		sz = 5;
		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
			sz += 1;
		}
		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
			sz += 1;
		}
		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
			sz += 1;
		}
	}
	newLargeInteger = instantiateClassindexableSize(largeClass, sz);
	for (i = 0; i <= (sz - 1); i += 1) {
		intValue = (magnitude >> (i * 8)) & 255;
		byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + i, intValue);
	}
	return newLargeInteger;
}


/*	Convert the given object into an integer value.
	The object may be either a positive SmallInteger or a eight-byte LargeInteger. */

usqLong magnitude64BitValueOf(sqInt oop) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt ok;
    sqInt smallIntValue;
    sqInt sz;
    usqLong value;
    sqInt classOop;
    sqInt ccIndex;
    sqInt classOop1;
    sqInt ccIndex1;
    sqInt header;
    sqInt sz1;

	if ((oop & 1)) {
		smallIntValue = (oop >> 1);
		if (smallIntValue < 0) {
			smallIntValue = 0 - smallIntValue;
		}
		return ((usqLong) smallIntValue);
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	classOop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD)));
	assert(!((oop & 1)));
	ccIndex1 = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	ok = (ClassLargePositiveIntegerCompactIndex == 0
		? (ccIndex1 == 0
	? ((longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK)) == classOop1
	: 0)
		: ClassLargePositiveIntegerCompactIndex == ccIndex1);
	if (!(ok)) {
		/* begin isClassOfNonImm:equalTo:compactClassIndex: */
		classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargeNegativeInteger << (SHIFT_FOR_WORD)));
		assert(!((oop & 1)));
		ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
		ok = (ClassLargeNegativeIntegerCompactIndex == 0
			? (ccIndex == 0
	? ((longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK)) == classOop
	: 0)
			: ClassLargeNegativeIntegerCompactIndex == ccIndex);
		if (!(ok)) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
	}
	/* begin lengthOf: */
	header = longAt(oop);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz1 = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz1 = header & (SIZE_MASK);
	}
	sz1 -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l1;
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> 2;
		goto l1;
	} else {
		sz = (sz1 - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
		goto l1;
	}
l1:	/* end lengthOf:baseHeader:format: */;
	if (sz > (sizeof(sqLong))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	value = 0;
	for (i = 0; i <= (sz - 1); i += 1) {
		value += (((sqLong) (byteAt((oop + (BASE_HEADER_SIZE)) + i)))) << (i * 8);
	}
	return value;
}


/*	make a Point xValue@yValue.
We know both will be integers so no value nor root checking is needed */

sqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue) {
    sqInt pointResult;

	pointResult = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD))), 3 * (BYTES_PER_WORD));
	longAtput((pointResult + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)), ((xValue << 1) | 1));
	longAtput((pointResult + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)), ((yValue << 1) | 1));
	return pointResult;
}


/*	Use the forwarding table to update the pointers of all non-free objects in the given range of memory. Also remap pointers in root objects which may contains pointers into the given memory range, and don't forget to flush the method cache based on the range */

sqInt mapPointersInObjectsFromto(sqInt memStart, sqInt memEnd) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt oop;
    sqInt i1;
    sqInt probe;
    sqInt i2;
    sqInt oop1;
    sqInt iLimiT;
    sqInt value;

	/* begin compilerMapHookFrom:to: */
	if (foo->compilerInitialized) {
		compilerMapFromto(memStart, memEnd);
	}
	/* begin mapInterpreterOops */
	/* begin mapRootObjects */
	foo->nilObj = remap(foo->nilObj);
	foo->falseObj = remap(foo->falseObj);
	foo->trueObj = remap(foo->trueObj);
	foo->specialObjectsOop = remap(foo->specialObjectsOop);
	if (!(foo->compilerInitialized)) {
		foo->stackPointer -= foo->activeContext;
		foo->activeContext = (usqInt)remap((sqInt)foo->activeContext);
		foo->stackPointer += foo->activeContext;
		foo->theHomeContext = (usqInt)remap((sqInt)foo->theHomeContext);
	}
	foo->instructionPointer -= foo->method;
	foo->method = (usqInt)remap((sqInt)foo->method);
	foo->instructionPointer += foo->method;
	foo->receiver = remap(foo->receiver);
	foo->messageSelector = remap(foo->messageSelector);
	foo->newMethod = (usqInt)remap((sqInt)foo->newMethod);
	foo->methodClass = remap(foo->methodClass);
	foo->lkupClass = remap(foo->lkupClass);
	foo->receiverClass = remap(foo->receiverClass);
	for (i2 = 1, iLimiT = foo->remapBufferCount; i2 <= iLimiT; i2 += 1) {
		oop1 = foo->remapBuffer[i2];
		if (!((oop1 & 1))) {
			/* begin remapBufferAt:put: */
			value = remap(oop1);
			foo->remapBuffer[i2] = value;
		}
	}
	for (i2 = 1; i2 <= foo->jmpDepth; i2 += 1) {
		oop1 = foo->suspendedCallbacks[i2];
		if (!((oop1 & 1))) {
			foo->suspendedCallbacks[i2] = (remap(oop1));
		}
		oop1 = foo->suspendedMethods[i2];
		if (!((oop1 & 1))) {
			foo->suspendedMethods[i2] = (remap(oop1));
		}
	}
	for (i = 1; i <= foo->extraRootCount; i += 1) {
		oop = (foo->extraRoots[i])[0];
		if (!((oop & 1))) {
			(foo->extraRoots[i])[0] = (remap(oop));
		}
	}
	/* begin flushMethodCacheFrom:to: */
	probe = 0;
	for (i1 = 1; i1 <= MethodCacheEntries; i1 += 1) {
		if (!((foo->methodCache[probe + MethodCacheSelector]) == 0)) {
			if ((((((((usqInt) (foo->methodCache[probe + MethodCacheSelector]))) >= (((usqInt) memStart))) && ((((usqInt) (foo->methodCache[probe + MethodCacheSelector]))) < (((usqInt) memEnd)))) || (((((usqInt) (foo->methodCache[probe + MethodCacheClass]))) >= (((usqInt) memStart))) && ((((usqInt) (foo->methodCache[probe + MethodCacheClass]))) < (((usqInt) memEnd))))) || (((((usqInt) (foo->methodCache[probe + MethodCacheMethod]))) >= (((usqInt) memStart))) && ((((usqInt) (foo->methodCache[probe + MethodCacheMethod]))) < (((usqInt) memEnd))))) || (((((usqInt) (foo->methodCache[probe + MethodCacheNative]))) >= (((usqInt) memStart))) && ((((usqInt) (foo->methodCache[probe + MethodCacheNative]))) < (((usqInt) memEnd))))) {
				foo->methodCache[probe + MethodCacheSelector] = 0;
			}
		}
		probe += MethodCacheEntrySize;
	}
	for (i1 = 1; i1 <= AtCacheTotalSize; i1 += 1) {
		foo->atCache[i1] = 0;
	}
	updatePointersInRootObjectsFromto(memStart, memEnd);
	updatePointersInRangeFromto(memStart, memEnd);
	return null;
}


/*	Mark all objects reachable from the given one.
	Trace from the given object even if it is old.
	Do not trace if it is already marked.
	Mark it only if it is a young object. */
/*	Tracer state variables:
		child		object being examined
		field		next field of child to examine
		parentField	field where child was stored in its referencing object */

sqInt markAndTrace(sqInt oop) {
register struct foo * foo = &fum;
    sqInt action;
    sqInt header;
    sqInt lastFieldOffset;
    sqInt statMarkCountLocal;
    sqInt contextSize;
    sqInt fmt;
    sqInt header1;
    sqInt methodHeader;
    sqInt sz;
    sqInt sp;
    sqInt header2;
    sqInt lastFieldOffset1;
    sqInt oop1;
    sqInt header3;
    sqInt type;
    sqInt childType;
    sqInt typeBits;
    sqInt contextSize1;
    sqInt fmt1;
    sqInt header4;
    sqInt methodHeader1;
    sqInt sz1;
    sqInt sp1;
    sqInt header11;
    sqInt type1;
    sqInt header5;
    sqInt type2;
    sqInt child;
    usqInt youngStartLocal;
    sqInt parentField;
    sqInt field;

	header = longAt(oop);
	if (!((header & (MARK_BIT)) == 0)) {
		return 0;
	}
	header = (header & (ALL_BUT_TYPE_MASK)) | HeaderTypeGC;
	if ((((usqInt) oop)) >= (((usqInt) foo->youngStart))) {
		header = header | (MARK_BIT);
	}
	longAtput(oop, header);
	parentField = GCTopMarker;
	child = oop;
	if (((((usqInt) (longAt(oop))) >> 8) & 15) == 4) {

		/* Set lastFieldOffset before the weak fields in the receiver */


		/* And remember as weak root */

		lastFieldOffset = (nonWeakFieldsOf(oop)) << (SHIFT_FOR_WORD);
		foo->weakRootCount += 1;
		foo->weakRoots[foo->weakRootCount] = oop;
	} else {

		/* Do it the usual way */

		/* begin lastPointerOf: */
		header1 = longAt(oop);
		fmt = (((usqInt) header1) >> 8) & 15;
		if (fmt <= 4) {
			if ((fmt == 3) && ((((((usqInt) header1) >> 12) & 0x1F) == 13) || ((((((usqInt) header1) >> 12) & 0x1F) == 14) || (((((usqInt) header1) >> 12) & 0x1F) == 4)))) {
				/* begin fetchStackPointerOf: */
				sp = longAt((oop + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
				if (!((sp & 1))) {
					contextSize = 0;
					goto l1;
				}
				contextSize = (sp >> 1);
			l1:	/* end fetchStackPointerOf: */;
				lastFieldOffset = (CtxtTempFrameStart + contextSize) * (BYTES_PER_WORD);
				goto l2;
			}
			/* begin sizeBitsOfSafe: */
			header3 = longAt(oop);
			/* begin rightType: */
			if ((header3 & (SIZE_MASK)) == 0) {
				type = HeaderTypeSizeAndClass;
				goto l4;
			} else {
				if ((header3 & CompactClassMask) == 0) {
					type = HeaderTypeClass;
					goto l4;
				} else {
					type = HeaderTypeShort;
					goto l4;
				}
			}
		l4:	/* end rightType: */;
			if (type == HeaderTypeSizeAndClass) {
				sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
				goto l5;
			} else {
				sz = header3 & (SIZE_MASK);
				goto l5;
			}
		l5:	/* end sizeBitsOfSafe: */;
			lastFieldOffset = sz - (BASE_HEADER_SIZE);
			goto l2;
		}
		if (fmt < 12) {
			lastFieldOffset = 0;
			goto l2;
		}
		methodHeader = longAt(oop + (BASE_HEADER_SIZE));
		lastFieldOffset = (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
	l2:	/* end lastPointerOf: */;
	}
	field = oop + lastFieldOffset;
	action = StartField;
	youngStartLocal = foo->youngStart;

	/* run the tracer state machine until all objects reachable from oop are marked */

	statMarkCountLocal = foo->statMarkCount;
	while (!(action == Done)) {
		statMarkCountLocal += 1;
		if (action == StartField) {
			/* begin startField */
			child = longAt(field);
			typeBits = child & TypeMask;
			if ((typeBits & 1) == 1) {
				field -= BYTES_PER_WORD;
				action = StartField;
				goto l7;
			}
			if (typeBits == 0) {
				longAtput(field, parentField);
				parentField = field;
				action = StartObj;
				goto l7;
			}
			if (typeBits == 2) {
				if ((child & CompactClassMask) != 0) {
					child = child & (ALL_BUT_TYPE_MASK);
					/* begin rightType: */
					if ((child & (SIZE_MASK)) == 0) {
						childType = HeaderTypeSizeAndClass;
						goto l6;
					} else {
						if ((child & CompactClassMask) == 0) {
							childType = HeaderTypeClass;
							goto l6;
						} else {
							childType = HeaderTypeShort;
							goto l6;
						}
					}
				l6:	/* end rightType: */;
					longAtput(field, child | childType);
					action = Upward;
					goto l7;
				} else {
					child = longAt(field - (BYTES_PER_WORD));
					child = child & (ALL_BUT_TYPE_MASK);
					longAtput(field - (BYTES_PER_WORD), parentField);
					parentField = (field - (BYTES_PER_WORD)) | 1;
					action = StartObj;
					goto l7;
				}
			}
		l7:	/* end startField */;
		}
		if (action == StartObj) {
			/* begin startObj */
			oop1 = child;
			if ((((usqInt) oop1)) < (((usqInt) youngStartLocal))) {
				field = oop1;
				action = Upward;
				goto l3;
			}
			header2 = longAt(oop1);
			if ((header2 & (MARK_BIT)) == 0) {
				if (((((usqInt) (longAt(oop1))) >> 8) & 15) == 4) {
					lastFieldOffset1 = (nonWeakFieldsOf(oop1)) << (SHIFT_FOR_WORD);
				} else {
					/* begin lastPointerOf: */
					header4 = longAt(oop1);
					fmt1 = (((usqInt) header4) >> 8) & 15;
					if (fmt1 <= 4) {
						if ((fmt1 == 3) && ((((((usqInt) header4) >> 12) & 0x1F) == 13) || ((((((usqInt) header4) >> 12) & 0x1F) == 14) || (((((usqInt) header4) >> 12) & 0x1F) == 4)))) {
							/* begin fetchStackPointerOf: */
							sp1 = longAt((oop1 + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
							if (!((sp1 & 1))) {
								contextSize1 = 0;
								goto l8;
							}
							contextSize1 = (sp1 >> 1);
						l8:	/* end fetchStackPointerOf: */;
							lastFieldOffset1 = (CtxtTempFrameStart + contextSize1) * (BYTES_PER_WORD);
							goto l11;
						}
						/* begin sizeBitsOfSafe: */
						header11 = longAt(oop1);
						/* begin rightType: */
						if ((header11 & (SIZE_MASK)) == 0) {
							type1 = HeaderTypeSizeAndClass;
							goto l9;
						} else {
							if ((header11 & CompactClassMask) == 0) {
								type1 = HeaderTypeClass;
								goto l9;
							} else {
								type1 = HeaderTypeShort;
								goto l9;
							}
						}
					l9:	/* end rightType: */;
						if (type1 == HeaderTypeSizeAndClass) {
							sz1 = (longAt(oop1 - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
							goto l10;
						} else {
							sz1 = header11 & (SIZE_MASK);
							goto l10;
						}
					l10:	/* end sizeBitsOfSafe: */;
						lastFieldOffset1 = sz1 - (BASE_HEADER_SIZE);
						goto l11;
					}
					if (fmt1 < 12) {
						lastFieldOffset1 = 0;
						goto l11;
					}
					methodHeader1 = longAt(oop1 + (BASE_HEADER_SIZE));
					lastFieldOffset1 = (((((usqInt) methodHeader1) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
				l11:	/* end lastPointerOf: */;
				}
				header2 = header2 & (ALL_BUT_TYPE_MASK);
				header2 = (header2 | (MARK_BIT)) | HeaderTypeGC;
				longAtput(oop1, header2);
				field = oop1 + lastFieldOffset1;
				action = StartField;
				goto l3;
			} else {
				field = oop1;
				action = Upward;
				goto l3;
			}
		l3:	/* end startObj */;
		}
		if (action == Upward) {
			/* begin upward */
			if ((parentField & 1) == 1) {
				if (parentField == GCTopMarker) {
					header5 = (longAt(field)) & (ALL_BUT_TYPE_MASK);
					/* begin rightType: */
					if ((header5 & (SIZE_MASK)) == 0) {
						type2 = HeaderTypeSizeAndClass;
						goto l12;
					} else {
						if ((header5 & CompactClassMask) == 0) {
							type2 = HeaderTypeClass;
							goto l12;
						} else {
							type2 = HeaderTypeShort;
							goto l12;
						}
					}
				l12:	/* end rightType: */;
					longAtput(field, header5 | type2);
					action = Done;
					goto l14;
				} else {
					child = field;
					field = parentField - 1;
					parentField = longAt(field);
					header5 = longAt(field + (BYTES_PER_WORD));
					/* begin rightType: */
					if ((header5 & (SIZE_MASK)) == 0) {
						type2 = HeaderTypeSizeAndClass;
						goto l13;
					} else {
						if ((header5 & CompactClassMask) == 0) {
							type2 = HeaderTypeClass;
							goto l13;
						} else {
							type2 = HeaderTypeShort;
							goto l13;
						}
					}
				l13:	/* end rightType: */;
					longAtput(field, child | type2);
					field += BYTES_PER_WORD;
					header5 = header5 & (ALL_BUT_TYPE_MASK);
					longAtput(field, header5 | type2);
					action = Upward;
					goto l14;
				}
			} else {
				child = field;
				field = parentField;
				parentField = longAt(field);
				longAtput(field, child);
				field -= BYTES_PER_WORD;
				action = StartField;
				goto l14;
			}
		l14:	/* end upward */;
		}
	}
	foo->statMarkCount = statMarkCountLocal;
	return null;
}


/*	Mark and trace all oops in the interpreter's state. */
/*	Assume: All traced variables contain valid oops. */

sqInt markAndTraceInterpreterOops(sqInt fullGCFlag) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt oop;
    sqInt iLimiT;

	/* begin compilerMarkHook */
	if (foo->compilerInitialized) {
		compilerMark();
	}
	markAndTrace(foo->specialObjectsOop);
	if (foo->compilerInitialized) {
		markAndTrace(foo->receiver);
		markAndTrace((sqInt)foo->method);
	} else {
		markAndTrace((sqInt)foo->activeContext);
	}
	markAndTrace(foo->messageSelector);
	markAndTrace((sqInt)foo->newMethod);
	markAndTrace(foo->methodClass);
	markAndTrace(foo->lkupClass);
	markAndTrace(foo->receiverClass);
	for (i = 1, iLimiT = foo->remapBufferCount; i <= iLimiT; i += 1) {
		oop = foo->remapBuffer[i];
		if (!((oop & 1))) {
			markAndTrace(oop);
		}
	}
	for (i = 1; i <= foo->jmpDepth; i += 1) {
		oop = foo->suspendedCallbacks[i];
		if (!((oop & 1))) {
			markAndTrace(oop);
		}
		oop = foo->suspendedMethods[i];
		if (!((oop & 1))) {
			markAndTrace(oop);
		}
	}
	return null;
}


/*	Mark phase of the mark and sweep garbage collector. Set 
	the mark bits of all reachable objects. Free chunks are 
	untouched by this process. */
/*	Assume: All non-free objects are initially unmarked. Root 
	objects were unmarked when they were made roots. (Make 
	sure this stays true!!). */

sqInt markPhase(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt oop;


	/* clear the recycled context lists */

	foo->freeContexts = NilContext;

	/* trace the interpreter's objects, including the active stack 
	and special objects array */

	foo->freeLargeContexts = NilContext;
	markAndTraceInterpreterOops(1);

	/* trace the roots */

	foo->statSpecialMarkCount = foo->statMarkCount;
	for (i = 1; i <= foo->rootTableCount; i += 1) {
		oop = foo->rootTable[i];
		markAndTrace(oop);
	}
	for (i = 1; i <= foo->extraRootCount; i += 1) {
		oop = (foo->extraRoots[i])[0];
		if (!((oop & 1))) {
			markAndTrace(oop);
		}
	}
	return null;
}


/*	Answer current interpreter and object memory state information. */
/*	see ContextInterpreter>>writeImageFileIO: */
/*	self putLong: (self imageFormatVersion) toFile: f.
	self putLong: headerSize toFile: f.
	self putLong: imageBytes toFile: f.
	self putLong: (objectMemory startOfMemory) toFile: f.
	self putLong: objectMemory getSpecialObjectsOop toFile: f.
	self putLong: objectMemory getLastHash toFile: f.
	self putLong: (self ioScreenSize) toFile: f.
	self putLong: fullScreenFlag toFile: f.
	self putLong: extraVMMemory toFile: f.
	1 to: 7 do: [:i | self putLong: 0 toFile: f]. */
/*	fill remaining header words with zeros */

sqInt memoryHeaderState(sqInt dataSize) {
register struct foo * foo = &fum;
    sqInt displayExtent;
    sqInt hash;
    sqInt headerSize;
    sqInt oopStart;
    sqInt results;
    sqInt splObjsOop;
    sqInt oop;
    sqInt oop1;
    sqInt valuePointer;
    sqInt screenSizeWord;
    sqInt displayX;
    sqInt displayY;
    sqInt extent;


	/* header size in bytes; do not change! */

	headerSize = 16 * (BYTES_PER_WORD);
	oopStart = memory;
	splObjsOop = foo->specialObjectsOop;

	/* self ioScreenSize. */
	/* fullScreenFlag */
	/* extraVMMemory */
	/* Pad the rest of the header. */
	/* 7 timesRepeat: [self putLong: 0 toFile: file]. */

	hash = ((foo->lastHash << 1) | 1);
	/* begin pushRemappableOop: */
	oop = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))), 16);
	foo->remapBuffer[(foo->remapBufferCount += 1)] = oop;
	/* begin displayExtent: */
	screenSizeWord = ioScreenSize();
	extent = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD))), 0);
	displayX = positive32BitIntegerFor(((usqInt) screenSizeWord) >> 16);
	displayY = positive32BitIntegerFor(screenSizeWord & 0xFFFF);
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) extent)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(extent, displayX);
	}
	longAtput((extent + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), displayX);
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) extent)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(extent, displayY);
	}
	longAtput((extent + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), displayY);
	displayExtent = extent;
	/* begin popRemappableOop */
	oop1 = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	results = oop1;
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((imageFormatVersionNumber << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), ((imageFormatVersionNumber << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((headerSize << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), ((headerSize << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	valuePointer = positive64BitIntegerFor(dataSize);
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, valuePointer);
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (2 << (SHIFT_FOR_WORD)), valuePointer);
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((oopStart << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (3 << (SHIFT_FOR_WORD)), ((oopStart << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((splObjsOop << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (4 << (SHIFT_FOR_WORD)), ((splObjsOop << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((hash << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (5 << (SHIFT_FOR_WORD)), ((hash << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, displayExtent);
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (6 << (SHIFT_FOR_WORD)), displayExtent);
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((foo->fullScreenFlag << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (7 << (SHIFT_FOR_WORD)), ((foo->fullScreenFlag << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((extraVMMemory << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (8 << (SHIFT_FOR_WORD)), ((extraVMMemory << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((0 << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (9 << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((0 << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (10 << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((0 << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (11 << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((0 << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (12 << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((0 << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (13 << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((0 << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (14 << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) results)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(results, ((0 << 1) | 1));
	}
	longAtput((results + (BASE_HEADER_SIZE)) + (15 << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
	return results;
}


/*	Answer a snapshot copy of the current object memory. If class is organized
	as words, then bytesPerElement should be 4, else 1 for byte organization. */

sqInt memoryImageCopyAsbytesPerElement(sqInt class, sqInt bytesPerElement) {
register struct foo * foo = &fum;
    void *copy;
    sqInt oop;
    void *ptr;
    size_t size;
    usqInt start;

	start = memory;

	/* Assume all objects are below the start of the free block */

	size = foo->freeBlock - start;
	copy = malloc(size);
	if (copy == null) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	memcpy(copy, pointerForOop(start), size);
	oop = instantiateClassindexableSize(class, size / bytesPerElement);
	if (!(!foo->primFailCode)) {
		free(copy);
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	ptr = firstIndexableField(oop);
	memcpy(ptr, copy, size);
	free(copy);
	return oop;
}


/*	Like #stackValue: but access method arguments left-to-right */

sqInt methodArg(sqInt index) {
register struct foo * foo = &fum;
	if ((index > foo->argumentCount) + 1) {
		fprintf(stderr,"[VM]: Attempt to access method args beyond range\n");
		printCallStackOf((sqInt)foo->activeContext);
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return 0;
	}
	return longAt(foo->stackPointer - ((foo->argumentCount - index) * (BYTES_PER_WORD)));
}

sqInt methodArgumentCount(void) {
	return foo->argumentCount;
}

sqInt methodPrimitiveIndex(void) {
	return foo->primitiveIndex;
}


/*	Sets the return value for a method.  In the CoInterpreter we replace the cumbersome
	 primResult machinery. */

sqInt methodReturnValue(sqInt oop) {
register struct foo * foo = &fum;
    sqInt sp;

	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), oop);
	foo->stackPointer = sp;
	return 0;
}


/*	The module with the given name was just unloaded. 
	Make sure we have no dangling references. */

EXPORT(sqInt) moduleUnloaded(char *aModuleName) {
	if ((strcmp(aModuleName, "SurfacePlugin")) == 0) {

		/* Surface plugin went away. Should never happen. But  then, who knows */

		showSurfaceFn = 0;
	}
	return null;
}

sqInt nilObject(void) {
	return foo->nilObj;
}


/*	Return the number of non-weak fields in oop (i.e. the number of fixed fields).
	Note: The following is copied from fixedFieldsOf:format:length: since we do know
	the format of the oop (e.g. format = 4) and thus don't need the length. */

sqInt nonWeakFieldsOf(sqInt oop) {
register struct foo * foo = &fum;
    sqInt class;
    sqInt classFormat;
    sqInt ccIndex;
    sqInt oop1;


	/* No need to inline - we won't call this often */

	if (!(((((usqInt) (longAt(oop))) >> 8) & 15) == 4)) {
		error("Called fixedFieldsOfWeak: with a non-weak oop");
	}
	/* begin fetchClassOf: */
	if ((oop & 1)) {
		class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		class = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	return (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
}


/*	Float objects were saved in platform word ordering. Reorder them into the
	traditional object format. */

sqInt normalizeFloatOrderingInImage(void) {
register struct foo * foo = &fum;
    unsigned int *floatData;
    sqInt oop;
    unsigned int val;
    sqInt obj;
    sqInt obj1;
    sqInt sz;
    sqInt header;
    sqInt sz1;
    sqInt header1;
    sqInt sz2;
    sqInt header2;

	if (!(isBigEnder())) {

		/* Swap words within Float objects, taking them out of native platform ordering */

		/* begin firstAccessibleObject */
		obj1 = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
		while ((((usqInt) obj1)) < (((usqInt) foo->endOfMemory))) {
			if (!(((longAt(obj1)) & TypeMask) == HeaderTypeFree)) {
				oop = obj1;
				goto l2;
			}
			/* begin objectAfter: */
			if (DoAssertionChecks) {
				if ((((usqInt) obj1)) >= (((usqInt) foo->endOfMemory))) {
					error("no objects after the end of memory");
				}
			}
			if (((longAt(obj1)) & TypeMask) == HeaderTypeFree) {
				sz = (longAt(obj1)) & (ALL_BUT_TYPE_MASK);
			} else {
				/* begin sizeBitsOf: */
				header = longAt(obj1);
				if ((header & TypeMask) == HeaderTypeSizeAndClass) {
					sz = (longAt(obj1 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
					goto l3;
				} else {
					sz = header & (SIZE_MASK);
					goto l3;
				}
			l3:	/* end sizeBitsOf: */;
			}
			obj1 = (obj1 + sz) + (foo->headerTypeBytes[(longAt(obj1 + sz)) & TypeMask]);
		}
		error("heap is empty");
	l2:	/* end firstAccessibleObject */;
		while (!(oop == null)) {
			if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
				if ((fetchClassOf(oop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
					floatData = ((unsigned int *) (firstIndexableField(oop)));
					val = floatData[0];
					floatData[0] = (floatData[1]);
					floatData[1] = val;
				}
				/* begin accessibleObjectAfter: */
				/* begin objectAfter: */
				if (DoAssertionChecks) {
					if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
						error("no objects after the end of memory");
					}
				}
				if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
					sz2 = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
				} else {
					/* begin sizeBitsOf: */
					header2 = longAt(oop);
					if ((header2 & TypeMask) == HeaderTypeSizeAndClass) {
						sz2 = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
						goto l5;
					} else {
						sz2 = header2 & (SIZE_MASK);
						goto l5;
					}
				l5:	/* end sizeBitsOf: */;
				}
				obj = (oop + sz2) + (foo->headerTypeBytes[(longAt(oop + sz2)) & TypeMask]);
				while ((((usqInt) obj)) < (((usqInt) foo->endOfMemory))) {
					if (!(((longAt(obj)) & TypeMask) == HeaderTypeFree)) {
						oop = obj;
						goto l1;
					}
					/* begin objectAfter: */
					if (DoAssertionChecks) {
						if ((((usqInt) obj)) >= (((usqInt) foo->endOfMemory))) {
							error("no objects after the end of memory");
						}
					}
					if (((longAt(obj)) & TypeMask) == HeaderTypeFree) {
						sz1 = (longAt(obj)) & (ALL_BUT_TYPE_MASK);
					} else {
						/* begin sizeBitsOf: */
						header1 = longAt(obj);
						if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
							sz1 = (longAt(obj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
							goto l4;
						} else {
							sz1 = header1 & (SIZE_MASK);
							goto l4;
						}
					l4:	/* end sizeBitsOf: */;
					}
					obj = (obj + sz1) + (foo->headerTypeBytes[(longAt(obj + sz1)) & TypeMask]);
				}
				oop = null;
			l1:	/* end accessibleObjectAfter: */;
			}
		}
	}
	return null;
}


/*	Record that the given oop in the old object area points to an 
	object in the young area. 
	HeaderLoc is usually = oop, but may be an addr in a 
	forwarding block. */

sqInt noteAsRootheaderLoc(sqInt oop, sqInt headerLoc) {
register struct foo * foo = &fum;
    sqInt header;

	header = longAt(headerLoc);
	if ((header & (ROOT_BIT)) == 0) {

		/* record oop as root only if not already recorded */

		if (foo->rootTableCount < RootTableRedZone) {

			/* record root if there is enough room in the roots 
					table  */

			foo->rootTableCount += 1;
			foo->rootTable[foo->rootTableCount] = oop;
			longAtput(headerLoc, header | (ROOT_BIT));
		} else {

			/* we're getting in the red zone */

			if (foo->rootTableCount < RootTableSize) {

				/* but there's still space to record it */

				foo->rootTableCount += 1;
				foo->rootTable[foo->rootTableCount] = oop;
				longAtput(headerLoc, header | (ROOT_BIT));
				foo->allocationCount = foo->allocationsBetweenGCs + 1;
			}
		}
	}
	return null;
}


/*	This should never be called: either the compiler is uninitialised (in which case the hooks should never be reached) or the compiler initialisation should have replaced all the hook with their external implementations. */

sqInt nullCompilerHook(void) {
	error("uninitialised compiler hook called");
	return 0;
}


/*	Answer the number of indexable bytes in the given non-immediate object.
	 Does not adjust the size of contexts by stackPointer. */

sqInt numBytesOf(sqInt objOop) {
    sqInt fmt;
    sqInt header;
    sqInt sz;

	header = longAt(objOop);
	sz = ((header & TypeMask) == HeaderTypeSizeAndClass
		? (longAt(objOop - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK)
		: header & (SIZE_MASK));
	fmt = (((usqInt) header) >> 8) & 15;
	return (fmt < 8
		? sz - (BASE_HEADER_SIZE)
		: (sz - (BASE_HEADER_SIZE)) - (fmt & 3));
}


/*	Answer the number of indexable bytes in the given non-immediate byte-indexable object. */

sqInt numBytesOfBytes(sqInt objOop) {
    sqInt fmt;
    sqInt header;
    sqInt sz;

	header = longAt(objOop);
	sz = ((header & TypeMask) == HeaderTypeSizeAndClass
		? (longAt(objOop - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK)
		: header & (SIZE_MASK));
	fmt = (((usqInt) header) >> 8) & 15;
	assert(fmt >= (firstByteFormat()));
	return (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
}


/*	Answer the number of oop-sized elements in the given object.
	 Unlike lengthOf: this does not adjust the length of a context
	 by the stackPointer and so can be used e.g. by cloneContext: */

sqInt numSlotsOf(sqInt obj) {
    sqInt header;
    sqInt sz;

	header = longAt(obj);
	sz = ((header & TypeMask) == HeaderTypeSizeAndClass
		? (longAt(obj - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK)
		: header & (SIZE_MASK));
	return ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
}


/*	Answer if objOop looks like a class object.  WIth Spur be lenient if the object doesn't
	 yet have a hash (i.e. is not yet in the classTable), and accept forwarding pointers. */

sqInt objCouldBeClassObj(sqInt objOop) {
register struct foo * foo = &fum;
    sqInt fieldOop;

	flag("FIXME");
	if (((((usqInt) (longAt(objOop))) >> 8) & 15) <= 4) {
		return 0;
	}
	if ((numSlotsOf(objOop)) > InstanceSpecificationIndex) {
		fieldOop = longAt((objOop + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
		if ((((fieldOop & 3) == 0) && (((((usqInt)fieldOop)) >= memory) && (((((usqInt)fieldOop)) < foo->freeBlock) && (((longAt(fieldOop)) & TypeMask) != HeaderTypeGC)))) && ((((((usqInt) (longAt(fieldOop))) >> 8) & 15) <= 4) || (0 && (isPointers(followForwarded(fieldOop)))))) {
			fieldOop = longAt((objOop + (BASE_HEADER_SIZE)) + (MethodDictionaryIndex << (SHIFT_FOR_WORD)));
			return ((((fieldOop & 3) == 0) && (((((usqInt)fieldOop)) >= memory) && (((((usqInt)fieldOop)) < foo->freeBlock) && (((longAt(fieldOop)) & TypeMask) != HeaderTypeGC)))) && ((((((usqInt) (longAt(fieldOop))) >> 8) & 15) <= 4) || (0 && (isPointers(followForwarded(fieldOop)))))) && (((longAt((objOop + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) & 1));
		}
	}
	return 0;
}


/*	Return the object or free chunk immediately following the 
	given object or free chunk in memory. Return endOfMemory 
	when enumeration is complete. */

sqInt objectAfter(sqInt oop) {
register struct foo * foo = &fum;
    sqInt sz;
    sqInt header;

	if (DoAssertionChecks) {
		if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
			error("no objects after the end of memory");
		}
	}
	if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
		sz = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin sizeBitsOf: */
		header = longAt(oop);
		if ((header & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
			goto l1;
		} else {
			sz = header & (SIZE_MASK);
			goto l1;
		}
	l1:	/* end sizeBitsOf: */;
	}
	return (oop + sz) + (foo->headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
}


/*	Like #stackObjectValue: but access method arguments left-to-right */

sqInt objectArg(sqInt index) {
register struct foo * foo = &fum;
    sqInt oop;

	oop = methodArg(index);
	if (oop == 0) {
		return 0.0;
	}
	if ((oop & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	return oop;
}


/*	This message is deprecated but supported for a while via a tweak to sqVirtualMachine.[ch] Use fetchLong32, fetchLong64 or fetchPointer instead for new code */

sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop) {
	return long32At((oop + (BASE_HEADER_SIZE)) + (fieldIndex << 2));
}


/*	If this is a pointers object, check that its fields are all okay oops. */

sqInt okayFields(sqInt oop) {
register struct foo * foo = &fum;
    sqInt c;
    sqInt fieldOop;
    sqInt i;
    sqInt ccIndex;
    sqInt oop1;

	if ((oop == null) || (oop == 0)) {
		return 1;
	}
	if ((oop & 1)) {
		return 1;
	}
	okayOop(oop);
	oopHasOkayClass(oop);
	if (!(((oop & 1) == 0) && (((((usqInt) (longAt(oop))) >> 8) & 15) <= 4))) {
		return 1;
	}
	/* begin fetchClassOf: */
	if ((oop & 1)) {
		c = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		c = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		c = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	if ((c == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassMethodContext << (SHIFT_FOR_WORD))))) || (c == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBlockContext << (SHIFT_FOR_WORD)))))) {
		i = (CtxtTempFrameStart + (fetchStackPointerOf(oop))) - 1;
	} else {
		i = (lengthOf(oop)) - 1;
	}
	while (i >= 0) {
		fieldOop = longAt((oop + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)));
		if (!((fieldOop & 1))) {
			okayOop(fieldOop);
			oopHasOkayClass(fieldOop);
		}
		i -= 1;
	}
	return null;
}


/*	Verify that the given oop is legitimate. Check address, header, and size but not class. */

sqInt okayOop(sqInt signedOop) {
register struct foo * foo = &fum;
    sqInt fmt;
    usqInt oop;
    sqInt sz;
    sqInt type;
    sqInt unusedBit;
    sqInt header;


	/* address and size checks */

	oop = ((usqInt) signedOop);
	if ((oop & 1)) {
		return 1;
	}
	if (!(oop < foo->endOfMemory)) {
		error("oop is not a valid address");
	}
	if (!((oop % (BYTES_PER_WORD)) == 0)) {
		error("oop is not a word-aligned address");
	}
	/* begin sizeBitsOf: */
	header = longAt(oop);
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l1;
	} else {
		sz = header & (SIZE_MASK);
		goto l1;
	}
l1:	/* end sizeBitsOf: */;
	if (!((oop + sz) < foo->endOfMemory)) {
		error("oop size would make it extend beyond the end of memory");
	}
	type = (longAt(oop)) & TypeMask;
	if (type == HeaderTypeFree) {
		error("oop is a free chunk, not an object");
	}
	if (type == HeaderTypeShort) {
		if (((((usqInt) (longAt(oop))) >> 12) & 0x1F) == 0) {
			error("cannot have zero compact class field in a short header");
		}
	}
	if (type == HeaderTypeClass) {
		if (!((oop >= (BYTES_PER_WORD)) && (((longAt(oop - (BYTES_PER_WORD))) & TypeMask) == type))) {
			error("class header word has wrong type");
		}
	}
	if (type == HeaderTypeSizeAndClass) {
		if (!((oop >= ((BYTES_PER_WORD) * 2)) && ((((longAt(oop - ((BYTES_PER_WORD) * 2))) & TypeMask) == type) && (((longAt(oop - (BYTES_PER_WORD))) & TypeMask) == type)))) {
			error("class header word has wrong type");
		}
	}
	fmt = (((usqInt) (longAt(oop))) >> 8) & 15;
	if ((fmt == 5) || (fmt == 7)) {
		error("oop has an unknown format type");
	}
	unusedBit = 0x20000000;
	if ((BYTES_PER_WORD) == 8) {
		unusedBit = unusedBit << 16;
		unusedBit = unusedBit << 16;
	}
	if (!(((longAt(oop)) & unusedBit) == 0)) {
		error("unused header bit 30 is set; should be zero");
	}
	if ((((longAt(oop)) & (ROOT_BIT)) == 1) && (oop >= foo->youngStart)) {
		error("root bit is set in a young object");
	}
	return 1;
}


/*	Compare two oop values, treating them as object memory locations.
	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
	method will be inlined during C translation. */

sqInt oopisGreaterThan(sqInt anOop, sqInt otherOop) {
	return (((usqInt) anOop)) > (((usqInt) otherOop));
}


/*	Compare two oop values, treating them as object memory locations.
	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
	method will be inlined during C translation. */

sqInt oopisGreaterThanOrEqualTo(sqInt anOop, sqInt otherOop) {
	return (((usqInt) anOop)) >= (((usqInt) otherOop));
}


/*	Compare two oop values, treating them as object memory locations.
	Use #cCoerce:to: to ensure comparison of unsigned magnitudes. This
	method will be inlined during C translation. */

sqInt oopisLessThan(sqInt anOop, sqInt otherOop) {
	return (((usqInt) anOop)) < (((usqInt) otherOop));
}


/*	Similar to oopHasOkayClass:, except that it only returns true or false. */

sqInt oopHasAcceptableClass(sqInt signedOop) {
register struct foo * foo = &fum;
    sqInt behaviorFormatBits;
    sqInt formatMask;
    usqInt oop;
    usqInt oopClass;
    sqInt oopFormatBits;

	if ((signedOop & 1)) {
		return 1;
	}
	oop = ((usqInt) signedOop);
	if (!(oop < foo->endOfMemory)) {
		return 0;
	}
	if (!((oop % (BYTES_PER_WORD)) == 0)) {
		return 0;
	}
	if (!((oop + (sizeBitsOf(oop))) < foo->endOfMemory)) {
		return 0;
	}
	oopClass = ((usqInt) (fetchClassOf(oop)));
	if ((oopClass & 1)) {
		return 0;
	}
	if (!(oopClass < foo->endOfMemory)) {
		return 0;
	}
	if (!((oopClass % (BYTES_PER_WORD)) == 0)) {
		return 0;
	}
	if (!((oopClass + (sizeBitsOf(oopClass))) < foo->endOfMemory)) {
		return 0;
	}
	if (!((((oopClass & 1) == 0) && (((((usqInt) (longAt(oopClass))) >> 8) & 15) <= 4)) && ((lengthOf(oopClass)) >= 3))) {
		return 0;
	}
	if (((oop & 1) == 0) && (((((usqInt) (longAt(oop))) >> 8) & 15) >= 8)) {

		/* ignore extra bytes size bits */

		formatMask = 3072;
	} else {
		formatMask = 3840;
	}
	behaviorFormatBits = ((longAt((oopClass + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1) & formatMask;
	oopFormatBits = (longAt(oop)) & formatMask;
	if (!(behaviorFormatBits == oopFormatBits)) {
		return 0;
	}
	return 1;
}


/*	Attempt to verify that the given oop has a reasonable behavior. The class must be a valid, non-integer oop and must not be nilObj. It must be a pointers object with three or more fields. Finally, the instance specification field of the behavior must match that of the instance. */

sqInt oopHasOkayClass(sqInt signedOop) {
    sqInt behaviorFormatBits;
    sqInt formatMask;
    usqInt oop;
    usqInt oopClass;
    sqInt oopFormatBits;

	oop = ((usqInt) signedOop);
	okayOop(oop);
	oopClass = ((usqInt) (fetchClassOf(oop)));
	if ((oopClass & 1)) {
		error("a SmallInteger is not a valid class or behavior");
	}
	okayOop(oopClass);
	if (!((((oopClass & 1) == 0) && (((((usqInt) (longAt(oopClass))) >> 8) & 15) <= 4)) && ((lengthOf(oopClass)) >= 3))) {
		error("a class (behavior) must be a pointers object of size >= 3");
	}
	if (((oop & 1) == 0) && (((((usqInt) (longAt(oop))) >> 8) & 15) >= 8)) {

		/* ignore extra bytes size bits */

		formatMask = 3072;
	} else {
		formatMask = 3840;
	}
	behaviorFormatBits = ((longAt((oopClass + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1) & formatMask;
	oopFormatBits = (longAt(oop)) & formatMask;
	if (!(behaviorFormatBits == oopFormatBits)) {
		error("object and its class (behavior) formats differ");
	}
	return 1;
}


/*	Note: May be called by translated primitive code. */

sqInt pop(sqInt nItems) {
register struct foo * foo = &fum;
	foo->stackPointer -= nItems * (BYTES_PER_WORD);
	return null;
}

sqInt popthenPush(sqInt nItems, sqInt oop) {
register struct foo * foo = &fum;
    sqInt sp;

	longAtput((sp = foo->stackPointer - ((nItems - 1) * (BYTES_PER_WORD))), oop);
	foo->stackPointer = sp;
	return null;
}


/*	Note: May be called by translated primitive code. */

double popFloat(void) {
register struct foo * foo = &fum;
    double  result;
    sqInt top;
    sqInt top1;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop1;

	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	top = top1;
	/* begin assertClassOf:is: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD)));
	if ((top & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(top))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		cl = (longAt(top - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl == classOop)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l1:	/* end assertClassOf:is: */;
	if (!foo->primFailCode) {
		;
		fetchFloatAtinto(top + (BASE_HEADER_SIZE), result);
	}
	return result;
}


/*	Pop and return the possibly remapped object from the remap buffer. */

sqInt popRemappableOop(void) {
register struct foo * foo = &fum;
    sqInt oop;

	oop = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	return oop;
}

sqInt popStack(void) {
register struct foo * foo = &fum;
    sqInt top;

	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	return top;
}


/*	Note - integerValue is interpreted as POSITIVE, eg, as the result of
		Bitmap>at:, or integer>bitAnd:. */

sqInt positive32BitIntegerFor(sqInt integerValue) {
register struct foo * foo = &fum;
    sqInt newLargeInteger;

	if (integerValue >= 0) {
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) integerValue)) ^ ((((int) integerValue)) << 1)) >= 0)
# else
			((integerValue >= -1073741824) && (integerValue <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			return ((integerValue << 1) | 1);
		}
	}
	if ((BYTES_PER_WORD) == 4) {

		/* Faster instantiateSmallClass: currently only works with integral word size. */

		newLargeInteger = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD))), (BASE_HEADER_SIZE) + 4);
	} else {

		/* Cant use instantiateSmallClass: due to integral word requirement. */

		newLargeInteger = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD))), 4);
	}
	byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + 3, (((usqInt) integerValue) >> 24) & 0xFF);
	byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + 2, (((usqInt) integerValue) >> 16) & 0xFF);
	byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + 1, (((usqInt) integerValue) >> 8) & 0xFF);
	byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + 0, integerValue & 0xFF);
	return newLargeInteger;
}


/*	Convert the given object into an integer value.
	The object may be either a positive ST integer or a four-byte LargePositiveInteger. */

sqInt positive32BitValueOf(sqInt oop) {
register struct foo * foo = &fum;
    sqInt sz;
    sqInt value;
    sqInt header;
    sqInt sz1;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop1;

	if ((oop & 1)) {
		value = (oop >> 1);
		if (value < 0) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
		return value;
	}
	/* begin assertClassOf:is: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD)));
	if ((oop & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l2;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		cl = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl == classOop)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l2:	/* end assertClassOf:is: */;
	if (!foo->primFailCode) {
		/* begin lengthOf: */
		header = longAt(oop);
		/* begin lengthOf:baseHeader:format: */
		if ((header & TypeMask) == HeaderTypeSizeAndClass) {
			sz1 = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		} else {
			sz1 = header & (SIZE_MASK);
		}
		sz1 -= header & (SIZE_4_BIT);
		if (((((usqInt) header) >> 8) & 15) <= 4) {
			sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
			goto l1;
		}
		if (((((usqInt) header) >> 8) & 15) < 8) {
			sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> 2;
			goto l1;
		} else {
			sz = (sz1 - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
			goto l1;
		}
	l1:	/* end lengthOf:baseHeader:format: */;
		if (!(sz == 4)) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
	}
	if (!foo->primFailCode) {
		return (((byteAt((oop + (BASE_HEADER_SIZE)) + 0)) + ((byteAt((oop + (BASE_HEADER_SIZE)) + 1)) << 8)) + ((byteAt((oop + (BASE_HEADER_SIZE)) + 2)) << 16)) + ((byteAt((oop + (BASE_HEADER_SIZE)) + 3)) << 24);
	}
	return null;
}


/*	Note - integerValue is interpreted as POSITIVE, eg, as the result of
		Bitmap>at:, or integer>bitAnd:. */

sqInt positive64BitIntegerFor(sqLong integerValue) {
    sqInt highWord;
    sqInt i;
    sqInt newLargeInteger;
    sqInt sz;
    sqInt value;

	if ((sizeof(integerValue)) == 4) {
		return positive32BitIntegerFor(integerValue);
	}

	/* shift is coerced to usqInt otherwise */

	highWord = integerValue >> 32;
	if (highWord == 0) {
		return positive32BitIntegerFor(integerValue);
	}
	sz = 5;
	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
		sz += 1;
	}
	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
		sz += 1;
	}
	if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
		sz += 1;
	}
	newLargeInteger = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD))), sz);
	for (i = 0; i <= (sz - 1); i += 1) {
		value = (integerValue >> (i * 8)) & 255;
		byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + i, value);
	}
	return newLargeInteger;
}


/*	Convert the given object into an integer value.
	The object may be either a positive ST integer or a eight-byte LargePositiveInteger. */

sqLong positive64BitValueOf(sqInt oop) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt sz;
    sqInt szsqLong;
    sqLong value;
    sqInt header;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop1;
    sqInt sz1;

	if ((oop & 1)) {
		value = (oop >> 1);
		if (value < 0) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
		return value;
	}
	/* begin assertClassOf:is: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD)));
	if ((oop & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		cl = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl == classOop)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l1:	/* end assertClassOf:is: */;
	if (!(!foo->primFailCode)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	szsqLong = sizeof(sqLong);
	/* begin lengthOf: */
	header = longAt(oop);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz1 = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz1 = header & (SIZE_MASK);
	}
	sz1 -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l2;
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> 2;
		goto l2;
	} else {
		sz = (sz1 - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
		goto l2;
	}
l2:	/* end lengthOf:baseHeader:format: */;
	if (sz > szsqLong) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	value = 0;
	for (i = 0; i <= (sz - 1); i += 1) {
		value += (((sqLong) (byteAt((oop + (BASE_HEADER_SIZE)) + i)))) << (i * 8);
	}
	return value;
}


/*	oop is an old object. If valueObj is young, mark the object as a root. */

sqInt possibleRootStoreIntovalue(sqInt oop, sqInt valueObj) {
register struct foo * foo = &fum;
    sqInt header;

	if (((((usqInt) valueObj)) >= (((usqInt) foo->youngStart))) && (!((valueObj & 1)))) {

		/* Yes, valueObj is a young object */

		/* begin noteAsRoot:headerLoc: */
		header = longAt(oop);
		if ((header & (ROOT_BIT)) == 0) {
			if (foo->rootTableCount < RootTableRedZone) {
				foo->rootTableCount += 1;
				foo->rootTable[foo->rootTableCount] = oop;
				longAtput(oop, header | (ROOT_BIT));
			} else {
				if (foo->rootTableCount < RootTableSize) {
					foo->rootTableCount += 1;
					foo->rootTable[foo->rootTableCount] = oop;
					longAtput(oop, header | (ROOT_BIT));
					foo->allocationCount = foo->allocationsBetweenGCs + 1;
				}
			}
		}
	}
	return null;
}


/*	Mark the active and home contexts as roots if old. This 
	allows the interpreter to use storePointerUnchecked to 
	store into them. */

sqInt postGCAction(void) {
register struct foo * foo = &fum;
    sqInt delta;
    sqInt limit;

	if (foo->compilerInitialized) {
		compilerPostGC();
	} else {
		if ((((usqInt) foo->activeContext)) < (((usqInt) foo->youngStart))) {
			beRootIfOld((sqInt)foo->activeContext);
		}
		if ((((usqInt) foo->theHomeContext)) < (((usqInt) foo->youngStart))) {
			beRootIfOld((sqInt)foo->theHomeContext);
		}
	}
	if (oopisGreaterThan((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), (sqInt)foo->shrinkThreshold)) {

		/* Attempt to shrink memory after successfully 
			reclaiming lots of memory */

		/* begin shrinkObjectMemory: */
		delta = ((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK)) - foo->growHeadroom;
		foo->statShrinkMemory += 1;
		limit = sqShrinkMemoryBy(foo->memoryLimit, delta);
		if (!(limit == foo->memoryLimit)) {
			foo->memoryLimit = limit - 24;
			initializeMemoryFirstFree(foo->freeBlock);
		}
	}
	/* begin signalSemaphoreWithIndex: */
	if (foo->gcSemaphoreIndex <= 0) {
		goto l1;
	}
	if (foo->semaphoresUseBufferA) {
		if (foo->semaphoresToSignalCountA < SemaphoresToSignalSize) {
			foo->semaphoresToSignalCountA += 1;
			foo->semaphoresToSignalA[foo->semaphoresToSignalCountA] = foo->gcSemaphoreIndex;
		}
	} else {
		if (foo->semaphoresToSignalCountB < SemaphoresToSignalSize) {
			foo->semaphoresToSignalCountB += 1;
			foo->semaphoresToSignalB[foo->semaphoresToSignalCountB] = foo->gcSemaphoreIndex;
		}
	}
	/* begin forceInterruptCheck */
	foo->interruptCheckCounter = -1000;
	foo->nextPollTick = 0;
l1:	/* end signalSemaphoreWithIndex: */;
	return null;
}


/*	Prepare the object memory to be captured as a resumable snapshot. Answer
	the size of object memory space to be snapshotted. */
/*	update state of active context */

sqInt prepareForSnapshot(void) {
register struct foo * foo = &fum;
    sqInt activeProc;
    sqInt oop;
    sqInt oop1;
    sqInt valuePointer;
    sqInt fmt;
    sqInt header;
    sqInt i;
    sqInt oop2;
    sqInt sz;
    sqInt header1;
    sqInt i1;
    sqInt oop11;
    sqInt sz1;
    sqInt header2;

	if (foo->compilerInitialized) {
		compilerPreSnapshot();
	} else {
		/* begin storeContextRegisters: */
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
	}
	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) activeProc)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(activeProc, (sqInt)foo->activeContext);
	}
	longAtput((activeProc + (BASE_HEADER_SIZE)) + (SuspendedContextIndex << (SHIFT_FOR_WORD)), foo->activeContext);
	incrementalGC();
	fullGC();
	/* begin snapshotCleanUp */
	oop2 = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) oop2)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(oop2)) & TypeMask) == HeaderTypeFree)) {
			header = longAt(oop2);
			fmt = (((usqInt) header) >> 8) & 15;
			if ((fmt == 3) && ((((((usqInt) header) >> 12) & 0x1F) == 13) || ((((((usqInt) header) >> 12) & 0x1F) == 14) || (((((usqInt) header) >> 12) & 0x1F) == 4)))) {
				/* begin sizeBitsOf: */
				header1 = longAt(oop2);
				if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
					sz = (longAt(oop2 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
					goto l1;
				} else {
					sz = header1 & (SIZE_MASK);
					goto l1;
				}
			l1:	/* end sizeBitsOf: */;
				for (i = ((lastPointerOf(oop2)) + (BYTES_PER_WORD)); i <= (sz - (BASE_HEADER_SIZE)); i += (BYTES_PER_WORD)) {
					longAtput(oop2 + i, foo->nilObj);
				}
			}
			if (fmt >= 12) {
				if ((primitiveIndexOf(oop2)) == PrimitiveExternalCallIndex) {
					flushExternalPrimitiveOf(oop2);
				}
			}
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) oop2)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(oop2)) & TypeMask) == HeaderTypeFree) {
			sz1 = (longAt(oop2)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header2 = longAt(oop2);
			if ((header2 & TypeMask) == HeaderTypeSizeAndClass) {
				sz1 = (longAt(oop2 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l2;
			} else {
				sz1 = header2 & (SIZE_MASK);
				goto l2;
			}
		l2:	/* end sizeBitsOf: */;
		}
		oop2 = (oop2 + sz1) + (foo->headerTypeBytes[(longAt(oop2 + sz1)) & TypeMask]);
	}
	/* begin clearRootsTable */
	for (i1 = 1; i1 <= foo->rootTableCount; i1 += 1) {
		oop11 = foo->rootTable[i1];
		longAtput(oop11, (longAt(oop11)) & (ALL_BUT_ROOT_BIT));
		foo->rootTable[i1] = 0;
	}
	foo->rootTableCount = 0;
	return foo->freeBlock - memory;
}


/*	Ensure that there are enough forwarding blocks to 
	accomodate this become, then prepare forwarding blocks for 
	the pointer swap. Return true if successful. */
/*	Details: Doing a GC might generate enough space for 
	forwarding blocks if we're short. However, this is an 
	uncommon enough case that it is better handled by primitive 
	fail code at the Smalltalk level. */
/*	Important note on multiple references to same object  - since the preparation of
	fwdBlocks is NOT idempotent we get VM crashes if the same object is referenced more
	than once in such a way as to require multiple fwdBlocks.
	oop1 forwardBecome: oop1 is ok since only a single fwdBlock is needed.
	oop1 become: oop1 would fail because the second fwdBlock woudl not have the actual object
	header but rather the mutated ref to the first fwdBlock.
	Further problems can arise with an array1 or array2 that refer multiply to the same 
	object. This would notbe expected input for programmer writen code but might arise from
	automatic usage such as in ImageSegment loading.
	To avoid the simple and rather common case of oop1 become*: oop1, we skip such pairs
	and simply avoid making fwdBlocks - it is redundant anyway */

sqInt prepareForwardingTableForBecomingwithtwoWay(sqInt array1, sqInt array2, sqInt twoWayFlag) {
register struct foo * foo = &fum;
    sqInt entriesAvailable;
    sqInt entriesNeeded;
    sqInt fieldOffset;
    sqInt fwdBlkSize;
    sqInt fwdBlock;
    sqInt oop1;
    sqInt oop2;
    sqInt originalHeader;
    sqInt originalHeaderType;
    sqInt originalHeader1;
    sqInt originalHeaderType1;
    sqInt contextSize;
    sqInt fmt;
    sqInt header;
    sqInt methodHeader;
    sqInt sz;
    sqInt sp;
    sqInt header1;
    sqInt type;


	/* need enough entries for all oops */
	/* Note: Forward blocks must be quadword aligned - see fwdTableInit:. */

	entriesNeeded = (lastPointerOf(array1)) / (BYTES_PER_WORD);
	if (twoWayFlag) {

		/* Double the number of blocks for two-way become */

		entriesNeeded = entriesNeeded * 2;
		fwdBlkSize = (BYTES_PER_WORD) * 2;
	} else {

		/* One-way become needs backPointers in fwd blocks. */

		fwdBlkSize = (BYTES_PER_WORD) * 4;
	}
	entriesAvailable = fwdTableInit(fwdBlkSize);
	if (entriesAvailable < entriesNeeded) {
		initializeMemoryFirstFree(foo->freeBlock);
		return 0;
	}
	/* begin lastPointerOf: */
	header = longAt(array1);
	fmt = (((usqInt) header) >> 8) & 15;
	if (fmt <= 4) {
		if ((fmt == 3) && ((((((usqInt) header) >> 12) & 0x1F) == 13) || ((((((usqInt) header) >> 12) & 0x1F) == 14) || (((((usqInt) header) >> 12) & 0x1F) == 4)))) {
			/* begin fetchStackPointerOf: */
			sp = longAt((array1 + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
			if (!((sp & 1))) {
				contextSize = 0;
				goto l3;
			}
			contextSize = (sp >> 1);
		l3:	/* end fetchStackPointerOf: */;
			fieldOffset = (CtxtTempFrameStart + contextSize) * (BYTES_PER_WORD);
			goto l4;
		}
		/* begin sizeBitsOfSafe: */
		header1 = longAt(array1);
		/* begin rightType: */
		if ((header1 & (SIZE_MASK)) == 0) {
			type = HeaderTypeSizeAndClass;
			goto l5;
		} else {
			if ((header1 & CompactClassMask) == 0) {
				type = HeaderTypeClass;
				goto l5;
			} else {
				type = HeaderTypeShort;
				goto l5;
			}
		}
	l5:	/* end rightType: */;
		if (type == HeaderTypeSizeAndClass) {
			sz = (longAt(array1 - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
			goto l6;
		} else {
			sz = header1 & (SIZE_MASK);
			goto l6;
		}
	l6:	/* end sizeBitsOfSafe: */;
		fieldOffset = sz - (BASE_HEADER_SIZE);
		goto l4;
	}
	if (fmt < 12) {
		fieldOffset = 0;
		goto l4;
	}
	methodHeader = longAt(array1 + (BASE_HEADER_SIZE));
	fieldOffset = (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
l4:	/* end lastPointerOf: */;
	while (fieldOffset >= (BASE_HEADER_SIZE)) {
		oop1 = longAt(array1 + fieldOffset);

		/* if oop1 == oop2, no need to do any work for this pair.
			May still be other entries in the arrays though so keep looking */

		oop2 = longAt(array2 + fieldOffset);
		if (!(oop1 == oop2)) {
			/* begin fwdBlockGet: */
			foo->fwdTableNext += fwdBlkSize;
			if (foo->fwdTableNext <= foo->fwdTableLast) {
				fwdBlock = foo->fwdTableNext;
				goto l2;
			} else {
				fwdBlock = null;
				goto l2;
			}
		l2:	/* end fwdBlockGet: */;
			/* begin initForwardBlock:mapping:to:withBackPtr: */
			originalHeader1 = longAt(oop1);
			if (DoAssertionChecks) {
				if (fwdBlock == null) {
					error("ran out of forwarding blocks in become");
				}
				if ((originalHeader1 & (MARK_BIT)) != 0) {
					error("object already has a forwarding table entry");
				}
			}
			originalHeaderType1 = originalHeader1 & TypeMask;
			longAtput(fwdBlock, oop2);
			longAtput(fwdBlock + (BYTES_PER_WORD), originalHeader1);
			if (!twoWayFlag) {
				longAtput(fwdBlock + ((BYTES_PER_WORD) * 2), oop1);
			}
			longAtput(oop1, (((usqInt) fwdBlock) >> 1) | ((MARK_BIT) | originalHeaderType1));
			if (twoWayFlag) {

				/* Second block maps oop2 back to oop1 for two-way become */

				/* begin fwdBlockGet: */
				foo->fwdTableNext += fwdBlkSize;
				if (foo->fwdTableNext <= foo->fwdTableLast) {
					fwdBlock = foo->fwdTableNext;
					goto l1;
				} else {
					fwdBlock = null;
					goto l1;
				}
			l1:	/* end fwdBlockGet: */;
				/* begin initForwardBlock:mapping:to:withBackPtr: */
				originalHeader = longAt(oop2);
				if (DoAssertionChecks) {
					if (fwdBlock == null) {
						error("ran out of forwarding blocks in become");
					}
					if ((originalHeader & (MARK_BIT)) != 0) {
						error("object already has a forwarding table entry");
					}
				}
				originalHeaderType = originalHeader & TypeMask;
				longAtput(fwdBlock, oop1);
				longAtput(fwdBlock + (BYTES_PER_WORD), originalHeader);
				if (!twoWayFlag) {
					longAtput(fwdBlock + ((BYTES_PER_WORD) * 2), oop2);
				}
				longAtput(oop2, (((usqInt) fwdBlock) >> 1) | ((MARK_BIT) | originalHeaderType));
			}
		}
		fieldOffset -= BYTES_PER_WORD;
	}
	return 1;
}

void primitiveAdd(void) {
register struct foo * foo = &fum;
    sqInt integerResult;
    sqInt sp;

	/* begin pop2AndPushIntegerIfOK: */
	integerResult = (stackIntegerValue(1)) + (stackIntegerValue(0));
	if (!foo->primFailCode) {
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) integerResult)) ^ ((((int) integerResult)) << 1)) >= 0)
# else
			((integerResult >= -1073741824) && (integerResult <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			/* begin pop:thenPush: */
			longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), ((integerResult << 1) | 1));
			foo->stackPointer = sp;
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
	}
}


/*	Primitive arithmetic operations for large integers in 64 bit range */

EXPORT(void) primitiveAddLargeIntegers(void) {
register struct foo * foo = &fum;
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt resultIsNegative;
    sqInt sp;

	oopArg = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	oopRcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (!(!foo->primFailCode)) {
		return;
	}
	if (aIsNegative == bIsNegative) {

		/* Protect against overflow */

		if (a > (0xFFFFFFFFFFFFFFFFULL - b)) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
		result = a + b;
		resultIsNegative = aIsNegative;
	} else {
		if (a >= b) {
			result = a - b;
			resultIsNegative = aIsNegative;
		} else {
			result = b - a;
			resultIsNegative = bIsNegative;
		}
	}
	oopResult = magnitude64BitIntegerForneg(result, resultIsNegative);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}


/*	Primitive. Change the class of the argument to make it an instance of the receiver
	 given that the format of the receiver matches the format of the argument's class.
	 Fail if receiver or argument are SmallIntegers, or the receiver is an instance of a
	 compact class and the argument isn't, or when the argument's class is compact and
	 the receiver isn't, or when the format of the receiver is different from the format of
	 the argument's class, or when the arguments class is fixed and the receiver's size
	 differs from the size that an instance of the argument's class should have. */

void primitiveAdoptInstance(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt err;
    sqInt rcvr;
    sqInt i;

	arg = longAt(foo->stackPointer);
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if (((arg & 1)) || ((foo->argumentCount > 1) && (((rcvr & 1)) || (!(objCouldBeClassObj(rcvr)))))) {
		(foo->primFailCode = PrimErrBadArgument); return;
	}
	err = changeClassOfto(arg, rcvr);
	if (err == 0) {

		/* Flush at cache because rcvr's class has changed. */

		/* begin flushAtCache */
		for (i = 1; i <= AtCacheTotalSize; i += 1) {
			foo->atCache[i] = 0;
		}
		/* begin pop: */
		foo->stackPointer -= foo->argumentCount * (BYTES_PER_WORD);
	} else {
		foo->primFailCode = err;
	}
	return;
}


/*	Answer an array of all objects that exist when the primitive
	 is called, excluding those that may be garbage collected as
	 a side effect of allocating the result array. */

EXPORT(sqInt) primitiveAllObjects(void) {
register struct foo * foo = &fum;
    sqInt result;
    sqInt sp;
    sqInt count;
    sqInt newCount;
    sqInt obj;
    sqInt resultArray;
    sqInt obj1;
    sqInt obj2;
    sqInt sz;
    sqInt header;
    sqInt sz1;
    sqInt header1;
    sqInt sz2;
    sqInt header2;
    sqInt sz3;
    sqInt header3;
    sqInt obj3;
    sqInt sz4;
    sqInt header4;
    sqInt obj4;
    sqInt sz5;
    sqInt header5;

	/* begin allObjects */
	count = 0;
	/* begin firstAccessibleObject */
	obj3 = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) obj3)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(obj3)) & TypeMask) == HeaderTypeFree)) {
			obj = obj3;
			goto l9;
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) obj3)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(obj3)) & TypeMask) == HeaderTypeFree) {
			sz4 = (longAt(obj3)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header4 = longAt(obj3);
			if ((header4 & TypeMask) == HeaderTypeSizeAndClass) {
				sz4 = (longAt(obj3 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l8;
			} else {
				sz4 = header4 & (SIZE_MASK);
				goto l8;
			}
		l8:	/* end sizeBitsOf: */;
		}
		obj3 = (obj3 + sz4) + (foo->headerTypeBytes[(longAt(obj3 + sz4)) & TypeMask]);
	}
	error("heap is empty");
l9:	/* end firstAccessibleObject */;
	while (!(obj == null)) {
		count += 1;
		/* begin accessibleObjectAfter: */
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) obj)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(obj)) & TypeMask) == HeaderTypeFree) {
			sz1 = (longAt(obj)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header1 = longAt(obj);
			if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
				sz1 = (longAt(obj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l5;
			} else {
				sz1 = header1 & (SIZE_MASK);
				goto l5;
			}
		l5:	/* end sizeBitsOf: */;
		}
		obj1 = (obj + sz1) + (foo->headerTypeBytes[(longAt(obj + sz1)) & TypeMask]);
		while ((((usqInt) obj1)) < (((usqInt) foo->endOfMemory))) {
			if (!(((longAt(obj1)) & TypeMask) == HeaderTypeFree)) {
				obj = obj1;
				goto l1;
			}
			/* begin objectAfter: */
			if (DoAssertionChecks) {
				if ((((usqInt) obj1)) >= (((usqInt) foo->endOfMemory))) {
					error("no objects after the end of memory");
				}
			}
			if (((longAt(obj1)) & TypeMask) == HeaderTypeFree) {
				sz = (longAt(obj1)) & (ALL_BUT_TYPE_MASK);
			} else {
				/* begin sizeBitsOf: */
				header = longAt(obj1);
				if ((header & TypeMask) == HeaderTypeSizeAndClass) {
					sz = (longAt(obj1 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
					goto l4;
				} else {
					sz = header & (SIZE_MASK);
					goto l4;
				}
			l4:	/* end sizeBitsOf: */;
			}
			obj1 = (obj1 + sz) + (foo->headerTypeBytes[(longAt(obj1 + sz)) & TypeMask]);
		}
		obj = null;
	l1:	/* end accessibleObjectAfter: */;
	}
	resultArray = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))), count);
	if (resultArray == null) {
		result = 0;
		goto l3;
	}
	newCount = 0;
	/* begin firstAccessibleObject */
	obj4 = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) obj4)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(obj4)) & TypeMask) == HeaderTypeFree)) {
			obj = obj4;
			goto l11;
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) obj4)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(obj4)) & TypeMask) == HeaderTypeFree) {
			sz5 = (longAt(obj4)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header5 = longAt(obj4);
			if ((header5 & TypeMask) == HeaderTypeSizeAndClass) {
				sz5 = (longAt(obj4 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l10;
			} else {
				sz5 = header5 & (SIZE_MASK);
				goto l10;
			}
		l10:	/* end sizeBitsOf: */;
		}
		obj4 = (obj4 + sz5) + (foo->headerTypeBytes[(longAt(obj4 + sz5)) & TypeMask]);
	}
	error("heap is empty");
l11:	/* end firstAccessibleObject */;
	while (!((obj == null) || (newCount >= count))) {
		if (!(obj == resultArray)) {
			newCount += 1;
			stObjectatput(resultArray, newCount, obj);
		}
		/* begin accessibleObjectAfter: */
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) obj)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(obj)) & TypeMask) == HeaderTypeFree) {
			sz3 = (longAt(obj)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header3 = longAt(obj);
			if ((header3 & TypeMask) == HeaderTypeSizeAndClass) {
				sz3 = (longAt(obj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l7;
			} else {
				sz3 = header3 & (SIZE_MASK);
				goto l7;
			}
		l7:	/* end sizeBitsOf: */;
		}
		obj2 = (obj + sz3) + (foo->headerTypeBytes[(longAt(obj + sz3)) & TypeMask]);
		while ((((usqInt) obj2)) < (((usqInt) foo->endOfMemory))) {
			if (!(((longAt(obj2)) & TypeMask) == HeaderTypeFree)) {
				obj = obj2;
				goto l2;
			}
			/* begin objectAfter: */
			if (DoAssertionChecks) {
				if ((((usqInt) obj2)) >= (((usqInt) foo->endOfMemory))) {
					error("no objects after the end of memory");
				}
			}
			if (((longAt(obj2)) & TypeMask) == HeaderTypeFree) {
				sz2 = (longAt(obj2)) & (ALL_BUT_TYPE_MASK);
			} else {
				/* begin sizeBitsOf: */
				header2 = longAt(obj2);
				if ((header2 & TypeMask) == HeaderTypeSizeAndClass) {
					sz2 = (longAt(obj2 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
					goto l6;
				} else {
					sz2 = header2 & (SIZE_MASK);
					goto l6;
				}
			l6:	/* end sizeBitsOf: */;
			}
			obj2 = (obj2 + sz2) + (foo->headerTypeBytes[(longAt(obj2 + sz2)) & TypeMask]);
		}
		obj = null;
	l2:	/* end accessibleObjectAfter: */;
	}
	if (newCount < count) {
		shortentoIndexableSize(resultArray, newCount);
	}
	result = resultArray;
l3:	/* end allObjects */;
	if (result == 0) {
		return (foo->primFailCode = PrimErrNoMemory);
	}
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), result);
	foo->stackPointer = sp;
	return null;
}

void primitiveArctan(void) {
register struct foo * foo = &fum;
    double rcvr;

	rcvr = popFloat();
	if (!foo->primFailCode) {
		pushFloat(atan(rcvr));
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	We must flush the method cache here, to eliminate stale references
	to mutated classes and/or selectors. */

void primitiveArrayBecome(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt rcvr;
    sqInt successBoolean;

	arg = longAt(foo->stackPointer);
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin success: */
	successBoolean = becomewithtwoWaycopyHash(rcvr, arg, 1, 0);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
	}
}


/*	We must flush the method cache here, to eliminate stale references
	to mutated classes and/or selectors. */

void primitiveArrayBecomeOneWay(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt rcvr;
    sqInt successBoolean;

	arg = longAt(foo->stackPointer);
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin success: */
	successBoolean = becomewithtwoWaycopyHash(rcvr, arg, 0, 1);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
	}
}


/*	Similar to primitiveArrayBecomeOneWay but accepts a third argument whether to copy
	the receiver's identity hash over the argument's identity hash. */

void primitiveArrayBecomeOneWayCopyHash(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt copyHashFlag;
    sqInt rcvr;
    sqInt successBoolean;

	/* begin booleanValueOf: */
	if ((longAt(foo->stackPointer)) == foo->trueObj) {
		copyHashFlag = 1;
		goto l1;
	}
	if ((longAt(foo->stackPointer)) == foo->falseObj) {
		copyHashFlag = 0;
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	copyHashFlag = null;
l1:	/* end booleanValueOf: */;
	arg = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	rcvr = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	/* begin success: */
	successBoolean = becomewithtwoWaycopyHash(rcvr, arg, 0, copyHashFlag);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= 2 * (BYTES_PER_WORD);
	}
}


/*	Similar to primitiveArrayBecomeOneWay but does /not/ copy the receiver's
	 elements identity hashes over the argument's elements identity hashes. */

void primitiveArrayBecomeOneWayNoCopyHash(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt rcvr;
    sqInt successBoolean;

	arg = longAt(foo->stackPointer);
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin success: */
	successBoolean = becomewithtwoWaycopyHash(rcvr, arg, 0, 0);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
	}
}

void primitiveAsFloat(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt integerPointer;
    sqInt top;

	/* begin popInteger */
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		arg = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		arg = 0;
		goto l1;
	}
	arg = null;
l1:	/* end popInteger */;
	if (!foo->primFailCode) {
		pushFloat(((double) arg));
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}

void primitiveAsOop(void) {
register struct foo * foo = &fum;
    sqInt thisReceiver;
    sqInt sp;

	thisReceiver = longAt(foo->stackPointer);
	/* begin success: */
	if (!(!((thisReceiver & 1)))) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin pop:thenPushInteger: */
		longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), ((((((usqInt) (longAt(thisReceiver))) >> 17) & 0xFFF) << 1) | 1));
		foo->stackPointer = sp;
	}
}

void primitiveAt(void) {
	commonAt(0);
}


/*	nb: This primitive was previously installed as primitive 67, but is no
	longer in use. */

sqInt primitiveAtEnd(void) {
register struct foo * foo = &fum;
    sqInt index;
    sqInt limit;
    sqInt stream;
    sqInt top;
    sqInt sp;
    sqInt sp1;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	stream = top;
	if ((((stream & 1) == 0) && (((((usqInt) (longAt(stream))) >> 8) & 15) <= 4)) && ((lengthOf(stream)) >= (StreamReadLimitIndex + 1))) {
		index = fetchIntegerofObject(StreamIndexIndex, stream);
		limit = fetchIntegerofObject(StreamReadLimitIndex, stream);
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin pushBool: */
		if (index >= limit) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
			foo->stackPointer = sp;
		} else {
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
			foo->stackPointer = sp1;
		}
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
	return null;
}

void primitiveAtPut(void) {
	commonAtPut(0);
}


/*	Set the cursor to the given shape. The Mac only supports 16x16 pixel cursors. Cursor offsets are handled by Smalltalk. */

void primitiveBeCursor(void) {
register struct foo * foo = &fum;
    sqInt bitsObj;
    sqInt cursorBitsIndex;
    sqInt cursorObj;
    sqInt depth;
    sqInt extentX;
    sqInt extentY;
    sqInt i;
    sqInt maskBitsIndex;
    sqInt maskObj;
    sqInt offsetObj;
    sqInt offsetX;
    sqInt offsetY;
    sqInt ourCursor;
    sqInt successBoolean;
    sqInt successBoolean1;
    sqInt successBoolean2;
    sqInt successBoolean3;
    sqInt successBoolean4;
    sqInt successBoolean5;
    sqInt successBoolean6;
    sqInt successBoolean7;
    sqInt successBoolean8;
    sqInt successBoolean9;
    sqInt successBoolean10;
    sqInt successBoolean11;
    sqInt successBoolean12;

	if (foo->argumentCount == 0) {
		cursorObj = longAt(foo->stackPointer);
		maskBitsIndex = null;
	}
	if (foo->argumentCount == 1) {
		cursorObj = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
		maskObj = longAt(foo->stackPointer);
	}
	/* begin success: */
	if (!(foo->argumentCount < 2)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	/* begin success: */
	successBoolean11 = (((cursorObj & 1) == 0) && (((((usqInt) (longAt(cursorObj))) >> 8) & 15) <= 4)) && ((lengthOf(cursorObj)) >= 5);
	if (!(successBoolean11)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		bitsObj = longAt((cursorObj + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
		extentX = fetchIntegerofObject(1, cursorObj);
		extentY = fetchIntegerofObject(2, cursorObj);
		depth = fetchIntegerofObject(3, cursorObj);
		offsetObj = longAt((cursorObj + (BASE_HEADER_SIZE)) + (4 << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	successBoolean12 = (((offsetObj & 1) == 0) && (((((usqInt) (longAt(offsetObj))) >> 8) & 15) <= 4)) && ((lengthOf(offsetObj)) >= 2);
	if (!(successBoolean12)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		offsetX = fetchIntegerofObject(0, offsetObj);
		offsetY = fetchIntegerofObject(1, offsetObj);
		if ((foo->argumentCount == 0) && (depth == 32)) {

			/* Support arbitrary-sized 32 bit ARGB forms --bf 3/1/2007 23:51 */

			/* begin success: */
			successBoolean = (extentX > 0) && (extentY > 0);
			if (!(successBoolean)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			/* begin success: */
			successBoolean1 = (offsetX >= (extentX * -1)) && (offsetX <= 0);
			if (!(successBoolean1)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			/* begin success: */
			successBoolean2 = (offsetY >= (extentY * -1)) && (offsetY <= 0);
			if (!(successBoolean2)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			cursorBitsIndex = bitsObj + (BASE_HEADER_SIZE);
			/* begin success: */
			successBoolean3 = (((bitsObj & 1) == 0) && (((((usqInt) (longAt(bitsObj))) >> 8) & 15) == 6)) && ((lengthOf(bitsObj)) == (extentX * extentY));
			if (!(successBoolean3)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			;
		} else {
			/* begin success: */
			successBoolean4 = (extentX == 16) && ((extentY == 16) && (depth == 1));
			if (!(successBoolean4)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			/* begin success: */
			successBoolean5 = (offsetX >= -16) && (offsetX <= 0);
			if (!(successBoolean5)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			/* begin success: */
			successBoolean6 = (offsetY >= -16) && (offsetY <= 0);
			if (!(successBoolean6)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			/* begin success: */
			successBoolean7 = (((bitsObj & 1) == 0) && (((((usqInt) (longAt(bitsObj))) >> 8) & 15) == 6)) && ((lengthOf(bitsObj)) == 16);
			if (!(successBoolean7)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			cursorBitsIndex = bitsObj + (BASE_HEADER_SIZE);
			;
		}
	}
	if (foo->argumentCount == 1) {
		/* begin success: */
		successBoolean10 = (((maskObj & 1) == 0) && (((((usqInt) (longAt(maskObj))) >> 8) & 15) <= 4)) && ((lengthOf(maskObj)) >= 5);
		if (!(successBoolean10)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		if (!foo->primFailCode) {
			bitsObj = longAt((maskObj + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
			extentX = fetchIntegerofObject(1, maskObj);
			extentY = fetchIntegerofObject(2, maskObj);
			depth = fetchIntegerofObject(3, maskObj);
		}
		if (!foo->primFailCode) {
			/* begin success: */
			successBoolean8 = (extentX == 16) && ((extentY == 16) && (depth == 1));
			if (!(successBoolean8)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			/* begin success: */
			successBoolean9 = (((bitsObj & 1) == 0) && (((((usqInt) (longAt(bitsObj))) >> 8) & 15) == 6)) && ((lengthOf(bitsObj)) == 16);
			if (!(successBoolean9)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			maskBitsIndex = bitsObj + (BASE_HEADER_SIZE);
		}
	}
	if (!foo->primFailCode) {
		if (foo->argumentCount == 0) {
			if (depth == 32) {
				if (!(ioSetCursorARGB(cursorBitsIndex, extentX, extentY, offsetX, offsetY))) {
					/* begin success: */
					if (!(0)) {
						if (!foo->primFailCode) {
							foo->primFailCode = 1;
						}
					}
					return;
				}
			} else {
				ioSetCursor(cursorBitsIndex, offsetX, offsetY);
			}
		} else {
			ioSetCursorWithMask(cursorBitsIndex, maskBitsIndex, offsetX, offsetY);
		}
		/* begin pop: */
		foo->stackPointer -= foo->argumentCount * (BYTES_PER_WORD);
	}
}


/*	Record the system Display object in the specialObjectsTable. */

void primitiveBeDisplay(void) {
register struct foo * foo = &fum;
    sqInt rcvr;
    sqInt successBoolean;

	rcvr = longAt(foo->stackPointer);
	/* begin success: */
	successBoolean = (((rcvr & 1) == 0) && (((((usqInt) (longAt(rcvr))) >> 8) & 15) <= 4)) && ((lengthOf(rcvr)) >= 4);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(foo->specialObjectsOop, rcvr);
		}
		longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheDisplay << (SHIFT_FOR_WORD)), rcvr);
	}
}


/*	make the basic beep noise */

void primitiveBeep(void) {
	ioBeep();
}

void primitiveBehaviorHash(void) {
register struct foo * foo = &fum;
    sqInt hashOrError;
    sqInt sp;

	assert(!(((stackTop()) & 1)));
	hashOrError = (((usqInt) (longAt(longAt(foo->stackPointer)))) >> 17) & 0xFFF;
	if (hashOrError >= 0) {
		/* begin pop:thenPushInteger: */
		longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), ((hashOrError << 1) | 1));
		foo->stackPointer = sp;
	} else {
		foo->primFailCode = -hashOrError;
	}
}

void primitiveBitAnd(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt object;
    sqInt sp;
    sqInt top;
    sqInt top1;
    sqInt top2;
    sqInt top11;

	/* begin popPos32BitInteger */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	top = top1;
	integerArgument = positive32BitValueOf(top);
	/* begin popPos32BitInteger */
	/* begin popStack */
	top11 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	top2 = top11;
	integerReceiver = positive32BitValueOf(top2);
	if (!foo->primFailCode) {
		/* begin push: */
		object = positive32BitIntegerFor(integerReceiver & integerArgument);
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Primitive logical operations for large integers in 64 bit range */

EXPORT(void) primitiveBitAndLargeIntegers(void) {
register struct foo * foo = &fum;
    sqLong integerArg;
    sqLong integerRcvr;
    sqInt oopResult;
    sqInt sp;

	integerArg = positive64BitValueOf(longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	integerRcvr = positive64BitValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	if (!(!foo->primFailCode)) {
		return;
	}
	oopResult = positive64BitIntegerFor(integerRcvr & integerArg);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}

void primitiveBitOr(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt object;
    sqInt sp;
    sqInt top;
    sqInt top1;
    sqInt top2;
    sqInt top11;

	/* begin popPos32BitInteger */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	top = top1;
	integerArgument = positive32BitValueOf(top);
	/* begin popPos32BitInteger */
	/* begin popStack */
	top11 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	top2 = top11;
	integerReceiver = positive32BitValueOf(top2);
	if (!foo->primFailCode) {
		/* begin push: */
		object = positive32BitIntegerFor(integerReceiver | integerArgument);
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Primitive logical operations for large integers in 64 bit range */

EXPORT(void) primitiveBitOrLargeIntegers(void) {
register struct foo * foo = &fum;
    sqLong integerArg;
    sqLong integerRcvr;
    sqInt oopResult;
    sqInt sp;

	integerArg = positive64BitValueOf(longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	integerRcvr = positive64BitValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	if (!(!foo->primFailCode)) {
		return;
	}
	oopResult = positive64BitIntegerFor(integerRcvr | integerArg);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}

void primitiveBitShift(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    unsigned shifted;
    sqInt object;
    sqInt sp;
    sqInt top;
    sqInt top1;
    sqInt integerPointer;
    sqInt top2;

	/* begin popInteger */
	/* begin popStack */
	top2 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top2;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		integerArgument = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerArgument = 0;
		goto l1;
	}
	integerArgument = null;
l1:	/* end popInteger */;
	/* begin popPos32BitInteger */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	top = top1;
	integerReceiver = positive32BitValueOf(top);
	if (!foo->primFailCode) {
		if (integerArgument >= 0) {

			/* Left shift -- must fail if we lose bits beyond 32 */

			/* begin success: */
			if (!(integerArgument <= 0x1F)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			shifted = integerReceiver << integerArgument;
			/* begin success: */
			if (!((((usqInt) shifted) >> integerArgument) == integerReceiver)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
		} else {

			/* Right shift -- OK to lose bits */

			/* begin success: */
			if (!(integerArgument >= -31)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			shifted = ((usqInt) integerReceiver) >> (0 - integerArgument);
		}
	}
	if (!foo->primFailCode) {
		/* begin push: */
		object = positive32BitIntegerFor(shifted);
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Primitive arithmetic operations for large integers in 64 bit range */

EXPORT(void) primitiveBitShiftLargeIntegers(void) {
register struct foo * foo = &fum;
    usqLong a;
    sqInt aIsNegative;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt shift;
    sqInt sp;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		shift = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		shift = 0;
		goto l1;
	}
	shift = null;
l1:	/* end stackIntegerValue: */;
	oopRcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	a = magnitude64BitValueOf(oopRcvr);
	if (!(!foo->primFailCode)) {
		return;
	}
	if (shift >= 0) {

		/* Protect against overflow */


		/* This is to avoid undue (usqInt) cast */

		result = 0xFFFFFFFFFFFFFFFFULL;
		if ((shift >= 64) || (a > (((usqInt) result) >> shift))) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
		result = a << shift;
	} else {
		shift = 0 - shift;
		if (shift >= 64) {
			result = 0;
		} else {
			result = ((usqInt) a) >> shift;
		}
		if (aIsNegative && ((result << shift) != a)) {
			result += 1;
		}
	}
	oopResult = magnitude64BitIntegerForneg(result, aIsNegative);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}

void primitiveBitXor(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt object;
    sqInt sp;
    sqInt top;
    sqInt top1;
    sqInt top2;
    sqInt top11;

	/* begin popPos32BitInteger */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	top = top1;
	integerArgument = positive32BitValueOf(top);
	/* begin popPos32BitInteger */
	/* begin popStack */
	top11 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	top2 = top11;
	integerReceiver = positive32BitValueOf(top2);
	if (!foo->primFailCode) {
		/* begin push: */
		object = positive32BitIntegerFor(integerReceiver ^ integerArgument);
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Primitive logical operations for large integers in 64 bit range */

EXPORT(void) primitiveBitXorLargeIntegers(void) {
register struct foo * foo = &fum;
    sqLong integerArg;
    sqLong integerRcvr;
    sqInt oopResult;
    sqInt sp;

	integerArg = positive64BitValueOf(longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	integerRcvr = positive64BitValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	if (!(!foo->primFailCode)) {
		return;
	}
	oopResult = positive64BitIntegerFor(integerRcvr ^ integerArg);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}

sqInt primitiveBlockCopy(void) {
register struct foo * foo = &fum;
    sqInt context;
    sqInt contextSize;
    sqInt initialIP;
    sqInt methodContext;
    sqInt newContext;
    sqInt header;
    sqInt oop;
    sqInt sp;

	context = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if (((longAt((context + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)))) & 1)) {

		/* context is a block; get the context of its enclosing method */

		methodContext = longAt((context + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
	} else {
		methodContext = context;
	}
	/* begin sizeBitsOf: */
	header = longAt(methodContext);
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		contextSize = (longAt(methodContext - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l1;
	} else {
		contextSize = header & (SIZE_MASK);
		goto l1;
	}
l1:	/* end sizeBitsOf: */;

	/* context is no longer needed and is not preserved across allocation */
	/* remap methodContext in case GC happens during allocation */

	context = null;
	/* begin pushRemappableOop: */
	foo->remapBuffer[(foo->remapBufferCount += 1)] = methodContext;
	newContext = instantiateContextsizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBlockContext << (SHIFT_FOR_WORD))), contextSize);
	/* begin popRemappableOop */
	oop = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	methodContext = oop;

	/* Was instructionPointer + 3, but now it's greater by 1 due to preIncrement */
	/* Assume: have just allocated a new context; it must be young.
	 Thus, can use uncheck stores. See the comment in fetchContextRegisters. */

	initialIP = (((((foo->instructionPointer + 1) + 3) - (foo->method + (BASE_HEADER_SIZE))) << 1) | 1);
	longAtput((newContext + (BASE_HEADER_SIZE)) + (InitialIPIndex << (SHIFT_FOR_WORD)), initialIP);
	longAtput((newContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), initialIP);
	/* begin storeStackPointerValue:inContext: */
	longAtput((newContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
	longAtput((newContext + (BASE_HEADER_SIZE)) + (BlockArgumentCountIndex << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	longAtput((newContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)), methodContext);
	longAtput((newContext + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)), foo->nilObj);
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), newContext);
	foo->stackPointer = sp;
	return null;
}


/*	Answer the encoder names for the supported bytecode sets. */

EXPORT(sqInt) primitiveBytecodeSetsAvailable(void) {
register struct foo * foo = &fum;
    sqInt encoderName;
    sqInt encoderNames;
    sqInt oop;
    sqInt sp;

	if (foo->argumentCount > 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	encoderNames = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))), 1);
	/* begin pushRemappableOop: */
	foo->remapBuffer[(foo->remapBufferCount += 1)] = encoderNames;
	encoderName = stringForCString("EncoderForV3PlusClosures");
	/* begin popRemappableOop */
	oop = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	encoderNames = oop;
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) encoderNames)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(encoderNames, encoderName);
	}
	longAtput((encoderNames + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), encoderName);
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), encoderNames);
	foo->stackPointer = sp;
	return null;
}


/*	Reports bytes available at this moment. For more meaningful 
	results, calls to this primitive should be preceeded by a full 
	or incremental garbage collection. */

void primitiveBytesLeft(void) {
register struct foo * foo = &fum;
    sqInt aBool;
    sqInt oop;
    sqInt sp;
    sqInt oop1;
    sqInt sp1;

	if (foo->argumentCount == 0) {

		/* old behavior - just return the size of the free block */

		/* begin pop:thenPush: */
		oop = positive64BitIntegerFor((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK));
		longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), oop);
		foo->stackPointer = sp;
		return;
	}
	if (foo->argumentCount == 1) {

		/* new behaviour -including or excluding swap space depending on aBool */

		/* begin booleanValueOf: */
		if ((longAt(foo->stackPointer)) == foo->trueObj) {
			aBool = 1;
			goto l1;
		}
		if ((longAt(foo->stackPointer)) == foo->falseObj) {
			aBool = 0;
			goto l1;
		}
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		aBool = null;
	l1:	/* end booleanValueOf: */;
		if (!(!foo->primFailCode)) {
			return;
		}
		/* begin pop:thenPush: */
		oop1 = positive64BitIntegerFor(((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK)) + (sqMemoryExtraBytesLeft(aBool)));
		longAtput((sp1 = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oop1);
		foo->stackPointer = sp1;
		return;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return;
}


/*	Perform a function call to a foreign function.
	Only invoked from method containing explicit external call spec.
	Due to this we use the pluggable prim mechanism explicitly here
	(the first literal of any FFI spec'ed method is an ExternalFunction
	and not an array as used in the pluggable primitive mechanism). */

void primitiveCalloutToFFI(void) {
register struct foo * foo = &fum;
    static void *function = 0;
    static char *functionName = "primitiveCallout";
    static char *moduleName = "SqueakFFIPrims";

	if (function == 0) {
		function = ioLoadExternalFunctionOfLengthFromModuleOfLength(oopForPointer(functionName), 16, oopForPointer(moduleName), 14);
		if (function == 0) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
	}
	((sqInt (*)(void))function)(); return;
}


/*	Primitive.  Change the class of the receiver into the class of the argument given that
	 the format of the receiver matches the format of the argument's class.  Fail if the
	 receiver or argument are SmallIntegers, or the receiver is an instance of a compact
	 class and the argument isn't, or when the argument's class is compact and the receiver
	 isn't, or when the format of the receiver is different from the format of the argument's
	 class, or when the arguments class is fixed and the receiver's size differs from the size
	 that an instance of the argument's class should have. */

void primitiveChangeClass(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt argClass;
    sqInt err;
    sqInt rcvr;
    sqInt i;
    sqInt oop;
    sqInt oop1;
    sqInt ccIndex;
    sqInt oop11;

	/* begin stackObjectValue: */
	oop = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	if ((oop & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		arg = null;
		goto l1;
	}
	arg = oop;
l1:	/* end stackObjectValue: */;
	/* begin stackObjectValue: */
	oop1 = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if ((oop1 & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		rcvr = null;
		goto l2;
	}
	rcvr = oop1;
l2:	/* end stackObjectValue: */;
	if (!(!foo->primFailCode)) {
		return;
	}
	/* begin fetchClassOfNonInt: */
	ccIndex = (((usqInt) (longAt(arg))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		argClass = (longAt(arg - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l3;
	} else {
		/* begin fetchPointer:ofObject: */
		oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		argClass = longAt((oop11 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l3;
	}
l3:	/* end fetchClassOfNonInt: */;
	err = changeClassOfto(rcvr, argClass);
	if (err == 0) {

		/* Flush at cache because rcvr's class has changed. */

		/* begin flushAtCache */
		for (i = 1; i <= AtCacheTotalSize; i += 1) {
			foo->atCache[i] = 0;
		}
		/* begin pop: */
		foo->stackPointer -= foo->argumentCount * (BYTES_PER_WORD);
	} else {
		foo->primFailCode = err;
	}
	return;
}

void primitiveClass(void) {
register struct foo * foo = &fum;
    sqInt instance;
    sqInt oop;
    sqInt sp;
    sqInt ccIndex;
    sqInt oop1;

	instance = longAt(foo->stackPointer);
	/* begin pop:thenPush: */
	/* begin fetchClassOf: */
	if ((instance & 1)) {
		oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(instance))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		oop = (longAt(instance - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		oop = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), oop);
	foo->stackPointer = sp;
}


/*	When called with a single string argument, post the string to 
	the clipboard. When called with zero arguments, return a 
	string containing the current clipboard contents. */

void primitiveClipboardText(void) {
register struct foo * foo = &fum;
    sqInt s;
    sqInt sz;
    sqInt sp;

	if (foo->argumentCount == 1) {
		s = longAt(foo->stackPointer);
		if (!(((s & 1) == 0) && (((((usqInt) (longAt(s))) >> 8) & 15) >= 8))) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
		if (!foo->primFailCode) {
			sz = stSizeOf(s);
			clipboardWriteFromAt(sz, s + (BASE_HEADER_SIZE), 0);
			/* begin pop: */
			foo->stackPointer -= 1 * (BYTES_PER_WORD);
		}
	} else {
		sz = clipboardSize();
		if (!(sufficientSpaceToAllocate(sz))) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
		s = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassString << (SHIFT_FOR_WORD))), sz);
		clipboardReadIntoAt(sz, s + (BASE_HEADER_SIZE), 0);
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), s);
		foo->stackPointer = sp;
	}
}


/*	Return a shallow copy of the receiver. */

void primitiveClone(void) {
register struct foo * foo = &fum;
    sqInt newCopy;
    sqInt sp;

	newCopy = clone(longAt(foo->stackPointer));
	if (newCopy == 0) {

		/* not enough memory most likely */

		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), newCopy);
	foo->stackPointer = sp;
}

void primitiveClosureCopyWithCopiedValues(void) {
register struct foo * foo = &fum;
    sqInt copiedValues;
    sqInt i;
    sqInt newClosure;
    sqInt numArgs;
    sqInt numCopiedValues;
    sqInt valuePointer;
    sqInt successBoolean;
    sqInt sz;
    sqInt header;
    sqInt initialIP;
    sqInt newClosure1;
    sqInt sp;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		numArgs = (integerPointer >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		numArgs = 0;
		goto l2;
	}
	numArgs = null;
l2:	/* end stackIntegerValue: */;
	copiedValues = longAt(foo->stackPointer);
	/* begin success: */
	successBoolean = (fetchClassOf(copiedValues)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))));
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin fetchWordLengthOf: */
	/* begin sizeBitsOf: */
	header = longAt(copiedValues);
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(copiedValues - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l1;
	} else {
		sz = header & (SIZE_MASK);
		goto l1;
	}
l1:	/* end sizeBitsOf: */;
	numCopiedValues = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
	/* begin closureNumArgs:instructionPointer:numCopiedValues: */
	initialIP = (foo->instructionPointer + 2) - (foo->method + (BASE_HEADER_SIZE));
	newClosure1 = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBlockClosure << (SHIFT_FOR_WORD))), ((BYTES_PER_WORD) * (ClosureFirstCopiedValueIndex + numCopiedValues)) + (BASE_HEADER_SIZE));
	longAtput((newClosure1 + (BASE_HEADER_SIZE)) + (ClosureStartPCIndex << (SHIFT_FOR_WORD)), ((initialIP << 1) | 1));
	longAtput((newClosure1 + (BASE_HEADER_SIZE)) + (ClosureNumArgsIndex << (SHIFT_FOR_WORD)), ((numArgs << 1) | 1));
	newClosure = newClosure1;
	longAtput((newClosure + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - (2 * (BYTES_PER_WORD))));
	if (numCopiedValues > 0) {

		/* Allocation may have done a GC and copiedValues may have moved. */

		copiedValues = longAt(foo->stackPointer);
		for (i = 0; i <= (numCopiedValues - 1); i += 1) {

			/* Assume: have just allocated a new BlockClosure; it must be young.
			 Thus, can use unchecked stores. */

			/* begin storePointerUnchecked:ofObject:withValue: */
			valuePointer = longAt((copiedValues + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)));
			longAtput((newClosure + (BASE_HEADER_SIZE)) + ((i + ClosureFirstCopiedValueIndex) << (SHIFT_FOR_WORD)), valuePointer);
		}
	}
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((3 - 1) * (BYTES_PER_WORD))), newClosure);
	foo->stackPointer = sp;
}

void primitiveClosureValue(void) {
register struct foo * foo = &fum;
    sqInt blockArgumentCount;
    sqInt blockClosure;
    sqInt closureMethod;
    sqInt outerContext;

	blockClosure = longAt(foo->stackPointer - (foo->argumentCount * (BYTES_PER_WORD)));
	blockArgumentCount = ((longAt((blockClosure + (BASE_HEADER_SIZE)) + (ClosureNumArgsIndex << (SHIFT_FOR_WORD)))) >> 1);
	if (!(foo->argumentCount == blockArgumentCount)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	outerContext = longAt((blockClosure + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)));
	if (!(((outerContext & 1) == 0) && ((((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == 13) || ((((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == 14) || (((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == 4))))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}

	/* Check if the closure's method is actually a CompiledMethod. */

	closureMethod = longAt((outerContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	if (!(((closureMethod & 1) == 0) && (((((usqInt) (longAt(closureMethod))) >> 8) & 15) >= 12))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	activateNewClosureMethod(blockClosure);
	/* begin quickCheckForInterrupts */
	if (((foo->interruptCheckCounter -= 1)) <= 0) {
		checkForInterrupts();
	}
}


/*	An exact clone of primitiveClosureValue except that this version will not
	 check for interrupts on stack overflow. */

void primitiveClosureValueNoContextSwitch(void) {
register struct foo * foo = &fum;
    sqInt blockArgumentCount;
    sqInt blockClosure;
    sqInt closureMethod;
    sqInt outerContext;

	blockClosure = longAt(foo->stackPointer - (foo->argumentCount * (BYTES_PER_WORD)));
	blockArgumentCount = ((longAt((blockClosure + (BASE_HEADER_SIZE)) + (ClosureNumArgsIndex << (SHIFT_FOR_WORD)))) >> 1);
	if (!(foo->argumentCount == blockArgumentCount)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	outerContext = longAt((blockClosure + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)));
	if (!(((outerContext & 1) == 0) && ((((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == 13) || ((((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == 14) || (((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == 4))))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}

	/* Check if the closure's method is actually a CompiledMethod. */

	closureMethod = longAt((outerContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	if (!(((closureMethod & 1) == 0) && (((((usqInt) (longAt(closureMethod))) >> 8) & 15) >= 12))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	activateNewClosureMethod(blockClosure);
}

void primitiveClosureValueWithArgs(void) {
register struct foo * foo = &fum;
    sqInt argumentArray;
    sqInt arraySize;
    sqInt blockArgumentCount;
    sqInt blockClosure;
    sqInt closureMethod;
    sqInt cntxSize;
    sqInt index;
    sqInt outerContext;
    sqInt object;
    sqInt sp;
    sqInt sz;
    sqInt header;
    sqInt sz1;
    sqInt header1;
    sqInt top;

	argumentArray = longAt(foo->stackPointer);
	if (!(((argumentArray & 1) == 0) && (((((usqInt) (longAt(argumentArray))) >> 8) & 15) == 2))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin fetchWordLengthOf: */
	/* begin sizeBitsOf: */
	header = longAt(argumentArray);
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(argumentArray - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l1;
	} else {
		sz = header & (SIZE_MASK);
		goto l1;
	}
l1:	/* end sizeBitsOf: */;
	arraySize = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
	/* begin fetchWordLengthOf: */
	/* begin sizeBitsOf: */
	header1 = longAt(foo->activeContext);
	if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
		sz1 = (longAt(foo->activeContext - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l2;
	} else {
		sz1 = header1 & (SIZE_MASK);
		goto l2;
	}
l2:	/* end sizeBitsOf: */;
	cntxSize = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
	if (!(((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) + arraySize) < cntxSize)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	blockClosure = longAt(foo->stackPointer - (foo->argumentCount * (BYTES_PER_WORD)));
	blockArgumentCount = ((longAt((blockClosure + (BASE_HEADER_SIZE)) + (ClosureNumArgsIndex << (SHIFT_FOR_WORD)))) >> 1);
	if (!(arraySize == blockArgumentCount)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	outerContext = longAt((blockClosure + (BASE_HEADER_SIZE)) + (ClosureOuterContextIndex << (SHIFT_FOR_WORD)));
	if (!(((outerContext & 1) == 0) && ((((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == 13) || ((((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == 14) || (((((usqInt) (longAt(outerContext))) >> 12) & 0x1F) == 4))))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}

	/* Check if the closure's method is actually a CompiledMethod. */

	closureMethod = longAt((outerContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	if (!(((closureMethod & 1) == 0) && (((((usqInt) (longAt(closureMethod))) >> 8) & 15) >= 12))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	index = 1;
	while (index <= arraySize) {
		/* begin push: */
		object = longAt((argumentArray + (BASE_HEADER_SIZE)) + ((index - 1) << (SHIFT_FOR_WORD)));
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
		index += 1;
	}
	foo->argumentCount = arraySize;
	activateNewClosureMethod(blockClosure);
	/* begin quickCheckForInterrupts */
	if (((foo->interruptCheckCounter -= 1)) <= 0) {
		checkForInterrupts();
	}
}


/*	Fill the receiver, which must be an indexable bytes or words 
	objects, with the given integer value. */

void primitiveConstantFill(void) {
register struct foo * foo = &fum;
    usqInt end;
    sqInt fillValue;
    usqInt i;
    sqInt rcvr;
    sqInt rcvrIsBytes;
    sqInt successBoolean;
    sqInt successBoolean1;

	fillValue = positive32BitValueOf(longAt(foo->stackPointer));
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin success: */
	successBoolean1 = ((rcvr & 1) == 0) && (isWordsOrBytesNonInt(rcvr));
	if (!(successBoolean1)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	rcvrIsBytes = ((rcvr & 1) == 0) && (((((usqInt) (longAt(rcvr))) >> 8) & 15) >= 8);
	if (rcvrIsBytes) {
		/* begin success: */
		successBoolean = (fillValue >= 0) && (fillValue <= 0xFF);
		if (!(successBoolean)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!foo->primFailCode) {
		end = rcvr + (sizeBitsOf(rcvr));
		i = rcvr + (BASE_HEADER_SIZE);
		if (rcvrIsBytes) {
			while (i < end) {
				byteAtput(i, fillValue);
				i += 1;
			}
		} else {
			while (i < end) {
				long32Atput(i, fillValue);
				i += 4;
			}
		}
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
	}
}


/*	Primitive. Copy the state of the receiver from the argument. 
		Fail if receiver and argument are of a different class. 
		Fail if the receiver or argument are non-pointer objects.
		Fail if receiver and argument have different lengths (for indexable objects).
	 */

void primitiveCopyObject(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt i;
    sqInt length;
    sqInt rcvr;
    sqInt header;
    sqInt valuePointer;
    sqInt oop;
    sqInt oop1;
    sqInt sz;

	if (!(foo->argumentCount == 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin stackObjectValue: */
	oop = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	if ((oop & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		arg = null;
		goto l1;
	}
	arg = oop;
l1:	/* end stackObjectValue: */;
	/* begin stackObjectValue: */
	oop1 = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if ((oop1 & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		rcvr = null;
		goto l2;
	}
	rcvr = oop1;
l2:	/* end stackObjectValue: */;
	if (foo->primFailCode) {
		return;
	}
	if (!(((rcvr & 1) == 0) && (((((usqInt) (longAt(rcvr))) >> 8) & 15) <= 4))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (!((fetchClassOf(rcvr)) == (fetchClassOf(arg)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin lengthOf: */
	header = longAt(rcvr);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(rcvr - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = header & (SIZE_MASK);
	}
	sz -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		length = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l3;
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		length = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l3;
	} else {
		length = (sz - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
		goto l3;
	}
l3:	/* end lengthOf:baseHeader:format: */;
	if (!(length == (lengthOf(arg)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	for (i = 0; i <= (length - 1); i += 1) {
		/* begin storePointer:ofObject:withValue: */
		valuePointer = longAt((arg + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)));
		if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(rcvr, valuePointer);
		}
		longAtput((rcvr + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)), valuePointer);
	}
	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
}

void primitiveCosine(void) {
register struct foo * foo = &fum;
    double rcvr;

	rcvr = popFloat();
	if (!foo->primFailCode) {
		pushFloat(cos(rcvr));
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	Set or clear the flag that controls whether modifications of 
	the Display object are propagated to the underlying 
	platform's screen. */

void primitiveDeferDisplayUpdates(void) {
register struct foo * foo = &fum;
    sqInt flag;

	flag = longAt(foo->stackPointer);
	if (flag == foo->trueObj) {
		foo->deferDisplayUpdates = 1;
	} else {
		if (flag == foo->falseObj) {
			foo->deferDisplayUpdates = 0;
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
	}
}


/*	Pass in a non-negative value to disable the architectures powermanager if any, zero to enable. This is a named (not numbered) primitive in the null module (ie the VM) */

EXPORT(sqInt) primitiveDisablePowerManager(void) {
register struct foo * foo = &fum;
    sqInt integer;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		integer = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integer = 0;
		goto l1;
	}
	integer = null;
l1:	/* end stackIntegerValue: */;
	if (!foo->primFailCode) {
		ioDisablePowerManager(integer);
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
	}
	return null;
}

void primitiveDiv(void) {
register struct foo * foo = &fum;
    sqInt quotient;
    sqInt sp;

	quotient = doPrimitiveDivby(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer));
	/* begin pop2AndPushIntegerIfOK: */
	if (!foo->primFailCode) {
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) quotient)) ^ ((((int) quotient)) << 1)) >= 0)
# else
			((quotient >= -1073741824) && (quotient <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			/* begin pop:thenPush: */
			longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), ((quotient << 1) | 1));
			foo->stackPointer = sp;
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
	}
}


/*	Primitive arithmetic operations for large integers in 64 bit range */

EXPORT(void) primitiveDivLargeIntegers(void) {
register struct foo * foo = &fum;
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong rem;
    usqLong result;
    sqInt sp;

	oopArg = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	oopRcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (b == 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return;
	}
	result = a / b;
	if (!(a == 0)) {
		if (!(bIsNegative == aIsNegative)) {

			/* Round toward negative infinity */

			rem = a % b;
			if (!(rem == 0)) {

				/* This can not overflow, because b > 1, otherwise rem = 0 */

				result += 1;
			}
		}
	}
	oopResult = magnitude64BitIntegerForneg(result, bIsNegative != aIsNegative);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}

void primitiveDivide(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt sp;
    sqInt integerPointer;
    sqInt integerPointer1;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		integerReceiver = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerReceiver = 0;
		goto l1;
	}
	integerReceiver = null;
l1:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		integerArgument = (integerPointer1 >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerArgument = 0;
		goto l2;
	}
	integerArgument = null;
l2:	/* end stackIntegerValue: */;
	if ((integerArgument != 0) && ((integerReceiver % integerArgument) == 0)) {
		/* begin pop2AndPushIntegerIfOK: */
		if (!foo->primFailCode) {
			if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
				(((((int) (integerReceiver / integerArgument))) ^ ((((int) (integerReceiver / integerArgument))) << 1)) >= 0)
# else
				(((integerReceiver / integerArgument) >= -1073741824) && ((integerReceiver / integerArgument) <= 0x3FFFFFFF))
# endif  // SQ_HOST32
			) {
				/* begin pop:thenPush: */
				longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (((integerReceiver / integerArgument) << 1) | 1));
				foo->stackPointer = sp;
			} else {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
			}
		}
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
}


/*	Primitive arithmetic operations for large integers in 64 bit range */

EXPORT(void) primitiveDivideLargeIntegers(void) {
register struct foo * foo = &fum;
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt sp;

	oopArg = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	oopRcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (!(!foo->primFailCode)) {
		return;
	}
	if (!((b != 0) && ((a % b) == 0))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	result = a / b;
	oopResult = magnitude64BitIntegerForneg(result, aIsNegative != bIsNegative);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}

void primitiveDoPrimitiveWithArgs(void) {
register struct foo * foo = &fum;
    sqInt argumentArray;
    sqInt arraySize;
    sqInt cntxSize;
    sqInt index;
    sqInt primIdx;
    sqInt object;
    sqInt sp;
    sqInt sp1;
    sqInt sp2;
    sqInt sz;
    sqInt header;
    sqInt sz1;
    sqInt header1;
    sqInt successBoolean;
    sqInt oop;
    sqInt integerPointer;

	argumentArray = longAt(foo->stackPointer);
	/* begin fetchWordLengthOf: */
	/* begin sizeBitsOf: */
	header = longAt(argumentArray);
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(argumentArray - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l1;
	} else {
		sz = header & (SIZE_MASK);
		goto l1;
	}
l1:	/* end sizeBitsOf: */;
	arraySize = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
	/* begin fetchWordLengthOf: */
	/* begin sizeBitsOf: */
	header1 = longAt(foo->activeContext);
	if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
		sz1 = (longAt(foo->activeContext - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l2;
	} else {
		sz1 = header1 & (SIZE_MASK);
		goto l2;
	}
l2:	/* end sizeBitsOf: */;
	cntxSize = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
	/* begin success: */
	successBoolean = ((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) + arraySize) < cntxSize;
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!(((argumentArray & 1) == 0) && (((((usqInt) (longAt(argumentArray))) >> 8) & 15) == 2))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		primIdx = (integerPointer >> 1);
		goto l3;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		primIdx = 0;
		goto l3;
	}
	primIdx = null;
l3:	/* end stackIntegerValue: */;
	if (!(!foo->primFailCode)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin pop: */
	foo->stackPointer -= 2 * (BYTES_PER_WORD);
	foo->primitiveIndex = primIdx;
	foo->argumentCount = arraySize;
	index = 1;
	while (index <= foo->argumentCount) {
		/* begin push: */
		object = longAt((argumentArray + (BASE_HEADER_SIZE)) + ((index - 1) << (SHIFT_FOR_WORD)));
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
		index += 1;
	}
	/* begin pushRemappableOop: */
	foo->remapBuffer[(foo->remapBufferCount += 1)] = argumentArray;
	foo->lkupClass = foo->nilObj;
	primitiveResponse();
	/* begin popRemappableOop */
	oop = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	argumentArray = oop;
	if (!(!foo->primFailCode)) {

		/* If primitive failed, then restore state for failure code */

		/* begin pop: */
		foo->stackPointer -= arraySize * (BYTES_PER_WORD);
		/* begin pushInteger: */
		/* begin push: */
		longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), ((primIdx << 1) | 1));
		foo->stackPointer = sp1;
		/* begin push: */
		longAtput((sp2 = foo->stackPointer + (BYTES_PER_WORD)), argumentArray);
		foo->stackPointer = sp2;
		foo->argumentCount = 2;
	}
}


/*	Attempt to enter a CriticalSection/Mutex.  If not owned, set the owner to the current
	 process and answer false. If owned by the current process  answer true.   Otherwise
	 suspend the process.  Answer if the receiver is owned by the current process.
	 For simulation if there is an argument it is taken to be the effective activeProcess
	 (see Process>>effectiveProcess). */

void primitiveEnterCriticalSection(void) {
register struct foo * foo = &fum;
    sqInt activeProc;
    sqInt criticalSection;
    sqInt owningProcess;
    sqInt owningProcessIndex;
    sqInt oop;
    sqInt sp;
    sqInt sp1;
    sqInt sp2;
    sqInt oop1;

	if (foo->argumentCount > 0) {

		/* rcvr */

		criticalSection = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
		activeProc = longAt(foo->stackPointer);
	} else {

		/* rcvr */

		criticalSection = longAt(foo->stackPointer);
		/* begin fetchPointer:ofObject: */
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
		oop = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
		activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	}

	/* CriticalSections are laid out like Semaphores */

	owningProcessIndex = ExcessSignalsIndex;
	owningProcess = longAt((criticalSection + (BASE_HEADER_SIZE)) + (owningProcessIndex << (SHIFT_FOR_WORD)));
	if (owningProcess == foo->nilObj) {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) criticalSection)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(criticalSection, activeProc);
		}
		longAtput((criticalSection + (BASE_HEADER_SIZE)) + (owningProcessIndex << (SHIFT_FOR_WORD)), activeProc);
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), foo->falseObj);
		foo->stackPointer = sp;
		return;
	}
	if (owningProcess == activeProc) {
		/* begin pop:thenPush: */
		longAtput((sp1 = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), foo->trueObj);
		foo->stackPointer = sp1;
		return;
	}
	/* begin pop:thenPush: */
	longAtput((sp2 = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), foo->falseObj);
	foo->stackPointer = sp2;
	addLastLinktoList(activeProc, criticalSection);
	transferTo(wakeHighestPriority());
}

void primitiveEqual(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt result;
    sqInt top;
    sqInt top1;
    sqInt sp;
    sqInt sp1;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerArgument = top;
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerReceiver = top1;
	/* begin compare31or32Bits:equal: */
	if (((integerReceiver & 1)) && ((integerArgument & 1))) {
		result = integerReceiver == integerArgument;
		goto l1;
	}
	result = (positive32BitValueOf(integerReceiver)) == (positive32BitValueOf(integerArgument));
l1:	/* end compare31or32Bits:equal: */;
	/* begin checkBooleanResult: */
	if (!foo->primFailCode) {
		/* begin pushBool: */
		if (result) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
			foo->stackPointer = sp;
		} else {
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
			foo->stackPointer = sp1;
		}
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Primitive comparison operations for large integers in 64 bit range */

EXPORT(void) primitiveEqualLargeIntegers(void) {
register struct foo * foo = &fum;
    sqLong integerArg;
    sqLong integerRcvr;
    sqInt sp;

	integerArg = signed64BitValueOf(longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	integerRcvr = signed64BitValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (integerRcvr == integerArg
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}

sqInt primitiveErrorTable(void) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (PrimErrTableIndex << (SHIFT_FOR_WORD)));
}


/*	receiver, args, then method are on top of stack. Execute method against receiver and args */

void primitiveExecuteMethod(void) {
register struct foo * foo = &fum;
    sqInt top;
    sqInt primBits;
    sqInt successBoolean;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	foo->newMethod = top;
	/* begin primitiveIndexOf: */
	primBits = (((usqInt) (longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 1) & 268435967;
	foo->primitiveIndex = (primBits & 0x1FF) + (((usqInt) primBits) >> 19);
	/* begin success: */
	successBoolean = (foo->argumentCount - 1) == ((((usqInt) (longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 25) & 15);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		foo->argumentCount -= 1;
		/* begin executeNewMethod */
		if (foo->primitiveIndex > 0) {
			primitiveResponse();
			if (!foo->primFailCode) {
				goto l1;
			}
		}
		activateNewMethod();
		/* begin quickCheckForInterrupts */
		if (((foo->interruptCheckCounter -= 1)) <= 0) {
			checkForInterrupts();
		}
	l1:	/* end executeNewMethod */;
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	receiver, argsArray, then method are on top of stack.  Execute method against
	 receiver and args.  Allow for up to two extra arguments (e.g. for mirror primitives).
	 Set primitiveFunctionPointer because no cache lookup has been done for the
	 method, and hence primitiveFunctionPointer is stale. */

void primitiveExecuteMethodArgsArray(void) {
register struct foo * foo = &fum;
    sqInt argCnt;
    sqInt argumentArray;
    sqInt i;
    sqInt methodArgument;
    sqInt object;
    sqInt sp;
    sqInt primBits;

	methodArgument = longAt(foo->stackPointer);
	argumentArray = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if (!((((methodArgument & 1) == 0) && (((((usqInt) (longAt(methodArgument))) >> 8) & 15) >= 12)) && (((argumentArray & 1) == 0) && (((((usqInt) (longAt(argumentArray))) >> 8) & 15) == 2)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	argCnt = (((usqInt) (longAt((methodArgument + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 25) & 15;
	if (!(argCnt == (fetchWordLengthOf(argumentArray)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (foo->argumentCount > 2) {

		/* CompiledMethod class>>receiver:withArguments:executeMethod:
								SqueakObjectPrimitives class >> receiver:withArguments:apply:
								VMMirror>>ifFail:object:with:executeMethod: et al */

		if (foo->argumentCount > 4) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
		longAtput(foo->stackPointer - (foo->argumentCount * (BYTES_PER_WORD)), longAt(foo->stackPointer - (2 * (BYTES_PER_WORD))));
	}
	/* begin pop: */
	foo->stackPointer -= foo->argumentCount * (BYTES_PER_WORD);
	for (i = 0; i <= (argCnt - 1); i += 1) {
		/* begin push: */
		object = longAt((argumentArray + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)));
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
	}
	foo->newMethod = methodArgument;
	/* begin primitiveIndexOf: */
	primBits = (((usqInt) (longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 1) & 268435967;
	foo->primitiveIndex = (primBits & 0x1FF) + (((usqInt) primBits) >> 19);
	primitiveFunctionPointer = primitiveTable[foo->primitiveIndex];

	/* We set the messageSelector for executeMethod below since things
	 like the at cache read messageSelector and so it cannot be left stale. */

	foo->argumentCount = argCnt;
	foo->messageSelector = foo->nilObj;
	/* begin executeNewMethod */
	if (foo->primitiveIndex > 0) {
		primitiveResponse();
		if (!foo->primFailCode) {
			goto l1;
		}
	}
	activateNewMethod();
	/* begin quickCheckForInterrupts */
	if (((foo->interruptCheckCounter -= 1)) <= 0) {
		checkForInterrupts();
	}
l1:	/* end executeNewMethod */;
	/* begin initPrimCall */
	foo->primFailCode = 0;
}


/*	Exit the critical section.
	 This may change the active process as a result. */

void primitiveExitCriticalSection(void) {
register struct foo * foo = &fum;
    sqInt criticalSection;
    sqInt owningProcess;
    sqInt owningProcessIndex;
    sqInt preemptionYields;


	/* rcvr */

	criticalSection = longAt(foo->stackPointer);

	/* CriticalSections are laid out like Semaphores */

	owningProcessIndex = ExcessSignalsIndex;
	if ((longAt((criticalSection + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)))) == foo->nilObj) {
		longAtput((criticalSection + (BASE_HEADER_SIZE)) + (owningProcessIndex << (SHIFT_FOR_WORD)), foo->nilObj);
	} else {

		/* store check unnecessary because criticalSection referred to owningProcess
			  via its FirstLinkIndex slot before owningProcess was removed. */

		owningProcess = removeFirstLinkOfList(criticalSection);
		longAtput((criticalSection + (BASE_HEADER_SIZE)) + (owningProcessIndex << (SHIFT_FOR_WORD)), owningProcess);
		resumepreemptedYieldingIf(owningProcess, preemptionYields);
	}
}

void primitiveExitToDebugger(void) {
	error("Exit to debugger at user request");
}


/*	Computes E raised to the receiver power. */

void primitiveExp(void) {
register struct foo * foo = &fum;
    double rcvr;

	rcvr = popFloat();
	if (!foo->primFailCode) {
		pushFloat(exp(rcvr));
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	Exponent part of this float. */

void primitiveExponent(void) {
register struct foo * foo = &fum;
    double frac;
    int pwr;
    double rcvr;
    sqInt sp;

	rcvr = popFloat();
	if (!foo->primFailCode) {

		/* rcvr = frac * 2^pwr, where frac is in [0.5..1.0) */

		frac = frexp(rcvr, &pwr);
		/* begin pushInteger: */
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), (((pwr - 1) << 1) | 1));
		foo->stackPointer = sp;
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	Call an external primitive. The external primitive methods 
	contain as first literal an array consisting of: 
	* The module name (String | Symbol) 
	* The function name (String | Symbol) 
	* The session ID (SmallInteger) [OBSOLETE] 
	* The function index (Integer) in the externalPrimitiveTable 
	For fast failures the primitive index of any method where the 
	external prim is not found is rewritten in the method cache 
	with zero. This allows for ultra fast responses as long as the 
	method stays in the cache. 
	The fast failure response relies on lkupClass being properly 
	set. This is done in 
	#addToMethodCacheSel:class:method:primIndex: to 
	compensate for execution of methods that are looked up in a 
	superclass (such as in primitivePerformAt). 
	With the latest modifications (e.g., actually flushing the 
	function addresses from the VM), the session ID is obsolete. 
	But for backward compatibility it is still kept around. Also, a 
	failed lookup is reported specially. If a method has been 
	looked up and not been found, the function address is stored 
	as -1 (e.g., the SmallInteger -1 to distinguish from 
	16rFFFFFFFF which may be returned from the lookup). 
	It is absolutely okay to remove the rewrite if we run into any 
	problems later on. It has an approximate speed difference of 
	30% per failed primitive call which may be noticable but if, 
	for any reasons, we run into problems (like with J3) we can 
	always remove the rewrite. 
	 */

void primitiveExternalCall(void) {
register struct foo * foo = &fum;
    void (*extFnAddr)(void);
    sqInt functionLength;
    sqInt functionName;
    sqInt index;
    sqInt lit;
    sqInt moduleLength;
    sqInt moduleName;
    sqInt successBoolean;
    sqInt header;
    sqInt successBoolean1;
    sqInt successBoolean2;
    sqInt successBoolean3;
    sqInt header1;
    sqInt sz;
    sqInt sz1;


	/* Fetch the first literal of the method */

	/* begin success: */
	successBoolean1 = (literalCountOfHeader(longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) > 0;
	if (!(successBoolean1)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return;
	}

	/* Check if it's an array of length 4 */

	lit = longAt((foo->newMethod + (BASE_HEADER_SIZE)) + ((0 + LiteralStart) << (SHIFT_FOR_WORD)));
	/* begin success: */
	successBoolean2 = (((lit & 1) == 0) && (((((usqInt) (longAt(lit))) >> 8) & 15) == 2)) && ((lengthOf(lit)) == 4);
	if (!(successBoolean2)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return;
	}
	index = longAt((lit + (BASE_HEADER_SIZE)) + (3 << (SHIFT_FOR_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((index & 1)) {
		index = (index >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l1;
	}
l1:	/* end checkedIntegerValueOf: */;
	if (!(!foo->primFailCode)) {
		return;
	}
	if (index < 0) {

		/* Function address was not found in this session, 
			Rewrite the mcache entry with a zero primitive index. */

		rewriteMethodCacheSelclassprimIndex(foo->messageSelector, foo->lkupClass, 0);
		/* begin success: */
		if (!(0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		return;
	}
	if ((index > 0) && (index <= MaxExternalPrimitiveTableSize)) {
		extFnAddr = externalPrimitiveTable[index - 1];
		if (extFnAddr != 0) {
			rewriteMethodCacheSelclassprimIndexprimFunction(foo->messageSelector, foo->lkupClass, 1000 + index, extFnAddr);
			callExternalPrimitive(extFnAddr);
			return;
		}
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	longAtput((lit + (BASE_HEADER_SIZE)) + (2 << (SHIFT_FOR_WORD)), ConstZero);
	longAtput((lit + (BASE_HEADER_SIZE)) + (3 << (SHIFT_FOR_WORD)), ConstZero);
	moduleName = longAt((lit + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
	if (moduleName == foo->nilObj) {
		moduleLength = 0;
	} else {
		/* begin success: */
		successBoolean = ((moduleName & 1) == 0) && (((((usqInt) (longAt(moduleName))) >> 8) & 15) >= 8);
		if (!(successBoolean)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		/* begin lengthOf: */
		header = longAt(moduleName);
		/* begin lengthOf:baseHeader:format: */
		if ((header & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(moduleName - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		} else {
			sz = header & (SIZE_MASK);
		}
		sz -= header & (SIZE_4_BIT);
		if (((((usqInt) header) >> 8) & 15) <= 4) {
			moduleLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
			goto l2;
		}
		if (((((usqInt) header) >> 8) & 15) < 8) {
			moduleLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
			goto l2;
		} else {
			moduleLength = (sz - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
			goto l2;
		}
	l2:	/* end lengthOf:baseHeader:format: */;
		;
	}
	functionName = longAt((lit + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)));
	/* begin success: */
	successBoolean3 = ((functionName & 1) == 0) && (((((usqInt) (longAt(functionName))) >> 8) & 15) >= 8);
	if (!(successBoolean3)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	/* begin lengthOf: */
	header1 = longAt(functionName);
	/* begin lengthOf:baseHeader:format: */
	if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
		sz1 = (longAt(functionName - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz1 = header1 & (SIZE_MASK);
	}
	sz1 -= header1 & (SIZE_4_BIT);
	if (((((usqInt) header1) >> 8) & 15) <= 4) {
		functionLength = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l3;
	}
	if (((((usqInt) header1) >> 8) & 15) < 8) {
		functionLength = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> 2;
		goto l3;
	} else {
		functionLength = (sz1 - (BASE_HEADER_SIZE)) - (((((usqInt) header1) >> 8) & 15) & 3);
		goto l3;
	}
l3:	/* end lengthOf:baseHeader:format: */;
	if (!(!foo->primFailCode)) {
		return;
	}
	extFnAddr = ((void (*)(void)) (ioLoadExternalFunctionOfLengthFromModuleOfLength(functionName + (BASE_HEADER_SIZE), functionLength, moduleName + (BASE_HEADER_SIZE), moduleLength)));
	if (extFnAddr == 0) {
		index = -1;
	} else {

		/* add the function to the external primitive table */

		index = addToExternalPrimitiveTable(extFnAddr);
	}
	/* begin success: */
	if (!(index >= 0)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	longAtput((lit + (BASE_HEADER_SIZE)) + (3 << (SHIFT_FOR_WORD)), ((index << 1) | 1));
	if ((!foo->primFailCode) && (extFnAddr != 0)) {
		rewriteMethodCacheSelclassprimIndexprimFunction(foo->messageSelector, foo->lkupClass, 1000 + index, extFnAddr);
		callExternalPrimitive(extFnAddr);
	} else {

		/* Otherwise rewrite the primitive index */

		rewriteMethodCacheSelclassprimIndex(foo->messageSelector, foo->lkupClass, 0);
	}
}


/*	Set general (unspecified) primitive failure.  Don't overwrite an error code that has already been set. */
/*	Use returnTypeC: #sqInt because that's the way it is defined in sq.h.
	 Use no explicit return so that Slang doesn't fail an inlining type-check when
	 a primitive with return type void uses ^self primitiveFail to exit. */

sqInt primitiveFail(void) {
register struct foo * foo = &fum;
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return null;
}


/*	If the storeSegment primitive fails, it must clean up first. */
/*	Store nils throughout the outPointer array. */

sqInt primitiveFailAfterCleanup(sqInt outPointerArray) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt lastAddr;

	lastAddr = outPointerArray + (lastPointerOf(outPointerArray));
	i = outPointerArray + (BASE_HEADER_SIZE);
	while (i <= lastAddr) {
		longAtput(i, foo->nilObj);
		i += BYTES_PER_WORD;
	}
	if (DoAssertionChecks) {
		verifyCleanHeaders();
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return null;
}


/*	Set specific primitive failure.
	 N.B. primitiveFailFor: PrimNoErr is expected to clear the primFailCode. */

sqInt primitiveFailFor(sqInt reasonCode) {
	return (foo->primFailCode = reasonCode);
}

sqInt primitiveFailureCode(void) {
	return foo->primFailCode;
}


/*	Primitive. Search up the context stack for the next method context marked for exception handling starting at the receiver. Return nil if none found */

void primitiveFindHandlerContext(void) {
register struct foo * foo = &fum;
    sqInt nilOop;
    sqInt thisCntx;
    sqInt sp;
    sqInt top;
    sqInt sp1;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	thisCntx = top;
	nilOop = foo->nilObj;
	do {
		if (isHandlerMarked(thisCntx)) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), thisCntx);
			foo->stackPointer = sp;
			return;
		}
		thisCntx = longAt((thisCntx + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
	} while(!(thisCntx == nilOop));
	/* begin push: */
	longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->nilObj);
	foo->stackPointer = sp1;
	return;
}


/*	Primitive. Search up the context stack for the next method context marked for unwind handling from the receiver up to but not including the argument. Return nil if none found. */

void primitiveFindNextUnwindContext(void) {
register struct foo * foo = &fum;
    sqInt aContext;
    sqInt nilOop;
    sqInt thisCntx;
    sqInt unwindMarked;
    sqInt sp;
    sqInt header;
    sqInt meth;
    sqInt pIndex;
    sqInt top;
    sqInt oop;
    sqInt sp1;
    sqInt primBits;
    sqInt top1;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	aContext = top;
	/* begin fetchPointer:ofObject: */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	oop = top1;
	thisCntx = longAt((oop + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
	nilOop = foo->nilObj;
	while (!((thisCntx == aContext) || (thisCntx == nilOop))) {
		/* begin isUnwindMarked: */
		header = longAt(thisCntx);
		if (!(((((usqInt) header) >> 12) & 0x1F) == 14)) {
			unwindMarked = 0;
			goto l1;
		}
		meth = longAt((thisCntx + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
		/* begin primitiveIndexOf: */
		primBits = (((usqInt) (longAt((meth + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 1) & 268435967;
		pIndex = (primBits & 0x1FF) + (((usqInt) primBits) >> 19);
		unwindMarked = pIndex == 198;
	l1:	/* end isUnwindMarked: */;
		if (unwindMarked) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), thisCntx);
			foo->stackPointer = sp;
			return;
		}
		thisCntx = longAt((thisCntx + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
	}
	/* begin push: */
	longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), nilOop);
	foo->stackPointer = sp1;
	return;
}

void primitiveFloatAdd(void) {
register struct foo * foo = &fum;
	primitiveFloatAddtoArg(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer)); return;
}

sqInt primitiveFloatAddtoArg(sqInt rcvrOop, sqInt argOop) {
register struct foo * foo = &fum;
    double arg;
    double rcvr;

	/* begin loadFloatOrIntFrom: */
	if ((rcvrOop & 1)) {
		rcvr = ((double) ((rcvrOop >> 1)) );
		goto l1;
	}
	if ((fetchClassOfNonInt(rcvrOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		rcvr = floatValueOf(rcvrOop);
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l1:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if ((argOop & 1)) {
		arg = ((double) ((argOop >> 1)) );
		goto l2;
	}
	if ((fetchClassOfNonInt(argOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		arg = floatValueOf(argOop);
		goto l2;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l2:	/* end loadFloatOrIntFrom: */;
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= 2 * (BYTES_PER_WORD);
		pushFloat(rcvr + arg);
	}
	return null;
}


/*	Provide platform-independent access to 32-bit words comprising
	 a Float.  Map index 1 onto the most significant word and index 2
	 onto the least significant word. */

void primitiveFloatAt(void) {
register struct foo * foo = &fum;
    sqInt index;
    sqInt rcvr;
    usqInt result;
    sqInt sp;
    sqInt sp1;
    sqInt reasonCode;

	/* begin initPrimCall */
	foo->primFailCode = 0;
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	index = longAt(foo->stackPointer);
	if (index == ConstOne) {
		result = positive32BitIntegerFor(long32At((rcvr + (BASE_HEADER_SIZE)) + (0 << 2)));
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), result);
		foo->stackPointer = sp;
		return;
	}
	if (index == ConstTwo) {
		result = positive32BitIntegerFor(long32At((rcvr + (BASE_HEADER_SIZE)) + (1 << 2)));
		/* begin pop:thenPush: */
		longAtput((sp1 = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), result);
		foo->stackPointer = sp1;
		return;
	}
	/* begin primitiveFailFor: */
	reasonCode = ((index & 1)
		? PrimErrBadIndex
		: PrimErrBadArgument);
	foo->primFailCode = reasonCode;
}


/*	Provide platform-independent access to 32-bit words comprising
	 a Float.  Map index 1 onto the most significant word and index 2
	 onto the least significant word. */

void primitiveFloatAtPut(void) {
register struct foo * foo = &fum;
    sqInt index;
    sqInt oopToStore;
    sqInt rcvr;
    sqInt valueToStore;
    sqInt sp;
    sqInt sp1;
    sqInt reasonCode;

	/* begin initPrimCall */
	foo->primFailCode = 0;
	oopToStore = longAt(foo->stackPointer);
	valueToStore = positive32BitValueOf(oopToStore);
	if (!(!foo->primFailCode)) {
		(foo->primFailCode = PrimErrBadArgument); return;
	}
	rcvr = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	index = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if (index == ConstOne) {
		long32Atput((rcvr + (BASE_HEADER_SIZE)) + (0 << 2), valueToStore);
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((3 - 1) * (BYTES_PER_WORD))), oopToStore);
		foo->stackPointer = sp;
		return;
	}
	if (index == ConstTwo) {
		long32Atput((rcvr + (BASE_HEADER_SIZE)) + (1 << 2), valueToStore);
		/* begin pop:thenPush: */
		longAtput((sp1 = foo->stackPointer - ((3 - 1) * (BYTES_PER_WORD))), oopToStore);
		foo->stackPointer = sp1;
		return;
	}
	/* begin primitiveFailFor: */
	reasonCode = ((index & 1)
		? PrimErrBadIndex
		: PrimErrBadArgument);
	foo->primFailCode = reasonCode;
}

void primitiveFloatDivide(void) {
register struct foo * foo = &fum;
	primitiveFloatDividebyArg(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer));
}

sqInt primitiveFloatDividebyArg(sqInt rcvrOop, sqInt argOop) {
register struct foo * foo = &fum;
    double arg;
    double rcvr;

	/* begin loadFloatOrIntFrom: */
	if ((rcvrOop & 1)) {
		rcvr = ((double) ((rcvrOop >> 1)) );
		goto l1;
	}
	if ((fetchClassOfNonInt(rcvrOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		rcvr = floatValueOf(rcvrOop);
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l1:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if ((argOop & 1)) {
		arg = ((double) ((argOop >> 1)) );
		goto l2;
	}
	if ((fetchClassOfNonInt(argOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		arg = floatValueOf(argOop);
		goto l2;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l2:	/* end loadFloatOrIntFrom: */;
	if (!foo->primFailCode) {
		/* begin success: */
		if (!(arg != 0.0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		if (!foo->primFailCode) {
			/* begin pop: */
			foo->stackPointer -= 2 * (BYTES_PER_WORD);
			pushFloat(rcvr / arg);
		}
	}
	return null;
}

void primitiveFloatEqual(void) {
register struct foo * foo = &fum;
    sqInt aBool;
    sqInt sp;

	aBool = primitiveFloatEqualtoArg(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (aBool
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}

sqInt primitiveFloatEqualtoArg(sqInt rcvrOop, sqInt argOop) {
register struct foo * foo = &fum;
    double arg;
    double rcvr;

	/* begin loadFloatOrIntFrom: */
	if ((rcvrOop & 1)) {
		rcvr = ((double) ((rcvrOop >> 1)) );
		goto l1;
	}
	if ((fetchClassOfNonInt(rcvrOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		rcvr = floatValueOf(rcvrOop);
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l1:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if ((argOop & 1)) {
		arg = ((double) ((argOop >> 1)) );
		goto l2;
	}
	if ((fetchClassOfNonInt(argOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		arg = floatValueOf(argOop);
		goto l2;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l2:	/* end loadFloatOrIntFrom: */;
	if (!foo->primFailCode) {
		return rcvr == arg;
	}
	return null;
}

sqInt primitiveFloatGreaterthanArg(sqInt rcvrOop, sqInt argOop) {
register struct foo * foo = &fum;
    double arg;
    double rcvr;

	/* begin loadFloatOrIntFrom: */
	if ((rcvrOop & 1)) {
		rcvr = ((double) ((rcvrOop >> 1)) );
		goto l1;
	}
	if ((fetchClassOfNonInt(rcvrOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		rcvr = floatValueOf(rcvrOop);
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l1:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if ((argOop & 1)) {
		arg = ((double) ((argOop >> 1)) );
		goto l2;
	}
	if ((fetchClassOfNonInt(argOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		arg = floatValueOf(argOop);
		goto l2;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l2:	/* end loadFloatOrIntFrom: */;
	if (!foo->primFailCode) {
		return rcvr > arg;
	}
	return null;
}

void primitiveFloatGreaterOrEqual(void) {
register struct foo * foo = &fum;
    sqInt aBool;
    sqInt sp;

	aBool = primitiveFloatGreaterOrEqualtoArg(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (aBool
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}

sqInt primitiveFloatGreaterOrEqualtoArg(sqInt rcvrOop, sqInt argOop) {
register struct foo * foo = &fum;
    double arg;
    double rcvr;

	/* begin loadFloatOrIntFrom: */
	if ((rcvrOop & 1)) {
		rcvr = ((double) ((rcvrOop >> 1)) );
		goto l1;
	}
	if ((fetchClassOfNonInt(rcvrOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		rcvr = floatValueOf(rcvrOop);
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l1:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if ((argOop & 1)) {
		arg = ((double) ((argOop >> 1)) );
		goto l2;
	}
	if ((fetchClassOfNonInt(argOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		arg = floatValueOf(argOop);
		goto l2;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l2:	/* end loadFloatOrIntFrom: */;
	if (!foo->primFailCode) {
		return rcvr >= arg;
	}
	return null;
}

void primitiveFloatGreaterThan(void) {
register struct foo * foo = &fum;
    sqInt aBool;
    sqInt sp;

	aBool = primitiveFloatGreaterthanArg(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (aBool
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}

sqInt primitiveFloatLessthanArg(sqInt rcvrOop, sqInt argOop) {
register struct foo * foo = &fum;
    double arg;
    double rcvr;

	/* begin loadFloatOrIntFrom: */
	if ((rcvrOop & 1)) {
		rcvr = ((double) ((rcvrOop >> 1)) );
		goto l1;
	}
	if ((fetchClassOfNonInt(rcvrOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		rcvr = floatValueOf(rcvrOop);
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l1:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if ((argOop & 1)) {
		arg = ((double) ((argOop >> 1)) );
		goto l2;
	}
	if ((fetchClassOfNonInt(argOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		arg = floatValueOf(argOop);
		goto l2;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l2:	/* end loadFloatOrIntFrom: */;
	if (!foo->primFailCode) {
		return rcvr < arg;
	}
	return null;
}

void primitiveFloatLessOrEqual(void) {
register struct foo * foo = &fum;
    sqInt aBool;
    sqInt sp;

	aBool = primitiveFloatLessOrEqualtoArg(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (aBool
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}

sqInt primitiveFloatLessOrEqualtoArg(sqInt rcvrOop, sqInt argOop) {
register struct foo * foo = &fum;
    double arg;
    double rcvr;

	/* begin loadFloatOrIntFrom: */
	if ((rcvrOop & 1)) {
		rcvr = ((double) ((rcvrOop >> 1)) );
		goto l1;
	}
	if ((fetchClassOfNonInt(rcvrOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		rcvr = floatValueOf(rcvrOop);
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l1:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if ((argOop & 1)) {
		arg = ((double) ((argOop >> 1)) );
		goto l2;
	}
	if ((fetchClassOfNonInt(argOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		arg = floatValueOf(argOop);
		goto l2;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l2:	/* end loadFloatOrIntFrom: */;
	if (!foo->primFailCode) {
		return rcvr <= arg;
	}
	return null;
}

void primitiveFloatLessThan(void) {
register struct foo * foo = &fum;
    sqInt aBool;
    sqInt sp;

	aBool = primitiveFloatLessthanArg(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (aBool
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}

void primitiveFloatMultiply(void) {
register struct foo * foo = &fum;
	primitiveFloatMultiplybyArg(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer));
}

sqInt primitiveFloatMultiplybyArg(sqInt rcvrOop, sqInt argOop) {
register struct foo * foo = &fum;
    double arg;
    double rcvr;

	/* begin loadFloatOrIntFrom: */
	if ((rcvrOop & 1)) {
		rcvr = ((double) ((rcvrOop >> 1)) );
		goto l1;
	}
	if ((fetchClassOfNonInt(rcvrOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		rcvr = floatValueOf(rcvrOop);
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l1:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if ((argOop & 1)) {
		arg = ((double) ((argOop >> 1)) );
		goto l2;
	}
	if ((fetchClassOfNonInt(argOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		arg = floatValueOf(argOop);
		goto l2;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l2:	/* end loadFloatOrIntFrom: */;
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= 2 * (BYTES_PER_WORD);
		pushFloat(rcvr * arg);
	}
	return null;
}

void primitiveFloatNotEqual(void) {
register struct foo * foo = &fum;
    sqInt aBool;
    sqInt sp;

	aBool = primitiveFloatEqualtoArg(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (!aBool
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}

void primitiveFloatSubtract(void) {
register struct foo * foo = &fum;
	primitiveFloatSubtractfromArg(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer)); return;
}

sqInt primitiveFloatSubtractfromArg(sqInt rcvrOop, sqInt argOop) {
register struct foo * foo = &fum;
    double arg;
    double rcvr;

	/* begin loadFloatOrIntFrom: */
	if ((rcvrOop & 1)) {
		rcvr = ((double) ((rcvrOop >> 1)) );
		goto l1;
	}
	if ((fetchClassOfNonInt(rcvrOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		rcvr = floatValueOf(rcvrOop);
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l1:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if ((argOop & 1)) {
		arg = ((double) ((argOop >> 1)) );
		goto l2;
	}
	if ((fetchClassOfNonInt(argOop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD))))) {
		arg = floatValueOf(argOop);
		goto l2;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l2:	/* end loadFloatOrIntFrom: */;
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= 2 * (BYTES_PER_WORD);
		pushFloat(rcvr - arg);
	}
	return null;
}


/*	Clear the method lookup cache. This must be done after every programming change. */

void primitiveFlushCache(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt i1;

	/* begin flushMethodCache */
	for (i = 1; i <= MethodCacheSize; i += 1) {
		foo->methodCache[i] = 0;
	}
	/* begin flushAtCache */
	for (i1 = 1; i1 <= AtCacheTotalSize; i1 += 1) {
		foo->atCache[i1] = 0;
	}
	/* begin compilerFlushCacheHook: */
	if (foo->compilerInitialized) {
		compilerFlushCache(null);
	}
}


/*	The receiver is a compiledMethod.  Clear all entries in the method lookup cache that refer to this method, presumably because it has been redefined, overridden or removed. */

void primitiveFlushCacheByMethod(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt oldMethod;
    sqInt probe;
    sqInt i1;

	oldMethod = longAt(foo->stackPointer);
	probe = 0;
	for (i = 1; i <= MethodCacheEntries; i += 1) {
		if ((foo->methodCache[probe + MethodCacheMethod]) == oldMethod) {
			foo->methodCache[probe + MethodCacheSelector] = 0;
		}
		probe += MethodCacheEntrySize;
	}
	/* begin flushAtCache */
	for (i1 = 1; i1 <= AtCacheTotalSize; i1 += 1) {
		foo->atCache[i1] = 0;
	}
	/* begin compilerFlushCacheHook: */
	if (foo->compilerInitialized) {
		compilerFlushCache(oldMethod);
	}
}


/*	The receiver is a message selector.  Clear all entries in the method lookup cache with this selector, presumably because an associated method has been redefined. */

void primitiveFlushCacheBySelector(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt probe;
    sqInt selector;
    sqInt i1;

	selector = longAt(foo->stackPointer);
	probe = 0;
	for (i = 1; i <= MethodCacheEntries; i += 1) {
		if ((foo->methodCache[probe + MethodCacheSelector]) == selector) {
			foo->methodCache[probe + MethodCacheSelector] = 0;
		}
		probe += MethodCacheEntrySize;
	}
	if ((selector == (fetchPointerofObject(16 * 2, longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD)))))) || (selector == (fetchPointerofObject(17 * 2, longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SpecialSelectors << (SHIFT_FOR_WORD))))))) {
		/* begin flushAtCache */
		for (i1 = 1; i1 <= AtCacheTotalSize; i1 += 1) {
			foo->atCache[i1] = 0;
		}
	}
}


/*	Primitive. Flush all the existing external primitives in the image thus forcing a reload on next invokation. */

void primitiveFlushExternalPrimitives(void) {
	flushExternalPrimitives();
}


/*	On some platforms, this primitive forces enqueued display updates to be processed immediately. On others, it does nothing. */

void primitiveForceDisplayUpdate(void) {
	ioForceDisplayUpdate();
}


/*	Set force tenure flag to true, this forces a tenure operation on the next incremental GC */

EXPORT(sqInt) primitiveForceTenure(void) {
	/* begin setForceTenureFlag: */
	foo->forceTenureFlag = 1;
	return null;
}


/*	On platforms that support it, this primitive prints the receiver, assumed to be a Form, to the default printer. */

void primitiveFormPrint(void) {
register struct foo * foo = &fum;
    sqInt bitsArray;
    sqInt bitsArraySize;
    sqInt depth;
    sqInt h;
    double  hScale;
    sqInt landscapeFlag;
    sqInt ok;
    sqInt pixelsPerWord;
    sqInt rcvr;
    double  vScale;
    sqInt w;
    sqInt wordsPerLine;
    sqInt fmt;
    sqInt header;
    sqInt sz;

	/* begin booleanValueOf: */
	if ((longAt(foo->stackPointer)) == foo->trueObj) {
		landscapeFlag = 1;
		goto l2;
	}
	if ((longAt(foo->stackPointer)) == foo->falseObj) {
		landscapeFlag = 0;
		goto l2;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	landscapeFlag = null;
l2:	/* end booleanValueOf: */;
	vScale = floatValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	hScale = floatValueOf(longAt(foo->stackPointer - (2 * (BYTES_PER_WORD))));
	rcvr = longAt(foo->stackPointer - (3 * (BYTES_PER_WORD)));
	if ((rcvr & 1)) {
		/* begin success: */
		if (!(0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!foo->primFailCode) {
		if (!((((rcvr & 1) == 0) && (((((usqInt) (longAt(rcvr))) >> 8) & 15) <= 4)) && ((lengthOf(rcvr)) >= 4))) {
			/* begin success: */
			if (!(0)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
		}
	}
	if (!foo->primFailCode) {
		bitsArray = longAt((rcvr + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
		w = fetchIntegerofObject(1, rcvr);
		h = fetchIntegerofObject(2, rcvr);
		depth = fetchIntegerofObject(3, rcvr);
		if (!((w > 0) && (h > 0))) {
			/* begin success: */
			if (!(0)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
		}
		pixelsPerWord = 32 / depth;
		wordsPerLine = (w + (pixelsPerWord - 1)) / pixelsPerWord;
		if ((!((rcvr & 1))) && (((bitsArray & 1) == 0) && (isWordsOrBytesNonInt(bitsArray)))) {
			/* begin byteLengthOf: */
			header = longAt(bitsArray);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(bitsArray - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
			} else {
				sz = header & (SIZE_MASK);
			}
			fmt = (((usqInt) header) >> 8) & 15;
			if (fmt < 8) {
				bitsArraySize = sz - (BASE_HEADER_SIZE);
				goto l1;
			} else {
				bitsArraySize = (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
				goto l1;
			}
		l1:	/* end byteLengthOf: */;
			/* begin success: */
			if (!(bitsArraySize == ((wordsPerLine * h) * 4))) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
		} else {
			/* begin success: */
			if (!(0)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
		}
	}
	if (!foo->primFailCode) {
		if ((BYTES_PER_WORD) == 8) {
			ok = ioFormPrint(bitsArray + 8, w, h, depth, hScale, vScale, landscapeFlag);
		} else {
			ok = ioFormPrint(bitsArray + 4, w, h, depth, hScale, vScale, landscapeFlag);
		}
		/* begin success: */
		if (!(ok)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= 3 * (BYTES_PER_WORD);
	}
}

void primitiveFractionalPart(void) {
register struct foo * foo = &fum;
    double frac;
    double rcvr;
    double trunc;

	rcvr = popFloat();
	if (!foo->primFailCode) {
		frac = modf(rcvr, &trunc);
		pushFloat(frac);
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	Do a full garbage collection and return the number of bytes available (including swap space if dynamic memory management is supported). */

void primitiveFullGC(void) {
register struct foo * foo = &fum;
    sqInt object;
    sqInt sp;

	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
	incrementalGC();
	fullGC();
	/* begin push: */
	object = positive64BitIntegerFor(((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK)) + (sqMemoryExtraBytesLeft(1)));
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
	foo->stackPointer = sp;
}


/*	Fetch the system attribute with the given integer ID. The 
	result is a string, which will be empty if the attribute is not 
	defined. */

void primitiveGetAttribute(void) {
register struct foo * foo = &fum;
    sqInt attr;
    sqInt s;
    sqInt sz;
    sqInt sp;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		attr = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		attr = 0;
		goto l1;
	}
	attr = null;
l1:	/* end stackIntegerValue: */;
	if (!foo->primFailCode) {
		sz = attributeSize(attr);
	}
	if (!foo->primFailCode) {
		s = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassString << (SHIFT_FOR_WORD))), sz);
		getAttributeIntoLength(attr, s + (BASE_HEADER_SIZE), sz);
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), s);
		foo->stackPointer = sp;
	}
}


/*	Primitive. Return the next input event from the VM event queue. */

void primitiveGetNextEvent(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt eventTypeIs;
    long evtBuf[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
    sqInt i;
    sqInt value;
    sqInt oop;

	;
	arg = longAt(foo->stackPointer);
	if (!((((arg & 1) == 0) && (((((usqInt) (longAt(arg))) >> 8) & 15) == 2)) && ((slotSizeOf(arg)) == 8))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	ioGetNextEvent(((sqInputEvent*) evtBuf));
	if (!(!foo->primFailCode)) {
		return;
	}
	eventTypeIs = evtBuf[0];
	/* begin storeInteger:ofObject:withValue: */
	if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
		(((((int) (evtBuf[0]))) ^ ((((int) (evtBuf[0]))) << 1)) >= 0)
# else
		(((evtBuf[0]) >= -1073741824) && ((evtBuf[0]) <= 0x3FFFFFFF))
# endif  // SQ_HOST32
	) {
		longAtput((arg + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), (((evtBuf[0]) << 1) | 1));
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return;
	}
	if (eventTypeIs == 6) {
		for (i = 1; i <= 7; i += 1) {
			value = evtBuf[i];
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) arg)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(arg, value);
			}
			longAtput((arg + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)), value);
		}
	} else {

		/* Event time stamp */

		/* begin storeInteger:ofObject:withValue: */
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) ((evtBuf[1]) & MillisecondClockMask))) ^ ((((int) ((evtBuf[1]) & MillisecondClockMask))) << 1)) >= 0)
# else
			((((evtBuf[1]) & MillisecondClockMask) >= -1073741824) && (((evtBuf[1]) & MillisecondClockMask) <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			longAtput((arg + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), ((((evtBuf[1]) & MillisecondClockMask) << 1) | 1));
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
		if (!(!foo->primFailCode)) {
			return;
		}
		for (i = 2; i <= 7; i += 1) {
			value = evtBuf[i];
			if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
				(((((int) value)) ^ ((((int) value)) << 1)) >= 0)
# else
				((value >= -1073741824) && (value <= 0x3FFFFFFF))
# endif  // SQ_HOST32
			) {
				/* begin storeInteger:ofObject:withValue: */
				if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
					(((((int) value)) ^ ((((int) value)) << 1)) >= 0)
# else
					((value >= -1073741824) && (value <= 0x3FFFFFFF))
# endif  // SQ_HOST32
				) {
					longAtput((arg + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)), ((value << 1) | 1));
				} else {
					/* begin primitiveFail */
					if (foo->primFailCode == 0) {
						foo->primFailCode = 1;
					}
				}
			} else {

				/* Need to remap because allocation may cause GC */

				/* begin pushRemappableOop: */
				foo->remapBuffer[(foo->remapBufferCount += 1)] = arg;
				value = positive32BitIntegerFor(value);
				/* begin popRemappableOop */
				oop = foo->remapBuffer[foo->remapBufferCount];
				foo->remapBufferCount -= 1;
				arg = oop;
				/* begin storePointer:ofObject:withValue: */
				if ((((usqInt) arg)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(arg, value);
				}
				longAtput((arg + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)), value);
			}
		}
	}
	if (!(!foo->primFailCode)) {
		return;
	}
	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
}

void primitiveGreaterOrEqual(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt integerPointer;
    sqInt top;
    sqInt integerPointer1;
    sqInt top1;
    sqInt sp;
    sqInt sp1;

	/* begin popInteger */
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		integerArgument = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerArgument = 0;
		goto l1;
	}
	integerArgument = null;
l1:	/* end popInteger */;
	/* begin popInteger */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer1 = top1;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		integerReceiver = (integerPointer1 >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerReceiver = 0;
		goto l2;
	}
	integerReceiver = null;
l2:	/* end popInteger */;
	/* begin checkBooleanResult: */
	if (!foo->primFailCode) {
		/* begin pushBool: */
		if (integerReceiver >= integerArgument) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
			foo->stackPointer = sp;
		} else {
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
			foo->stackPointer = sp1;
		}
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Primitive comparison operations for large integers in 64 bit range */

EXPORT(void) primitiveGreaterOrEqualLargeIntegers(void) {
register struct foo * foo = &fum;
    sqLong integerArg;
    sqLong integerRcvr;
    sqInt sp;

	integerArg = signed64BitValueOf(longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	integerRcvr = signed64BitValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (integerRcvr >= integerArg
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}

void primitiveGreaterThan(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt integerPointer;
    sqInt top;
    sqInt integerPointer1;
    sqInt top1;
    sqInt sp;
    sqInt sp1;

	/* begin popInteger */
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		integerArgument = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerArgument = 0;
		goto l1;
	}
	integerArgument = null;
l1:	/* end popInteger */;
	/* begin popInteger */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer1 = top1;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		integerReceiver = (integerPointer1 >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerReceiver = 0;
		goto l2;
	}
	integerReceiver = null;
l2:	/* end popInteger */;
	/* begin checkBooleanResult: */
	if (!foo->primFailCode) {
		/* begin pushBool: */
		if (integerReceiver > integerArgument) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
			foo->stackPointer = sp;
		} else {
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
			foo->stackPointer = sp1;
		}
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Primitive comparison operations for large integers in 64 bit range */

EXPORT(void) primitiveGreaterThanLargeIntegers(void) {
register struct foo * foo = &fum;
    sqLong integerArg;
    sqLong integerRcvr;
    sqInt sp;

	integerArg = signed64BitValueOf(longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	integerRcvr = signed64BitValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (integerRcvr > integerArg
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}


/*	is the receiver/first argument the same object as the (last) argument?.
	 pop argumentCount because this can be used as a mirror primitive. */

void primitiveIdentical(void) {
register struct foo * foo = &fum;
    sqInt otherObject;
    sqInt thisObject;
    sqInt sp;

	otherObject = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	thisObject = longAt(foo->stackPointer);
	/* begin pop:thenPushBool: */
	longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), (thisObject == otherObject
		? foo->trueObj
		: foo->falseObj));
	foo->stackPointer = sp;
}

sqInt primitiveIdentityHash(void) {
register struct foo * foo = &fum;
    sqInt thisReceiver;
    sqInt sp;

	thisReceiver = longAt(foo->stackPointer);
	if ((thisReceiver & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	} else {
		/* begin pop:thenPushInteger: */
		longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), ((((((usqInt) (longAt(thisReceiver))) >> 17) & 0xFFF) << 1) | 1));
		foo->stackPointer = sp;
	}
	return null;
}


/*	Answer an integer identifying the type of image. The image version number may
	identify the format of the image (e.g. 32 or 64-bit word size) or specific requirements
	of the image (e.g. block closure support required).
	
	This is a named (not numbered) primitive in the null module (ie the VM) */

EXPORT(sqInt) primitiveImageFormatVersion(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt sp;

	/* begin pop:thenPush: */
	oop = positive32BitIntegerFor(imageFormatVersionNumber);
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), oop);
	foo->stackPointer = sp;
	return null;
}


/*	When called with a single string argument, record the string as the current image file name. When called with zero arguments, return a string containing the current image file name. */

void primitiveImageName(void) {
register struct foo * foo = &fum;
    sqInt okToRename;
    sqInt s;
    void *sCRIfn;
    sqInt sz;
    sqInt sp;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop1;

	if (foo->argumentCount == 1) {

		/* If the security plugin can be loaded, use it to check for rename permission.
		If not, assume it's ok */

		sCRIfn = ioLoadFunctionFrom("secCanRenameImage", "SecurityPlugin");
		if (sCRIfn != 0) {
			okToRename =  ((sqInt (*)(void))sCRIfn)();
			if (!(okToRename)) {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
				return;
			}
		}
		s = longAt(foo->stackPointer);
		/* begin assertClassOf:is: */
		classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassString << (SHIFT_FOR_WORD)));
		if ((s & 1)) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			goto l1;
		}
		ccIndex = (((usqInt) (longAt(s))) >> 12) & 0x1F;
		if (ccIndex == 0) {
			cl = (longAt(s - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
			cl = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		}
		/* begin success: */
		if (!(cl == classOop)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
	l1:	/* end assertClassOf:is: */;
		if (!foo->primFailCode) {
			sz = stSizeOf(s);
			imageNamePutLength(s + (BASE_HEADER_SIZE), sz);
			/* begin pop: */
			foo->stackPointer -= 1 * (BYTES_PER_WORD);
		}
	} else {
		sz = imageNameSize();
		s = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassString << (SHIFT_FOR_WORD))), sz);
		imageNameGetLength(s + (BASE_HEADER_SIZE), sz);
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), s);
		foo->stackPointer = sp;
	}
}


/*	Do a quick, incremental garbage collection and return the number of bytes immediately available. (Note: more space may be made available by doing a full garbage collection. */

void primitiveIncrementalGC(void) {
register struct foo * foo = &fum;
    sqInt object;
    sqInt sp;

	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
	incrementalGC();
	/* begin push: */
	object = positive64BitIntegerFor(((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK)) + (sqMemoryExtraBytesLeft(0)));
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
	foo->stackPointer = sp;
}


/*	Note: We now have 10 bits of primitive index, but they are in two places
	for temporary backward compatibility.  The time to unpack is negligible,
	since the reconstituted full index is stored in the method cache. */

sqInt primitiveIndexOf(sqInt methodPointer) {
    sqInt primBits;

	primBits = (((usqInt) (longAt((methodPointer + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 1) & 268435967;
	return (primBits & 0x1FF) + (((usqInt) primBits) >> 19);
}


/*	Register the input semaphore. The argument is an index into the ExternalObjectsArray part of the specialObjectsArray and must have been allocated via 'Smalltalk registerExternalObject: the Semaphore'  */

void primitiveInputSemaphore(void) {
register struct foo * foo = &fum;
    sqInt arg;

	arg = longAt(foo->stackPointer);
	if ((arg & 1)) {

		/* If arg is integer, then condsider it as an index  into the external objects array and install it  as the new event semaphore */

		ioSetInputSemaphore((arg >> 1));
		if (!foo->primFailCode) {
			/* begin pop: */
			foo->stackPointer -= 1 * (BYTES_PER_WORD);
		}
		return;
	}
}


/*	Return an integer indicating the reason for the most recent input interrupt. */

void primitiveInputWord(void) {
register struct foo * foo = &fum;
    sqInt sp;

	/* begin pop:thenPushInteger: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), ((0 << 1) | 1));
	foo->stackPointer = sp;
}

void primitiveInstVarAt(void) {
register struct foo * foo = &fum;
    sqInt fixedFields;
    sqInt fmt;
    sqInt hdr;
    sqInt index;
    sqInt rcvr;
    sqInt totalLength;
    sqInt value;
    sqInt sp;
    sqInt sz;
    sqInt class;
    sqInt classFormat;
    sqInt ccIndex;
    sqInt oop1;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l5;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l5;
	}
	index = null;
l5:	/* end stackIntegerValue: */;
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if (!foo->primFailCode) {
		hdr = longAt(rcvr);
		fmt = (((usqInt) hdr) >> 8) & 15;
		/* begin lengthOf:baseHeader:format: */
		if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(rcvr - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		} else {
			sz = hdr & (SIZE_MASK);
		}
		sz -= hdr & (SIZE_4_BIT);
		if (fmt <= 4) {
			totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
			goto l1;
		}
		if (fmt < 8) {
			totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
			goto l1;
		} else {
			totalLength = (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
			goto l1;
		}
	l1:	/* end lengthOf:baseHeader:format: */;
		/* begin fixedFieldsOf:format:length: */
		if ((fmt > 4) || (fmt == 2)) {
			fixedFields = 0;
			goto l2;
		}
		if (fmt < 2) {
			fixedFields = totalLength;
			goto l2;
		}
		/* begin fetchClassOf: */
		if ((rcvr & 1)) {
			class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
			goto l4;
		}
		ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
		if (ccIndex == 0) {
			class = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
			goto l4;
		} else {
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
			class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
			goto l4;
		}
	l4:	/* end fetchClassOf: */;
		classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
		fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
	l2:	/* end fixedFieldsOf:format:length: */;
		if (!((index >= 1) && (index <= fixedFields))) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!foo->primFailCode) {
		/* begin subscript:with:format: */
		if (fmt <= 4) {
			value = longAt((rcvr + (BASE_HEADER_SIZE)) + ((index - 1) << (SHIFT_FOR_WORD)));
			goto l3;
		}
		if (fmt < 8) {
			value = positive32BitIntegerFor(long32At((rcvr + (BASE_HEADER_SIZE)) + ((index - 1) << 2)));
			goto l3;
		} else {
			value = (((byteAt((rcvr + (BASE_HEADER_SIZE)) + (index - 1))) << 1) | 1);
			goto l3;
		}
	l3:	/* end subscript:with:format: */;
	}
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), value);
		foo->stackPointer = sp;
	}
}

void primitiveInstVarAtPut(void) {
register struct foo * foo = &fum;
    sqInt fixedFields;
    sqInt fmt;
    sqInt hdr;
    sqInt index;
    sqInt newValue;
    sqInt rcvr;
    sqInt totalLength;
    sqInt sp;
    sqInt sz;
    sqInt class;
    sqInt classFormat;
    sqInt ccIndex;
    sqInt oop1;
    sqInt valueToStore;
    sqInt integerPointer;

	newValue = longAt(foo->stackPointer);
	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l4;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l4;
	}
	index = null;
l4:	/* end stackIntegerValue: */;
	rcvr = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	if (!foo->primFailCode) {
		hdr = longAt(rcvr);
		fmt = (((usqInt) hdr) >> 8) & 15;
		/* begin lengthOf:baseHeader:format: */
		if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(rcvr - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		} else {
			sz = hdr & (SIZE_MASK);
		}
		sz -= hdr & (SIZE_4_BIT);
		if (fmt <= 4) {
			totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
			goto l1;
		}
		if (fmt < 8) {
			totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
			goto l1;
		} else {
			totalLength = (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
			goto l1;
		}
	l1:	/* end lengthOf:baseHeader:format: */;
		/* begin fixedFieldsOf:format:length: */
		if ((fmt > 4) || (fmt == 2)) {
			fixedFields = 0;
			goto l2;
		}
		if (fmt < 2) {
			fixedFields = totalLength;
			goto l2;
		}
		/* begin fetchClassOf: */
		if ((rcvr & 1)) {
			class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
			goto l3;
		}
		ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
		if (ccIndex == 0) {
			class = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
			goto l3;
		} else {
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
			class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
			goto l3;
		}
	l3:	/* end fetchClassOf: */;
		classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
		fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
	l2:	/* end fixedFieldsOf:format:length: */;
		if (!((index >= 1) && (index <= fixedFields))) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!foo->primFailCode) {
		/* begin subscript:with:storing:format: */
		if (fmt <= 4) {
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) rcvr)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(rcvr, newValue);
			}
			longAtput((rcvr + (BASE_HEADER_SIZE)) + ((index - 1) << (SHIFT_FOR_WORD)), newValue);
		} else {
			if (fmt < 8) {
				valueToStore = positive32BitValueOf(newValue);
				if (!foo->primFailCode) {
					long32Atput((rcvr + (BASE_HEADER_SIZE)) + ((index - 1) << 2), valueToStore);
				}
			} else {
				if (!((newValue & 1))) {
					/* begin primitiveFail */
					if (foo->primFailCode == 0) {
						foo->primFailCode = 1;
					}
				}
				valueToStore = (newValue >> 1);
				if (!((valueToStore >= 0) && (valueToStore <= 0xFF))) {
					/* begin primitiveFail */
					if (foo->primFailCode == 0) {
						foo->primFailCode = 1;
					}
				}
				if (!foo->primFailCode) {
					byteAtput((rcvr + (BASE_HEADER_SIZE)) + (index - 1), valueToStore);
				}
			}
		}
	}
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), newValue);
		foo->stackPointer = sp;
	}
}


/*	Return the 32bit signed integer contents of a words receiver */

void primitiveIntegerAt(void) {
register struct foo * foo = &fum;
    sqInt addr;
    sqInt index;
    int intValue;
    sqInt rcvr;
    sqInt sz;
    sqInt value;
    sqInt object;
    sqInt sp;
    sqInt header;
    sqInt sp1;
    sqInt sz1;
    sqInt successBoolean;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l2;
	}
	index = null;
l2:	/* end stackIntegerValue: */;
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if ((rcvr & 1)) {
		/* begin success: */
		if (!(0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		return;
	}
	if (!(((rcvr & 1) == 0) && (((((usqInt) (longAt(rcvr))) >> 8) & 15) == 6))) {
		/* begin success: */
		if (!(0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		return;
	}
	/* begin lengthOf: */
	header = longAt(rcvr);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz1 = (longAt(rcvr - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz1 = header & (SIZE_MASK);
	}
	sz1 -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l1;
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> 2;
		goto l1;
	} else {
		sz = (sz1 - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
		goto l1;
	}
l1:	/* end lengthOf:baseHeader:format: */;
	/* begin success: */
	successBoolean = (index >= 1) && (index <= sz);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {

		/* for zero indexing */

		addr = ((rcvr + (BASE_HEADER_SIZE)) - 4) + (index * 4);
		value = intAt(addr);
		/* begin pop: */
		foo->stackPointer -= 2 * (BYTES_PER_WORD);
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) value)) ^ ((((int) value)) << 1)) >= 0)
# else
			((value >= -1073741824) && (value <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			/* begin pushInteger: */
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), ((value << 1) | 1));
			foo->stackPointer = sp1;
		} else {

			/* 32 bit int may have been stored in 32 or 64 bit sqInt */

			intValue = value;
			/* begin push: */
			object = signed32BitIntegerFor(intValue);
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
			foo->stackPointer = sp;
		}
	}
}


/*	Return the 32bit signed integer contents of a words receiver */

void primitiveIntegerAtPut(void) {
register struct foo * foo = &fum;
    sqInt addr;
    sqInt index;
    sqInt rcvr;
    sqInt sz;
    sqInt value;
    sqInt valueOop;
    sqInt sp;
    sqInt header;
    sqInt sz1;
    sqInt integerPointer;

	valueOop = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l2;
	}
	index = null;
l2:	/* end stackIntegerValue: */;
	rcvr = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	if ((rcvr & 1)) {
		/* begin success: */
		if (!(0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		return;
	}
	if (!(((rcvr & 1) == 0) && (((((usqInt) (longAt(rcvr))) >> 8) & 15) == 6))) {
		/* begin success: */
		if (!(0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		return;
	}
	/* begin lengthOf: */
	header = longAt(rcvr);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz1 = (longAt(rcvr - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz1 = header & (SIZE_MASK);
	}
	sz1 -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l1;
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> 2;
		goto l1;
	} else {
		sz = (sz1 - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
		goto l1;
	}
l1:	/* end lengthOf:baseHeader:format: */;
	if (!((index >= 1) && (index <= sz))) {
		/* begin success: */
		if (!(0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		return;
	}
	if ((valueOop & 1)) {
		value = (valueOop >> 1);
	} else {
		value = signed32BitValueOf(valueOop);
	}
	if (!foo->primFailCode) {

		/* for zero indexing */

		addr = ((rcvr + (BASE_HEADER_SIZE)) - 4) + (index * 4);
		value = intAtput(addr, value);
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((3 - 1) * (BYTES_PER_WORD))), valueOop);
		foo->stackPointer = sp;
	}
}


/*	Answer a string corresponding to the version of the interpreter source. This
	represents the version level of the Smalltalk source code (interpreter and various
	plugins) that is translated to C by a CCodeGenerator, as distinct from the external
	platform source code, typically written in C and managed separately for each platform.
	This is a named (not numbered) primitive in the null module (ie the VM) */

EXPORT(sqInt) primitiveInterpreterSourceVersion(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt sp;

	/* begin pop:thenPush: */
	oop = stringForCString(InterpreterSourceVersion);
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), oop);
	foo->stackPointer = sp;
	return null;
}


/*	Primitive. Answer state information for the object memory as of the point
	of entry to this primitive. This is the information that is stored in an image
	file header when the image is saved to disk. The memory state information,
	when combined with the object memory image, is sufficient to initialize an
	an image to be run in an interpreter. */

EXPORT(sqInt) primitiveInterpreterStateSnapshot(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt sp;

	/* begin methodReturnValue: */
	oop = memoryHeaderState(prepareForSnapshot());
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), oop);
	foo->stackPointer = sp;
	return null;
}


/*	Register the user interrupt semaphore. If the argument is 
	not a Semaphore, unregister the current interrupt 
	semaphore.  */

void primitiveInterruptSemaphore(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt top;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	arg = top;
	if ((fetchClassOf(arg)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD))))) {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(foo->specialObjectsOop, arg);
		}
		longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheInterruptSemaphore << (SHIFT_FOR_WORD)), arg);
	} else {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(foo->specialObjectsOop, foo->nilObj);
		}
		longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheInterruptSemaphore << (SHIFT_FOR_WORD)), foo->nilObj);
	}
}


/*	Primitive. 'Invoke' an object like a function, sending the special message 
		run: originalSelector with: arguments in: aReceiver.
	Installed as primitive 248 prior to VMMaker 4.19.1 */

void primitiveInvokeObjectAsMethod(void) {
register struct foo * foo = &fum;
    sqInt lookupClass;
    sqInt newReceiver;
    sqInt runArgs;
    sqInt runReceiver;
    sqInt runSelector;
    sqInt in;
    sqInt lastIn;
    sqInt out;
    sqInt sp;
    sqInt sp1;
    sqInt sp2;
    sqInt sp3;
    sqInt ccIndex;
    sqInt oop1;

	runArgs = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))), foo->argumentCount);
	beRootIfOld(runArgs);
	/* begin transfer:from:to: */
	flag("Dan");
	in = (foo->stackPointer - ((foo->argumentCount - 1) * (BYTES_PER_WORD))) - (BYTES_PER_WORD);
	lastIn = in + (foo->argumentCount * (BYTES_PER_WORD));
	out = (runArgs + (BASE_HEADER_SIZE)) - (BYTES_PER_WORD);
	while ((((usqInt) in)) < (((usqInt) lastIn))) {
		longAtput((out += BYTES_PER_WORD), longAt((in += BYTES_PER_WORD)));
	}
	runSelector = foo->messageSelector;
	runReceiver = longAt(foo->stackPointer - (foo->argumentCount * (BYTES_PER_WORD)));
	/* begin pop: */
	foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
	newReceiver = foo->newMethod;
	foo->messageSelector = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorRunWithIn << (SHIFT_FOR_WORD)));
	foo->argumentCount = 3;
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), newReceiver);
	foo->stackPointer = sp;
	/* begin push: */
	longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), runSelector);
	foo->stackPointer = sp1;
	/* begin push: */
	longAtput((sp2 = foo->stackPointer + (BYTES_PER_WORD)), runArgs);
	foo->stackPointer = sp2;
	/* begin push: */
	longAtput((sp3 = foo->stackPointer + (BYTES_PER_WORD)), runReceiver);
	foo->stackPointer = sp3;
	/* begin fetchClassOf: */
	if ((newReceiver & 1)) {
		lookupClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(newReceiver))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		lookupClass = (longAt(newReceiver - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		lookupClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	findNewMethodInClass(lookupClass);
	executeNewMethodFromCache();
	/* begin initPrimCall */
	foo->primFailCode = 0;
}


/*	Answer true if running on a big endian machine. */

EXPORT(sqInt) primitiveIsBigEnder(void) {
register struct foo * foo = &fum;
    sqInt sp;
    sqInt sp1;

	if (isBigEnder()) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), foo->trueObj);
		foo->stackPointer = sp;
	} else {
		/* begin pop:thenPush: */
		longAtput((sp1 = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), foo->falseObj);
		foo->stackPointer = sp1;
	}
	return null;
}


/*	Primitive. Answer whether the argument to the primitive is a root for young space */

EXPORT(sqInt) primitiveIsRoot(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt oop1;
    sqInt trueOrFalse;
    sqInt sp;
    sqInt sp1;

	/* begin stackObjectValue: */
	oop1 = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	if ((oop1 & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		oop = null;
		goto l1;
	}
	oop = oop1;
l1:	/* end stackObjectValue: */;
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
		/* begin pushBool: */
		trueOrFalse = (longAt(oop)) & (ROOT_BIT);
		if (trueOrFalse) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
			foo->stackPointer = sp;
		} else {
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
			foo->stackPointer = sp1;
		}
	}
	return null;
}


/*	Primitive. Answer whether the argument to the primitive resides in young space. */

EXPORT(sqInt) primitiveIsYoung(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt oop1;
    sqInt sp;
    sqInt sp1;

	/* begin stackObjectValue: */
	oop1 = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	if ((oop1 & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		oop = null;
		goto l1;
	}
	oop = oop1;
l1:	/* end stackObjectValue: */;
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
		/* begin pushBool: */
		if ((((usqInt) oop)) >= (((usqInt) foo->youngStart))) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
			foo->stackPointer = sp;
		} else {
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
			foo->stackPointer = sp1;
		}
	}
	return null;
}


/*	Obsolete on virtually all platforms; old style input polling code.
	Return the next keycode and remove it from the input buffer. The low byte is the 8-bit ISO character. The next four bits are the Smalltalk modifier bits <cmd><option><ctrl><shift>. */

void primitiveKbdNext(void) {
register struct foo * foo = &fum;
    sqInt keystrokeWord;
    sqInt sp;
    sqInt sp1;

	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
	keystrokeWord = ioGetKeystroke();
	if (keystrokeWord >= 0) {
		/* begin pushInteger: */
		/* begin push: */
		longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), ((keystrokeWord << 1) | 1));
		foo->stackPointer = sp1;
	} else {
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->nilObj);
		foo->stackPointer = sp;
	}
}


/*	Obsolete on virtually all platforms; old style input polling code.
	Return the next keycode and without removing it from the input buffer. The low byte is the 8-bit ISO character. The next four bits are the Smalltalk modifier bits <cmd><option><ctrl><shift>. */

void primitiveKbdPeek(void) {
register struct foo * foo = &fum;
    sqInt keystrokeWord;
    sqInt sp;
    sqInt sp1;

	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
	keystrokeWord = ioPeekKeystroke();
	if (keystrokeWord >= 0) {
		/* begin pushInteger: */
		/* begin push: */
		longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), ((keystrokeWord << 1) | 1));
		foo->stackPointer = sp1;
	} else {
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->nilObj);
		foo->stackPointer = sp;
	}
}

void primitiveLessOrEqual(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt integerPointer;
    sqInt top;
    sqInt integerPointer1;
    sqInt top1;
    sqInt sp;
    sqInt sp1;

	/* begin popInteger */
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		integerArgument = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerArgument = 0;
		goto l1;
	}
	integerArgument = null;
l1:	/* end popInteger */;
	/* begin popInteger */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer1 = top1;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		integerReceiver = (integerPointer1 >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerReceiver = 0;
		goto l2;
	}
	integerReceiver = null;
l2:	/* end popInteger */;
	/* begin checkBooleanResult: */
	if (!foo->primFailCode) {
		/* begin pushBool: */
		if (integerReceiver <= integerArgument) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
			foo->stackPointer = sp;
		} else {
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
			foo->stackPointer = sp1;
		}
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Primitive comparison operations for large integers in 64 bit range */

EXPORT(void) primitiveLessOrEqualLargeIntegers(void) {
register struct foo * foo = &fum;
    sqLong integerArg;
    sqLong integerRcvr;
    sqInt sp;

	integerArg = signed64BitValueOf(longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	integerRcvr = signed64BitValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (integerRcvr <= integerArg
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}

void primitiveLessThan(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt integerPointer;
    sqInt top;
    sqInt integerPointer1;
    sqInt top1;
    sqInt sp;
    sqInt sp1;

	/* begin popInteger */
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		integerArgument = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerArgument = 0;
		goto l1;
	}
	integerArgument = null;
l1:	/* end popInteger */;
	/* begin popInteger */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer1 = top1;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		integerReceiver = (integerPointer1 >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerReceiver = 0;
		goto l2;
	}
	integerReceiver = null;
l2:	/* end popInteger */;
	/* begin checkBooleanResult: */
	if (!foo->primFailCode) {
		/* begin pushBool: */
		if (integerReceiver < integerArgument) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
			foo->stackPointer = sp;
		} else {
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
			foo->stackPointer = sp1;
		}
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Primitive comparison operations for large integers in 64 bit range */

EXPORT(void) primitiveLessThanLargeIntegers(void) {
register struct foo * foo = &fum;
    sqLong integerArg;
    sqLong integerRcvr;
    sqInt sp;

	integerArg = signed64BitValueOf(longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	integerRcvr = signed64BitValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (integerRcvr < integerArg
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}


/*	Primitive. Return the n-th builtin module name. */

void primitiveListBuiltinModule(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt index;
    sqInt length;
    char *moduleName;
    sqInt nameOop;
    sqInt sp;
    sqInt sp1;
    sqInt integerPointer;

	if (!(foo->argumentCount == 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l1;
	}
	index = null;
l1:	/* end stackIntegerValue: */;
	if (index <= 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	moduleName = ioListBuiltinModule(index);
	if (moduleName == null) {
		/* begin pop: */
		foo->stackPointer -= 2 * (BYTES_PER_WORD);
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->nilObj);
		foo->stackPointer = sp;
		return;
	}
	length = strlen(moduleName);
	nameOop = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassString << (SHIFT_FOR_WORD))), length);
	for (i = 0; i <= (length - 1); i += 1) {
		byteAtput((nameOop + (BASE_HEADER_SIZE)) + i, moduleName[i]);
	}
	/* begin forceInterruptCheck */
	foo->interruptCheckCounter = -1000;
	foo->nextPollTick = 0;
	/* begin pop:thenPush: */
	longAtput((sp1 = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), nameOop);
	foo->stackPointer = sp1;
}


/*	Primitive. Return the n-th loaded external module name. */

void primitiveListExternalModule(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt index;
    sqInt length;
    char *moduleName;
    sqInt nameOop;
    sqInt sp;
    sqInt sp1;
    sqInt integerPointer;

	if (!(foo->argumentCount == 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l1;
	}
	index = null;
l1:	/* end stackIntegerValue: */;
	if (index <= 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	moduleName = ioListLoadedModule(index);
	if (moduleName == null) {
		/* begin pop: */
		foo->stackPointer -= 2 * (BYTES_PER_WORD);
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->nilObj);
		foo->stackPointer = sp;
		return;
	}
	length = strlen(moduleName);
	nameOop = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassString << (SHIFT_FOR_WORD))), length);
	for (i = 0; i <= (length - 1); i += 1) {
		byteAtput((nameOop + (BASE_HEADER_SIZE)) + i, moduleName[i]);
	}
	/* begin forceInterruptCheck */
	foo->interruptCheckCounter = -1000;
	foo->nextPollTick = 0;
	/* begin pop:thenPush: */
	longAtput((sp1 = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), nameOop);
	foo->stackPointer = sp1;
}


/*	This primitive is called from Squeak as...
		<imageSegment> loadSegmentFrom: aWordArray outPointers: anArray. */
/*	This primitive will load a binary image segment created by primitiveStoreImageSegment.  It expects the outPointer array to be of the proper size, and the wordArray to be well formed.  It will return as its value the original array of roots, and the erstwhile segmentWordArray will have been truncated to a size of zero.  If this primitive should fail, the segmentWordArray will, sadly, have been reduced to an unrecognizable and unusable jumble.  But what more could you have done with it anyway? */

void primitiveLoadImageSegment(void) {
register struct foo * foo = &fum;
    sqInt data;
    sqInt doingClass;
    usqInt endSeg;
    sqInt extraSize;
    sqInt fieldOop;
    usqInt fieldPtr;
    sqInt hdrTypeBits;
    sqInt header;
    usqInt lastOut;
    usqInt lastPtr;
    sqInt mapOop;
    sqInt outPointerArray;
    usqInt outPtr;
    usqInt segOop;
    sqInt segmentWordArray;
    sqInt sp;
    sqInt addr;
    sqInt addr1;
    sqInt sz;
    sqInt header1;
    sqInt sz1;
    sqInt header2;

	if (DoAssertionChecks) {
		verifyCleanHeaders();
	}
	outPointerArray = longAt(foo->stackPointer);
	lastOut = outPointerArray + (lastPointerOf(outPointerArray));
	segmentWordArray = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));

	/* Essential type checks */

	endSeg = (segmentWordArray + (sizeBitsOf(segmentWordArray))) - (BASE_HEADER_SIZE);
	if (!((((((usqInt) (longAt(outPointerArray))) >> 8) & 15) == 2) && (((((usqInt) (longAt(segmentWordArray))) >> 8) & 15) == 6))) {

		/* Must be indexable words */

		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	data = longAt(segmentWordArray + (BASE_HEADER_SIZE));
	if (!(readableFormat(data & 0xFFFF))) {

		/* low 2 bytes */
		/* Not readable -- try again with reversed bytes... */

		/* begin reverseBytesFrom:to: */
		flag("Dan");
		addr1 = segmentWordArray + (BASE_HEADER_SIZE);
		while ((((usqInt) addr1)) < (((usqInt) (endSeg + (BYTES_PER_WORD))))) {
			longAtput(addr1, byteSwapped(longAt(addr1)));
			addr1 += BYTES_PER_WORD;
		}
		data = longAt(segmentWordArray + (BASE_HEADER_SIZE));
		if (!(readableFormat(data & 0xFFFF))) {

			/* low 2 bytes */
			/* Still NG -- put things back and fail */

			/* begin reverseBytesFrom:to: */
			flag("Dan");
			addr = segmentWordArray + (BASE_HEADER_SIZE);
			while ((((usqInt) addr)) < (((usqInt) (endSeg + (BYTES_PER_WORD))))) {
				longAtput(addr, byteSwapped(longAt(addr)));
				addr += BYTES_PER_WORD;
			}
			if (DoAssertionChecks) {
				verifyCleanHeaders();
			}
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
	}
	if (!((((usqInt) data) >> 16) == (((usqInt) (imageSegmentVersion())) >> 16))) {

		/* Reverse the byte-type objects once */


		/* Oop of first embedded object */

		segOop = ((segmentWordArray + (BASE_HEADER_SIZE)) + (BYTES_PER_WORD)) + (foo->headerTypeBytes[(longAt((segmentWordArray + (BASE_HEADER_SIZE)) + (BYTES_PER_WORD))) & TypeMask]);
		byteSwapByteObjectsFromto(segOop, endSeg + (BYTES_PER_WORD));
	}
	segOop = ((segmentWordArray + (BASE_HEADER_SIZE)) + (BYTES_PER_WORD)) + (foo->headerTypeBytes[(longAt((segmentWordArray + (BASE_HEADER_SIZE)) + (BYTES_PER_WORD))) & TypeMask]);
	while (segOop <= endSeg) {
		if (((longAt(segOop)) & TypeMask) <= 1) {

			/* This object has a class field (type = 0 or 1) -- start with that. */

			fieldPtr = segOop - (BYTES_PER_WORD);
			doingClass = 1;
		} else {

			/* No class field -- start with first data field */

			fieldPtr = segOop + (BASE_HEADER_SIZE);
			doingClass = 0;
		}

		/* last field */

		lastPtr = segOop + (lastPointerOf(segOop));
		if (lastPtr > endSeg) {
			if (DoAssertionChecks) {
				verifyCleanHeaders();
			}
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
		while (!(fieldPtr > lastPtr)) {

			/* Examine each pointer field */

			fieldOop = longAt(fieldPtr);
			if (doingClass) {
				hdrTypeBits = (longAt(fieldPtr)) & TypeMask;
				fieldOop -= hdrTypeBits;
			}
			if ((fieldOop & 1)) {

				/* Integer -- nothing to do */

				fieldPtr += BYTES_PER_WORD;
			} else {
				if (!((fieldOop & 3) == 0)) {
					/* begin primitiveFail */
					if (foo->primFailCode == 0) {
						foo->primFailCode = 1;
					}
					return;
				}
				if ((fieldOop & 0x80000000U) == 0) {

					/* Internal pointer -- add segment offset */

					mapOop = fieldOop + segmentWordArray;
				} else {

					/* External pointer -- look it up in outPointers */

					outPtr = outPointerArray + (fieldOop & 0x7FFFFFFFU);
					if (outPtr > lastOut) {
						/* begin primitiveFail */
						if (foo->primFailCode == 0) {
							foo->primFailCode = 1;
						}
						return;
					}
					mapOop = longAt(outPtr);
				}
				if (doingClass) {
					longAtput(fieldPtr, mapOop + hdrTypeBits);
					fieldPtr += 8;
					doingClass = 0;
				} else {
					longAtput(fieldPtr, mapOop);
					fieldPtr += BYTES_PER_WORD;
				}
				if (segOop < foo->youngStart) {
					possibleRootStoreIntovalue(segOop, mapOop);
				}
			}
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) segOop)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(segOop)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(segOop)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header1 = longAt(segOop);
			if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(segOop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header1 & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
		}
		segOop = (segOop + sz) + (foo->headerTypeBytes[(longAt(segOop + sz)) & TypeMask]);
	}
	segOop = ((segmentWordArray + (BASE_HEADER_SIZE)) + (BYTES_PER_WORD)) + (foo->headerTypeBytes[(longAt((segmentWordArray + (BASE_HEADER_SIZE)) + (BYTES_PER_WORD))) & TypeMask]);
	while (segOop <= endSeg) {
		if (!(oopHasAcceptableClass(segOop))) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}

		/* first field */

		fieldPtr = segOop + (BASE_HEADER_SIZE);

		/* last field */
		/* Go through all oops, remapping them... */

		lastPtr = segOop + (lastPointerOf(segOop));
		while (!(fieldPtr > lastPtr)) {

			/* Examine each pointer field */

			fieldOop = longAt(fieldPtr);
			if (!(oopHasAcceptableClass(fieldOop))) {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
				return;
			}
			fieldPtr += BYTES_PER_WORD;
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) segOop)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(segOop)) & TypeMask) == HeaderTypeFree) {
			sz1 = (longAt(segOop)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header2 = longAt(segOop);
			if ((header2 & TypeMask) == HeaderTypeSizeAndClass) {
				sz1 = (longAt(segOop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l2;
			} else {
				sz1 = header2 & (SIZE_MASK);
				goto l2;
			}
		l2:	/* end sizeBitsOf: */;
		}
		segOop = (segOop + sz1) + (foo->headerTypeBytes[(longAt(segOop + sz1)) & TypeMask]);
	}
	extraSize = foo->headerTypeBytes[(longAt(segmentWordArray)) & TypeMask];
	hdrTypeBits = (longAt(segmentWordArray)) & TypeMask;
	if (extraSize == 8) {
		longAtput(segmentWordArray - extraSize, ((BASE_HEADER_SIZE) + (BYTES_PER_WORD)) + hdrTypeBits);
	} else {
		header = longAt(segmentWordArray);
		longAtput(segmentWordArray, ((header - (header & (SIZE_MASK))) + (BASE_HEADER_SIZE)) + (BYTES_PER_WORD));
	}
	if (DoAssertionChecks) {
		verifyCleanHeaders();
	}
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((3 - 1) * (BYTES_PER_WORD))), ((segmentWordArray + (BASE_HEADER_SIZE)) + (BYTES_PER_WORD)) + (foo->headerTypeBytes[(longAt((segmentWordArray + (BASE_HEADER_SIZE)) + (BYTES_PER_WORD))) & TypeMask]));
	foo->stackPointer = sp;
}

void primitiveLoadInstVar(void) {
register struct foo * foo = &fum;
    sqInt thisReceiver;
    sqInt top;
    sqInt object;
    sqInt sp;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	thisReceiver = top;
	/* begin push: */
	object = longAt((thisReceiver + (BASE_HEADER_SIZE)) + ((foo->primitiveIndex - 264) << (SHIFT_FOR_WORD)));
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
	foo->stackPointer = sp;
}


/*	Answer the local microseconds since the Smalltalk epoch. The value is
	derived from the Posix epoch (see primitiveUTCMicrosecondClock) with a
	constant offset corresponding to elapsed microseconds between the two
	epochs according to RFC 868, and with an offset duration corresponding to
	the current offset of local time from UTC. */

EXPORT(void) primitiveLocalMicrosecondClock(void) {
register struct foo * foo = &fum;
    sqLong clock;
    static usqLong epochDelta= 2177452800000000ULL;
    int offset;
    usqLong offsetMillis;
    sqInt uSecs;
    sqInt sp;

	if ((ioUtcWithOffset(&clock, &offset)) == -1) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}

	/* adjust for nominal Smalltalk epoch */

	clock += epochDelta;
	offsetMillis = offset;
	offsetMillis = offsetMillis * 1000000;

	/* adjust for local time offset */

	clock += offsetMillis;
	uSecs = positive64BitIntegerFor(clock);
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), uSecs);
	foo->stackPointer = sp;
}


/*	Natural log. */

void primitiveLogN(void) {
register struct foo * foo = &fum;
    double rcvr;

	rcvr = popFloat();
	if (!foo->primFailCode) {
		pushFloat(log(rcvr));
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	Register the low-space semaphore. If the argument is not a 
	Semaphore, unregister the current low-space Semaphore. */

void primitiveLowSpaceSemaphore(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt top;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	arg = top;
	if ((fetchClassOf(arg)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD))))) {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(foo->specialObjectsOop, arg);
		}
		longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheLowSpaceSemaphore << (SHIFT_FOR_WORD)), arg);
	} else {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(foo->specialObjectsOop, foo->nilObj);
		}
		longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheLowSpaceSemaphore << (SHIFT_FOR_WORD)), foo->nilObj);
	}
}

void primitiveMakePoint(void) {
register struct foo * foo = &fum;
    sqInt argument;
    sqInt pt;
    sqInt rcvr;
    sqInt pointResult;
    sqInt pointResult1;
    sqInt pointResult2;
    sqInt sp;

	argument = longAt(foo->stackPointer);
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if ((rcvr & 1)) {
		if ((argument & 1)) {
			/* begin makePointwithxValue:yValue: */
			pointResult = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD))), 3 * (BYTES_PER_WORD));
			longAtput((pointResult + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)), ((((rcvr >> 1)) << 1) | 1));
			longAtput((pointResult + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)), ((((argument >> 1)) << 1) | 1));
			pt = pointResult;
		} else {
			/* begin makePointwithxValue:yValue: */
			pointResult1 = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD))), 3 * (BYTES_PER_WORD));
			longAtput((pointResult1 + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)), ((((rcvr >> 1)) << 1) | 1));
			longAtput((pointResult1 + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
			pt = pointResult1;
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) pt)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(pt, longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
			}
			longAtput((pt + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
		}
	} else {
		if (!((fetchClassOf(rcvr)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD)))))) {
			/* begin success: */
			if (!(0)) {
				if (!foo->primFailCode) {
					foo->primFailCode = 1;
				}
			}
			return;
		}
		/* begin makePointwithxValue:yValue: */
		pointResult2 = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD))), 3 * (BYTES_PER_WORD));
		longAtput((pointResult2 + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
		longAtput((pointResult2 + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)), ((0 << 1) | 1));
		pt = pointResult2;
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) pt)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(pt, longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
		}
		longAtput((pt + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) pt)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(pt, longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
		}
		longAtput((pt + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	}
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), pt);
	foo->stackPointer = sp;
}


/*	Primitive. Mark the method for exception handling. The primitive must fail after marking the context so that the regular code is run. */

void primitiveMarkHandlerMethod(void) {
register struct foo * foo = &fum;
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
}


/*	Primitive. Mark the method for exception unwinding. The primitive must fail after marking the context so that the regular code is run.  It must also *not* allow a context switch. */

void primitiveMarkUnwindMethod(void) {
register struct foo * foo = &fum;
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return;
}

void primitiveMaxIdentityHash(void) {
register struct foo * foo = &fum;
    sqInt sp;

	/* begin pop:thenPushInteger: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), ((HashMaskUnshifted << 1) | 1));
	foo->stackPointer = sp;
}


/*	Primitive. Answer an exact copy of the object memory as of the point of entry
	to this primitive. The object memory is not prepared for saving as a snapshot.
	Compare to primitiveMemorySnapshotWithHeader, which prepares the object
	memory to be resumed from a saved snapshot */

EXPORT(sqInt) primitiveMemoryCopy(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt sp;

	/* begin methodReturnValue: */
	oop = memoryImageCopyAsbytesPerElement(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBitmap << (SHIFT_FOR_WORD))), 4);
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), oop);
	foo->stackPointer = sp;
	return null;
}


/*	Primitive. Answer an array with a snapshot copy of the object memory as
	of the point of entry to this primitive, and with the header information for
	the image at the point of the snapshot.

	The memory snapshot is a ByteArray copy of the object memory, and the header
	information is an array of the values that would be stored in an image file
	header if the image was being saved to disk. The header state information
	along with memory snapshot are sufficient to initialize an an image to be run
	in an interpreter. */
/*	pop rcvr. A resuming image will see this primitive answering true, otherwise
	it will answer the expected value of a two element array. Test for result equal
	to true to determine if the image is being resumed from a saved snapshot.. */

EXPORT(sqInt) primitiveMemorySnapshotBytesWithHeader(void) {
register struct foo * foo = &fum;
    sqInt result;
    sqInt sp;
    sqInt sp1;

	/* begin pop: */
	foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
	foo->stackPointer = sp;
	result = headerAndSnapshotOfSizeclass(prepareForSnapshot(), longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassByteArray << (SHIFT_FOR_WORD))));
	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
	/* begin push: */
	longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), result);
	foo->stackPointer = sp1;
	return null;
}


/*	Primitive. Answer an array with a snapshot copy of the object memory as
	of the point of entry to this primitive, and with the header information for
	the image at the point of the snapshot.

	The memory snapshot is a Bitmap copy of the object memory, and the header
	information is an array of the values that would be stored in an image file
	header if the image was being saved to disk. The header state information
	along with memory snapshot are sufficient to initialize an an image to be run
	in an interpreter. */
/*	pop rcvr. A resuming image will see this primitive answering true, otherwise
	it will answer the expected value of a two element array. Test for result equal
	to true to determine if the image is being resumed from a saved snapshot.. */

EXPORT(sqInt) primitiveMemorySnapshotWithHeader(void) {
register struct foo * foo = &fum;
    sqInt result;
    sqInt sp;
    sqInt sp1;

	/* begin pop: */
	foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
	foo->stackPointer = sp;
	result = headerAndSnapshotOfSizeclass(prepareForSnapshot(), longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBitmap << (SHIFT_FOR_WORD))));
	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
	/* begin push: */
	longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), result);
	foo->stackPointer = sp1;
	return null;
}


/*	Return the method an external primitive was defined in */

sqInt primitiveMethod(void) {
	return foo->newMethod;
}


/*	This is a named (not numbered) primitive in the null module (ie the VM) */

EXPORT(sqInt) primitiveMicrosecondClock(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt sp;

	/* begin pop:thenPush: */
	oop = positive64BitIntegerFor(ioMicroSecondClock());
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), oop);
	foo->stackPointer = sp;
	return null;
}


/*	Return the value of the millisecond clock as an integer. Note that the millisecond clock wraps around periodically. On some platforms it can wrap daily. The range is limited to SmallInteger maxVal / 2 to allow delays of up to that length without overflowing a SmallInteger. */

void primitiveMillisecondClock(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt sp;

	/* begin pop:thenPush: */
	oop = ((((ioMSecs()) & MillisecondClockMask) << 1) | 1);
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), oop);
	foo->stackPointer = sp;
}


/*	Provide access to the millisecond clock mask to support calculation
	of durations based on the millisecond clock value. */

EXPORT(sqInt) primitiveMillisecondClockMask(void) {
register struct foo * foo = &fum;
    sqInt sp;

	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), ((MillisecondClockMask << 1) | 1));
	foo->stackPointer = sp;
	return null;
}

void primitiveMod(void) {
register struct foo * foo = &fum;
    sqInt mod;
    sqInt sp;

	mod = doPrimitiveModby(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))), longAt(foo->stackPointer));
	/* begin pop2AndPushIntegerIfOK: */
	if (!foo->primFailCode) {
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) mod)) ^ ((((int) mod)) << 1)) >= 0)
# else
			((mod >= -1073741824) && (mod <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			/* begin pop:thenPush: */
			longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), ((mod << 1) | 1));
			foo->stackPointer = sp;
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
	}
}


/*	Primitive arithmetic operations for large integers in 64 bit range */

EXPORT(void) primitiveModLargeIntegers(void) {
register struct foo * foo = &fum;
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt sp;

	oopArg = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	oopRcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (b == 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return;
	}

	/* Handle remainder of same sign as argument */

	result = a % b;
	if (!(result == 0)) {
		if (!(bIsNegative == aIsNegative)) {
			result = b - result;
		}
	}
	oopResult = magnitude64BitIntegerForneg(result, bIsNegative);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}


/*	Obsolete on virtually all platforms; old style input polling code.
	Return the mouse button state. The low three bits encode the state of the <red><yellow><blue> mouse buttons. The next four bits encode the Smalltalk modifier bits <cmd><option><ctrl><shift>. */

void primitiveMouseButtons(void) {
register struct foo * foo = &fum;
    sqInt buttonWord;
    sqInt sp;

	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
	buttonWord = ioGetButtonState();
	/* begin pushInteger: */
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), ((buttonWord << 1) | 1));
	foo->stackPointer = sp;
}


/*	Obsolete on virtually all platforms; old style input polling code.
	Return a Point indicating current position of the mouse. Note that mouse coordinates may be negative if the mouse moves above or to the left of the top-left corner of the Smalltalk window. */

void primitiveMousePoint(void) {
register struct foo * foo = &fum;
    sqInt pointWord;
    sqInt x;
    sqInt y;
    sqInt object;
    sqInt sp;
    sqInt pointResult;

	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
	pointWord = ioMousePoint();
	/* begin signExtend16: */
	if ((((((usqInt) pointWord) >> 16) & 0xFFFF) & 32768) == 0) {
		x = (((usqInt) pointWord) >> 16) & 0xFFFF;
		goto l1;
	} else {
		x = ((((usqInt) pointWord) >> 16) & 0xFFFF) - 65536;
		goto l1;
	}
l1:	/* end signExtend16: */;
	/* begin signExtend16: */
	if (((pointWord & 0xFFFF) & 32768) == 0) {
		y = pointWord & 0xFFFF;
		goto l2;
	} else {
		y = (pointWord & 0xFFFF) - 65536;
		goto l2;
	}
l2:	/* end signExtend16: */;
	/* begin push: */
	/* begin makePointwithxValue:yValue: */
	pointResult = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD))), 3 * (BYTES_PER_WORD));
	longAtput((pointResult + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)), ((x << 1) | 1));
	longAtput((pointResult + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)), ((y << 1) | 1));
	object = pointResult;
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
	foo->stackPointer = sp;
}

void primitiveMultiply(void) {
register struct foo * foo = &fum;
    sqInt integerArg;
    sqInt integerRcvr;
    sqInt integerResult;
    sqInt overflow;
    sqInt sp;
    sqInt integerPointer;
    sqInt integerPointer1;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		integerRcvr = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerRcvr = 0;
		goto l1;
	}
	integerRcvr = null;
l1:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		integerArg = (integerPointer1 >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerArg = 0;
		goto l2;
	}
	integerArg = null;
l2:	/* end stackIntegerValue: */;
	if (!foo->primFailCode) {
		overflow = (integerRcvr > 0
			? (integerArg > 0
	? integerRcvr > (0x3FFFFFFF / integerArg)
	: integerArg < (-1073741824 / integerRcvr))
			: (integerArg > 0
	? integerRcvr < (-1073741824 / integerArg)
	: (integerRcvr < 0) && (integerArg < (0x3FFFFFFF / integerRcvr))));
		if (overflow) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		} else {
			integerResult = integerRcvr * integerArg;
			/* begin pop:thenPush: */
			longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), ((integerResult << 1) | 1));
			foo->stackPointer = sp;
		}
	}
}


/*	Primitive arithmetic operations for large integers in 64 bit range */

EXPORT(void) primitiveMultiplyLargeIntegers(void) {
register struct foo * foo = &fum;
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt sp;

	oopArg = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	oopRcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (!(!foo->primFailCode)) {
		return;
	}
	if ((a > 1) && ((b > 1) && (a > (0xFFFFFFFFFFFFFFFFULL / b)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	result = a * b;
	oopResult = magnitude64BitIntegerForneg(result, aIsNegative != bIsNegative);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}


/*	Allocate a new fixed-size instance. Fail if the allocation would leave less than lowSpaceThreshold bytes free. May cause a GC */

void primitiveNew(void) {
register struct foo * foo = &fum;
    sqInt class;
    sqInt spaceOkay;
    sqInt object;
    sqInt sp;
    sqInt format;
    usqInt minFree;
    usqInt minFree1;


	/* The following may cause GC! */

	class = longAt(foo->stackPointer);
	/* begin sufficientSpaceToInstantiate:indexableSize: */
	format = (((usqInt) ((longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1)) >> 8) & 15;
	if ((0 > 0) && (format < 2)) {
		spaceOkay = 0;
		goto l1;
	}
	if (format < 8) {
		if (isExcessiveAllocationRequestshift(0, SHIFT_FOR_WORD)) {
			spaceOkay = 0;
			goto l1;
		}
		/* begin sufficientSpaceToAllocate: */
		minFree = (foo->lowSpaceThreshold + (2500 + (0 * (BYTES_PER_WORD)))) + (BASE_HEADER_SIZE);
		if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree)) {
			spaceOkay = 1;
			goto l1;
		} else {
			spaceOkay = sufficientSpaceAfterGC(minFree);
			goto l1;
		}
		spaceOkay = null;
		goto l1;
	} else {
		if (isExcessiveAllocationRequestshift(0, 0)) {
			spaceOkay = 0;
			goto l1;
		}
		/* begin sufficientSpaceToAllocate: */
		minFree1 = (foo->lowSpaceThreshold + (2500 + 0)) + (BASE_HEADER_SIZE);
		if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree1)) {
			spaceOkay = 1;
			goto l1;
		} else {
			spaceOkay = sufficientSpaceAfterGC(minFree1);
			goto l1;
		}
		spaceOkay = null;
		goto l1;
	}
l1:	/* end sufficientSpaceToInstantiate:indexableSize: */;
	/* begin success: */
	if (!(spaceOkay)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin push: */
		object = instantiateClassindexableSize(popStack(), 0);
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
	}
}

void primitiveNewMethod(void) {
register struct foo * foo = &fum;
    sqInt bytecodeCount;
    sqInt class;
    sqInt header;
    sqInt i;
    sqInt literalCount;
    sqInt size;
    sqInt theMethod;
    sqInt top;
    sqInt integerPointer;
    sqInt top1;
    sqInt top2;
    sqInt sp;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	header = top;
	/* begin popInteger */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top1;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		bytecodeCount = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		bytecodeCount = 0;
		goto l1;
	}
	bytecodeCount = null;
l1:	/* end popInteger */;
	/* begin success: */
	if (!((header & 1))) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
		return;
	}
	/* begin popStack */
	top2 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	class = top2;
	size = ((((((usqInt) header) >> 10) & 0xFF) + 1) * (BYTES_PER_WORD)) + bytecodeCount;
	theMethod = instantiateClassindexableSize(class, size);
	longAtput((theMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD)), header);
	literalCount = (((usqInt) header) >> 10) & 0xFF;
	for (i = 1; i <= literalCount; i += 1) {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) theMethod)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(theMethod, foo->nilObj);
		}
		longAtput((theMethod + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)), foo->nilObj);
	}
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), theMethod);
	foo->stackPointer = sp;
}


/*	Allocate a new indexable instance. Fail if the allocation would leave less than lowSpaceThreshold bytes free. */

void primitiveNewWithArg(void) {
register struct foo * foo = &fum;
    sqInt class;
    usqInt size;
    sqInt spaceOkay;
    sqInt oop;
    sqInt sp;
    sqInt format;
    usqInt minFree;
    usqInt minFree1;

	
# if (SQ_IMAGE64 && SQ_HOST64)  // permit large object allocation on 64 bit image and host
	size = positive64BitValueOf(longAt(foo->stackPointer));
# else
	size = positive32BitValueOf(longAt(foo->stackPointer));
# endif  // SQ_IMAGE64 && SQ_HOST64
	
	class = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin success: */
	if (!(size >= 0)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {

		/* The following may cause GC! */

		/* begin sufficientSpaceToInstantiate:indexableSize: */
		format = (((usqInt) ((longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1)) >> 8) & 15;
		if ((size > 0) && (format < 2)) {
			spaceOkay = 0;
			goto l1;
		}
		if (format < 8) {
			if (isExcessiveAllocationRequestshift(size, SHIFT_FOR_WORD)) {
				spaceOkay = 0;
				goto l1;
			}
			/* begin sufficientSpaceToAllocate: */
			minFree = (foo->lowSpaceThreshold + (2500 + (size * (BYTES_PER_WORD)))) + (BASE_HEADER_SIZE);
			if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree)) {
				spaceOkay = 1;
				goto l1;
			} else {
				spaceOkay = sufficientSpaceAfterGC(minFree);
				goto l1;
			}
			spaceOkay = null;
			goto l1;
		} else {
			if (isExcessiveAllocationRequestshift(size, 0)) {
				spaceOkay = 0;
				goto l1;
			}
			/* begin sufficientSpaceToAllocate: */
			minFree1 = (foo->lowSpaceThreshold + (2500 + size)) + (BASE_HEADER_SIZE);
			if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree1)) {
				spaceOkay = 1;
				goto l1;
			} else {
				spaceOkay = sufficientSpaceAfterGC(minFree1);
				goto l1;
			}
			spaceOkay = null;
			goto l1;
		}
	l1:	/* end sufficientSpaceToInstantiate:indexableSize: */;
		/* begin success: */
		if (!(spaceOkay)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		class = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	}
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		oop = instantiateClassindexableSize(class, size);
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oop);
		foo->stackPointer = sp;
	}
}


/*	PrimitiveNext will succeed only if the stream's array is in the atCache.
	Otherwise failure will lead to proper message lookup of at: and
	subsequent installation in the cache if appropriate.
	nb: This primitive was previously installed as primitive 65, but is no
	longer in use. */

sqInt primitiveNext(void) {
register struct foo * foo = &fum;
    sqInt array;
    sqInt atIx;
    sqInt index;
    sqInt limit;
    sqInt result;
    sqInt stream;
    sqInt sp;

	stream = longAt(foo->stackPointer);
	if (!((((stream & 1) == 0) && (((((usqInt) (longAt(stream))) >> 8) & 15) <= 4)) && ((lengthOf(stream)) >= (StreamReadLimitIndex + 1)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	array = longAt((stream + (BASE_HEADER_SIZE)) + (StreamArrayIndex << (SHIFT_FOR_WORD)));
	index = fetchIntegerofObject(StreamIndexIndex, stream);
	limit = fetchIntegerofObject(StreamReadLimitIndex, stream);
	atIx = array & AtCacheMask;
	if (!((index < limit) && ((foo->atCache[atIx + AtCacheOop]) == array))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	index += 1;

	/* Above may cause GC, so can't use stream, array etc. below it */

	result = commonVariableatcacheIndex(array, index, atIx);
	if (!foo->primFailCode) {
		stream = longAt(foo->stackPointer);
		/* begin storeInteger:ofObject:withValue: */
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) index)) ^ ((((int) index)) << 1)) >= 0)
# else
			((index >= -1073741824) && (index <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			longAtput((stream + (BASE_HEADER_SIZE)) + (StreamIndexIndex << (SHIFT_FOR_WORD)), ((index << 1) | 1));
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), result);
		foo->stackPointer = sp;
		return null;
	}
	return null;
}

void primitiveNextInstance(void) {
register struct foo * foo = &fum;
    sqInt instance;
    sqInt object;
    sqInt sp;
    sqInt classPointer;
    sqInt thisClass;
    sqInt thisObj;
    sqInt obj;
    sqInt obj1;
    sqInt sz;
    sqInt header;
    sqInt sz1;
    sqInt header1;
    sqInt ccIndex;
    sqInt oop1;
    sqInt sz2;
    sqInt header2;
    sqInt ccIndex1;
    sqInt oop11;
    sqInt sz3;
    sqInt header3;

	object = longAt(foo->stackPointer);
	/* begin instanceAfter: */
	/* begin fetchClassOf: */
	if ((object & 1)) {
		classPointer = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l8;
	}
	ccIndex1 = (((usqInt) (longAt(object))) >> 12) & 0x1F;
	if (ccIndex1 == 0) {
		classPointer = (longAt(object - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l8;
	} else {
		/* begin fetchPointer:ofObject: */
		oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		classPointer = longAt((oop11 + (BASE_HEADER_SIZE)) + ((ccIndex1 - 1) << (SHIFT_FOR_WORD)));
		goto l8;
	}
l8:	/* end fetchClassOf: */;
	/* begin accessibleObjectAfter: */
	/* begin objectAfter: */
	if (DoAssertionChecks) {
		if ((((usqInt) object)) >= (((usqInt) foo->endOfMemory))) {
			error("no objects after the end of memory");
		}
	}
	if (((longAt(object)) & TypeMask) == HeaderTypeFree) {
		sz3 = (longAt(object)) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin sizeBitsOf: */
		header3 = longAt(object);
		if ((header3 & TypeMask) == HeaderTypeSizeAndClass) {
			sz3 = (longAt(object - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
			goto l9;
		} else {
			sz3 = header3 & (SIZE_MASK);
			goto l9;
		}
	l9:	/* end sizeBitsOf: */;
	}
	obj1 = (object + sz3) + (foo->headerTypeBytes[(longAt(object + sz3)) & TypeMask]);
	while ((((usqInt) obj1)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(obj1)) & TypeMask) == HeaderTypeFree)) {
			thisObj = obj1;
			goto l3;
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) obj1)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(obj1)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(obj1)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header = longAt(obj1);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(obj1 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l4;
			} else {
				sz = header & (SIZE_MASK);
				goto l4;
			}
		l4:	/* end sizeBitsOf: */;
		}
		obj1 = (obj1 + sz) + (foo->headerTypeBytes[(longAt(obj1 + sz)) & TypeMask]);
	}
	thisObj = null;
l3:	/* end accessibleObjectAfter: */;
	while (!(thisObj == null)) {
		/* begin fetchClassOf: */
		if ((thisObj & 1)) {
			thisClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
			goto l6;
		}
		ccIndex = (((usqInt) (longAt(thisObj))) >> 12) & 0x1F;
		if (ccIndex == 0) {
			thisClass = (longAt(thisObj - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
			goto l6;
		} else {
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
			thisClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
			goto l6;
		}
	l6:	/* end fetchClassOf: */;
		if (thisClass == classPointer) {
			instance = thisObj;
			goto l1;
		}
		/* begin accessibleObjectAfter: */
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) thisObj)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(thisObj)) & TypeMask) == HeaderTypeFree) {
			sz2 = (longAt(thisObj)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header2 = longAt(thisObj);
			if ((header2 & TypeMask) == HeaderTypeSizeAndClass) {
				sz2 = (longAt(thisObj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l7;
			} else {
				sz2 = header2 & (SIZE_MASK);
				goto l7;
			}
		l7:	/* end sizeBitsOf: */;
		}
		obj = (thisObj + sz2) + (foo->headerTypeBytes[(longAt(thisObj + sz2)) & TypeMask]);
		while ((((usqInt) obj)) < (((usqInt) foo->endOfMemory))) {
			if (!(((longAt(obj)) & TypeMask) == HeaderTypeFree)) {
				thisObj = obj;
				goto l2;
			}
			/* begin objectAfter: */
			if (DoAssertionChecks) {
				if ((((usqInt) obj)) >= (((usqInt) foo->endOfMemory))) {
					error("no objects after the end of memory");
				}
			}
			if (((longAt(obj)) & TypeMask) == HeaderTypeFree) {
				sz1 = (longAt(obj)) & (ALL_BUT_TYPE_MASK);
			} else {
				/* begin sizeBitsOf: */
				header1 = longAt(obj);
				if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
					sz1 = (longAt(obj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
					goto l5;
				} else {
					sz1 = header1 & (SIZE_MASK);
					goto l5;
				}
			l5:	/* end sizeBitsOf: */;
			}
			obj = (obj + sz1) + (foo->headerTypeBytes[(longAt(obj + sz1)) & TypeMask]);
		}
		thisObj = null;
	l2:	/* end accessibleObjectAfter: */;
	}
	instance = foo->nilObj;
l1:	/* end instanceAfter: */;
	if (instance == foo->nilObj) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	} else {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), instance);
		foo->stackPointer = sp;
	}
}


/*	Return the object following the receiver in the heap. Return the SmallInteger zero when there are no more objects. */

void primitiveNextObject(void) {
register struct foo * foo = &fum;
    sqInt instance;
    sqInt object;
    sqInt sp;
    sqInt sp1;
    sqInt obj;
    sqInt sz;
    sqInt header;
    sqInt sz1;
    sqInt header1;

	object = longAt(foo->stackPointer);
	/* begin accessibleObjectAfter: */
	/* begin objectAfter: */
	if (DoAssertionChecks) {
		if ((((usqInt) object)) >= (((usqInt) foo->endOfMemory))) {
			error("no objects after the end of memory");
		}
	}
	if (((longAt(object)) & TypeMask) == HeaderTypeFree) {
		sz1 = (longAt(object)) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin sizeBitsOf: */
		header1 = longAt(object);
		if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
			sz1 = (longAt(object - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
			goto l3;
		} else {
			sz1 = header1 & (SIZE_MASK);
			goto l3;
		}
	l3:	/* end sizeBitsOf: */;
	}
	obj = (object + sz1) + (foo->headerTypeBytes[(longAt(object + sz1)) & TypeMask]);
	while ((((usqInt) obj)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(obj)) & TypeMask) == HeaderTypeFree)) {
			instance = obj;
			goto l1;
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) obj)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(obj)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(obj)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header = longAt(obj);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(obj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l2;
			} else {
				sz = header & (SIZE_MASK);
				goto l2;
			}
		l2:	/* end sizeBitsOf: */;
		}
		obj = (obj + sz) + (foo->headerTypeBytes[(longAt(obj + sz)) & TypeMask]);
	}
	instance = null;
l1:	/* end accessibleObjectAfter: */;
	if (instance == null) {
		/* begin pop:thenPushInteger: */
		longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), ((0 << 1) | 1));
		foo->stackPointer = sp;
	} else {
		/* begin pop:thenPush: */
		longAtput((sp1 = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), instance);
		foo->stackPointer = sp1;
	}
}


/*	PrimitiveNextPut will succeed only if the stream's array is in the atPutCache.
	Otherwise failure will lead to proper message lookup of at:put: and
	subsequent installation in the cache if appropriate.
	nb: This primitive was previously installed as primitive 66, but is no
	longer in use. */

sqInt primitiveNextPut(void) {
register struct foo * foo = &fum;
    sqInt array;
    sqInt atIx;
    sqInt index;
    sqInt limit;
    sqInt stream;
    sqInt value;
    sqInt sp;
    sqInt fixedFields;
    sqInt fmt;
    sqInt stSize;
    sqInt valToPut;

	value = longAt(foo->stackPointer);
	stream = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if (!((((stream & 1) == 0) && (((((usqInt) (longAt(stream))) >> 8) & 15) <= 4)) && ((lengthOf(stream)) >= (StreamReadLimitIndex + 1)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	array = longAt((stream + (BASE_HEADER_SIZE)) + (StreamArrayIndex << (SHIFT_FOR_WORD)));
	index = fetchIntegerofObject(StreamIndexIndex, stream);
	limit = fetchIntegerofObject(StreamWriteLimitIndex, stream);
	atIx = (array & AtCacheMask) + AtPutBase;
	if (!((index < limit) && ((foo->atCache[atIx + AtCacheOop]) == array))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	index += 1;
	/* begin commonVariable:at:put:cacheIndex: */
	stSize = foo->atCache[atIx + AtCacheSize];
	if (((((usqInt) index)) >= (((usqInt) 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) {
		fmt = foo->atCache[atIx + AtCacheFmt];
		if (fmt <= 4) {
			fixedFields = foo->atCache[atIx + AtCacheFixedFields];
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) array)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(array, value);
			}
			longAtput((array + (BASE_HEADER_SIZE)) + (((index + fixedFields) - 1) << (SHIFT_FOR_WORD)), value);
			goto l1;
		}
		if (fmt < 8) {
			valToPut = positive32BitValueOf(value);
			if (!foo->primFailCode) {
				long32Atput((array + (BASE_HEADER_SIZE)) + ((index - 1) << 2), valToPut);
			}
			goto l1;
		}
		if (fmt >= 16) {
			valToPut = asciiOfCharacter(value);
			if (!(!foo->primFailCode)) {
				goto l1;
			}
		} else {
			valToPut = value;
		}
		if ((valToPut & 1)) {
			valToPut = (valToPut >> 1);
			if (!((valToPut >= 0) && (valToPut <= 0xFF))) {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
				goto l1;
			}
			byteAtput((array + (BASE_HEADER_SIZE)) + (index - 1), valToPut);
			goto l1;
		}
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
l1:	/* end commonVariable:at:put:cacheIndex: */;
	if (!foo->primFailCode) {
		/* begin storeInteger:ofObject:withValue: */
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) index)) ^ ((((int) index)) << 1)) >= 0)
# else
			((index >= -1073741824) && (index <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			longAtput((stream + (BASE_HEADER_SIZE)) + (StreamIndexIndex << (SHIFT_FOR_WORD)), ((index << 1) | 1));
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), value);
		foo->stackPointer = sp;
		return null;
	}
	return null;
}


/*	A placeholder for primitives that haven't been implemented or are being withdrawn gradually. Just absorbs any arguments and returns the receiver. */

void primitiveNoop(void) {
register struct foo * foo = &fum;
	/* begin pop: */
	foo->stackPointer -= foo->argumentCount * (BYTES_PER_WORD);
}

void primitiveNotEqual(void) {
register struct foo * foo = &fum;
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt result;
    sqInt top;
    sqInt top1;
    sqInt sp;
    sqInt sp1;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerArgument = top;
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerReceiver = top1;
	result = !(compare31or32Bitsequal(integerReceiver, integerArgument));
	/* begin checkBooleanResult: */
	if (!foo->primFailCode) {
		/* begin pushBool: */
		if (result) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
			foo->stackPointer = sp;
		} else {
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
			foo->stackPointer = sp1;
		}
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Primitive comparison operations for large integers in 64 bit range */

EXPORT(void) primitiveNotEqualLargeIntegers(void) {
register struct foo * foo = &fum;
    sqLong integerArg;
    sqLong integerRcvr;
    sqInt sp;

	integerArg = signed64BitValueOf(longAt(foo->stackPointer - (0 * (BYTES_PER_WORD))));
	integerRcvr = signed64BitValueOf(longAt(foo->stackPointer - (1 * (BYTES_PER_WORD))));
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (integerRcvr != integerArg
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}


/*	is the receiver/first argument not the same object as the (last) argument?.
	 pop argumentCount because this can be used as a mirror primitive. */

void primitiveNotIdentical(void) {
register struct foo * foo = &fum;
    sqInt otherObject;
    sqInt thisObject;
    sqInt sp;

	otherObject = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	thisObject = longAt(foo->stackPointer);
	/* begin pop:thenPushBool: */
	longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), (thisObject != otherObject
		? foo->trueObj
		: foo->falseObj));
	foo->stackPointer = sp;
}


/*	Defined for CompiledMethods only */

void primitiveObjectAt(void) {
register struct foo * foo = &fum;
    sqInt index;
    sqInt thisReceiver;
    sqInt object;
    sqInt sp;
    sqInt top;
    sqInt integerPointer;
    sqInt top1;
    sqInt successBoolean;

	/* begin popInteger */
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top1;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l1;
	}
	index = null;
l1:	/* end popInteger */;
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	thisReceiver = top;
	/* begin success: */
	if (!(index > 0)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	/* begin success: */
	successBoolean = index <= ((literalCountOfHeader(longAt((thisReceiver + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) + LiteralStart);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin push: */
		object = longAt((thisReceiver + (BASE_HEADER_SIZE)) + ((index - 1) << (SHIFT_FOR_WORD)));
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Defined for CompiledMethods only */

void primitiveObjectAtPut(void) {
register struct foo * foo = &fum;
    sqInt index;
    sqInt newValue;
    sqInt thisReceiver;
    sqInt sp;
    sqInt top;
    sqInt top1;
    sqInt integerPointer;
    sqInt top2;
    sqInt successBoolean;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	newValue = top;
	/* begin popInteger */
	/* begin popStack */
	top2 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top2;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l1;
	}
	index = null;
l1:	/* end popInteger */;
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	thisReceiver = top1;
	/* begin success: */
	if (!(index > 0)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	/* begin success: */
	successBoolean = index <= ((literalCountOfHeader(longAt((thisReceiver + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) + LiteralStart);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) thisReceiver)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(thisReceiver, newValue);
		}
		longAtput((thisReceiver + (BASE_HEADER_SIZE)) + ((index - 1) << (SHIFT_FOR_WORD)), newValue);
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), newValue);
		foo->stackPointer = sp;
	} else {
		/* begin unPop: */
		foo->stackPointer += 3 * (BYTES_PER_WORD);
	}
}

void primitiveObjectPointsTo(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt lastField;
    sqInt rcvr;
    sqInt thang;
    sqInt top;
    sqInt top1;
    sqInt contextSize;
    sqInt fmt;
    sqInt header;
    sqInt methodHeader;
    sqInt sz;
    sqInt sp;
    sqInt sp2;
    sqInt sp1;
    sqInt header1;
    sqInt type;
    sqInt sp3;
    sqInt sp11;
    sqInt sp4;
    sqInt sp12;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	thang = top;
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	rcvr = top1;
	if ((rcvr & 1)) {
		/* begin pushBool: */
		if (0) {
			/* begin push: */
			longAtput((sp2 = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
			foo->stackPointer = sp2;
		} else {
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
			foo->stackPointer = sp1;
		}
		return;
	}
	/* begin lastPointerOf: */
	header = longAt(rcvr);
	fmt = (((usqInt) header) >> 8) & 15;
	if (fmt <= 4) {
		if ((fmt == 3) && ((((((usqInt) header) >> 12) & 0x1F) == 13) || ((((((usqInt) header) >> 12) & 0x1F) == 14) || (((((usqInt) header) >> 12) & 0x1F) == 4)))) {
			/* begin fetchStackPointerOf: */
			sp = longAt((rcvr + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
			if (!((sp & 1))) {
				contextSize = 0;
				goto l1;
			}
			contextSize = (sp >> 1);
		l1:	/* end fetchStackPointerOf: */;
			lastField = (CtxtTempFrameStart + contextSize) * (BYTES_PER_WORD);
			goto l2;
		}
		/* begin sizeBitsOfSafe: */
		header1 = longAt(rcvr);
		/* begin rightType: */
		if ((header1 & (SIZE_MASK)) == 0) {
			type = HeaderTypeSizeAndClass;
			goto l3;
		} else {
			if ((header1 & CompactClassMask) == 0) {
				type = HeaderTypeClass;
				goto l3;
			} else {
				type = HeaderTypeShort;
				goto l3;
			}
		}
	l3:	/* end rightType: */;
		if (type == HeaderTypeSizeAndClass) {
			sz = (longAt(rcvr - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
			goto l4;
		} else {
			sz = header1 & (SIZE_MASK);
			goto l4;
		}
	l4:	/* end sizeBitsOfSafe: */;
		lastField = sz - (BASE_HEADER_SIZE);
		goto l2;
	}
	if (fmt < 12) {
		lastField = 0;
		goto l2;
	}
	methodHeader = longAt(rcvr + (BASE_HEADER_SIZE));
	lastField = (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
l2:	/* end lastPointerOf: */;
	for (i = (BASE_HEADER_SIZE); i <= lastField; i += (BYTES_PER_WORD)) {
		if ((longAt(rcvr + i)) == thang) {
			/* begin pushBool: */
			if (1) {
				/* begin push: */
				longAtput((sp3 = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
				foo->stackPointer = sp3;
			} else {
				/* begin push: */
				longAtput((sp11 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
				foo->stackPointer = sp11;
			}
			return;
		}
	}
	/* begin pushBool: */
	if (0) {
		/* begin push: */
		longAtput((sp4 = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
		foo->stackPointer = sp4;
	} else {
		/* begin push: */
		longAtput((sp12 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
		foo->stackPointer = sp12;
	}
}

void primitivePerform(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt lookupClass;
    sqInt newReceiver;
    sqInt performMethod;
    sqInt performSelector;
    sqInt selectorIndex;
    sqInt successBoolean;
    sqInt valuePointer;
    sqInt fromIndex;
    sqInt lastFrom;
    sqInt toIndex;
    sqInt ccIndex;
    sqInt oop1;

	performSelector = foo->messageSelector;
	performMethod = foo->newMethod;
	foo->messageSelector = longAt(foo->stackPointer - ((foo->argumentCount - 1) * (BYTES_PER_WORD)));

	/* NOTE: the following lookup may fail and be converted to #doesNotUnderstand:, so we must adjust argumentCount and slide args now, so that would work. */
	/* Slide arguments down over selector */

	newReceiver = longAt(foo->stackPointer - (foo->argumentCount * (BYTES_PER_WORD)));
	foo->argumentCount -= 1;
	selectorIndex = (((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - foo->argumentCount;
	/* begin transfer:fromIndex:ofObject:toIndex:ofObject: */
	flag("Dan");
	fromIndex = foo->activeContext + ((selectorIndex + 1) * (BYTES_PER_WORD));
	toIndex = foo->activeContext + (selectorIndex * (BYTES_PER_WORD));
	lastFrom = fromIndex + (foo->argumentCount * (BYTES_PER_WORD));
	while ((((usqInt) fromIndex)) < (((usqInt) lastFrom))) {
		fromIndex += BYTES_PER_WORD;
		toIndex += BYTES_PER_WORD;
		longAtput(toIndex, longAt(fromIndex));
	}
	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
	/* begin fetchClassOf: */
	if ((newReceiver & 1)) {
		lookupClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(newReceiver))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		lookupClass = (longAt(newReceiver - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		lookupClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	findNewMethodInClass(lookupClass);
	if (((foo->newMethod & 1) == 0) && (((((usqInt) (longAt(foo->newMethod))) >> 8) & 15) >= 12)) {
		/* begin success: */
		successBoolean = ((((usqInt) (longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 25) & 15) == foo->argumentCount;
		if (!(successBoolean)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!foo->primFailCode) {
		executeNewMethodFromCache();
		/* begin initPrimCall */
		foo->primFailCode = 0;
	} else {

		/* Slide the args back up (sigh) and re-insert the 
			selector.  */

		for (i = 1; i <= foo->argumentCount; i += 1) {
			/* begin storePointer:ofObject:withValue: */
			valuePointer = longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (((foo->argumentCount - i) + selectorIndex) << (SHIFT_FOR_WORD)));
			if ((((usqInt) foo->activeContext)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue((sqInt)foo->activeContext, valuePointer);
			}
			longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + ((((foo->argumentCount - i) + 1) + selectorIndex) << (SHIFT_FOR_WORD)), valuePointer);
		}
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) foo->activeContext)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue((sqInt)foo->activeContext, foo->messageSelector);
		}
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (selectorIndex << (SHIFT_FOR_WORD)), foo->messageSelector);
		foo->argumentCount += 1;
		foo->newMethod = performMethod;
		foo->messageSelector = performSelector;
	}
}


/*	Common routine used by perform:withArgs: and perform:withArgs:inSuperclass: */
/*	NOTE:  The case of doesNotUnderstand: is not a failure to perform.
	The only failures are arg types and consistency of argumentCount. */

sqInt primitivePerformAt(sqInt lookupClass) {
register struct foo * foo = &fum;
    sqInt argumentArray;
    sqInt arraySize;
    sqInt cntxSize;
    sqInt index;
    sqInt performArgCount;
    sqInt performMethod;
    sqInt performSelector;
    sqInt sz;
    sqInt header;
    sqInt sz1;
    sqInt header1;
    sqInt successBoolean;
    sqInt object;
    sqInt sp;
    sqInt successBoolean1;
    sqInt sp1;
    sqInt sp2;
    sqInt top;
    sqInt top1;

	argumentArray = longAt(foo->stackPointer);
	if (!(((argumentArray & 1) == 0) && (((((usqInt) (longAt(argumentArray))) >> 8) & 15) == 2))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	if (!foo->primFailCode) {

		/* Check for enough space in thisContext to push all args */

		/* begin fetchWordLengthOf: */
		/* begin sizeBitsOf: */
		header = longAt(argumentArray);
		if ((header & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(argumentArray - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
			goto l1;
		} else {
			sz = header & (SIZE_MASK);
			goto l1;
		}
	l1:	/* end sizeBitsOf: */;
		arraySize = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		/* begin fetchWordLengthOf: */
		/* begin sizeBitsOf: */
		header1 = longAt(foo->activeContext);
		if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
			sz1 = (longAt(foo->activeContext - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
			goto l2;
		} else {
			sz1 = header1 & (SIZE_MASK);
			goto l2;
		}
	l2:	/* end sizeBitsOf: */;
		cntxSize = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		/* begin success: */
		successBoolean = ((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) + arraySize) < cntxSize;
		if (!(successBoolean)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!(!foo->primFailCode)) {
		return null;
	}
	performSelector = foo->messageSelector;
	performMethod = foo->newMethod;

	/* pop the arg array and the selector, then push the args out of the array, as if they were on the stack */

	performArgCount = foo->argumentCount;
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	foo->messageSelector = top1;
	index = 1;
	while (index <= arraySize) {
		/* begin push: */
		object = longAt((argumentArray + (BASE_HEADER_SIZE)) + ((index - 1) << (SHIFT_FOR_WORD)));
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
		index += 1;
	}
	foo->argumentCount = arraySize;
	findNewMethodInClass(lookupClass);
	if (((foo->newMethod & 1) == 0) && (((((usqInt) (longAt(foo->newMethod))) >> 8) & 15) >= 12)) {
		/* begin success: */
		successBoolean1 = ((((usqInt) (longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD))))) >> 25) & 15) == foo->argumentCount;
		if (!(successBoolean1)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!foo->primFailCode) {
		executeNewMethodFromCache();
		/* begin initPrimCall */
		foo->primFailCode = 0;
	} else {

		/* Restore the state by popping all those array entries and pushing back the selector and array, and fail */

		/* begin pop: */
		foo->stackPointer -= foo->argumentCount * (BYTES_PER_WORD);
		/* begin push: */
		longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->messageSelector);
		foo->stackPointer = sp1;
		/* begin push: */
		longAtput((sp2 = foo->stackPointer + (BYTES_PER_WORD)), argumentArray);
		foo->stackPointer = sp2;
		foo->messageSelector = performSelector;
		foo->newMethod = performMethod;
		foo->argumentCount = performArgCount;
	}
	return null;
}

void primitivePerformInSuperclass(void) {
register struct foo * foo = &fum;
    sqInt currentClass;
    sqInt lookupClass;
    sqInt rcvr;
    sqInt s1;
    sqInt s2;
    sqInt s3;
    sqInt s4;
    sqInt s5;
    sqInt sp;
    sqInt top;
    sqInt sp1;
    sqInt sp2;
    sqInt sp3;
    sqInt sp4;
    sqInt sp5;
    sqInt top1;
    sqInt top2;
    sqInt top3;
    sqInt top4;
    sqInt top5;
    sqInt sp6;
    sqInt sp7;
    sqInt sp8;
    sqInt ccIndex;
    sqInt oop1;

	lookupClass = longAt(foo->stackPointer);
	rcvr = longAt(foo->stackPointer - (3 * (BYTES_PER_WORD)));
	/* begin fetchClassOf: */
	if ((rcvr & 1)) {
		currentClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		currentClass = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		currentClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	while (currentClass != lookupClass) {
		currentClass = longAt((currentClass + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
		if (currentClass == foo->nilObj) {
			(foo->primFailCode = PrimErrBadArgument); return;
		}
	}
	if (foo->argumentCount == 3) {

		/* normal primitive call with 3 arguments expected on the stack */

		/* begin popStack */
		top = longAt(foo->stackPointer);
		foo->stackPointer -= BYTES_PER_WORD;
		primitivePerformAt(lookupClass);
		if (!(!foo->primFailCode)) {
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), lookupClass);
			foo->stackPointer = sp;
		}
	} else {
		if (foo->argumentCount == 4) {

			/* mirror primitive call with extra argument specifying object to serve as receiver */
			/* save stack contents */

			/* begin popStack */
			top1 = longAt(foo->stackPointer);
			foo->stackPointer -= BYTES_PER_WORD;
			s1 = top1;
			/* begin popStack */
			top2 = longAt(foo->stackPointer);
			foo->stackPointer -= BYTES_PER_WORD;
			s2 = top2;
			/* begin popStack */
			top3 = longAt(foo->stackPointer);
			foo->stackPointer -= BYTES_PER_WORD;
			s3 = top3;
			/* begin popStack */
			top4 = longAt(foo->stackPointer);
			foo->stackPointer -= BYTES_PER_WORD;
			s4 = top4;
			/* begin popStack */
			top5 = longAt(foo->stackPointer);
			foo->stackPointer -= BYTES_PER_WORD;
			s5 = top5;
			/* begin push: */
			longAtput((sp6 = foo->stackPointer + (BYTES_PER_WORD)), s4);
			foo->stackPointer = sp6;
			/* begin push: */
			longAtput((sp7 = foo->stackPointer + (BYTES_PER_WORD)), s3);
			foo->stackPointer = sp7;
			/* begin push: */
			longAtput((sp8 = foo->stackPointer + (BYTES_PER_WORD)), s2);
			foo->stackPointer = sp8;
			primitivePerformAt(lookupClass);
			if (!(!foo->primFailCode)) {

				/* restore original stack */

				/* begin pop: */
				foo->stackPointer -= 3 * (BYTES_PER_WORD);
				/* begin push: */
				longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), s5);
				foo->stackPointer = sp1;
				/* begin push: */
				longAtput((sp2 = foo->stackPointer + (BYTES_PER_WORD)), s4);
				foo->stackPointer = sp2;
				/* begin push: */
				longAtput((sp3 = foo->stackPointer + (BYTES_PER_WORD)), s3);
				foo->stackPointer = sp3;
				/* begin push: */
				longAtput((sp4 = foo->stackPointer + (BYTES_PER_WORD)), s2);
				foo->stackPointer = sp4;
				/* begin push: */
				longAtput((sp5 = foo->stackPointer + (BYTES_PER_WORD)), s1);
				foo->stackPointer = sp5;
			}
		} else {

			/* wrong number of arguments */

			(foo->primFailCode = PrimErrBadNumArgs); return;
		}
	}
}

void primitivePerformWithArgs(void) {
register struct foo * foo = &fum;
    sqInt lookupClass;
    sqInt rcvr;
    sqInt ccIndex;
    sqInt oop1;

	rcvr = longAt(foo->stackPointer - (foo->argumentCount * (BYTES_PER_WORD)));
	/* begin fetchClassOf: */
	if ((rcvr & 1)) {
		lookupClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		lookupClass = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		lookupClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	primitivePerformAt(lookupClass);
}


/*	Answer a string corresponding to the version of the external platform source
	code, typically written in C and managed separately for each platform.
	This is a named (not numbered) primitive in the null module (ie the VM) */

EXPORT(sqInt) primitivePlatformSourceVersion(void) {
register struct foo * foo = &fum;
    sqInt versionString;
    sqInt sp;

	
# ifdef PLATFORM_SOURCE_VERSION  // version level of platform support code
	versionString = stringForCString(PLATFORM_SOURCE_VERSION);
# else
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return null;
# endif  // PLATFORM_SOURCE_VERSION
	
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), versionString);
	foo->stackPointer = sp;
	return null;
}

sqInt primitivePointX(void) {
register struct foo * foo = &fum;
    sqInt rcvr;
    sqInt object;
    sqInt sp;
    sqInt top;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop1;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	rcvr = top;
	/* begin assertClassOf:is: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD)));
	if ((rcvr & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		cl = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl == classOop)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l1:	/* end assertClassOf:is: */;
	if (!foo->primFailCode) {
		/* begin push: */
		object = longAt((rcvr + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)));
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
	return null;
}

sqInt primitivePointY(void) {
register struct foo * foo = &fum;
    sqInt rcvr;
    sqInt object;
    sqInt sp;
    sqInt top;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop1;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	rcvr = top;
	/* begin assertClassOf:is: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD)));
	if ((rcvr & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		cl = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl == classOop)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l1:	/* end assertClassOf:is: */;
	if (!foo->primFailCode) {
		/* begin push: */
		object = longAt((rcvr + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)));
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
		foo->stackPointer = sp;
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
	return null;
}

void primitivePushFalse(void) {
register struct foo * foo = &fum;
    sqInt top;
    sqInt sp;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
	foo->stackPointer = sp;
}

void primitivePushMinusOne(void) {
register struct foo * foo = &fum;
    sqInt top;
    sqInt sp;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), ConstMinusOne);
	foo->stackPointer = sp;
}

void primitivePushNil(void) {
register struct foo * foo = &fum;
    sqInt top;
    sqInt sp;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->nilObj);
	foo->stackPointer = sp;
}

void primitivePushOne(void) {
register struct foo * foo = &fum;
    sqInt top;
    sqInt sp;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), ConstOne);
	foo->stackPointer = sp;
}


/*		no-op, really...
	thisReceiver := self popStack.
	self push: thisReceiver
 */

void primitivePushSelf(void) {
}

void primitivePushTrue(void) {
register struct foo * foo = &fum;
    sqInt top;
    sqInt sp;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
	foo->stackPointer = sp;
}

void primitivePushTwo(void) {
register struct foo * foo = &fum;
    sqInt top;
    sqInt sp;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), ConstTwo);
	foo->stackPointer = sp;
}

void primitivePushZero(void) {
register struct foo * foo = &fum;
    sqInt top;
    sqInt sp;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), ConstZero);
	foo->stackPointer = sp;
}

void primitiveQuit(void) {
register struct foo * foo = &fum;
	ioExitWithErrorCode((foo->argumentCount == 1
		? ((longAt(foo->stackPointer)) >> 1)
		: 0));
}


/*	Rounds negative results towards zero. */

void primitiveQuo(void) {
register struct foo * foo = &fum;
    sqInt integerArg;
    sqInt integerRcvr;
    sqInt integerResult;
    sqInt sp;
    sqInt integerPointer;
    sqInt integerPointer1;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		integerRcvr = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerRcvr = 0;
		goto l1;
	}
	integerRcvr = null;
l1:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		integerArg = (integerPointer1 >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		integerArg = 0;
		goto l2;
	}
	integerArg = null;
l2:	/* end stackIntegerValue: */;
	/* begin success: */
	if (!(integerArg != 0)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		if (integerRcvr > 0) {
			if (integerArg > 0) {
				integerResult = integerRcvr / integerArg;
			} else {
				integerResult = 0 - (integerRcvr / (0 - integerArg));
			}
		} else {
			if (integerArg > 0) {
				integerResult = 0 - ((0 - integerRcvr) / integerArg);
			} else {
				integerResult = (0 - integerRcvr) / (0 - integerArg);
			}
		}
	}
	/* begin pop2AndPushIntegerIfOK: */
	if (!foo->primFailCode) {
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) integerResult)) ^ ((((int) integerResult)) << 1)) >= 0)
# else
			((integerResult >= -1073741824) && (integerResult <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			/* begin pop:thenPush: */
			longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), ((integerResult << 1) | 1));
			foo->stackPointer = sp;
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
	}
}


/*	Primitive arithmetic operations for large integers in 64 bit range */

EXPORT(void) primitiveQuoLargeIntegers(void) {
register struct foo * foo = &fum;
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt sp;

	oopArg = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	oopRcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (b == 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return;
	}
	result = a / b;
	oopResult = magnitude64BitIntegerForneg(result, bIsNegative != aIsNegative);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}


/*	Relinquish the processor for up to the given number of microseconds. The exact behavior of this primitive is platform dependent. */

void primitiveRelinquishProcessor(void) {
register struct foo * foo = &fum;
    sqInt microSecs;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		microSecs = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		microSecs = 0;
		goto l1;
	}
	microSecs = null;
l1:	/* end stackIntegerValue: */;
	if (!foo->primFailCode) {
		ioRelinquishProcessorForMicroseconds(microSecs);
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
	}
}


/*	Primitive arithmetic operations for large integers in 64 bit range */

EXPORT(void) primitiveRemLargeIntegers(void) {
register struct foo * foo = &fum;
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt sp;

	oopArg = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	oopRcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (b == 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return;
	}
	result = a % b;
	oopResult = magnitude64BitIntegerForneg(result, aIsNegative);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}

sqInt primitiveResponse(void) {
register struct foo * foo = &fum;
    sqInt delta;
    sqInt nArgs;
    sqInt primIdx;

	if (DoBalanceChecks) {

		/* check stack balance */

		nArgs = foo->argumentCount;
		delta = foo->stackPointer - foo->activeContext;
	}
	if (((primIdx = foo->primitiveIndex)) > MaxPrimitiveIndex) {
		return (foo->primFailCode = PrimErrUnsupported);
	}
	/* begin initPrimCall */
	foo->primFailCode = 0;
	dispatchFunctionPointerOnin(primIdx, primitiveTable);
	if (DoBalanceChecks) {
		if (!(balancedStackafterPrimitivewithArgs(delta, primIdx, nArgs))) {
			printUnbalancedStack(primIdx);
		}
	}
	checkForInterrupts();

	/* clear out primIndex so VM knows we're no longer in primitive */

	foo->primitiveIndex = 0;
	return foo->primFailCode;
}


/*	Put this process on the scheduler's lists thus allowing it to proceed next
	time there is a chance for processes of its priority level */

void primitiveResume(void) {
register struct foo * foo = &fum;
    sqInt proc;
    sqInt activePriority;
    sqInt activeProc;
    sqInt newPriority;
    sqInt oop;
    sqInt oop1;
    sqInt priority;
    sqInt processList;
    sqInt processLists;
    sqInt oop2;
    sqInt oop11;
    sqInt priority1;
    sqInt processList1;
    sqInt processLists1;
    sqInt oop3;
    sqInt oop12;


	/* rcvr */
	/* self success: ((self fetchClassOf: proc) = (objectMemory splObj: ClassProcess)). */

	proc = longAt(foo->stackPointer);
	if (!(isContext(longAt((proc + (BASE_HEADER_SIZE)) + (SuspendedContextIndex << (SHIFT_FOR_WORD)))))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (!foo->primFailCode) {
		/* begin resume: */
		/* begin fetchPointer:ofObject: */
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
		oop = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
		activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
		activePriority = ((longAt((activeProc + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
		newPriority = ((longAt((proc + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
		if (newPriority > activePriority) {
			/* begin putToSleep: */
			priority = ((longAt((activeProc + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
			/* begin fetchPointer:ofObject: */
			/* begin fetchPointer:ofObject: */
			oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
			oop2 = longAt((oop11 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
			processLists = longAt((oop2 + (BASE_HEADER_SIZE)) + (ProcessListsIndex << (SHIFT_FOR_WORD)));
			processList = longAt((processLists + (BASE_HEADER_SIZE)) + ((priority - 1) << (SHIFT_FOR_WORD)));
			addLastLinktoList(activeProc, processList);
			transferTo(proc);
		} else {
			/* begin putToSleep: */
			priority1 = ((longAt((proc + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
			/* begin fetchPointer:ofObject: */
			/* begin fetchPointer:ofObject: */
			oop12 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
			oop3 = longAt((oop12 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
			processLists1 = longAt((oop3 + (BASE_HEADER_SIZE)) + (ProcessListsIndex << (SHIFT_FOR_WORD)));
			processList1 = longAt((processLists1 + (BASE_HEADER_SIZE)) + ((priority1 - 1) << (SHIFT_FOR_WORD)));
			addLastLinktoList(proc, processList1);
		}
	}
}


/*	Discard the current object memory and resume interpreter execution
	in the provided snapshot. */

EXPORT(sqInt) primitiveResumeFromSnapshot(void) {
register struct foo * foo = &fum;
    sqInt bigEndian;
    sqInt defaultHeapSize;
    sqInt desiredHeapSize;
    sqInt expectedArraySize;
    sqInt headerSize;
    sqInt imageBytes;
    sqInt imageHeaderFlags;
    sqInt newMemoryBytesOrBitmap;
    sqInt screenSizePoint;
    sqInt size;
    sqInt snapshotExtraVMMemory;
    sqInt snapshotFullScreen;
    sqInt snapshotImageFormat;
    sqInt snapshotLastHash;
    sqInt snapshotSpecialObjectsOop;
    sqInt snapshotStartOfMemory;
    sqInt snapshotValues;
    sqInt swapBytes;
    sqInt oop;
    sqInt header;
    sqInt sz;
    sqInt sp;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop1;
    sqInt classOop1;
    sqInt ccIndex1;
    sqInt cl1;
    sqInt oop11;


	/* ImageSnapshot new asValues size => 11 */

	expectedArraySize = 11;
	if (!(foo->argumentCount == 1)) {
		return (foo->primFailCode = PrimErrBadNumArgs);
	}
	/* begin stackObjectValue: */
	oop = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	if ((oop & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		snapshotValues = null;
		goto l1;
	}
	snapshotValues = oop;
l1:	/* end stackObjectValue: */;
	/* begin assertClassOf:is: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD)));
	if ((snapshotValues & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l2;
	}
	ccIndex = (((usqInt) (longAt(snapshotValues))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		cl = (longAt(snapshotValues - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl == classOop)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l2:	/* end assertClassOf:is: */;
	if (!(!foo->primFailCode)) {
		return (foo->primFailCode = PrimErrBadArgument);
	}
	/* begin numSlotsOf: */
	header = longAt(snapshotValues);
	sz = ((header & TypeMask) == HeaderTypeSizeAndClass
		? (longAt(snapshotValues - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK)
		: header & (SIZE_MASK));
	size = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
	if (size < expectedArraySize) {
		return (foo->primFailCode = PrimErrBadArgument);
	}
	newMemoryBytesOrBitmap = longAt((snapshotValues + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
	bigEndian = (longAt((snapshotValues + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)))) == foo->trueObj;
	snapshotImageFormat = ((longAt((snapshotValues + (BASE_HEADER_SIZE)) + (2 << (SHIFT_FOR_WORD)))) >> 1);
	if (!(readableFormat(snapshotImageFormat))) {
		return (foo->primFailCode = PrimErrInappropriate);
	}
	headerSize = ((longAt((snapshotValues + (BASE_HEADER_SIZE)) + (3 << (SHIFT_FOR_WORD)))) >> 1);

	/* good for up to 2GB image */

	imageBytes = positive32BitValueOf(longAt((snapshotValues + (BASE_HEADER_SIZE)) + (4 << (SHIFT_FOR_WORD))));
	snapshotStartOfMemory = ((longAt((snapshotValues + (BASE_HEADER_SIZE)) + (5 << (SHIFT_FOR_WORD)))) >> 1);
	snapshotSpecialObjectsOop = ((longAt((snapshotValues + (BASE_HEADER_SIZE)) + (6 << (SHIFT_FOR_WORD)))) >> 1);
	snapshotLastHash = ((longAt((snapshotValues + (BASE_HEADER_SIZE)) + (7 << (SHIFT_FOR_WORD)))) >> 1);
	screenSizePoint = longAt((snapshotValues + (BASE_HEADER_SIZE)) + (8 << (SHIFT_FOR_WORD)));
	/* begin assertClassOf:is: */
	classOop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD)));
	if ((screenSizePoint & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l3;
	}
	ccIndex1 = (((usqInt) (longAt(screenSizePoint))) >> 12) & 0x1F;
	if (ccIndex1 == 0) {
		cl1 = (longAt(screenSizePoint - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl1 = longAt((oop11 + (BASE_HEADER_SIZE)) + ((ccIndex1 - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl1 == classOop1)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l3:	/* end assertClassOf:is: */;
	if (!(!foo->primFailCode)) {
		return (foo->primFailCode = PrimErrBadArgument);
	}
	imageHeaderFlags = ((longAt((snapshotValues + (BASE_HEADER_SIZE)) + (9 << (SHIFT_FOR_WORD)))) >> 1);
	snapshotExtraVMMemory = ((longAt((snapshotValues + (BASE_HEADER_SIZE)) + (10 << (SHIFT_FOR_WORD)))) >> 1);
	imageFormatVersionNumber = 0;
	imageFormatInitialVersion = snapshotImageFormat;
	swapBytes = bigEndian != (isBigEnder());

	/* FIXME */
	/* From sqUnixMain.c
	#define DefaultHeapSize           20
		megabytes BEYOND actual image size */

	snapshotFullScreen = 0;
	defaultHeapSize = (20 * 1000) * 1000;
	desiredHeapSize = defaultHeapSize + imageBytes;
	snapshotResumeheapSizeswapBytesoldBaseAddrspecialObjectsOoplastHashsavedWindowSizefullScreenFlagextraVMMemory(newMemoryBytesOrBitmap, desiredHeapSize, swapBytes, snapshotStartOfMemory, snapshotSpecialObjectsOop, snapshotLastHash, screenSizePoint, snapshotFullScreen, snapshotExtraVMMemory);
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), newMemoryBytesOrBitmap);
	foo->stackPointer = sp;
	return null;
}


/*	Primitive. Answer a copy (snapshot) element of the root table.
	The primitive can cause GC itself and if so the return value may
	be inaccurate - in this case one should guard the read operation
	by looking at the gc counter statistics. */

EXPORT(sqInt) primitiveRootTable(void) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt oop;
    sqInt sz;
    sqInt sp;

	sz = foo->rootTableCount;

	/* can cause GC */

	oop = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))), sz);
	if (sz > foo->rootTableCount) {
		sz = foo->rootTableCount;
	}
	for (i = 1; i <= sz; i += 1) {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) oop)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(oop, foo->rootTable[i]);
		}
		longAtput((oop + (BASE_HEADER_SIZE)) + ((i - 1) << (SHIFT_FOR_WORD)), foo->rootTable[i]);
	}
	/* begin pop: */
	foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), oop);
	foo->stackPointer = sp;
	return null;
}


/*	Primitive. Answer the nth element of the root table.
	This primitive avoids the creation of an extra array;
	it is intended for enumerations of the form:
		index := 1.
		[root := Smalltalk rootTableAt: index.
		root == nil] whileFalse:[index := index + 1].
	 */

EXPORT(sqInt) primitiveRootTableAt(void) {
register struct foo * foo = &fum;
    sqInt index;
    sqInt sp;
    sqInt successBoolean;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l1;
	}
	index = null;
l1:	/* end stackIntegerValue: */;
	/* begin success: */
	successBoolean = (index > 0) && (index <= foo->rootTableCount);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->rootTable[index]);
		foo->stackPointer = sp;
	}
	return null;
}


/*	The character scanner primitive. */

void primitiveScanCharacters(void) {
register struct foo * foo = &fum;
    sqInt ascii;
    sqInt glyphIndex;
    sqInt kernDelta;
    sqInt maxGlyph;
    sqInt nextDestX;
    sqInt nilOop;
    sqInt rcvr;
    sqInt scanDestX;
    sqInt scanLastIndex;
    sqInt scanMap;
    sqInt scanRightX;
    sqInt scanStartIndex;
    sqInt scanStopIndex;
    sqInt scanXTable;
    sqInt sourceString;
    sqInt sourceX;
    sqInt sourceX2;
    sqInt stopReason;
    sqInt stops;
    sqInt sp;
    sqInt object;
    sqInt sp1;
    sqInt object1;
    sqInt sp2;
    sqInt oop;
    sqInt oop1;
    sqInt oop2;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt integerPointer2;
    sqInt integerPointer3;

	if (!(foo->argumentCount == 6)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		kernDelta = (integerPointer >> 1);
		goto l4;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		kernDelta = 0;
		goto l4;
	}
	kernDelta = null;
l4:	/* end stackIntegerValue: */;
	/* begin stackObjectValue: */
	oop = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if ((oop & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		stops = null;
		goto l1;
	}
	stops = oop;
l1:	/* end stackObjectValue: */;
	if (!(((stops & 1) == 0) && (((((usqInt) (longAt(stops))) >> 8) & 15) == 2))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (!((slotSizeOf(stops)) >= 258)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		scanRightX = (integerPointer1 >> 1);
		goto l5;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		scanRightX = 0;
		goto l5;
	}
	scanRightX = null;
l5:	/* end stackIntegerValue: */;
	/* begin stackObjectValue: */
	oop1 = longAt(foo->stackPointer - (3 * (BYTES_PER_WORD)));
	if ((oop1 & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		sourceString = null;
		goto l2;
	}
	sourceString = oop1;
l2:	/* end stackObjectValue: */;
	if (!(((sourceString & 1) == 0) && (((((usqInt) (longAt(sourceString))) >> 8) & 15) >= 8))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin stackIntegerValue: */
	integerPointer2 = longAt(foo->stackPointer - (4 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer2 & 1)) {
		scanStopIndex = (integerPointer2 >> 1);
		goto l6;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		scanStopIndex = 0;
		goto l6;
	}
	scanStopIndex = null;
l6:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer3 = longAt(foo->stackPointer - (5 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer3 & 1)) {
		scanStartIndex = (integerPointer3 >> 1);
		goto l7;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		scanStartIndex = 0;
		goto l7;
	}
	scanStartIndex = null;
l7:	/* end stackIntegerValue: */;
	if (!((scanStartIndex > 0) && ((scanStopIndex > 0) && (scanStopIndex <= (byteSizeOf(sourceString)))))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin stackObjectValue: */
	oop2 = longAt(foo->stackPointer - (6 * (BYTES_PER_WORD)));
	if ((oop2 & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		rcvr = null;
		goto l3;
	}
	rcvr = oop2;
l3:	/* end stackObjectValue: */;
	if (!((((rcvr & 1) == 0) && (((((usqInt) (longAt(rcvr))) >> 8) & 15) <= 4)) && ((slotSizeOf(rcvr)) >= 4))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	scanDestX = fetchIntegerofObject(0, rcvr);
	scanLastIndex = fetchIntegerofObject(1, rcvr);
	scanXTable = longAt((rcvr + (BASE_HEADER_SIZE)) + (2 << (SHIFT_FOR_WORD)));
	scanMap = longAt((rcvr + (BASE_HEADER_SIZE)) + (3 << (SHIFT_FOR_WORD)));
	if (!((((scanXTable & 1) == 0) && (((((usqInt) (longAt(scanXTable))) >> 8) & 15) == 2)) && (((scanMap & 1) == 0) && (((((usqInt) (longAt(scanMap))) >> 8) & 15) == 2)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (!((slotSizeOf(scanMap)) == 256)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (!(!foo->primFailCode)) {
		return;
	}

	/* Okay, here we go. We have eliminated nearly all failure 
	conditions, to optimize the inner fetches. */

	maxGlyph = (slotSizeOf(scanXTable)) - 2;
	scanLastIndex = scanStartIndex;
	nilOop = foo->nilObj;
	while (scanLastIndex <= scanStopIndex) {

		/* Known to be okay since scanStartIndex > 0 and scanStopIndex <= sourceString size */


		/* Known to be okay since stops size >= 258 */

		ascii = byteAt((sourceString + (BASE_HEADER_SIZE)) + (scanLastIndex - 1));
		if (!(((stopReason = longAt((stops + (BASE_HEADER_SIZE)) + (ascii << (SHIFT_FOR_WORD))))) == nilOop)) {

			/* Store everything back and get out of here since some stop conditionn needs to be checked */

			if (!(
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
					(((((int) scanDestX)) ^ ((((int) scanDestX)) << 1)) >= 0)
# else
					((scanDestX >= -1073741824) && (scanDestX <= 0x3FFFFFFF))
# endif  // SQ_HOST32
				)) {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
				return;
			}
			/* begin storeInteger:ofObject:withValue: */
			if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
				(((((int) scanDestX)) ^ ((((int) scanDestX)) << 1)) >= 0)
# else
				((scanDestX >= -1073741824) && (scanDestX <= 0x3FFFFFFF))
# endif  // SQ_HOST32
			) {
				longAtput((rcvr + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), ((scanDestX << 1) | 1));
			} else {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
			}
			/* begin storeInteger:ofObject:withValue: */
			if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
				(((((int) scanLastIndex)) ^ ((((int) scanLastIndex)) << 1)) >= 0)
# else
				((scanLastIndex >= -1073741824) && (scanLastIndex <= 0x3FFFFFFF))
# endif  // SQ_HOST32
			) {
				longAtput((rcvr + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), ((scanLastIndex << 1) | 1));
			} else {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
			}
			/* begin pop: */
			foo->stackPointer -= 7 * (BYTES_PER_WORD);
			/* begin push: */
			longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), stopReason);
			foo->stackPointer = sp;
			return;
		}

		/* fail if the glyphIndex is out of range */

		glyphIndex = fetchIntegerofObject(ascii, scanMap);
		if (foo->primFailCode || ((glyphIndex < 0) || (glyphIndex > maxGlyph))) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
		sourceX = fetchIntegerofObject(glyphIndex, scanXTable);

		/* Above may fail if non-integer entries in scanXTable */

		sourceX2 = fetchIntegerofObject(glyphIndex + 1, scanXTable);
		if (foo->primFailCode) {
			return;
		}
		nextDestX = (scanDestX + sourceX2) - sourceX;
		if (nextDestX > scanRightX) {

			/* Store everything back and get out of here since we got to the right edge */

			if (!(
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
					(((((int) scanDestX)) ^ ((((int) scanDestX)) << 1)) >= 0)
# else
					((scanDestX >= -1073741824) && (scanDestX <= 0x3FFFFFFF))
# endif  // SQ_HOST32
				)) {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
				return;
			}
			/* begin storeInteger:ofObject:withValue: */
			if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
				(((((int) scanDestX)) ^ ((((int) scanDestX)) << 1)) >= 0)
# else
				((scanDestX >= -1073741824) && (scanDestX <= 0x3FFFFFFF))
# endif  // SQ_HOST32
			) {
				longAtput((rcvr + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), ((scanDestX << 1) | 1));
			} else {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
			}
			/* begin storeInteger:ofObject:withValue: */
			if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
				(((((int) scanLastIndex)) ^ ((((int) scanLastIndex)) << 1)) >= 0)
# else
				((scanLastIndex >= -1073741824) && (scanLastIndex <= 0x3FFFFFFF))
# endif  // SQ_HOST32
			) {
				longAtput((rcvr + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), ((scanLastIndex << 1) | 1));
			} else {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
			}
			/* begin pop: */
			foo->stackPointer -= 7 * (BYTES_PER_WORD);
			/* begin push: */
			object = longAt((stops + (BASE_HEADER_SIZE)) + ((CrossedX - 1) << (SHIFT_FOR_WORD)));
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), object);
			foo->stackPointer = sp1;
			return;
		}
		scanDestX = nextDestX + kernDelta;
		scanLastIndex += 1;
	}
	if (!(
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) scanDestX)) ^ ((((int) scanDestX)) << 1)) >= 0)
# else
			((scanDestX >= -1073741824) && (scanDestX <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin storeInteger:ofObject:withValue: */
	if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
		(((((int) scanDestX)) ^ ((((int) scanDestX)) << 1)) >= 0)
# else
		((scanDestX >= -1073741824) && (scanDestX <= 0x3FFFFFFF))
# endif  // SQ_HOST32
	) {
		longAtput((rcvr + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), ((scanDestX << 1) | 1));
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	/* begin storeInteger:ofObject:withValue: */
	if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
		(((((int) scanStopIndex)) ^ ((((int) scanStopIndex)) << 1)) >= 0)
# else
		((scanStopIndex >= -1073741824) && (scanStopIndex <= 0x3FFFFFFF))
# endif  // SQ_HOST32
	) {
		longAtput((rcvr + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), ((scanStopIndex << 1) | 1));
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	/* begin pop: */
	foo->stackPointer -= 7 * (BYTES_PER_WORD);
	/* begin push: */
	object1 = longAt((stops + (BASE_HEADER_SIZE)) + ((EndOfRun - 1) << (SHIFT_FOR_WORD)));
	longAtput((sp2 = foo->stackPointer + (BYTES_PER_WORD)), object1);
	foo->stackPointer = sp2;
	return;
}


/*	Return a SmallInteger indicating the current depth of the OS screen. Negative values are used to imply LSB type pixel format an there is some support in the VM for handling either MSB or LSB */

EXPORT(sqInt) primitiveScreenDepth(void) {
register struct foo * foo = &fum;
    sqInt depth;
    sqInt sp;

	depth = ioScreenDepth();
	if (foo->primFailCode) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	/* begin pop:thenPushInteger: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), ((depth << 1) | 1));
	foo->stackPointer = sp;
	return null;
}


/*	Return a point indicating the current size of the Smalltalk window. Currently there is a limit of 65535 in each direction because the point is encoded into a single 32bit value in the image header. This might well become a problem one day */

void primitiveScreenSize(void) {
register struct foo * foo = &fum;
    sqInt pointWord;
    sqInt object;
    sqInt sp;
    sqInt pointResult;

	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
	pointWord = ioScreenSize();
	/* begin push: */
	/* begin makePointwithxValue:yValue: */
	pointResult = instantiateSmallClasssizeInBytes(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassPoint << (SHIFT_FOR_WORD))), 3 * (BYTES_PER_WORD));
	longAtput((pointResult + (BASE_HEADER_SIZE)) + (XIndex << (SHIFT_FOR_WORD)), ((((((usqInt) pointWord) >> 16) & 0xFFFF) << 1) | 1));
	longAtput((pointResult + (BASE_HEADER_SIZE)) + (YIndex << (SHIFT_FOR_WORD)), (((pointWord & 0xFFFF) << 1) | 1));
	object = pointResult;
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
	foo->stackPointer = sp;
}


/*	Return the number of seconds since January 1, 1901 as an integer. */

void primitiveSecondsClock(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt sp;

	/* begin pop:thenPush: */
	oop = positive32BitIntegerFor(ioSeconds());
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), oop);
	foo->stackPointer = sp;
}


/*	Set to OS to the requested display mode.
	See also DisplayScreen setDisplayDepth:extent:fullscreen: */

void primitiveSetDisplayMode(void) {
register struct foo * foo = &fum;
    sqInt d;
    sqInt fsFlag;
    sqInt h;
    sqInt okay;
    sqInt w;
    sqInt sp;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt integerPointer2;

	/* begin booleanValueOf: */
	if ((longAt(foo->stackPointer)) == foo->trueObj) {
		fsFlag = 1;
		goto l1;
	}
	if ((longAt(foo->stackPointer)) == foo->falseObj) {
		fsFlag = 0;
		goto l1;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	fsFlag = null;
l1:	/* end booleanValueOf: */;
	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		h = (integerPointer >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		h = 0;
		goto l2;
	}
	h = null;
l2:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		w = (integerPointer1 >> 1);
		goto l3;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		w = 0;
		goto l3;
	}
	w = null;
l3:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer2 = longAt(foo->stackPointer - (3 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer2 & 1)) {
		d = (integerPointer2 >> 1);
		goto l4;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		d = 0;
		goto l4;
	}
	d = null;
l4:	/* end stackIntegerValue: */;
	if (!foo->primFailCode) {
		okay = ioSetDisplayMode(w, h, d, fsFlag);
	}
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((5 - 1) * (BYTES_PER_WORD))), (okay
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}


/*	On platforms that support it, set full-screen mode to the value of the boolean argument. */

void primitiveSetFullScreen(void) {
register struct foo * foo = &fum;
    sqInt argOop;

	argOop = longAt(foo->stackPointer);
	if (argOop == foo->trueObj) {
		ioSetFullScreen(1);
		foo->fullScreenFlag = 1;
	} else {
		if (argOop == foo->falseObj) {
			ioSetFullScreen(0);
			foo->fullScreenFlag = 0;
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!foo->primFailCode) {
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
	}
}


/*	Primitive. Indicate if the GC logic should have bias to grow */

EXPORT(sqInt) primitiveSetGCBiasToGrow(void) {
register struct foo * foo = &fum;
    sqInt flag;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		flag = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		flag = 0;
		goto l1;
	}
	flag = null;
l1:	/* end stackIntegerValue: */;
	if (!foo->primFailCode) {
		/* begin setGcBiasToGrow: */
		foo->gcBiasToGrow = flag;
		/* begin pop: */
		foo->stackPointer -= foo->argumentCount * (BYTES_PER_WORD);
	}
	return null;
}


/*	Primitive. If the GC logic has  bias to grow, set growth limit */

EXPORT(sqInt) primitiveSetGCBiasToGrowGCLimit(void) {
register struct foo * foo = &fum;
    sqInt value;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		value = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		value = 0;
		goto l1;
	}
	value = null;
l1:	/* end stackIntegerValue: */;
	if (!foo->primFailCode) {
		/* begin setGCBiasToGrowGCLimit: */
		foo->gcBiasToGrowGCLimit = value;
		foo->gcBiasToGrowThreshold = foo->youngStart - (((int) memory));
		/* begin pop: */
		foo->stackPointer -= foo->argumentCount * (BYTES_PER_WORD);
	}
	return null;
}


/*	Primitive. Indicate the semaphore to be signalled for upon garbage collection */

EXPORT(sqInt) primitiveSetGCSemaphore(void) {
register struct foo * foo = &fum;
    sqInt index;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l1;
	}
	index = null;
l1:	/* end stackIntegerValue: */;
	if (!foo->primFailCode) {
		/* begin setGcSemaphoreIndex: */
		foo->gcSemaphoreIndex = index;
		/* begin pop: */
		foo->stackPointer -= foo->argumentCount * (BYTES_PER_WORD);
	}
	return null;
}

void primitiveSetIdentityHash(void) {
register struct foo * foo = &fum;
    sqInt hash;
    sqInt oldHash;
    sqInt thisReceiver;
    sqInt sp;
    sqInt oop;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		hash = (integerPointer >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		hash = 0;
		goto l2;
	}
	hash = null;
l2:	/* end stackIntegerValue: */;
	/* begin stackObjectValue: */
	oop = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if ((oop & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		thisReceiver = null;
		goto l1;
	}
	thisReceiver = oop;
l1:	/* end stackObjectValue: */;
	if (!foo->primFailCode) {
		oldHash = (((usqInt) (longAt(thisReceiver))) >> 17) & 0xFFF;
		/* begin setHashBitsOf:to: */
		longAtput(thisReceiver, ((((longAt(thisReceiver)) | HashBits) - HashBits)) | ((hash & HashMaskUnshifted) << HashBitsOffset));
		/* begin pop:thenPushInteger: */
		longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), ((oldHash << 1) | 1));
		foo->stackPointer = sp;
	}
}


/*	Set the user interrupt keycode. The keycode is an integer whose encoding is described in the comment for primitiveKbdNext. */

void primitiveSetInterruptKey(void) {
register struct foo * foo = &fum;
    sqInt keycode;
    sqInt integerPointer;
    sqInt top;

	/* begin popInteger */
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		keycode = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		keycode = 0;
		goto l1;
	}
	keycode = null;
l1:	/* end popInteger */;
	if (!foo->primFailCode) {
		foo->interruptKeycode = keycode;
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	Treat the receiver, which can be indexible by either bytes or words, as an array of signed 16-bit values. Return the contents of the given index. Note that the index specifies the i-th 16-bit entry, not the i-th byte or word. */

void primitiveShortAt(void) {
register struct foo * foo = &fum;
    sqInt addr;
    sqInt index;
    sqInt rcvr;
    sqInt sz;
    sqInt value;
    sqInt sp;
    sqInt successBoolean;
    sqInt successBoolean1;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		index = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l1;
	}
	index = null;
l1:	/* end stackIntegerValue: */;
	rcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin success: */
	successBoolean = (!((rcvr & 1))) && (((rcvr & 1) == 0) && (isWordsOrBytesNonInt(rcvr)));
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return;
	}

	/* number of 16-bit fields */

	sz = ((sqInt) ((sizeBitsOf(rcvr)) - (BASE_HEADER_SIZE)) >> 1);
	/* begin success: */
	successBoolean1 = (index >= 1) && (index <= sz);
	if (!(successBoolean1)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		addr = (rcvr + (BASE_HEADER_SIZE)) + (2 * (index - 1));
		value = shortAt(addr);
		/* begin pop:thenPushInteger: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), ((value << 1) | 1));
		foo->stackPointer = sp;
	}
}


/*	Treat the receiver, which can be indexible by either bytes or words, as an array of signed 16-bit values. Set the contents of the given index to the given value. Note that the index specifies the i-th 16-bit entry, not the i-th byte or word. */

void primitiveShortAtPut(void) {
register struct foo * foo = &fum;
    sqInt addr;
    sqInt index;
    sqInt rcvr;
    sqInt sz;
    sqInt value;
    sqInt successBoolean;
    sqInt successBoolean1;
    sqInt successBoolean2;
    sqInt integerPointer;
    sqInt integerPointer1;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		value = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		value = 0;
		goto l1;
	}
	value = null;
l1:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		index = (integerPointer1 >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		index = 0;
		goto l2;
	}
	index = null;
l2:	/* end stackIntegerValue: */;
	rcvr = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	/* begin success: */
	successBoolean = (!((rcvr & 1))) && (((rcvr & 1) == 0) && (isWordsOrBytesNonInt(rcvr)));
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		return;
	}

	/* number of 16-bit fields */

	sz = ((sqInt) ((sizeBitsOf(rcvr)) - (BASE_HEADER_SIZE)) >> 1);
	/* begin success: */
	successBoolean1 = (index >= 1) && (index <= sz);
	if (!(successBoolean1)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	/* begin success: */
	successBoolean2 = (value >= -32768) && (value <= 0x7FFF);
	if (!(successBoolean2)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		addr = (rcvr + (BASE_HEADER_SIZE)) + (2 * (index - 1));
		shortAtput(addr, value);
		/* begin pop: */
		foo->stackPointer -= 2 * (BYTES_PER_WORD);
	}
}


/*	Force the given rectangular section of the Display to be 
	copied to the screen. */

void primitiveShowDisplayRect(void) {
register struct foo * foo = &fum;
    sqInt bottom;
    sqInt left;
    sqInt right;
    sqInt top;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt integerPointer2;
    sqInt integerPointer3;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		bottom = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		bottom = 0;
		goto l1;
	}
	bottom = null;
l1:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		top = (integerPointer1 >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		top = 0;
		goto l2;
	}
	top = null;
l2:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer2 = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer2 & 1)) {
		right = (integerPointer2 >> 1);
		goto l3;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		right = 0;
		goto l3;
	}
	right = null;
l3:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer3 = longAt(foo->stackPointer - (3 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer3 & 1)) {
		left = (integerPointer3 >> 1);
		goto l4;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		left = 0;
		goto l4;
	}
	left = null;
l4:	/* end stackIntegerValue: */;
	displayBitsOfLeftTopRightBottom(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheDisplay << (SHIFT_FOR_WORD))), left, top, right, bottom);
	if (!foo->primFailCode) {
		ioForceDisplayUpdate();
		/* begin pop: */
		foo->stackPointer -= 4 * (BYTES_PER_WORD);
	}
}


/*	synchromously signal the semaphore. This may change the active process as a result */

void primitiveSignal(void) {
register struct foo * foo = &fum;
    sqInt sema;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop1;


	/* rcvr */

	sema = longAt(foo->stackPointer);
	/* begin assertClassOf:is: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD)));
	if ((sema & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(sema))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		cl = (longAt(sema - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl == classOop)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l1:	/* end assertClassOf:is: */;
	if (!foo->primFailCode) {
		synchronousSignal(sema);
	}
}


/*	Set the low-water mark for free space. When the free space 
	falls below this level, the new and new: primitives fail and 
	system attempts to allocate space (e.g., to create a method 
	context) cause the low-space semaphore (if one is 
	registered) to be signalled. */

void primitiveSignalAtBytesLeft(void) {
register struct foo * foo = &fum;
    sqInt bytes;
    sqInt integerPointer;
    sqInt top;

	/* begin popInteger */
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		bytes = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		bytes = 0;
		goto l1;
	}
	bytes = null;
l1:	/* end popInteger */;
	if (!foo->primFailCode) {
		/* begin setLowSpaceThreshold: */
		foo->lowSpaceThreshold = bytes;
	} else {
		/* begin setLowSpaceThreshold: */
		foo->lowSpaceThreshold = 0;
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	Cause the time semaphore, if one has been registered, to
	be signalled when the millisecond clock is greater than or
	equal to the given tick value. A tick value of zero turns off
	timer interrupts. */

void primitiveSignalAtMilliseconds(void) {
register struct foo * foo = &fum;
    sqInt sema;
    sqInt tick;
    sqInt integerPointer;
    sqInt top;
    sqInt top1;

	/* begin popInteger */
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		tick = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		tick = 0;
		goto l1;
	}
	tick = null;
l1:	/* end popInteger */;
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	sema = top1;
	if (!foo->primFailCode) {
		if ((fetchClassOf(sema)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD))))) {
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(foo->specialObjectsOop, sema);
			}
			longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheTimerSemaphore << (SHIFT_FOR_WORD)), sema);
			foo->nextWakeupTick = tick;
		} else {
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(foo->specialObjectsOop, foo->nilObj);
			}
			longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheTimerSemaphore << (SHIFT_FOR_WORD)), foo->nilObj);
			foo->nextWakeupTick = 0;
		}
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}


/*	Cause the time semaphore, if one has been registered, to be
	 signalled when the microsecond clock is greater than or equal to
	 the given tick value. A tick value of zero turns off timer interrupts. */
/*	Provided for compatibility with StackInterpreter microsecond implementation.
	This is a required primitive in some newer images, and is implemented here
	with millisecond precision only. */

void primitiveSignalAtUTCMicroseconds(void) {
register struct foo * foo = &fum;
    usqLong now;
    sqInt sema;
    sqInt tick;
    usqLong usecs;
    sqInt usecsObj;
    sqInt top;
    sqInt top1;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	usecsObj = top;
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	sema = top1;
	usecs = positive64BitValueOf(usecsObj);
	now = ioUTCMicroseconds();

	/* add 500 for rounding */

	tick = foo->lastTick + (((sqInt) (((usecs - now) + 500) / 1000)));
	if (!foo->primFailCode) {
		if ((fetchClassOf(sema)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD))))) {
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(foo->specialObjectsOop, sema);
			}
			longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheTimerSemaphore << (SHIFT_FOR_WORD)), sema);
			foo->nextWakeupTick = tick;
		} else {
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) foo->specialObjectsOop)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(foo->specialObjectsOop, foo->nilObj);
			}
			longAtput((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheTimerSemaphore << (SHIFT_FOR_WORD)), foo->nilObj);
			foo->nextWakeupTick = 0;
		}
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}

void primitiveSine(void) {
register struct foo * foo = &fum;
    double rcvr;

	rcvr = popFloat();
	if (!foo->primFailCode) {
		pushFloat(sin(rcvr));
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}

void primitiveSize(void) {
register struct foo * foo = &fum;
    sqInt rcvr;
    sqInt sz;
    sqInt oop;
    sqInt sp;

	rcvr = longAt(foo->stackPointer);
	if ((rcvr & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (((((usqInt) (longAt(rcvr))) >> 8) & 15) < 2) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	sz = stSizeOf(rcvr);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		oop = positive32BitIntegerFor(sz);
		longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), oop);
		foo->stackPointer = sp;
	}
}


/*	save a normal snapshot under the same name as it was loaded unless it has been renamed by the last primitiveImageName */

void primitiveSnapshot(void) {
	snapshot(0);
}


/*	save an embedded snapshot */

void primitiveSnapshotEmbedded(void) {
	snapshot(1);
}

void primitiveSomeInstance(void) {
register struct foo * foo = &fum;
    sqInt class;
    sqInt instance;
    sqInt sp;
    sqInt thisClass;
    sqInt thisObj;
    sqInt obj;
    sqInt sz;
    sqInt header;
    sqInt ccIndex;
    sqInt oop1;
    sqInt sz1;
    sqInt header1;
    sqInt obj1;
    sqInt sz2;
    sqInt header2;

	class = longAt(foo->stackPointer);
	/* begin initialInstanceOf: */
	/* begin firstAccessibleObject */
	obj1 = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) obj1)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(obj1)) & TypeMask) == HeaderTypeFree)) {
			thisObj = obj1;
			goto l6;
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) obj1)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(obj1)) & TypeMask) == HeaderTypeFree) {
			sz2 = (longAt(obj1)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header2 = longAt(obj1);
			if ((header2 & TypeMask) == HeaderTypeSizeAndClass) {
				sz2 = (longAt(obj1 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l7;
			} else {
				sz2 = header2 & (SIZE_MASK);
				goto l7;
			}
		l7:	/* end sizeBitsOf: */;
		}
		obj1 = (obj1 + sz2) + (foo->headerTypeBytes[(longAt(obj1 + sz2)) & TypeMask]);
	}
	error("heap is empty");
l6:	/* end firstAccessibleObject */;
	while (!(thisObj == null)) {
		/* begin fetchClassOf: */
		if ((thisObj & 1)) {
			thisClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
			goto l4;
		}
		ccIndex = (((usqInt) (longAt(thisObj))) >> 12) & 0x1F;
		if (ccIndex == 0) {
			thisClass = (longAt(thisObj - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
			goto l4;
		} else {
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
			thisClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
			goto l4;
		}
	l4:	/* end fetchClassOf: */;
		if (thisClass == class) {
			instance = thisObj;
			goto l1;
		}
		/* begin accessibleObjectAfter: */
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) thisObj)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(thisObj)) & TypeMask) == HeaderTypeFree) {
			sz1 = (longAt(thisObj)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header1 = longAt(thisObj);
			if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
				sz1 = (longAt(thisObj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l5;
			} else {
				sz1 = header1 & (SIZE_MASK);
				goto l5;
			}
		l5:	/* end sizeBitsOf: */;
		}
		obj = (thisObj + sz1) + (foo->headerTypeBytes[(longAt(thisObj + sz1)) & TypeMask]);
		while ((((usqInt) obj)) < (((usqInt) foo->endOfMemory))) {
			if (!(((longAt(obj)) & TypeMask) == HeaderTypeFree)) {
				thisObj = obj;
				goto l2;
			}
			/* begin objectAfter: */
			if (DoAssertionChecks) {
				if ((((usqInt) obj)) >= (((usqInt) foo->endOfMemory))) {
					error("no objects after the end of memory");
				}
			}
			if (((longAt(obj)) & TypeMask) == HeaderTypeFree) {
				sz = (longAt(obj)) & (ALL_BUT_TYPE_MASK);
			} else {
				/* begin sizeBitsOf: */
				header = longAt(obj);
				if ((header & TypeMask) == HeaderTypeSizeAndClass) {
					sz = (longAt(obj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
					goto l3;
				} else {
					sz = header & (SIZE_MASK);
					goto l3;
				}
			l3:	/* end sizeBitsOf: */;
			}
			obj = (obj + sz) + (foo->headerTypeBytes[(longAt(obj + sz)) & TypeMask]);
		}
		thisObj = null;
	l2:	/* end accessibleObjectAfter: */;
	}
	instance = foo->nilObj;
l1:	/* end initialInstanceOf: */;
	if (instance == foo->nilObj) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	} else {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), instance);
		foo->stackPointer = sp;
	}
}


/*	Return the first object in the heap. */

void primitiveSomeObject(void) {
register struct foo * foo = &fum;
    sqInt object;
    sqInt sp;
    sqInt obj;
    sqInt sz;
    sqInt header;

	/* begin pop: */
	foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
	/* begin push: */
	/* begin firstAccessibleObject */
	obj = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) obj)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(obj)) & TypeMask) == HeaderTypeFree)) {
			object = obj;
			goto l1;
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) obj)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(obj)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(obj)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header = longAt(obj);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(obj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l2;
			} else {
				sz = header & (SIZE_MASK);
				goto l2;
			}
		l2:	/* end sizeBitsOf: */;
		}
		obj = (obj + sz) + (foo->headerTypeBytes[(longAt(obj + sz)) & TypeMask]);
	}
	error("heap is empty");
l1:	/* end firstAccessibleObject */;
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
	foo->stackPointer = sp;
}


/*	Return the oop of the SpecialObjectsArray. */

void primitiveSpecialObjectsOop(void) {
register struct foo * foo = &fum;
    sqInt sp;

	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), foo->specialObjectsOop);
	foo->stackPointer = sp;
}

void primitiveSquareRoot(void) {
register struct foo * foo = &fum;
    double rcvr;

	rcvr = popFloat();
	/* begin success: */
	if (!(rcvr >= 0.0)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		pushFloat(sqrt(rcvr));
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	This primitive is called from Squeak as...
		<imageSegment> storeSegmentFor: arrayOfRoots into: aWordArray outPointers: anArray. */
/*	This primitive will store a binary image segment (in the same format as the Squeak image file) of the receiver and every object in its proper tree of subParts (ie, that is not refered to from anywhere else outside the tree).  All pointers from within the tree to objects outside the tree will be copied into the array of outpointers.  In their place in the image segment will be an oop equal to the offset in the outPointer array (the first would be 4). but with the high bit set. */
/*	The primitive expects the array and wordArray to be more than adequately long.  In this case it returns normally, and truncates the two arrays to exactly the right size.  To simplify truncation, both incoming arrays are required to be 256 bytes or more long (ie with 3-word headers).  If either array is too small, the primitive will fail, but in no other case.

During operation of the primitive, it is necessary to convert from both internal and external oops to their mapped values.  To make this fast, the headers of the original objects in question are replaced by the mapped values (and this is noted by adding the forbidden XX header type).  Tables are kept of both kinds of oops, as well as of the original headers for restoration.

To be specific, there are two similar two-part tables, the outpointer array, and one in the upper fifth of the segmentWordArray.  Each grows oops from the bottom up, and preserved headers from halfway up.

In case of either success or failure, the headers must be restored.  In the event of primitive failure, the table of outpointers must also be nilled out (since the garbage in the high half will not have been discarded. */

void primitiveStoreImageSegment(void) {
register struct foo * foo = &fum;
    sqInt arrayOfRoots;
    sqInt doingClass;
    usqInt endSeg;
    sqInt extraSize;
    sqInt fieldOop;
    usqInt fieldPtr;
    usqInt firstIn;
    usqInt firstOut;
    usqInt hdrBaseIn;
    usqInt hdrBaseOut;
    sqInt hdrTypeBits;
    sqInt header;
    usqInt lastIn;
    usqInt lastOut;
    usqInt lastPtr;
    usqInt lastSeg;
    sqInt mapOop;
    sqInt outPointerArray;
    usqInt savedYoungStart;
    usqInt segOop;
    sqInt segmentWordArray;
    sqInt versionOffset;
    sqInt i;
    sqInt lastAddr;
    sqInt i1;
    sqInt lastAddr1;
    sqInt i2;
    sqInt lastAddr2;
    sqInt i3;
    sqInt lastAddr3;
    sqInt in;
    sqInt lastIn1;
    sqInt out;
    sqInt in1;
    sqInt lastIn2;
    sqInt out1;
    sqInt sz;
    sqInt header1;

	outPointerArray = longAt(foo->stackPointer);
	segmentWordArray = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));

	/* Essential type checks */

	arrayOfRoots = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	if (!((((((usqInt) (longAt(arrayOfRoots))) >> 8) & 15) == 2) && ((((((usqInt) (longAt(outPointerArray))) >> 8) & 15) == 2) && (((((usqInt) (longAt(segmentWordArray))) >> 8) & 15) == 6)))) {

		/* Must be indexable words */

		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (!((((longAt(outPointerArray)) & TypeMask) == HeaderTypeSizeAndClass) && (((longAt(segmentWordArray)) & TypeMask) == HeaderTypeSizeAndClass))) {

		/* Must be 3-word header */

		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (DoAssertionChecks) {
		verifyCleanHeaders();
	}
	firstOut = outPointerArray + (BASE_HEADER_SIZE);
	lastOut = firstOut - (BYTES_PER_WORD);

	/* top half */

	hdrBaseOut = outPointerArray + (((lastPointerOf(outPointerArray)) / ((BYTES_PER_WORD) * 2)) * (BYTES_PER_WORD));
	lastSeg = segmentWordArray;

	/* Write a version number for byte order and version check */

	endSeg = (segmentWordArray + (sizeBitsOf(segmentWordArray))) - (BYTES_PER_WORD);
	versionOffset = BYTES_PER_WORD;
	lastSeg += versionOffset;
	if (lastSeg > endSeg) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	longAtput(lastSeg, imageSegmentVersion());

	/* Take 1/8 of seg */

	firstIn = endSeg - (((sizeBitsOf(segmentWordArray)) / ((BYTES_PER_WORD) * 8)) * (BYTES_PER_WORD));
	lastIn = firstIn - (BYTES_PER_WORD);

	/* top half of that */
	/* First mark the rootArray and all root objects. */

	hdrBaseIn = firstIn + (((sizeBitsOf(segmentWordArray)) / ((BYTES_PER_WORD) * 16)) * (BYTES_PER_WORD));
	longAtput(arrayOfRoots, (longAt(arrayOfRoots)) | (MARK_BIT));
	lastPtr = arrayOfRoots + (lastPointerOf(arrayOfRoots));
	fieldPtr = arrayOfRoots + (BASE_HEADER_SIZE);
	while (fieldPtr <= lastPtr) {
		fieldOop = longAt(fieldPtr);
		if (!((fieldOop & 1))) {
			longAtput(fieldOop, (longAt(fieldOop)) | (MARK_BIT));
		}
		fieldPtr += BYTES_PER_WORD;
	}
	savedYoungStart = foo->youngStart;
	/* begin setYoungStart: */
	foo->youngStart = memory;
	/* begin setFreeContexts: */
	foo->freeContexts = NilContext;
	/* begin setFreeLargeContexts: */
	foo->freeLargeContexts = NilContext;
	markAndTraceInterpreterOops(1);
	/* begin setYoungStart: */
	foo->youngStart = savedYoungStart;
	longAtput(arrayOfRoots, (longAt(arrayOfRoots)) & (ALL_BUT_MARK_BIT));
	fieldPtr = arrayOfRoots + (BASE_HEADER_SIZE);
	while (fieldPtr <= lastPtr) {
		fieldOop = longAt(fieldPtr);
		if (!((fieldOop & 1))) {
			longAtput(fieldOop, (longAt(fieldOop)) & (ALL_BUT_MARK_BIT));
		}
		fieldPtr += BYTES_PER_WORD;
	}
	lastIn += BYTES_PER_WORD;
	if (lastIn >= hdrBaseIn) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	lastSeg = copyObjtoSegmentaddrstopAtsaveOopAtheaderAt(arrayOfRoots, segmentWordArray, lastSeg, firstIn, lastIn, hdrBaseIn + (lastIn - firstIn));
	if (!(!foo->primFailCode)) {
		lastIn -= BYTES_PER_WORD;
		restoreHeadersFromtofromandtofrom(firstIn, lastIn, hdrBaseIn, firstOut, lastOut, hdrBaseOut);
		/* begin primitiveFailAfterCleanup: */
		lastAddr = outPointerArray + (lastPointerOf(outPointerArray));
		i = outPointerArray + (BASE_HEADER_SIZE);
		while (i <= lastAddr) {
			longAtput(i, foo->nilObj);
			i += BYTES_PER_WORD;
		}
		if (DoAssertionChecks) {
			verifyCleanHeaders();
		}
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	segOop = ((segmentWordArray + versionOffset) + (BASE_HEADER_SIZE)) + (foo->headerTypeBytes[(longAt((segmentWordArray + versionOffset) + (BASE_HEADER_SIZE))) & TypeMask]);
	while (segOop <= lastSeg) {
		if (((longAt(segOop)) & TypeMask) <= 1) {

			/* This object has a class field (type=0 or 1) -- start with that. */

			fieldPtr = segOop - (BYTES_PER_WORD);
			doingClass = 1;
		} else {

			/* No class field -- start with first data field */

			fieldPtr = segOop + (BASE_HEADER_SIZE);
			doingClass = 0;
		}

		/* last field */
		/* Go through all oops, remapping them... */

		lastPtr = segOop + (lastPointerOf(segOop));
		while (!(fieldPtr > lastPtr)) {

			/* Examine each pointer field */

			fieldOop = longAt(fieldPtr);
			if (doingClass) {
				hdrTypeBits = fieldOop & TypeMask;
				fieldOop -= hdrTypeBits;
			}
			if ((fieldOop & 1)) {

				/* Just an integer -- nothing to do */

				fieldPtr += BYTES_PER_WORD;
			} else {
				header = longAt(fieldOop);
				if ((header & TypeMask) == HeaderTypeFree) {

					/* Has already been forwarded -- this is the link */

					mapOop = header & (ALL_BUT_TYPE_MASK);
				} else {
					if (((longAt(fieldOop)) & (MARK_BIT)) == 0) {

						/* Points to an unmarked obj -- an internal pointer.
							Copy the object into the segment, and forward its oop. */

						lastIn += BYTES_PER_WORD;
						if (lastIn >= hdrBaseIn) {
							/* begin primitiveFail */
							if (foo->primFailCode == 0) {
								foo->primFailCode = 1;
							}
						}
						lastSeg = copyObjtoSegmentaddrstopAtsaveOopAtheaderAt(fieldOop, segmentWordArray, lastSeg, firstIn, lastIn, hdrBaseIn + (lastIn - firstIn));
						if (!(!foo->primFailCode)) {

							/* Out of space in segment */

							lastIn -= BYTES_PER_WORD;
							restoreHeadersFromtofromandtofrom(firstIn, lastIn, hdrBaseIn, firstOut, lastOut, hdrBaseOut);
							/* begin primitiveFailAfterCleanup: */
							lastAddr1 = outPointerArray + (lastPointerOf(outPointerArray));
							i1 = outPointerArray + (BASE_HEADER_SIZE);
							while (i1 <= lastAddr1) {
								longAtput(i1, foo->nilObj);
								i1 += BYTES_PER_WORD;
							}
							if (DoAssertionChecks) {
								verifyCleanHeaders();
							}
							/* begin primitiveFail */
							if (foo->primFailCode == 0) {
								foo->primFailCode = 1;
							}
							return;
						}
						mapOop = (longAt(fieldOop)) & (ALL_BUT_TYPE_MASK);
					} else {

						/* Points to a marked obj -- an external pointer.
							Map it as a tagged index in outPointers, and forward its oop. */

						lastOut += BYTES_PER_WORD;
						if (lastOut >= hdrBaseOut) {

							/* Out of space in outPointerArray */

							lastOut -= BYTES_PER_WORD;
							restoreHeadersFromtofromandtofrom(firstIn, lastIn, hdrBaseIn, firstOut, lastOut, hdrBaseOut);
							/* begin primitiveFailAfterCleanup: */
							lastAddr2 = outPointerArray + (lastPointerOf(outPointerArray));
							i2 = outPointerArray + (BASE_HEADER_SIZE);
							while (i2 <= lastAddr2) {
								longAtput(i2, foo->nilObj);
								i2 += BYTES_PER_WORD;
							}
							if (DoAssertionChecks) {
								verifyCleanHeaders();
							}
							/* begin primitiveFail */
							if (foo->primFailCode == 0) {
								foo->primFailCode = 1;
							}
							return;
						}
						mapOop = (lastOut - outPointerArray) | 0x80000000U;
						/* begin forward:to:savingOopAt:andHeaderAt: */
						longAtput(lastOut, fieldOop);
						longAtput(hdrBaseOut + (lastOut - firstOut), longAt(fieldOop));
						longAtput(fieldOop, mapOop + HeaderTypeFree);
					}
				}
				if (doingClass) {
					longAtput(fieldPtr, mapOop + hdrTypeBits);
					fieldPtr += (BYTES_PER_WORD) * 2;
					doingClass = 0;
				} else {
					longAtput(fieldPtr, mapOop);
					fieldPtr += BYTES_PER_WORD;
				}
			}
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) segOop)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(segOop)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(segOop)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header1 = longAt(segOop);
			if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(segOop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header1 & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
		}
		segOop = (segOop + sz) + (foo->headerTypeBytes[(longAt(segOop + sz)) & TypeMask]);
	}
	restoreHeadersFromtofromandtofrom(firstIn, lastIn, hdrBaseIn, firstOut, lastOut, hdrBaseOut);
	if ((((outPointerArray + (lastPointerOf(outPointerArray))) - lastOut) < 12) || ((endSeg - lastSeg) < 12)) {

		/* Not enough room to insert simple 3-word headers */

		/* begin primitiveFailAfterCleanup: */
		lastAddr3 = outPointerArray + (lastPointerOf(outPointerArray));
		i3 = outPointerArray + (BASE_HEADER_SIZE);
		while (i3 <= lastAddr3) {
			longAtput(i3, foo->nilObj);
			i3 += BYTES_PER_WORD;
		}
		if (DoAssertionChecks) {
			verifyCleanHeaders();
		}
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	extraSize = foo->headerTypeBytes[(longAt(segmentWordArray)) & TypeMask];

	/* Copy the 3-word wordArray header to establish a free chunk. */

	hdrTypeBits = (longAt(segmentWordArray)) & TypeMask;
	/* begin transfer:from:to: */
	flag("Dan");
	in = (segmentWordArray - extraSize) - (BYTES_PER_WORD);
	lastIn1 = in + (3 * (BYTES_PER_WORD));
	out = (lastOut + (BYTES_PER_WORD)) - (BYTES_PER_WORD);
	while ((((usqInt) in)) < (((usqInt) lastIn1))) {
		longAtput((out += BYTES_PER_WORD), longAt((in += BYTES_PER_WORD)));
	}
	longAtput(lastOut + (BYTES_PER_WORD), (((outPointerArray + (lastPointerOf(outPointerArray))) - lastOut) - extraSize) + hdrTypeBits);
	longAtput(outPointerArray - extraSize, ((lastOut - firstOut) + ((BYTES_PER_WORD) * 2)) + hdrTypeBits);
	beRootIfOld(outPointerArray);
	/* begin transfer:from:to: */
	flag("Dan");
	in1 = (segmentWordArray - extraSize) - (BYTES_PER_WORD);
	lastIn2 = in1 + (3 * (BYTES_PER_WORD));
	out1 = (lastSeg + (BYTES_PER_WORD)) - (BYTES_PER_WORD);
	while ((((usqInt) in1)) < (((usqInt) lastIn2))) {
		longAtput((out1 += BYTES_PER_WORD), longAt((in1 += BYTES_PER_WORD)));
	}
	longAtput(segmentWordArray - extraSize, ((lastSeg - segmentWordArray) + (BASE_HEADER_SIZE)) + hdrTypeBits);
	longAtput(lastSeg + (BYTES_PER_WORD), ((endSeg - lastSeg) - extraSize) + hdrTypeBits);
	if (DoAssertionChecks) {
		verifyCleanHeaders();
	}
	/* begin pop: */
	foo->stackPointer -= 3 * (BYTES_PER_WORD);
}


/*	Atomic store into context stackPointer. 
	Also ensures that any newly accessible cells are initialized to nil  */

void primitiveStoreStackp(void) {
register struct foo * foo = &fum;
    sqInt ctxt;
    sqInt i;
    sqInt newStackp;
    sqInt stackp;
    sqInt sp;
    sqInt successBoolean;
    sqInt integerPointer;
    sqInt otherOop;

	ctxt = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		newStackp = (integerPointer >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		newStackp = 0;
		goto l2;
	}
	newStackp = null;
l2:	/* end stackIntegerValue: */;
	/* begin success: */
	if (!((((usqInt) newStackp)) >= (((usqInt) 0)))) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	/* begin success: */
	/* begin oop:isLessThanOrEqualTo: */
	otherOop = (((LARGE_CONTEXT_SIZE) - (BASE_HEADER_SIZE)) / (BYTES_PER_WORD)) - CtxtTempFrameStart;
	successBoolean = (((usqInt) newStackp)) <= (((usqInt) otherOop));
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!(!foo->primFailCode)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin fetchStackPointerOf: */
	sp = longAt((ctxt + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
	if (!((sp & 1))) {
		stackp = 0;
		goto l1;
	}
	stackp = (sp >> 1);
l1:	/* end fetchStackPointerOf: */;
	if ((((usqInt) newStackp)) > (((usqInt) stackp))) {

		/* Nil any newly accessible cells */

		for (i = (stackp + 1); i <= newStackp; i += 1) {
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) ctxt)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(ctxt, foo->nilObj);
			}
			longAtput((ctxt + (BASE_HEADER_SIZE)) + (((i + CtxtTempFrameStart) - 1) << (SHIFT_FOR_WORD)), foo->nilObj);
		}
	}
	/* begin storeStackPointerValue:inContext: */
	longAtput((ctxt + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), ((newStackp << 1) | 1));
	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
}

void primitiveStringAt(void) {
	commonAt(1);
}

void primitiveStringAtPut(void) {
	commonAtPut(1);
}


/*	 
	<array> primReplaceFrom: start to: stop with: replacement 
	startingAt: repStart  
	<primitive: 105>
	 */

void primitiveStringReplace(void) {
register struct foo * foo = &fum;
    sqInt array;
    sqInt arrayFmt;
    sqInt arrayInstSize;
    sqInt hdr;
    sqInt i;
    sqInt repl;
    sqInt replFmt;
    sqInt replInstSize;
    sqInt replStart;
    sqInt srcIndex;
    sqInt start;
    sqInt stop;
    sqInt totalLength;
    sqInt valuePointer;
    sqInt valueWord;
    sqInt sz;
    sqInt class;
    sqInt classFormat;
    sqInt sz1;
    sqInt class1;
    sqInt classFormat1;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt integerPointer2;
    sqInt ccIndex;
    sqInt oop1;
    sqInt ccIndex1;
    sqInt oop11;

	array = longAt(foo->stackPointer - (4 * (BYTES_PER_WORD)));
	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (3 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		start = (integerPointer >> 1);
		goto l5;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		start = 0;
		goto l5;
	}
	start = null;
l5:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(foo->stackPointer - (2 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer1 & 1)) {
		stop = (integerPointer1 >> 1);
		goto l6;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		stop = 0;
		goto l6;
	}
	stop = null;
l6:	/* end stackIntegerValue: */;
	repl = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin stackIntegerValue: */
	integerPointer2 = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer2 & 1)) {
		replStart = (integerPointer2 >> 1);
		goto l7;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		replStart = 0;
		goto l7;
	}
	replStart = null;
l7:	/* end stackIntegerValue: */;
	if (!(!foo->primFailCode)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if ((repl & 1)) {

		/* can happen in LgInt copy */

		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	hdr = longAt(array);
	arrayFmt = (((usqInt) hdr) >> 8) & 15;
	/* begin lengthOf:baseHeader:format: */
	if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(array - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = hdr & (SIZE_MASK);
	}
	sz -= hdr & (SIZE_4_BIT);
	if (arrayFmt <= 4) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l1;
	}
	if (arrayFmt < 8) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l1;
	} else {
		totalLength = (sz - (BASE_HEADER_SIZE)) - (arrayFmt & 3);
		goto l1;
	}
l1:	/* end lengthOf:baseHeader:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((arrayFmt > 4) || (arrayFmt == 2)) {
		arrayInstSize = 0;
		goto l2;
	}
	if (arrayFmt < 2) {
		arrayInstSize = totalLength;
		goto l2;
	}
	/* begin fetchClassOf: */
	if ((array & 1)) {
		class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l8;
	}
	ccIndex = (((usqInt) (longAt(array))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		class = (longAt(array - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l8;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l8;
	}
l8:	/* end fetchClassOf: */;
	classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	arrayInstSize = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
l2:	/* end fixedFieldsOf:format:length: */;
	if (!((start >= 1) && (((start - 1) <= stop) && ((stop + arrayInstSize) <= totalLength)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	hdr = longAt(repl);
	replFmt = (((usqInt) hdr) >> 8) & 15;
	/* begin lengthOf:baseHeader:format: */
	if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
		sz1 = (longAt(repl - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz1 = hdr & (SIZE_MASK);
	}
	sz1 -= hdr & (SIZE_4_BIT);
	if (replFmt <= 4) {
		totalLength = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l3;
	}
	if (replFmt < 8) {
		totalLength = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> 2;
		goto l3;
	} else {
		totalLength = (sz1 - (BASE_HEADER_SIZE)) - (replFmt & 3);
		goto l3;
	}
l3:	/* end lengthOf:baseHeader:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((replFmt > 4) || (replFmt == 2)) {
		replInstSize = 0;
		goto l4;
	}
	if (replFmt < 2) {
		replInstSize = totalLength;
		goto l4;
	}
	/* begin fetchClassOf: */
	if ((repl & 1)) {
		class1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l9;
	}
	ccIndex1 = (((usqInt) (longAt(repl))) >> 12) & 0x1F;
	if (ccIndex1 == 0) {
		class1 = (longAt(repl - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l9;
	} else {
		/* begin fetchPointer:ofObject: */
		oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		class1 = longAt((oop11 + (BASE_HEADER_SIZE)) + ((ccIndex1 - 1) << (SHIFT_FOR_WORD)));
		goto l9;
	}
l9:	/* end fetchClassOf: */;
	classFormat1 = (longAt((class1 + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	replInstSize = (((((usqInt) classFormat1) >> 11) & 192) + ((((usqInt) classFormat1) >> 2) & 0x3F)) - 1;
l4:	/* end fixedFieldsOf:format:length: */;
	if (!((replStart >= 1) && ((((stop - start) + replStart) + replInstSize) <= totalLength))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (arrayFmt < 8) {
		if (!(arrayFmt == replFmt)) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
	} else {
		if (!((arrayFmt & 12) == (replFmt & 12))) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
	}

	/* - 1 for 0-based access */

	srcIndex = (replStart + replInstSize) - 1;
	if (arrayFmt <= 4) {

		/* pointer type objects */

		for (i = ((start + arrayInstSize) - 1); i <= ((stop + arrayInstSize) - 1); i += 1) {
			/* begin storePointer:ofObject:withValue: */
			valuePointer = longAt((repl + (BASE_HEADER_SIZE)) + (srcIndex << (SHIFT_FOR_WORD)));
			if ((((usqInt) array)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(array, valuePointer);
			}
			longAtput((array + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)), valuePointer);
			srcIndex += 1;
		}
	} else {
		if (arrayFmt < 8) {

			/* 32-bit-word type objects */

			for (i = ((start + arrayInstSize) - 1); i <= ((stop + arrayInstSize) - 1); i += 1) {
				/* begin storeLong32:ofObject:withValue: */
				valueWord = long32At((repl + (BASE_HEADER_SIZE)) + (srcIndex << 2));
				long32Atput((array + (BASE_HEADER_SIZE)) + (i << 2), valueWord);
				srcIndex += 1;
			}
		} else {

			/* byte-type objects */

			for (i = ((start + arrayInstSize) - 1); i <= ((stop + arrayInstSize) - 1); i += 1) {
				byteAtput((array + (BASE_HEADER_SIZE)) + i, byteAt((repl + (BASE_HEADER_SIZE)) + srcIndex));
				srcIndex += 1;
			}
		}
	}
	/* begin pop: */
	foo->stackPointer -= foo->argumentCount * (BYTES_PER_WORD);
}

void primitiveSubtract(void) {
register struct foo * foo = &fum;
    sqInt integerResult;
    sqInt sp;

	/* begin pop2AndPushIntegerIfOK: */
	integerResult = (stackIntegerValue(1)) - (stackIntegerValue(0));
	if (!foo->primFailCode) {
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) integerResult)) ^ ((((int) integerResult)) << 1)) >= 0)
# else
			((integerResult >= -1073741824) && (integerResult <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			/* begin pop:thenPush: */
			longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), ((integerResult << 1) | 1));
			foo->stackPointer = sp;
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
	}
}


/*	Primitive arithmetic operations for large integers in 64 bit range */

EXPORT(void) primitiveSubtractLargeIntegers(void) {
register struct foo * foo = &fum;
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt resultIsNegative;
    sqInt sp;

	oopArg = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	oopRcvr = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (!(!foo->primFailCode)) {
		return;
	}
	if (aIsNegative != bIsNegative) {

		/* Protect against overflow */

		if (a > (0xFFFFFFFFFFFFFFFFULL - b)) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
		result = a + b;
		resultIsNegative = aIsNegative;
	} else {
		if (a >= b) {
			result = a - b;
			resultIsNegative = aIsNegative;
		} else {
			result = b - a;
			resultIsNegative = !aIsNegative;
		}
	}
	oopResult = magnitude64BitIntegerForneg(result, resultIsNegative);
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), oopResult);
		foo->stackPointer = sp;
	}
}


/*	Primitive. Suspend the receiver, aProcess such that it can be executed again
	by sending #resume. If the given process is not currently running, take it off
	its corresponding list. The primitive returns the list the receiver was previously on. */

void primitiveSuspend(void) {
register struct foo * foo = &fum;
    sqInt activeProc;
    sqInt myList;
    sqInt process;
    sqInt sp;
    sqInt sp1;
    sqInt firstLink;
    sqInt lastLink;
    sqInt nextLink;
    sqInt tempLink;
    sqInt oop;
    sqInt oop1;

	process = longAt(foo->stackPointer);
	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	if (process == activeProc) {
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->nilObj);
		foo->stackPointer = sp;
		transferTo(wakeHighestPriority());
	} else {

		/* XXXX Fixme. We should really check whether myList is a kind of LinkedList or not
		but we can't easily so just do a quick check for nil which is the most common case. */

		myList = longAt((process + (BASE_HEADER_SIZE)) + (MyListIndex << (SHIFT_FOR_WORD)));
		if (myList == foo->nilObj) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
		/* begin removeProcess:fromList: */
		firstLink = longAt((myList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)));
		lastLink = longAt((myList + (BASE_HEADER_SIZE)) + (LastLinkIndex << (SHIFT_FOR_WORD)));
		if (process == firstLink) {
			nextLink = longAt((process + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)));
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) myList)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(myList, nextLink);
			}
			longAtput((myList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)), nextLink);
			if (process == lastLink) {
				/* begin storePointer:ofObject:withValue: */
				if ((((usqInt) myList)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(myList, foo->nilObj);
				}
				longAtput((myList + (BASE_HEADER_SIZE)) + (LastLinkIndex << (SHIFT_FOR_WORD)), foo->nilObj);
			}
		} else {
			tempLink = firstLink;
					while (1) {
				if (tempLink == foo->nilObj) {
					/* begin success: */
					if (!(0)) {
						if (!foo->primFailCode) {
							foo->primFailCode = 1;
						}
					}
					goto l1;
				}
				nextLink = longAt((tempLink + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)));
				if (nextLink == process) break;
				tempLink = longAt((tempLink + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)));
			}
			nextLink = longAt((process + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)));
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) tempLink)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(tempLink, nextLink);
			}
			longAtput((tempLink + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)), nextLink);
			if (process == lastLink) {
				/* begin storePointer:ofObject:withValue: */
				if ((((usqInt) myList)) < (((usqInt) foo->youngStart))) {
					possibleRootStoreIntovalue(myList, tempLink);
				}
				longAtput((myList + (BASE_HEADER_SIZE)) + (LastLinkIndex << (SHIFT_FOR_WORD)), tempLink);
			}
		}
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) process)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(process, foo->nilObj);
		}
		longAtput((process + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)), foo->nilObj);
	l1:	/* end removeProcess:fromList: */;
		if (!foo->primFailCode) {
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) process)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(process, foo->nilObj);
			}
			longAtput((process + (BASE_HEADER_SIZE)) + (MyListIndex << (SHIFT_FOR_WORD)), foo->nilObj);
			/* begin pop: */
			foo->stackPointer -= 1 * (BYTES_PER_WORD);
			/* begin push: */
			longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), myList);
			foo->stackPointer = sp1;
		}
	}
}


/*	Primitive. Terminate up the context stack from the receiver up to but not including the argument, if previousContext is on my Context stack. Make previousContext my sender. This prim has to shadow the code in ContextPart>terminateTo: to be correct */

void primitiveTerminateTo(void) {
register struct foo * foo = &fum;
    sqInt aContext;
    sqInt currentCntx;
    sqInt nextCntx;
    sqInt nilOop;
    sqInt thisCntx;
    sqInt top;
    sqInt top1;
    sqInt sp;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	aContext = top;
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	thisCntx = top1;
	if (contexthasSender(thisCntx, aContext)) {
		nilOop = foo->nilObj;
		currentCntx = longAt((thisCntx + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
		while (!(currentCntx == aContext)) {
			nextCntx = longAt((currentCntx + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) currentCntx)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(currentCntx, nilOop);
			}
			longAtput((currentCntx + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)), nilOop);
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) currentCntx)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(currentCntx, nilOop);
			}
			longAtput((currentCntx + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), nilOop);
			currentCntx = nextCntx;
		}
	}
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) thisCntx)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(thisCntx, aContext);
	}
	longAtput((thisCntx + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)), aContext);
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), thisCntx);
	foo->stackPointer = sp;
	return;
}


/*	Attempt to test-and-set the ownership of the critical section.  If not owned,
	 set the owner to the current process and answer false. If owned by the
	 current process answer true.  If owned by some other process answer nil.
	 For simulation if there is an argument it is taken to be the effective activeProcess
	 (see Process>>effectiveProcess). */

void primitiveTestAndSetOwnershipOfCriticalSection(void) {
register struct foo * foo = &fum;
    sqInt activeProc;
    sqInt criticalSection;
    sqInt owningProcess;
    sqInt owningProcessIndex;
    sqInt oop;
    sqInt sp;
    sqInt sp1;
    sqInt sp2;
    sqInt oop1;

	if (foo->argumentCount > 0) {

		/* rcvr */

		criticalSection = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
		activeProc = longAt(foo->stackPointer);
	} else {

		/* rcvr */

		criticalSection = longAt(foo->stackPointer);
		/* begin fetchPointer:ofObject: */
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
		oop = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
		activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	}

	/* CriticalSections are laid out like Semaphores */

	owningProcessIndex = ExcessSignalsIndex;
	owningProcess = longAt((criticalSection + (BASE_HEADER_SIZE)) + (owningProcessIndex << (SHIFT_FOR_WORD)));
	if (owningProcess == foo->nilObj) {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) criticalSection)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(criticalSection, activeProc);
		}
		longAtput((criticalSection + (BASE_HEADER_SIZE)) + (owningProcessIndex << (SHIFT_FOR_WORD)), activeProc);
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), foo->falseObj);
		foo->stackPointer = sp;
		return;
	}
	if (owningProcess == activeProc) {
		/* begin pop:thenPush: */
		longAtput((sp1 = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), foo->trueObj);
		foo->stackPointer = sp1;
		return;
	}
	/* begin pop:thenPush: */
	longAtput((sp2 = foo->stackPointer - (((foo->argumentCount + 1) - 1) * (BYTES_PER_WORD))), foo->nilObj);
	foo->stackPointer = sp2;
}


/*	Return true if the host OS does support the given display depth. */

void primitiveTestDisplayDepth(void) {
register struct foo * foo = &fum;
    sqInt bitsPerPixel;
    sqInt okay;
    sqInt sp;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		bitsPerPixel = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		bitsPerPixel = 0;
		goto l1;
	}
	bitsPerPixel = null;
l1:	/* end stackIntegerValue: */;
	if (!foo->primFailCode) {
		okay = ioHasDisplayDepth(bitsPerPixel);
	}
	if (!foo->primFailCode) {
		/* begin pop:thenPushBool: */
		longAtput((sp = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), (okay
			? foo->trueObj
			: foo->falseObj));
		foo->stackPointer = sp;
	}
}


/*	Given an object with indexable pointer fields, reduce the size of the indexable fields
	to the requested size. Answer the number of bytes freed, or zero if the object cannot
	be shortened. */

EXPORT(sqInt) primitiveTestShortenIndexableSize(void) {
register struct foo * foo = &fum;
    sqInt array;
    sqInt bytesFreed;
    sqInt newSize;
    sqInt sp;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(foo->stackPointer - (0 * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		newSize = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		newSize = 0;
		goto l1;
	}
	newSize = null;
l1:	/* end stackIntegerValue: */;
	array = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	/* begin pop: */
	foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
	bytesFreed = shortentoIndexableSize(array, newSize);
	/* begin pushInteger: */
	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), ((bytesFreed << 1) | 1));
	foo->stackPointer = sp;
	return null;
}

void primitiveTimesTwoPower(void) {
register struct foo * foo = &fum;
    sqInt arg;
    double rcvr;
    sqInt integerPointer;
    sqInt top;

	/* begin popInteger */
	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	integerPointer = top;
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		arg = (integerPointer >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		arg = 0;
		goto l1;
	}
	arg = null;
l1:	/* end popInteger */;
	rcvr = popFloat();
	if (!foo->primFailCode) {
		pushFloat(ldexp(rcvr, arg));
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
}

void primitiveTruncated(void) {
register struct foo * foo = &fum;
    double frac;
    double rcvr;
    double trunc;

	rcvr = popFloat();
	if (!foo->primFailCode) {
		frac = modf(rcvr, &trunc);
		flag("Dan");
		success((-1073741824.0 <= trunc) && (trunc <= 1073741823.0));
	}
	if (!foo->primFailCode) {
		pushInteger((sqInt) trunc);
	} else {
		/* begin unPop: */
		foo->stackPointer += 1 * (BYTES_PER_WORD);
	}
}


/*	Answer the UTC microseconds since the Smalltalk epoch. The value is
	derived from the Posix epoch (see primitiveUTCMicrosecondClock) with a
	constant offset corresponding to elapsed microseconds between the two
	epochs according to RFC 868. */

EXPORT(void) primitiveUTCMicrosecondClock(void) {
register struct foo * foo = &fum;
    sqLong clock;
    static usqLong epochDelta= 2177452800000000ULL;
    int offset;
    sqInt uSecs;
    sqInt sp;

	if ((ioUtcWithOffset(&clock, &offset)) == -1) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	clock += epochDelta;
	uSecs = positive64BitIntegerFor(clock);
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), uSecs);
	foo->stackPointer = sp;
}


/*	Primitive. Unload the module with the given name. */
/*	Reloading of the module will happen *later* automatically, when a 
	function from it is called. This is ensured by invalidating current sessionID. */

void primitiveUnloadModule(void) {
register struct foo * foo = &fum;
    sqInt moduleName;

	if (!(foo->argumentCount == 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	moduleName = longAt(foo->stackPointer);
	if ((moduleName & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (!(((moduleName & 1) == 0) && (((((usqInt) (longAt(moduleName))) >> 8) & 15) >= 8))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	if (!(ioUnloadModuleOfLength(oopForPointer(firstIndexableField(moduleName)), byteSizeOf(moduleName)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	flushExternalPrimitives();
	/* begin forceInterruptCheck */
	foo->interruptCheckCounter = -1000;
	foo->nextPollTick = 0;
	/* begin pop: */
	foo->stackPointer -= 1 * (BYTES_PER_WORD);
}


/*	Answer an array with UTC microseconds since the Posix epoch and the
	current seconds offset from GMT in the local time zone. An empty two
	element array (or any object with two or more slots) may be supplied
	as a parameter.
	This is a named (not numbered) primitive in the null module (ie the VM) */

EXPORT(sqInt) primitiveUtcWithOffset(void) {
register struct foo * foo = &fum;
    sqLong clock;
    int offset;
    sqInt resultArray;
    sqInt top;
    sqInt oop;
    sqInt valuePointer;
    sqInt sp;
    sqInt oop1;

	if (foo->argumentCount > 1) {
		return (foo->primFailCode = PrimErrBadNumArgs);
	}
	if ((ioUtcWithOffset(&clock, &offset)) == -1) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	/* begin pushRemappableOop: */
	oop = positive64BitIntegerFor(clock);
	foo->remapBuffer[(foo->remapBufferCount += 1)] = oop;
	if (foo->argumentCount > 0) {
		/* begin popStack */
		top = longAt(foo->stackPointer);
		foo->stackPointer -= BYTES_PER_WORD;
		resultArray = top;
		if (!((((resultArray & 1) == 0) && (((((usqInt) (longAt(resultArray))) >> 8) & 15) <= 4)) && ((lengthOf(resultArray)) >= 2))) {
			return (foo->primFailCode = PrimErrBadArgument);
		}
	} else {
		resultArray = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))), 2);
	}
	/* begin storePointer:ofObject:withValue: */
	/* begin popRemappableOop */
	oop1 = foo->remapBuffer[foo->remapBufferCount];
	foo->remapBufferCount -= 1;
	valuePointer = oop1;
	if ((((usqInt) resultArray)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(resultArray, valuePointer);
	}
	longAtput((resultArray + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), valuePointer);
	longAtput((resultArray + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), ((offset << 1) | 1));
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), resultArray);
	foo->stackPointer = sp;
	return null;
}


/*	Behaviour depends on argument count:
		0 args:	return an Array of VM parameter values;
		1 arg:	return the indicated VM parameter;
		2 args:	set the VM indicated parameter.
	VM parameters are numbered as follows:
		1	end of old-space (0-based, read-only)
		2	end of young-space (read-only)
		3	end of memory (read-only)
		4	allocationCount (read-only)
		5	allocations between GCs (read-write)
		6	survivor count tenuring threshold (read-write)
		7	full GCs since startup (read-only)
		8	total milliseconds in full GCs since startup (read-only)
		9	incremental GCs since startup (read-only)
		10	total milliseconds in incremental GCs since startup (read-only)
		11	tenures of surving objects since startup (read-only)
		12-20 specific to the translating VM
		21	root table size (read-only)
		22	root table overflows since startup (read-only)
		23	bytes of extra memory to reserve for VM buffers, plugins, etc.
		24	memory threshold above which shrinking object memory (rw)
		25	memory headroom when growing object memory (rw)
		26  interruptChecksEveryNms - force an ioProcessEvents every N milliseconds, in case the image  is not calling getNextEvent often (rw)
		27	number of times mark loop iterated for current IGC/FGC (read-only) includes ALL marking
		28	number of times sweep loop iterated  for current IGC/FGC (read-only)
		29	number of times make forward loop iterated for current IGC/FGC (read-only)
		30	number of times compact move loop iterated for current IGC/FGC (read-only)
		31	number of grow memory requests (read-only)
		32	number of shrink memory requests (read-only)
		33	number of root table entries used for current IGC/FGC (read-only)
		34	number of allocations done before current IGC/FGC (read-only)
		35	number of survivor objects after current IGC/FGC (read-only)
		36  millisecond clock when current IGC/FGC completed (read-only)
		37  number of marked objects for Roots of the world, not including Root Table entries for current IGC/FGC (read-only)
		38  milliseconds taken by current IGC  (read-only)
		39  Number of finalization signals for Weak Objects pending when current IGC/FGC completed (read-only)
		40 BytesPerWord for this image
		
	Note: Thanks to Ian Piumarta for this primitive. */

void primitiveVMParameter(void) {
register struct foo * foo = &fum;
    sqInt arg;
    sqInt endOfMemoryObj;
    sqInt freeBlockObj;
    sqInt growHeadroomOop;
    sqInt i;
    sqInt index;
    sqInt mem;
    sqInt paramsArraySize;
    sqInt result;
    sqInt shrinkThresholdOop;
    sqInt statFullGCMSecsObj;
    sqInt statGCTimeObj;
    sqInt statIGCDeltaTimeObj;
    sqInt statIncrGCMSecsObj;
    sqInt youngStartOop;
    sqInt oop;
    sqInt oop1;
    sqInt oop2;
    sqInt oop3;
    sqInt oop4;
    sqInt oop5;
    sqInt oop6;
    sqInt oop7;
    sqInt oop8;
    sqInt oop9;
    sqInt oop10;
    sqInt oop11;
    sqInt oop12;
    sqInt oop13;
    sqInt oop14;
    sqInt oop15;
    sqInt oop16;
    sqInt oop17;
    sqInt oop18;
    sqInt valuePointer;
    sqInt valuePointer1;
    sqInt sp;
    sqInt sp1;
    sqInt sp2;

	mem = memory;
	paramsArraySize = 40;
	if (foo->argumentCount == 0) {
		result = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassArray << (SHIFT_FOR_WORD))), paramsArraySize);
		/* begin pushRemappableOop: */
		foo->remapBuffer[(foo->remapBufferCount += 1)] = result;
		/* begin pushRemappableOop: */
		oop = positive64BitIntegerFor(foo->youngStart - mem);
		foo->remapBuffer[(foo->remapBufferCount += 1)] = oop;
		/* begin pushRemappableOop: */
		oop1 = positive64BitIntegerFor(foo->freeBlock - mem);
		foo->remapBuffer[(foo->remapBufferCount += 1)] = oop1;
		/* begin pushRemappableOop: */
		oop2 = positive64BitIntegerFor(foo->endOfMemory - mem);
		foo->remapBuffer[(foo->remapBufferCount += 1)] = oop2;
		/* begin pushRemappableOop: */
		oop3 = floatOrIntegerObjectOfLongdividedBy(foo->statFullGCMSecs, 1000);
		foo->remapBuffer[(foo->remapBufferCount += 1)] = oop3;
		/* begin pushRemappableOop: */
		oop4 = floatOrIntegerObjectOfLongdividedBy(foo->statIncrGCMSecs, 1000);
		foo->remapBuffer[(foo->remapBufferCount += 1)] = oop4;
		/* begin pushRemappableOop: */
		oop5 = positive64BitIntegerFor((sqLong)foo->shrinkThreshold);
		foo->remapBuffer[(foo->remapBufferCount += 1)] = oop5;
		/* begin pushRemappableOop: */
		oop6 = positive64BitIntegerFor((sqLong)foo->growHeadroom);
		foo->remapBuffer[(foo->remapBufferCount += 1)] = oop6;
		/* begin pushRemappableOop: */
		oop7 = floatOrIntegerObjectOfLongdividedBy(foo->statGCTime, 1000);
		foo->remapBuffer[(foo->remapBufferCount += 1)] = oop7;
		/* begin pushRemappableOop: */
		oop8 = floatOrIntegerObjectOfLongdividedBy(foo->statIGCDeltaTime, 1000);
		foo->remapBuffer[(foo->remapBufferCount += 1)] = oop8;
		/* begin popRemappableOop */
		oop9 = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		statIGCDeltaTimeObj = oop9;
		/* begin popRemappableOop */
		oop10 = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		statGCTimeObj = oop10;
		/* begin popRemappableOop */
		oop11 = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		growHeadroomOop = oop11;
		/* begin popRemappableOop */
		oop12 = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		shrinkThresholdOop = oop12;
		/* begin popRemappableOop */
		oop13 = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		statIncrGCMSecsObj = oop13;
		/* begin popRemappableOop */
		oop14 = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		statFullGCMSecsObj = oop14;
		/* begin popRemappableOop */
		oop15 = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		endOfMemoryObj = oop15;
		/* begin popRemappableOop */
		oop16 = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		freeBlockObj = oop16;
		/* begin popRemappableOop */
		oop17 = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		youngStartOop = oop17;
		/* begin popRemappableOop */
		oop18 = foo->remapBuffer[foo->remapBufferCount];
		foo->remapBufferCount -= 1;
		result = oop18;
		for (i = 0; i <= (paramsArraySize - 1); i += 1) {
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(result, ConstZero);
			}
			longAtput((result + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD)), ConstZero);
		}
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, youngStartOop);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)), youngStartOop);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, freeBlockObj);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (1 << (SHIFT_FOR_WORD)), freeBlockObj);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, endOfMemoryObj);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (2 << (SHIFT_FOR_WORD)), endOfMemoryObj);
		/* begin storePointer:ofObject:withValue: */
		valuePointer = ((foo->allocationCount << 1) | 1);
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, valuePointer);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (3 << (SHIFT_FOR_WORD)), valuePointer);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->allocationsBetweenGCs << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (4 << (SHIFT_FOR_WORD)), ((foo->allocationsBetweenGCs << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->tenuringThreshold << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (5 << (SHIFT_FOR_WORD)), ((foo->tenuringThreshold << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statFullGCs << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (6 << (SHIFT_FOR_WORD)), ((foo->statFullGCs << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, statFullGCMSecsObj);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (7 << (SHIFT_FOR_WORD)), statFullGCMSecsObj);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statIncrGCs << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (8 << (SHIFT_FOR_WORD)), ((foo->statIncrGCs << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, statIncrGCMSecsObj);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (9 << (SHIFT_FOR_WORD)), statIncrGCMSecsObj);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statTenures << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (10 << (SHIFT_FOR_WORD)), ((foo->statTenures << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		valuePointer1 = ((foo->rootTableCount << 1) | 1);
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, valuePointer1);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (20 << (SHIFT_FOR_WORD)), valuePointer1);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statRootTableOverflows << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (21 << (SHIFT_FOR_WORD)), ((foo->statRootTableOverflows << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((extraVMMemory << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (22 << (SHIFT_FOR_WORD)), ((extraVMMemory << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, shrinkThresholdOop);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (23 << (SHIFT_FOR_WORD)), shrinkThresholdOop);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, growHeadroomOop);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (24 << (SHIFT_FOR_WORD)), growHeadroomOop);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->interruptChecksEveryNms << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (25 << (SHIFT_FOR_WORD)), ((foo->interruptChecksEveryNms << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statMarkCount << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (26 << (SHIFT_FOR_WORD)), ((foo->statMarkCount << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statSweepCount << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (27 << (SHIFT_FOR_WORD)), ((foo->statSweepCount << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statMkFwdCount << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (28 << (SHIFT_FOR_WORD)), ((foo->statMkFwdCount << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statCompMoveCount << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (29 << (SHIFT_FOR_WORD)), ((foo->statCompMoveCount << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statGrowMemory << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (30 << (SHIFT_FOR_WORD)), ((foo->statGrowMemory << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statShrinkMemory << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (0x1F << (SHIFT_FOR_WORD)), ((foo->statShrinkMemory << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statRootTableCount << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (32 << (SHIFT_FOR_WORD)), ((foo->statRootTableCount << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statAllocationCount << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (33 << (SHIFT_FOR_WORD)), ((foo->statAllocationCount << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statSurvivorCount << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (34 << (SHIFT_FOR_WORD)), ((foo->statSurvivorCount << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, statGCTimeObj);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (35 << (SHIFT_FOR_WORD)), statGCTimeObj);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statSpecialMarkCount << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (36 << (SHIFT_FOR_WORD)), ((foo->statSpecialMarkCount << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, statIGCDeltaTimeObj);
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (37 << (SHIFT_FOR_WORD)), statIGCDeltaTimeObj);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, ((foo->statpendingFinalizationSignals << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (38 << (SHIFT_FOR_WORD)), ((foo->statpendingFinalizationSignals << 1) | 1));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) result)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(result, (((BYTES_PER_WORD) << 1) | 1));
		}
		longAtput((result + (BASE_HEADER_SIZE)) + (39 << (SHIFT_FOR_WORD)), (((BYTES_PER_WORD) << 1) | 1));
		/* begin pop:thenPush: */
		longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), result);
		foo->stackPointer = sp;
		return;
	}
	arg = longAt(foo->stackPointer);
	if (!((arg & 1))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	arg = (arg >> 1);
	if (foo->argumentCount == 1) {

		/* read VM parameter */

		if ((arg < 1) || (arg > paramsArraySize)) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return;
		}
		if (arg == 1) {
			result = positive64BitIntegerFor(foo->youngStart - mem);
		}
		if (arg == 2) {
			result = positive64BitIntegerFor(foo->freeBlock - mem);
		}
		if (arg == 3) {
			result = positive64BitIntegerFor(foo->endOfMemory - mem);
		}
		if (arg == 4) {
			result = ((foo->allocationCount << 1) | 1);
		}
		if (arg == 5) {
			result = ((foo->allocationsBetweenGCs << 1) | 1);
		}
		if (arg == 6) {
			result = ((foo->tenuringThreshold << 1) | 1);
		}
		if (arg == 7) {
			result = ((foo->statFullGCs << 1) | 1);
		}
		if (arg == 8) {
			result = floatOrIntegerObjectOfLongdividedBy(foo->statFullGCMSecs, 1000);
		}
		if (arg == 9) {
			result = ((foo->statIncrGCs << 1) | 1);
		}
		if (arg == 10) {
			result = floatOrIntegerObjectOfLongdividedBy(foo->statIncrGCMSecs, 1000);
		}
		if (arg == 11) {
			result = ((foo->statTenures << 1) | 1);
		}
		if ((arg >= 12) && (arg <= 20)) {
			result = ((0 << 1) | 1);
		}
		if (arg == 21) {
			result = ((foo->rootTableCount << 1) | 1);
		}
		if (arg == 22) {
			result = ((foo->statRootTableOverflows << 1) | 1);
		}
		if (arg == 23) {
			result = positive64BitIntegerFor(extraVMMemory);
		}
		if (arg == 24) {
			result = positive64BitIntegerFor((sqLong)foo->shrinkThreshold);
		}
		if (arg == 25) {
			result = positive64BitIntegerFor((sqLong)foo->growHeadroom);
		}
		if (arg == 26) {
			result = ((foo->interruptChecksEveryNms << 1) | 1);
		}
		if (arg == 27) {
			result = ((foo->statMarkCount << 1) | 1);
		}
		if (arg == 28) {
			result = ((foo->statSweepCount << 1) | 1);
		}
		if (arg == 29) {
			result = ((foo->statMkFwdCount << 1) | 1);
		}
		if (arg == 30) {
			result = ((foo->statCompMoveCount << 1) | 1);
		}
		if (arg == 0x1F) {
			result = ((foo->statGrowMemory << 1) | 1);
		}
		if (arg == 32) {
			result = ((foo->statShrinkMemory << 1) | 1);
		}
		if (arg == 33) {
			result = ((foo->statRootTableCount << 1) | 1);
		}
		if (arg == 34) {
			result = ((foo->statAllocationCount << 1) | 1);
		}
		if (arg == 35) {
			result = ((foo->statSurvivorCount << 1) | 1);
		}
		if (arg == 36) {
			result = floatOrIntegerObjectOfLongdividedBy(foo->statGCTime, 1000);
		}
		if (arg == 37) {
			result = ((foo->statSpecialMarkCount << 1) | 1);
		}
		if (arg == 38) {
			result = floatOrIntegerObjectOfLongdividedBy(foo->statIGCDeltaTime, 1000);
		}
		if (arg == 39) {
			result = ((foo->statpendingFinalizationSignals << 1) | 1);
		}
		if (arg == 40) {
			result = (((BYTES_PER_WORD) << 1) | 1);
		}
		/* begin pop:thenPush: */
		longAtput((sp1 = foo->stackPointer - ((2 - 1) * (BYTES_PER_WORD))), result);
		foo->stackPointer = sp1;
		return;
	}
	if (!(foo->argumentCount == 2)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	index = longAt(foo->stackPointer - (1 * (BYTES_PER_WORD)));
	if (!((index & 1))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	index = (index >> 1);
	if (index <= 0) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	if (index == 5) {
		result = foo->allocationsBetweenGCs;
		/* begin setAllocationsBetweenGCs: */
		foo->allocationsBetweenGCs = arg;
		/* begin initPrimCall */
		foo->primFailCode = 0;
	}
	if (index == 6) {
		result = foo->tenuringThreshold;
		/* begin setTenuringThreshold: */
		foo->tenuringThreshold = arg;
		/* begin initPrimCall */
		foo->primFailCode = 0;
	}
	if (index == 23) {
		result = extraVMMemory;
		extraVMMemory = arg;
		/* begin initPrimCall */
		foo->primFailCode = 0;
	}
	if (index == 24) {
		result = foo->shrinkThreshold;
		if (arg > 0) {
			/* begin setShrinkThreshold: */
			foo->shrinkThreshold = arg;
			/* begin initPrimCall */
			foo->primFailCode = 0;
		}
	}
	if (index == 25) {
		result = foo->growHeadroom;
		if (arg > 0) {
			/* begin setGrowHeadroom: */
			foo->growHeadroom = arg;
			/* begin initPrimCall */
			foo->primFailCode = 0;
		}
	}
	if (index == 26) {
		if (arg > 1) {
			result = foo->interruptChecksEveryNms;
			foo->interruptChecksEveryNms = arg;
			/* begin initPrimCall */
			foo->primFailCode = 0;
		}
	}
	if (!foo->primFailCode) {
		/* begin pop:thenPush: */
		longAtput((sp2 = foo->stackPointer - ((3 - 1) * (BYTES_PER_WORD))), ((result << 1) | 1));
		foo->stackPointer = sp2;
		return;
	}
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
}


/*	Return a string containing the path name of VM's directory. */

void primitiveVMPath(void) {
register struct foo * foo = &fum;
    sqInt s;
    sqInt sz;
    sqInt sp;

	sz = vmPathSize();
	s = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassString << (SHIFT_FOR_WORD))), sz);
	vmPathGetLength(s + (BASE_HEADER_SIZE), sz);
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), s);
	foo->stackPointer = sp;
}


/*	Answer a string corresponding to the version of virtual machine. This
	represents the version level of the Smalltalk source code (interpreter and various
	plugins) that is translated to C by a CCodeGenerator,  in addition to the external
	platform source code, typically written in C and managed separately for each platform.
	By convention, this is a string composed of the interpreter source version and the
	platform source version, e.g. '4.0.2-2172'.
	
	This is a named (not numbered) primitive in the null module (ie the VM) */

EXPORT(sqInt) primitiveVMVersion(void) {
register struct foo * foo = &fum;
    sqInt versionString;
    sqInt sp;

	
# ifdef VM_VERSION  // version level of interpreter plus platform support code
	versionString = stringForCString(VM_VERSION);
# else
	/* begin primitiveFail */
	if (foo->primFailCode == 0) {
		foo->primFailCode = 1;
	}
	return null;
# endif  // VM_VERSION
	
	/* begin pop:thenPush: */
	longAtput((sp = foo->stackPointer - ((1 - 1) * (BYTES_PER_WORD))), versionString);
	foo->stackPointer = sp;
	return null;
}

sqInt primitiveValue(void) {
register struct foo * foo = &fum;
    sqInt blockArgumentCount;
    sqInt blockContext;
    sqInt initialIP;
    sqInt firstFrom;
    sqInt fromIndex;
    sqInt lastFrom;
    sqInt toIndex;
    sqInt successBoolean;
    sqInt tmp;
    sqInt localArgCount;
    sqInt valuePointer;

	blockContext = longAt(foo->stackPointer - (foo->argumentCount * (BYTES_PER_WORD)));
	/* begin argumentCountOfBlock: */
	localArgCount = longAt((blockContext + (BASE_HEADER_SIZE)) + (BlockArgumentCountIndex << (SHIFT_FOR_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((localArgCount & 1)) {
		blockArgumentCount = (localArgCount >> 1);
		goto l1;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		blockArgumentCount = 0;
		goto l1;
	}
	blockArgumentCount = null;
l1:	/* end argumentCountOfBlock: */;
	/* begin success: */
	successBoolean = (foo->argumentCount == blockArgumentCount) && ((longAt((blockContext + (BASE_HEADER_SIZE)) + (CallerIndex << (SHIFT_FOR_WORD)))) == foo->nilObj);
	if (!(successBoolean)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!foo->primFailCode) {
		/* begin transfer:fromIndex:ofObject:toIndex:ofObject: */
		firstFrom = ((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - foo->argumentCount) + 1;
		flag("Dan");
		fromIndex = foo->activeContext + (firstFrom * (BYTES_PER_WORD));
		toIndex = blockContext + (TempFrameStart * (BYTES_PER_WORD));
		lastFrom = fromIndex + (foo->argumentCount * (BYTES_PER_WORD));
		while ((((usqInt) fromIndex)) < (((usqInt) lastFrom))) {
			fromIndex += BYTES_PER_WORD;
			toIndex += BYTES_PER_WORD;
			longAtput(toIndex, longAt(fromIndex));
		}
		/* begin pop: */
		foo->stackPointer -= (foo->argumentCount + 1) * (BYTES_PER_WORD);
		initialIP = longAt((blockContext + (BASE_HEADER_SIZE)) + (InitialIPIndex << (SHIFT_FOR_WORD)));
		longAtput((blockContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), initialIP);
		/* begin storeStackPointerValue:inContext: */
		longAtput((blockContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), ((foo->argumentCount << 1) | 1));
		longAtput((blockContext + (BASE_HEADER_SIZE)) + (CallerIndex << (SHIFT_FOR_WORD)), foo->activeContext);
		/* begin newActiveContext: */
		/* begin storeContextRegisters: */
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
		if ((((usqInt) blockContext)) < (((usqInt) foo->youngStart))) {
			beRootIfOld(blockContext);
		}
		foo->activeContext = blockContext;
		/* begin fetchContextRegisters: */
		tmp = longAt((blockContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
		if ((tmp & 1)) {
			tmp = longAt((blockContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
			if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
				beRootIfOld(tmp);
			}
		} else {
			tmp = blockContext;
		}
		foo->theHomeContext = tmp;
		foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
		foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
		tmp = ((longAt((blockContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
		foo->instructionPointer = ((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2;
		tmp = ((longAt((blockContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
		foo->stackPointer = (blockContext + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD));
	}
	return null;
}


/*	The only purpose of this primitive is to indicate that the new EH mechanisms are supported. */

sqInt primitiveValueUninterruptably(void) {
	return primitiveValue();
}

sqInt primitiveValueWithArgs(void) {
register struct foo * foo = &fum;
    sqInt argumentArray;
    sqInt arrayArgumentCount;
    sqInt blockArgumentCount;
    sqInt blockContext;
    sqInt initialIP;
    sqInt sz;
    sqInt header;
    sqInt successBoolean;
    sqInt fromIndex;
    sqInt lastFrom;
    sqInt toIndex;
    sqInt top;
    sqInt top1;
    sqInt tmp;
    sqInt localArgCount;
    sqInt valuePointer;

	/* begin popStack */
	top = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	argumentArray = top;
	/* begin popStack */
	top1 = longAt(foo->stackPointer);
	foo->stackPointer -= BYTES_PER_WORD;
	blockContext = top1;
	/* begin argumentCountOfBlock: */
	localArgCount = longAt((blockContext + (BASE_HEADER_SIZE)) + (BlockArgumentCountIndex << (SHIFT_FOR_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((localArgCount & 1)) {
		blockArgumentCount = (localArgCount >> 1);
		goto l2;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		blockArgumentCount = 0;
		goto l2;
	}
	blockArgumentCount = null;
l2:	/* end argumentCountOfBlock: */;
	if (!(((argumentArray & 1) == 0) && (((((usqInt) (longAt(argumentArray))) >> 8) & 15) == 2))) {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	if (!foo->primFailCode) {
		/* begin fetchWordLengthOf: */
		/* begin sizeBitsOf: */
		header = longAt(argumentArray);
		if ((header & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(argumentArray - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
			goto l1;
		} else {
			sz = header & (SIZE_MASK);
			goto l1;
		}
	l1:	/* end sizeBitsOf: */;
		arrayArgumentCount = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		/* begin success: */
		successBoolean = (arrayArgumentCount == blockArgumentCount) && ((longAt((blockContext + (BASE_HEADER_SIZE)) + (CallerIndex << (SHIFT_FOR_WORD)))) == foo->nilObj);
		if (!(successBoolean)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
	}
	if (!foo->primFailCode) {
		/* begin transfer:fromIndex:ofObject:toIndex:ofObject: */
		flag("Dan");
		fromIndex = argumentArray + (0 * (BYTES_PER_WORD));
		toIndex = blockContext + (TempFrameStart * (BYTES_PER_WORD));
		lastFrom = fromIndex + (arrayArgumentCount * (BYTES_PER_WORD));
		while ((((usqInt) fromIndex)) < (((usqInt) lastFrom))) {
			fromIndex += BYTES_PER_WORD;
			toIndex += BYTES_PER_WORD;
			longAtput(toIndex, longAt(fromIndex));
		}
		initialIP = longAt((blockContext + (BASE_HEADER_SIZE)) + (InitialIPIndex << (SHIFT_FOR_WORD)));
		longAtput((blockContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), initialIP);
		/* begin storeStackPointerValue:inContext: */
		longAtput((blockContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), ((arrayArgumentCount << 1) | 1));
		longAtput((blockContext + (BASE_HEADER_SIZE)) + (CallerIndex << (SHIFT_FOR_WORD)), foo->activeContext);
		/* begin newActiveContext: */
		/* begin storeContextRegisters: */
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
		if ((((usqInt) blockContext)) < (((usqInt) foo->youngStart))) {
			beRootIfOld(blockContext);
		}
		foo->activeContext = blockContext;
		/* begin fetchContextRegisters: */
		tmp = longAt((blockContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
		if ((tmp & 1)) {
			tmp = longAt((blockContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
			if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
				beRootIfOld(tmp);
			}
		} else {
			tmp = blockContext;
		}
		foo->theHomeContext = tmp;
		foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
		foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
		tmp = ((longAt((blockContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
		foo->instructionPointer = ((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2;
		tmp = ((longAt((blockContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
		foo->stackPointer = (blockContext + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD));
	} else {
		/* begin unPop: */
		foo->stackPointer += 2 * (BYTES_PER_WORD);
	}
	return null;
}

void primitiveWait(void) {
register struct foo * foo = &fum;
    sqInt activeProc;
    sqInt excessSignals;
    sqInt sema;
    sqInt oop;
    sqInt oop1;
    sqInt classOop;
    sqInt ccIndex;
    sqInt cl;
    sqInt oop11;


	/* rcvr */

	sema = longAt(foo->stackPointer);
	/* begin assertClassOf:is: */
	classOop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD)));
	if ((sema & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(sema))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		cl = (longAt(sema - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
	} else {
		/* begin fetchPointer:ofObject: */
		oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		cl = longAt((oop11 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
	}
	/* begin success: */
	if (!(cl == classOop)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
l1:	/* end assertClassOf:is: */;
	if (!foo->primFailCode) {
		excessSignals = fetchIntegerofObject(ExcessSignalsIndex, sema);
		if (excessSignals > 0) {
			/* begin storeInteger:ofObject:withValue: */
			if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
				(((((int) (excessSignals - 1))) ^ ((((int) (excessSignals - 1))) << 1)) >= 0)
# else
				(((excessSignals - 1) >= -1073741824) && ((excessSignals - 1) <= 0x3FFFFFFF))
# endif  // SQ_HOST32
			) {
				longAtput((sema + (BASE_HEADER_SIZE)) + (ExcessSignalsIndex << (SHIFT_FOR_WORD)), (((excessSignals - 1) << 1) | 1));
			} else {
				/* begin primitiveFail */
				if (foo->primFailCode == 0) {
					foo->primFailCode = 1;
				}
			}
		} else {
			/* begin fetchPointer:ofObject: */
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
			oop = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
			activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
			addLastLinktoList(activeProc, sema);
			transferTo(wakeHighestPriority());
		}
	}
}


/*	primitively do the equivalent of Process>yield */

void primitiveYield(void) {
register struct foo * foo = &fum;
    sqInt activeProc;
    sqInt priority;
    sqInt processList;
    sqInt processLists;
    sqInt oop;
    sqInt oop1;
    sqInt oop2;
    sqInt oop3;

	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop2 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop = longAt((oop2 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	priority = ((longAt((activeProc + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop3 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop1 = longAt((oop3 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	processLists = longAt((oop1 + (BASE_HEADER_SIZE)) + (ProcessListsIndex << (SHIFT_FOR_WORD)));
	processList = longAt((processLists + (BASE_HEADER_SIZE)) + ((priority - 1) << (SHIFT_FOR_WORD)));
	if (!((longAt((processList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)))) == foo->nilObj)) {
		addLastLinktoList(activeProc, processList);
		transferTo(wakeHighestPriority());
	}
}


/*	For testing in Smalltalk, this method should be overridden in a subclass. */

sqInt print(char *s) {
	printf("%s", s);
	return null;
}


/*	Print all the stacks of all running processes, including those that are currently suspended. */

EXPORT(sqInt) printAllStacks(void) {
register struct foo * foo = &fum;
    sqInt ctx;
    sqInt oop;
    sqInt proc;
    sqInt oop1;
    sqInt sz;
    sqInt header;
    sqInt oop2;


	/* exported to permit access from plugins */

	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop2 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop1 = longAt((oop2 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	proc = longAt((oop1 + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	printNameOfClasscount(fetchClassOf(proc), 5);
	/* begin cr */
	printf("\n");
	printCallStackOf((sqInt)foo->activeContext);
	oop = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) oop)) < (((usqInt) foo->endOfMemory))) {
		if ((fetchClassOf(oop)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassSemaphore << (SHIFT_FOR_WORD))))) {
			/* begin cr */
			printf("\n");
			proc = longAt((oop + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)));
			while (!(proc == foo->nilObj)) {
				printNameOfClasscount(fetchClassOf(proc), 5);
				/* begin cr */
				printf("\n");
				ctx = longAt((proc + (BASE_HEADER_SIZE)) + (SuspendedContextIndex << (SHIFT_FOR_WORD)));
				if (!(ctx == foo->nilObj)) {
					printCallStackOf(ctx);
				}
				proc = longAt((proc + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)));
			}
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header = longAt(oop);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
		}
		oop = (oop + sz) + (foo->headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
	}
	return null;
}

sqInt printCallStack(void) {
	return printCallStackOf((sqInt)foo->activeContext);
}

sqInt printCallStackOf(sqInt aContext) {
register struct foo * foo = &fum;
    sqInt ctxt;
    sqInt home;
    sqInt message;
    sqInt methClass;
    sqInt methodSel;
    sqInt meth;
    sqInt rcvr;
    sqInt classDict;
    sqInt classDictSize;
    sqInt currClass;
    sqInt done;
    sqInt i;
    sqInt methodArray;
    sqInt sz;
    sqInt header;
    sqInt ccIndex;
    sqInt oop1;
    sqInt ccIndex1;
    sqInt oop11;
    sqInt meth1;
    sqInt rcvr1;
    sqInt classDict1;
    sqInt classDictSize1;
    sqInt currClass1;
    sqInt done1;
    sqInt i1;
    sqInt methodArray1;
    sqInt sz1;
    sqInt header1;
    sqInt ccIndex2;
    sqInt oop12;

	ctxt = aContext;
	while (!(ctxt == foo->nilObj)) {
		if ((fetchClassOf(ctxt)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassBlockContext << (SHIFT_FOR_WORD))))) {
			home = longAt((ctxt + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
		} else {
			home = ctxt;
		}
		/* begin findClassOfMethod:forReceiver: */
		meth = longAt((home + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
		rcvr = longAt((home + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
		/* begin fetchClassOf: */
		if ((rcvr & 1)) {
			currClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
			goto l2;
		}
		ccIndex = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
		if (ccIndex == 0) {
			currClass = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
			goto l2;
		} else {
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
			currClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
			goto l2;
		}
	l2:	/* end fetchClassOf: */;
		done = 0;
		while (!(done)) {
			classDict = longAt((currClass + (BASE_HEADER_SIZE)) + (MessageDictionaryIndex << (SHIFT_FOR_WORD)));
			/* begin fetchWordLengthOf: */
			/* begin sizeBitsOf: */
			header = longAt(classDict);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(classDict - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
			classDictSize = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
			methodArray = longAt((classDict + (BASE_HEADER_SIZE)) + (MethodArrayIndex << (SHIFT_FOR_WORD)));
			i = 0;
			while (i < (classDictSize - SelectorStart)) {
				if (meth == (longAt((methodArray + (BASE_HEADER_SIZE)) + (i << (SHIFT_FOR_WORD))))) {
					methClass = currClass;
					goto l3;
				}
				i += 1;
			}
			currClass = longAt((currClass + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
			done = currClass == foo->nilObj;
		}
		/* begin fetchClassOf: */
		if ((rcvr & 1)) {
			methClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
			goto l3;
		}
		ccIndex1 = (((usqInt) (longAt(rcvr))) >> 12) & 0x1F;
		if (ccIndex1 == 0) {
			methClass = (longAt(rcvr - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
			goto l3;
		} else {
			/* begin fetchPointer:ofObject: */
			oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
			methClass = longAt((oop11 + (BASE_HEADER_SIZE)) + ((ccIndex1 - 1) << (SHIFT_FOR_WORD)));
			goto l3;
		}
		methClass = null;
	l3:	/* end findClassOfMethod:forReceiver: */;
		/* begin findSelectorOfMethod:forReceiver: */
		meth1 = longAt((home + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
		rcvr1 = longAt((home + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
		/* begin fetchClassOf: */
		if ((rcvr1 & 1)) {
			currClass1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
			goto l5;
		}
		ccIndex2 = (((usqInt) (longAt(rcvr1))) >> 12) & 0x1F;
		if (ccIndex2 == 0) {
			currClass1 = (longAt(rcvr1 - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
			goto l5;
		} else {
			/* begin fetchPointer:ofObject: */
			oop12 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
			currClass1 = longAt((oop12 + (BASE_HEADER_SIZE)) + ((ccIndex2 - 1) << (SHIFT_FOR_WORD)));
			goto l5;
		}
	l5:	/* end fetchClassOf: */;
		done1 = 0;
		while (!(done1)) {
			classDict1 = longAt((currClass1 + (BASE_HEADER_SIZE)) + (MessageDictionaryIndex << (SHIFT_FOR_WORD)));
			/* begin fetchWordLengthOf: */
			/* begin sizeBitsOf: */
			header1 = longAt(classDict1);
			if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
				sz1 = (longAt(classDict1 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l4;
			} else {
				sz1 = header1 & (SIZE_MASK);
				goto l4;
			}
		l4:	/* end sizeBitsOf: */;
			classDictSize1 = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
			methodArray1 = longAt((classDict1 + (BASE_HEADER_SIZE)) + (MethodArrayIndex << (SHIFT_FOR_WORD)));
			i1 = 0;
			while (i1 <= (classDictSize1 - SelectorStart)) {
				if (meth1 == (longAt((methodArray1 + (BASE_HEADER_SIZE)) + (i1 << (SHIFT_FOR_WORD))))) {
					methodSel = longAt((classDict1 + (BASE_HEADER_SIZE)) + ((i1 + SelectorStart) << (SHIFT_FOR_WORD)));
					goto l6;
				}
				i1 += 1;
			}
			currClass1 = longAt((currClass1 + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
			done1 = currClass1 == foo->nilObj;
		}
		methodSel = foo->nilObj;
	l6:	/* end findSelectorOfMethod:forReceiver: */;
		printNum(ctxt);
		print(" ");
		if (!(ctxt == home)) {
			print("[] in ");
		}
		printNameOfClasscount(methClass, 5);
		print(">");
		if (methodSel == foo->nilObj) {
			print("?");
		} else {
			printStringOf(methodSel);
		}
		if (methodSel == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SelectorDoesNotUnderstand << (SHIFT_FOR_WORD))))) {

			/* print arg message selector */

			message = longAt((home + (BASE_HEADER_SIZE)) + ((0 + TempFrameStart) << (SHIFT_FOR_WORD)));
			methodSel = longAt((message + (BASE_HEADER_SIZE)) + (MessageSelectorIndex << (SHIFT_FOR_WORD)));
			print(" ");
			printStringOf(methodSel);
		}
		/* begin cr */
		printf("\n");
		ctxt = longAt((ctxt + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
	}
	return null;
}


/*	Print n in hex,  in the form '    0x1234', padded to a width of 10 characters
	 in 32-bits ('0x' + 8 nibbles) or 18 characters in 64-bits ('0x' + 16 nibbles) */

sqInt printHex(sqInt n) {
    char buf[35];
    sqInt len;


	/* large enough for a 64-bit value in hex plus the null plus 16 spaces */

	memset(buf,' ',34);
	len = sprintf(buf + 2 + 2 * BYTES_PER_WORD, "0x%lx", (unsigned long)(n));
	printf("%s", buf + len);
	;
	return null;
}


/*	Details: The count argument is used to avoid a possible infinite recursion if classOop is a corrupted object. */

sqInt printNameOfClasscount(sqInt classOop, sqInt cnt) {
	if (cnt <= 0) {
		return print("bad class");
	}
	if ((sizeBitsOf(classOop)) == (7 * (BYTES_PER_WORD))) {

		/* (Metaclass instSize+1 * 4) */

		printNameOfClasscount(longAt((classOop + (BASE_HEADER_SIZE)) + (5 << (SHIFT_FOR_WORD))), cnt - 1);
		print(" class");
	} else {
		printStringOf(longAt((classOop + (BASE_HEADER_SIZE)) + (6 << (SHIFT_FOR_WORD))));
	}
	return null;
}


/*	For testing in Smalltalk, this method should be overridden in a subclass. */

sqInt printNum(sqInt n) {
	printf("%ld", (long) n);
	return null;
}

sqInt printStringOf(sqInt oop) {
    sqInt cnt;
    sqInt fmt;
    sqInt i;

	if ((oop & 1)) {
		return null;
	}
	fmt = (((usqInt) (longAt(oop))) >> 8) & 15;
	if (fmt < 8) {
		return null;
	}
	cnt = ((100 < (lengthOf(oop))) ? 100 : (lengthOf(oop)));
	i = 0;
	while (i < cnt) {
		/* begin printChar: */
		putchar(byteAt((oop + (BASE_HEADER_SIZE)) + i));
		i += 1;
	}
	return null;
}

sqInt printUnbalancedStack(sqInt primIdx) {
	print("Stack unbalanced after ");
	if (!foo->primFailCode) {
		print("successful primitive ");
	} else {
		print("failed primitive ");
	}
	printNum(primIdx);
	/* begin cr */
	printf("\n");
	return null;
}

sqInt push(sqInt object) {
register struct foo * foo = &fum;
    sqInt sp;

	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
	foo->stackPointer = sp;
	return null;
}

sqInt pushBool(sqInt trueOrFalse) {
register struct foo * foo = &fum;
    sqInt sp;
    sqInt sp1;

	if (trueOrFalse) {
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
		foo->stackPointer = sp;
	} else {
		/* begin push: */
		longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
		foo->stackPointer = sp1;
	}
	return null;
}

sqInt pushFloat(double f) {
register struct foo * foo = &fum;
    sqInt object;
    sqInt sp;

	/* begin push: */
	object = floatObjectOf(f);
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), object);
	foo->stackPointer = sp;
	return null;
}

sqInt pushInteger(sqInt integerValue) {
register struct foo * foo = &fum;
    sqInt sp;

	/* begin push: */
	longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), ((integerValue << 1) | 1));
	foo->stackPointer = sp;
	return null;
}


/*	Record the given object in a the remap buffer. Objects in this buffer are remapped when a compaction occurs. This facility is used by the interpreter to ensure that objects in temporary variables are properly remapped. */

sqInt pushRemappableOop(sqInt oop) {
register struct foo * foo = &fum;
	foo->remapBuffer[(foo->remapBufferCount += 1)] = oop;
	return null;
}


/*	Append aWord to aFile in this platforms 'natural' byte order.  (Bytes will be swapped, if
	necessary, when the image is read on a different platform.) Set primFailCode if the
	write fails. */

sqInt putLongtoFile(sqInt aWord, sqImageFile  aFile) {
register struct foo * foo = &fum;
    sqInt objectsWritten;

	objectsWritten = sqImageFileWrite(&aWord, sizeof(aWord), 1, aFile);
	/* begin success: */
	if (!(objectsWritten == 1)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	return null;
}


/*	Read an image from the given file stream, allocating the given amount of memory to its object heap. Fail if the image has an unknown format or requires more than the given amount of memory. */
/*	Details: This method detects when the image was stored on a machine with the opposite byte ordering from this machine and swaps the bytes automatically. Furthermore, it allows the header information to start 512 bytes into the file, since some file transfer programs for the Macintosh apparently prepend a Mac-specific header of this size. Note that this same 512 bytes of prefix area could also be used to store an exec command on Unix systems, allowing one to launch Smalltalk by invoking the image name as a command. */
/*	This code is based on C code by Ian Piumarta and Smalltalk code by Tim Rowledge. Many thanks to both of you!! */

sqInt readImageFromFileHeapSizeStartingAt(sqImageFile  f, usqInt desiredHeapSize, squeakFileOffsetType  imageOffset) {
register struct foo * foo = &fum;
    size_t  dataSize;
    sqInt headerSize;
    squeakFileOffsetType  headerStart;
    sqInt oldBaseAddr;
    sqInt swapBytes;
    sqInt oop;
    sqInt hash;
    sqInt flagsWord;

	swapBytes = checkImageVersionFromstartingAt(f, imageOffset);

	/* record header start position */

	headerStart = (sqImageFilePosition(f)) - (BYTES_PER_WORD);
	headerSize = getLongFromFileswap(f, swapBytes);
	dataSize = getLongFromFileswap(f, swapBytes);
	oldBaseAddr = getLongFromFileswap(f, swapBytes);
	/* begin setSpecialObjectsOop: */
	oop = getLongFromFileswap(f, swapBytes);
	foo->specialObjectsOop = oop;
	/* begin setLastHash: */
	hash = getLongFromFileswap(f, swapBytes);
	foo->lastHash = hash;
	foo->savedWindowSize = getLongFromFileswap(f, swapBytes);
	/* begin oldFormatFullScreenFlag: */
	flagsWord = getLongFromFileswap(f, swapBytes);
	foo->fullScreenFlag = flagsWord & 1;
	extraVMMemory = getLongFromFileswap(f, swapBytes);
	if (foo->lastHash == 0) {

		/* lastHash wasn't stored (e.g. by the cloner); use 999 as the seed */

		/* begin setLastHash: */
		foo->lastHash = 999;
	}
	allocateMemoryheapSize(dataSize, desiredHeapSize);
	sqImageFileSeek(f, headerStart + headerSize);
	snapshotMemoryReadsize(f, dataSize);
	swapBytesAndPrepareToInterpretoldBaseAddr(swapBytes, oldBaseAddr);
	return dataSize;
}


/*	Anwer true if images of the given format are readable by this interpreter. Allows
	a virtual machine to accept selected older image formats.  In our case we can
	select a newer (closure) image format as well as the existing format. Images with
	platform-ordered floats (StackInterpreter and Cog format) are readable but will be
	converted to traditional word ordering. */

sqInt readableFormat(sqInt imageVersion) {
	if ((BYTES_PER_WORD) == 4) {
		return ((imageVersion == 6502) || (imageVersion == 6504)) || (imageVersion == 6505);
	} else {
		return ((imageVersion == 68000) || (imageVersion == 68002)) || (imageVersion == 68003);
	}
	return null;
}


/*	callbackContext is an activation of invokeCallback:stack:registers:jmpbuf:.  Its sender
	 is the interpreter's state prior to the callback.  Reestablish that state. */

EXPORT(sqInt) reestablishContextPriorToCallback(sqInt callbackContext) {
register struct foo * foo = &fum;
    sqInt calloutContext;
    sqInt tmp;
    sqInt valuePointer;

	if ((fetchClassOf(callbackContext)) != (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassMethodContext << (SHIFT_FOR_WORD))))) {
		return 0;
	}
	calloutContext = longAt((callbackContext + (BASE_HEADER_SIZE)) + (SenderIndex << (SHIFT_FOR_WORD)));
	/* begin newActiveContext: */
	/* begin storeContextRegisters: */
	longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
	longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
	if ((((usqInt) calloutContext)) < (((usqInt) foo->youngStart))) {
		beRootIfOld(calloutContext);
	}
	foo->activeContext = calloutContext;
	/* begin fetchContextRegisters: */
	tmp = longAt((calloutContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	if ((tmp & 1)) {
		tmp = longAt((calloutContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
		if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
			beRootIfOld(tmp);
		}
	} else {
		tmp = calloutContext;
	}
	foo->theHomeContext = tmp;
	foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
	foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	tmp = ((longAt((calloutContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->instructionPointer = ((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2;
	tmp = ((longAt((calloutContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->stackPointer = (calloutContext + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD));
	return 1;
}


/*	Map the given oop to its new value during a compaction or 
	become: operation. If it has no forwarding table entry, 
	return the oop itself. */

sqInt remap(sqInt oop) {
register struct foo * foo = &fum;
    sqInt fwdBlock;

	if (((oop & 1) == 0) && (((longAt(oop)) & (MARK_BIT)) != 0)) {

		/* get the new value for oop from its forwarding block */

		fwdBlock = ((longAt(oop)) & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
		if (DoAssertionChecks) {
			/* begin fwdBlockValidate: */
			if (!(((((usqInt) fwdBlock)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock & 3) == 0)))) {
				error("invalid fwd table entry");
			}
		}
		return longAt(fwdBlock);
	}
	return oop;
}


/*	Remove the first process from the given linked list. */

sqInt removeFirstLinkOfList(sqInt aList) {
register struct foo * foo = &fum;
    sqInt first;
    sqInt last;
    sqInt next;

	first = longAt((aList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)));
	last = longAt((aList + (BASE_HEADER_SIZE)) + (LastLinkIndex << (SHIFT_FOR_WORD)));
	if (first == last) {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) aList)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(aList, foo->nilObj);
		}
		longAtput((aList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)), foo->nilObj);
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) aList)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(aList, foo->nilObj);
		}
		longAtput((aList + (BASE_HEADER_SIZE)) + (LastLinkIndex << (SHIFT_FOR_WORD)), foo->nilObj);
	} else {
		next = longAt((first + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) aList)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(aList, next);
		}
		longAtput((aList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)), next);
	}
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) first)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(first, foo->nilObj);
	}
	longAtput((first + (BASE_HEADER_SIZE)) + (NextLinkIndex << (SHIFT_FOR_WORD)), foo->nilObj);
	return first;
}


/*	Remove the given variable location to the extra roots table */

EXPORT(sqInt) removeGCRoot(sqInt *varLoc) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt *root;

	for (i = 1; i <= foo->extraRootCount; i++) {
		root = foo->extraRoots[i];
		if (root == varLoc) {

			/* swap varLoc with last entry */

			foo->extraRoots[i] = (foo->extraRoots[foo->extraRootCount]);
			foo->extraRootCount -= 1;
			return 1;
		}
	}
	return 0;
}


/*	Restore the original header of the given oop from its 
	forwarding block. */

sqInt restoreHeaderOf(sqInt oop) {
register struct foo * foo = &fum;
    sqInt fwdBlock;
    sqInt fwdHeader;

	fwdHeader = longAt(oop);
	fwdBlock = (fwdHeader & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
	if (DoAssertionChecks) {
		if ((fwdHeader & (MARK_BIT)) == 0) {
			error("attempting to restore the header of an object that has no forwarding block");
		}
		/* begin fwdBlockValidate: */
		if (!(((((usqInt) fwdBlock)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock & 3) == 0)))) {
			error("invalid fwd table entry");
		}
	}
	longAtput(oop, longAt(fwdBlock + (BYTES_PER_WORD)));
	return null;
}


/*	Restore headers smashed by forwarding links */

sqInt restoreHeadersFromtofromandtofrom(sqInt firstIn, sqInt lastIn, sqInt hdrBaseIn, sqInt firstOut, sqInt lastOut, sqInt hdrBaseOut) {
register struct foo * foo = &fum;
    sqInt header;
    sqInt oop;
    sqInt tablePtr;
    sqInt sz;
    sqInt header1;

	tablePtr = firstIn;
	while ((((usqInt) tablePtr)) <= (((usqInt) lastIn))) {
		oop = longAt(tablePtr);
		header = longAt(hdrBaseIn + (tablePtr - firstIn));
		longAtput(oop, header);
		tablePtr += BYTES_PER_WORD;
	}
	tablePtr = firstOut;
	while ((((usqInt) tablePtr)) <= (((usqInt) lastOut))) {
		oop = longAt(tablePtr);
		header = longAt(hdrBaseOut + (tablePtr - firstOut));
		longAtput(oop, header);
		tablePtr += BYTES_PER_WORD;
	}
	oop = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) oop)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
			longAtput(oop, (longAt(oop)) & (ALL_BUT_MARK_BIT));
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header1 = longAt(oop);
			if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header1 & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
		}
		oop = (oop + sz) + (foo->headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
	}
	return null;
}


/*	Make aProcess runnable and if its priority is higher than  that of the
	 current process, preempt the current process.   Answer if the current
	 process was preempted.  If the current process was preempted then if
	 yieldImplicitly add the current process to the back of its run queue,
	 causing an implicit yiled to other processes on the run queue,  otherwise
	 add the current process to the front of its run queue, hence not yielding.
	 Blue book behaviour is to yield implicitly but is arguably incorrect. */

sqInt resumepreemptedYieldingIf(sqInt aProcess, sqInt yieldImplicitly) {
register struct foo * foo = &fum;
    sqInt activePriority;
    sqInt activeProc;
    sqInt newPriority;
    sqInt oop;
    sqInt oop1;
    sqInt priority;
    sqInt processList;
    sqInt processLists;
    sqInt oop2;
    sqInt oop11;
    sqInt priority1;
    sqInt processList1;
    sqInt processLists1;
    sqInt oop3;
    sqInt oop12;

	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	activePriority = ((longAt((activeProc + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
	newPriority = ((longAt((aProcess + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
	if (newPriority <= activePriority) {
		/* begin putToSleep:yieldingIf: */
		priority = ((longAt((aProcess + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
		/* begin fetchPointer:ofObject: */
		/* begin fetchPointer:ofObject: */
		oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
		oop2 = longAt((oop11 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
		processLists = longAt((oop2 + (BASE_HEADER_SIZE)) + (ProcessListsIndex << (SHIFT_FOR_WORD)));
		processList = longAt((processLists + (BASE_HEADER_SIZE)) + ((priority - 1) << (SHIFT_FOR_WORD)));
		if (1) {
			addLastLinktoList(aProcess, processList);
		} else {
			addFirstLinktoList(aProcess, processList);
		}
		return 0;
	}
	/* begin putToSleep:yieldingIf: */
	priority1 = ((longAt((activeProc + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop12 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop3 = longAt((oop12 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	processLists1 = longAt((oop3 + (BASE_HEADER_SIZE)) + (ProcessListsIndex << (SHIFT_FOR_WORD)));
	processList1 = longAt((processLists1 + (BASE_HEADER_SIZE)) + ((priority1 - 1) << (SHIFT_FOR_WORD)));
	if (yieldImplicitly) {
		addLastLinktoList(activeProc, processList1);
	} else {
		addFirstLinktoList(activeProc, processList1);
	}
	transferTo(aProcess);
	return 1;
}


/*	Reverse the given range of Display words (at different bit 
	depths, this will reverse different numbers of pixels). Used to 
	give feedback during VM activities such as garbage 
	collection when debugging. It is assumed that the given 
	word range falls entirely within the first line of the Display. */

sqInt reverseDisplayFromto(sqInt startIndex, sqInt endIndex) {
register struct foo * foo = &fum;
    sqInt dispBitsPtr;
    sqInt displayObj;
    sqInt ptr;
    sqInt reversed;
    sqInt w;

	displayObj = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (TheDisplay << (SHIFT_FOR_WORD)));
	if (!((((displayObj & 1) == 0) && (((((usqInt) (longAt(displayObj))) >> 8) & 15) <= 4)) && ((lengthOf(displayObj)) >= 4))) {
		return null;
	}
	w = fetchIntegerofObject(1, displayObj);
	dispBitsPtr = longAt((displayObj + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
	if ((dispBitsPtr & 1)) {
		return null;
	}
	dispBitsPtr += BASE_HEADER_SIZE;
	for (ptr = (dispBitsPtr + (startIndex * 4)); ptr <= (dispBitsPtr + (endIndex * 4)); ptr += 4) {
		reversed = (long32At(ptr)) ^ 0xFFFFFFFFU;
		longAtput(ptr, reversed);
	}
	/* begin initPrimCall */
	foo->primFailCode = 0;
	displayBitsOfLeftTopRightBottom(displayObj, 0, 0, w, 1);
	ioForceDisplayUpdate();
	return null;
}


/*	Rewrite the cache entry with the given primitive index and matching function pointer */

sqInt rewriteMethodCacheSelclassprimIndex(sqInt selector, sqInt class, sqInt localPrimIndex) {
    void (*primPtr)(void);

	if (localPrimIndex == 0) {
		primPtr = 0;
	} else {
		primPtr = primitiveTable[localPrimIndex];
	}
	rewriteMethodCacheSelclassprimIndexprimFunction(selector, class, localPrimIndex, primPtr);
	return null;
}


/*	Rewrite an existing entry in the method cache with a new primitive 
	index & function address. Used by primExternalCall to make direct jumps to found external prims */

sqInt rewriteMethodCacheSelclassprimIndexprimFunction(sqInt selector, sqInt class, sqInt localPrimIndex, void (*localPrimAddress)(void)) {
register struct foo * foo = &fum;
    sqInt hash;
    sqInt p;
    sqInt probe;

	hash = selector ^ class;
	for (p = 0; p <= (CacheProbeMax - 1); p += 1) {
		probe = (((usqInt) hash) >> p) & MethodCacheMask;
		if (((foo->methodCache[probe + MethodCacheSelector]) == selector) && ((foo->methodCache[probe + MethodCacheClass]) == class)) {
			foo->methodCache[probe + MethodCachePrim] = localPrimIndex;
			foo->methodCache[probe + MethodCachePrimFunction] = (((long) localPrimAddress));
			return null;
		}
	}
	return null;
}


/*	Send the 4 argument callback message invokeCallback:stack:registers:jmpbuf:
	 to Alien class with the supplied args.  The arguments are raw C addresses
	 and are converted to integer objects on the way. */

EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr) {
register struct foo * foo = &fum;
    sqInt where;
    sqInt oop;
    sqInt oop1;
    sqInt oop2;
    sqInt oop3;
    sqInt i;
    sqInt initialIP;
    sqInt methodHeader;
    sqInt needsLarge;
    sqInt newContext;
    sqInt tempCount;
    sqInt where1;
    sqInt tmp;
    sqInt ccIndex;
    sqInt oop11;
    sqInt valuePointer;

	/* begin pushRemappableOop: */
	oop = positive32BitIntegerFor(jmpBufPtr);
	foo->remapBuffer[(foo->remapBufferCount += 1)] = oop;
	/* begin pushRemappableOop: */
	oop1 = positive32BitIntegerFor(regsPtr);
	foo->remapBuffer[(foo->remapBufferCount += 1)] = oop1;
	/* begin pushRemappableOop: */
	oop2 = positive32BitIntegerFor(stackPtr);
	foo->remapBuffer[(foo->remapBufferCount += 1)] = oop2;
	/* begin pushRemappableOop: */
	oop3 = positive32BitIntegerFor(thunkPtr);
	foo->remapBuffer[(foo->remapBufferCount += 1)] = oop3;
	foo->receiver = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassAlien << (SHIFT_FOR_WORD)));
	/* begin fetchClassOfNonInt: */
	ccIndex = (((usqInt) (longAt(foo->receiver))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		foo->lkupClass = (longAt(foo->receiver - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		foo->lkupClass = longAt((oop11 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOfNonInt: */;
	foo->messageSelector = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (InvokeCallbackSelector << (SHIFT_FOR_WORD)));
	if (!(lookupInMethodCacheSelclass(foo->messageSelector, foo->lkupClass))) {
		if (!(lookupMethodNoMNUEtcInClass(foo->lkupClass))) {
			return 0;
		}
	}
	if (foo->primitiveIndex != 0) {
		return 0;
	}
	/* begin storeContextRegisters: */
	longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
	longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
	/* begin internalJustActivateNewMethod */
	methodHeader = longAt((foo->newMethod + (BASE_HEADER_SIZE)) + (HeaderIndex << (SHIFT_FOR_WORD)));
	needsLarge = methodHeader & LargeContextBit;
	if ((needsLarge == 0) && (foo->freeContexts != NilContext)) {
		newContext = foo->freeContexts;
		/* begin setFreeContextsAfter: */
		foo->freeContexts = longAt((newContext + (BASE_HEADER_SIZE)) + (0 << (SHIFT_FOR_WORD)));
	} else {
		newContext = allocateOrRecycleContext(needsLarge);
	}
	initialIP = ((LiteralStart + ((((usqInt) methodHeader) >> 10) & 0xFF)) * (BYTES_PER_WORD)) + 1;
	tempCount = (((usqInt) methodHeader) >> 19) & 0x3F;
	where1 = newContext + (BASE_HEADER_SIZE);
	longAtput(where1 + (SenderIndex << (SHIFT_FOR_WORD)), foo->activeContext);
	longAtput(where1 + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((initialIP << 1) | 1));
	longAtput(where1 + (StackPointerIndex << (SHIFT_FOR_WORD)), ((tempCount << 1) | 1));
	longAtput(where1 + (MethodIndex << (SHIFT_FOR_WORD)), foo->newMethod);
	longAtput(where1 + (ReceiverIndex << (SHIFT_FOR_WORD)), foo->receiver);
	needsLarge = foo->nilObj;
	for (i = (ReceiverIndex + 1); i <= (tempCount + ReceiverIndex); i += 1) {
		longAtput(where1 + (i << (SHIFT_FOR_WORD)), needsLarge);
	}
	foo->reclaimableContextCount += 1;
	foo->activeContext = newContext;
	where = (foo->activeContext + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD));
	longAtput(where + (1 << (SHIFT_FOR_WORD)), popRemappableOop());
	longAtput(where + (2 << (SHIFT_FOR_WORD)), popRemappableOop());
	longAtput(where + (3 << (SHIFT_FOR_WORD)), popRemappableOop());
	longAtput(where + (4 << (SHIFT_FOR_WORD)), popRemappableOop());
	/* begin fetchContextRegisters: */
	tmp = longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	if ((tmp & 1)) {
		tmp = longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
		if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
			beRootIfOld(tmp);
		}
	} else {
		tmp = foo->activeContext;
	}
	foo->theHomeContext = tmp;
	foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
	foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	tmp = ((longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->instructionPointer = ((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2;
	tmp = ((longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->stackPointer = (foo->activeContext + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD));
	callInterpreter();
	return 1;
}

sqInt setCompilerInitialized(sqInt newFlag) {
register struct foo * foo = &fum;
    sqInt oldFlag;

	oldFlag = foo->compilerInitialized;
	foo->compilerInitialized = newFlag;
	return oldFlag;
}

sqInt setFullScreenFlag(sqInt value) {
	foo->fullScreenFlag = value;
	return null;
}

sqInt setInterruptCheckCounter(sqInt value) {
	foo->interruptCheckCounter = value;
	return null;
}

sqInt setInterruptKeycode(sqInt value) {
	foo->interruptKeycode = value;
	return null;
}

sqInt setInterruptPending(sqInt value) {
	foo->interruptPending = value;
	return null;
}


/*	Set Mac file type and creator; this is a noop on other platforms */

sqInt setMacFileTypeForImageFile(void) {
    void *setMacType;

	setMacType = ioLoadFunctionFrom("setMacFileTypeAndCreator", "FilePlugin");
	if (!(setMacType == 0)) {
		((sqInt (*)(char *, char *, char *))setMacType)(imageName, "STim", "FAST");
	}
	return null;
}


/*	Set memory limits, assuming that previously allocated heap space is sufficient.
	Use this instead of allocateMemory: dataSize heapSize: desiredHeapSize when
	resuming the interpreter in a new inage snapshot using previously allocated
	heap memory. */

sqInt setMemoryLimitsheapSize(size_t  dataSize, usqInt heapSize) {
    sqInt minimumMemory;

	minimumMemory = dataSize + 100000;
	if (heapSize < minimumMemory) {

		/* try to make more space */

		growObjectMemory(minimumMemory - heapSize);
		if (heapSize < minimumMemory) {
			insufficientMemorySpecifiedError();
		}
	}
	/* begin setEndOfMemory: */
	foo->endOfMemory = memory + dataSize;
	return null;
}


/*	A default substitute for unimplemented ioUtcWithOffset external function. */

sqInt setMicroSecondsandOffset(sqLong *microSeconds, int *utcOffset) {
	flag("toRemove");
	return -1;
}

sqInt setNextWakeupTick(sqInt value) {
	foo->nextWakeupTick = value;
	return null;
}

sqInt setSavedWindowSize(sqInt value) {
	foo->savedWindowSize = value;
	return null;
}


/*	Reduce the number if indexable fields in obj, a pointer object, to nSlots. Convert the
	unused residual to a free chunk. Word and byte indexable objects are not changed.
	Answer the number of bytes returned to free memory, which may be zero if no change
	was possible. */

sqInt shortentoIndexableSize(sqInt obj, sqInt nSlots) {
register struct foo * foo = &fum;
    sqInt deltaBytes;
    sqInt desiredLength;
    sqInt fixedFields;
    sqInt fmt;
    sqInt hdr;
    sqInt indexableFields;
    sqInt totalLength;
    sqInt sz;
    sqInt class;
    sqInt classFormat;
    sqInt ccIndex;
    sqInt oop1;

	if (!(((((usqInt) (longAt(obj))) >> 8) & 15) <= 4)) {
		return 0;
	}
	if (!(nSlots > 0)) {
		return 0;
	}
	hdr = longAt(obj);
	fmt = (((usqInt) hdr) >> 8) & 15;
	/* begin lengthOf:baseHeader:format: */
	if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(obj - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = hdr & (SIZE_MASK);
	}
	sz -= hdr & (SIZE_4_BIT);
	if (fmt <= 4) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l1;
	}
	if (fmt < 8) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l1;
	} else {
		totalLength = (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
		goto l1;
	}
l1:	/* end lengthOf:baseHeader:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt > 4) || (fmt == 2)) {
		fixedFields = 0;
		goto l2;
	}
	if (fmt < 2) {
		fixedFields = totalLength;
		goto l2;
	}
	/* begin fetchClassOf: */
	if ((obj & 1)) {
		class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l3;
	}
	ccIndex = (((usqInt) (longAt(obj))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		class = (longAt(obj - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l3;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l3;
	}
l3:	/* end fetchClassOf: */;
	classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
l2:	/* end fixedFieldsOf:format:length: */;
	indexableFields = totalLength - fixedFields;
	if (nSlots >= indexableFields) {
		return 0;
	}
	desiredLength = fixedFields + nSlots;
	deltaBytes = (totalLength - desiredLength) * (BYTES_PER_WORD);
	/* begin setSizeOfFree:to: */
	longAtput((obj + (BASE_HEADER_SIZE)) + (desiredLength * (BYTES_PER_WORD)), (deltaBytes & (ALL_BUT_TYPE_MASK)) | HeaderTypeFree);
	
	switch ((longAt(obj)) & TypeMask) {
	case HeaderTypeSizeAndClass:
				longAtput(obj - ((BASE_HEADER_SIZE) * 2), (longAt(obj - ((BYTES_PER_WORD) * 2))) - deltaBytes);
		break;
	case HeaderTypeClass:
	case HeaderTypeShort:
				longAtput(obj, (((hdr | (SIZE_MASK)) - (SIZE_MASK))) | ((hdr & (SIZE_MASK)) - deltaBytes));
		break;
	default:
		error("Case not found and no otherwise clause");
	}
	return deltaBytes;
}


/*	Repaint the portion of the Smalltalk screen bounded by the affected rectangle. Used to synchronize the screen after a Bitblt to the Smalltalk Display object. */

sqInt showDisplayBitsLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b) {
	if (foo->deferDisplayUpdates) {
		return null;
	}
	displayBitsOfLeftTopRightBottom(aForm, l, t, r, b);
	return null;
}


/*	Record the given semaphore index in the double buffer semaphores array to be signaled at the next convenient moment. Force a real interrupt check as soon as possible. */

sqInt signalSemaphoreWithIndex(sqInt index) {
register struct foo * foo = &fum;
	if (index <= 0) {
		return null;
	}
	if (foo->semaphoresUseBufferA) {
		if (foo->semaphoresToSignalCountA < SemaphoresToSignalSize) {
			foo->semaphoresToSignalCountA += 1;
			foo->semaphoresToSignalA[foo->semaphoresToSignalCountA] = index;
		}
	} else {
		if (foo->semaphoresToSignalCountB < SemaphoresToSignalSize) {
			foo->semaphoresToSignalCountB += 1;
			foo->semaphoresToSignalB[foo->semaphoresToSignalCountB] = index;
		}
	}
	/* begin forceInterruptCheck */
	foo->interruptCheckCounter = -1000;
	foo->nextPollTick = 0;
	return null;
}


/*	Return a full 32 bit integer object for the given integer value */

sqInt signed32BitIntegerFor(int integerValue) {
register struct foo * foo = &fum;
    sqInt largeClass;
    sqInt newLargeInteger;
    sqInt value;

	if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
		(((((int) integerValue)) ^ ((((int) integerValue)) << 1)) >= 0)
# else
		((integerValue >= -1073741824) && (integerValue <= 0x3FFFFFFF))
# endif  // SQ_HOST32
	) {
		return ((integerValue << 1) | 1);
	}
	if (integerValue < 0) {
		largeClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargeNegativeInteger << (SHIFT_FOR_WORD)));
		value = 0 - integerValue;
	} else {
		largeClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD)));
		value = integerValue;
	}
	newLargeInteger = instantiateClassindexableSize(largeClass, 4);
	byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + 3, (((usqInt) value) >> 24) & 0xFF);
	byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + 2, (((usqInt) value) >> 16) & 0xFF);
	byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + 1, (((usqInt) value) >> 8) & 0xFF);
	byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + 0, value & 0xFF);
	return newLargeInteger;
}


/*	Convert the given object into an integer value.
	The object may be either a positive ST integer or a four-byte LargeInteger. */

int signed32BitValueOf(sqInt oop) {
register struct foo * foo = &fum;
    sqInt largeClass;
    sqInt negative;
    int value;
    sqInt ccIndex;
    sqInt oop1;

	if ((oop & 1)) {
		return (oop >> 1);
	}
	if ((lengthOf(oop)) > 4) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	/* begin fetchClassOf: */
	if ((oop & 1)) {
		largeClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l1;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		largeClass = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l1;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		largeClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l1;
	}
l1:	/* end fetchClassOf: */;
	if (largeClass == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD))))) {
		negative = 0;
	} else {
		if (largeClass == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargeNegativeInteger << (SHIFT_FOR_WORD))))) {
			negative = 1;
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
	}
	if ((lengthOf(oop)) != 4) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}

	/* Fail if value exceeds range of a 32-bit twos-complement signed integer. */

	value = (((byteAt((oop + (BASE_HEADER_SIZE)) + 0)) + ((byteAt((oop + (BASE_HEADER_SIZE)) + 1)) << 8)) + ((byteAt((oop + (BASE_HEADER_SIZE)) + 2)) << 16)) + ((byteAt((oop + (BASE_HEADER_SIZE)) + 3)) << 24);
	if (negative) {

		/* perform subtraction using unsigned int to prevent undefined result
				for optimizing C compilers in the case of value = 16r80000000 */

		value = 0 - (((unsigned int) value));
		if (value >= 0) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
	} else {
		if (value < 0) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
	}
	return value;
}


/*	Return a Large Integer object for the given integer value */

sqInt signed64BitIntegerFor(sqLong integerValue) {
register struct foo * foo = &fum;
    usqInt highWord;
    sqInt i;
    sqInt intValue;
    sqInt largeClass;
    unsigned sqLong magnitude;
    sqInt newLargeInteger;
    sqInt sz;

	if (integerValue < 0) {
		largeClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargeNegativeInteger << (SHIFT_FOR_WORD)));
		magnitude = 0 - integerValue;
	} else {
		largeClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD)));
		magnitude = integerValue;
	}
	if (magnitude <= 0x7FFFFFFFU) {
		return signed32BitIntegerFor(integerValue);
	}
	highWord = magnitude >> 32;
	if (highWord == 0) {
		sz = 4;
	} else {
		sz = 5;
		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
			sz += 1;
		}
		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
			sz += 1;
		}
		if (!(((highWord = ((usqInt) highWord) >> 8)) == 0)) {
			sz += 1;
		}
	}
	newLargeInteger = instantiateClassindexableSize(largeClass, sz);
	for (i = 0; i <= (sz - 1); i += 1) {
		intValue = (magnitude >> (i * 8)) & 255;
		byteAtput((newLargeInteger + (BASE_HEADER_SIZE)) + i, intValue);
	}
	return newLargeInteger;
}


/*	Convert the given object into an integer value.
	The object may be either a positive ST integer or a eight-byte LargeInteger. */

sqLong signed64BitValueOf(sqInt oop) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt largeClass;
    sqInt negative;
    sqInt sz;
    sqInt szsqLong;
    sqLong value;
    sqInt header;
    sqInt sz1;
    sqInt ccIndex;
    sqInt oop1;

	if ((oop & 1)) {
		return ((sqLong) ((oop >> 1)));
	}
	/* begin lengthOf: */
	header = longAt(oop);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz1 = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz1 = header & (SIZE_MASK);
	}
	sz1 -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l1;
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		sz = ((usqInt) (sz1 - (BASE_HEADER_SIZE))) >> 2;
		goto l1;
	} else {
		sz = (sz1 - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
		goto l1;
	}
l1:	/* end lengthOf:baseHeader:format: */;
	if (sz > 8) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	/* begin fetchClassOf: */
	if ((oop & 1)) {
		largeClass = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l2;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		largeClass = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l2;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		largeClass = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l2;
	}
l2:	/* end fetchClassOf: */;
	if (largeClass == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargePositiveInteger << (SHIFT_FOR_WORD))))) {
		negative = 0;
	} else {
		if (largeClass == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassLargeNegativeInteger << (SHIFT_FOR_WORD))))) {
			negative = 1;
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
	}
	szsqLong = sizeof(sqLong);
	if (sz > szsqLong) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	value = 0;
	for (i = 0; i <= (sz - 1); i += 1) {
		value += (((sqLong) (byteAt((oop + (BASE_HEADER_SIZE)) + i)))) << (i * 8);
	}
	if (negative) {

		/* perform subtraction using unsigned usqLong to prevent undefined result
				for optimizing C compilers in the case of value = 16r8000000000000000 */

		value = 0 - (((usqLong) value));
		if (value >= 0) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
	} else {
		if (value < 0) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
	}
	return value;
}


/*	Answer the number of bytes in the given object, including its base header, rounded up to an integral number of words. */
/*	Note: byte indexable objects need to have low bits subtracted from this size. */

sqInt sizeBitsOf(sqInt oop) {
    sqInt header;

	header = longAt(oop);
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		return (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		return header & (SIZE_MASK);
	}
	return null;
}


/*	Return the number of indexable fields of the given object. This method is to be called from an automatically generated C primitive. The argument is assumed to be a pointer to the first indexable field of a words or bytes object; the object header starts 4 bytes before that. */
/*	Note: Only called by translated primitive code. */

sqInt sizeOfSTArrayFromCPrimitive(void *cPtr) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt header;
    sqInt sz;

	oop = (oopForPointer(((char *) cPtr))) - (BASE_HEADER_SIZE);
	if (!(((oop & 1) == 0) && (isWordsOrBytesNonInt(oop)))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return 0;
	}
	/* begin lengthOf: */
	header = longAt(oop);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = header & (SIZE_MASK);
	}
	sz -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		return ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		return ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
	} else {
		return (sz - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
	}
	return null;
}


/*	Returns the number of slots in the receiver.
	If the receiver is a byte object, return the number of bytes.
	Otherwise return the number of words. */

sqInt slotSizeOf(sqInt oop) {
    sqInt header;
    sqInt sz;

	if ((oop & 1)) {
		return 0;
	}
	/* begin lengthOf: */
	header = longAt(oop);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = header & (SIZE_MASK);
	}
	sz -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		return ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		return ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
	} else {
		return (sz - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
	}
	return null;
}

sqInt snapshot(sqInt embedded) {
register struct foo * foo = &fum;
    sqInt dataSize;
    sqInt rcvr;
    sqInt top;
    sqInt sp;
    sqInt sp1;
    sqInt sp2;
    sqInt activeProc;
    sqInt oop;
    sqInt oop1;
    sqInt valuePointer;
    sqInt fmt;
    sqInt header;
    sqInt i;
    sqInt oop2;
    sqInt sz;
    sqInt header1;
    sqInt i1;
    sqInt oop11;
    sqInt sz1;
    sqInt header2;

	/* begin prepareForSnapshot */
	if (foo->compilerInitialized) {
		compilerPreSnapshot();
	} else {
		/* begin storeContextRegisters: */
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
	}
	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) activeProc)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(activeProc, (sqInt)foo->activeContext);
	}
	longAtput((activeProc + (BASE_HEADER_SIZE)) + (SuspendedContextIndex << (SHIFT_FOR_WORD)), foo->activeContext);
	incrementalGC();
	fullGC();
	/* begin snapshotCleanUp */
	oop2 = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) oop2)) < (((usqInt) foo->endOfMemory))) {
		if (!(((longAt(oop2)) & TypeMask) == HeaderTypeFree)) {
			header = longAt(oop2);
			fmt = (((usqInt) header) >> 8) & 15;
			if ((fmt == 3) && ((((((usqInt) header) >> 12) & 0x1F) == 13) || ((((((usqInt) header) >> 12) & 0x1F) == 14) || (((((usqInt) header) >> 12) & 0x1F) == 4)))) {
				/* begin sizeBitsOf: */
				header1 = longAt(oop2);
				if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
					sz = (longAt(oop2 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
					goto l1;
				} else {
					sz = header1 & (SIZE_MASK);
					goto l1;
				}
			l1:	/* end sizeBitsOf: */;
				for (i = ((lastPointerOf(oop2)) + (BYTES_PER_WORD)); i <= (sz - (BASE_HEADER_SIZE)); i += (BYTES_PER_WORD)) {
					longAtput(oop2 + i, foo->nilObj);
				}
			}
			if (fmt >= 12) {
				if ((primitiveIndexOf(oop2)) == PrimitiveExternalCallIndex) {
					flushExternalPrimitiveOf(oop2);
				}
			}
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) oop2)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(oop2)) & TypeMask) == HeaderTypeFree) {
			sz1 = (longAt(oop2)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header2 = longAt(oop2);
			if ((header2 & TypeMask) == HeaderTypeSizeAndClass) {
				sz1 = (longAt(oop2 - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l2;
			} else {
				sz1 = header2 & (SIZE_MASK);
				goto l2;
			}
		l2:	/* end sizeBitsOf: */;
		}
		oop2 = (oop2 + sz1) + (foo->headerTypeBytes[(longAt(oop2 + sz1)) & TypeMask]);
	}
	/* begin clearRootsTable */
	for (i1 = 1; i1 <= foo->rootTableCount; i1 += 1) {
		oop11 = foo->rootTable[i1];
		longAtput(oop11, (longAt(oop11)) & (ALL_BUT_ROOT_BIT));
		foo->rootTable[i1] = 0;
	}
	foo->rootTableCount = 0;
	dataSize = foo->freeBlock - memory;
	if (!foo->primFailCode) {
		/* begin popStack */
		top = longAt(foo->stackPointer);
		foo->stackPointer -= BYTES_PER_WORD;
		rcvr = top;
		/* begin push: */
		longAtput((sp = foo->stackPointer + (BYTES_PER_WORD)), foo->trueObj);
		foo->stackPointer = sp;
		writeImageFileIOembedded(dataSize, embedded);
		/* begin pop: */
		foo->stackPointer -= 1 * (BYTES_PER_WORD);
	}
	beRootIfOld((sqInt)foo->activeContext);
	if (!foo->primFailCode) {
		/* begin push: */
		longAtput((sp1 = foo->stackPointer + (BYTES_PER_WORD)), foo->falseObj);
		foo->stackPointer = sp1;
	} else {
		/* begin push: */
		longAtput((sp2 = foo->stackPointer + (BYTES_PER_WORD)), rcvr);
		foo->stackPointer = sp2;
	}
	if (foo->compilerInitialized) {
		compilerPostSnapshot();
	}
	return null;
}


/*	Read the object memory data from a snapshot file into a previously allocated memory space. */

usqInt snapshotMemoryReadsize(sqImageFile  imageFile, size_t  dataSize) {
    sqInt bytesRead;

	bytesRead = sqImageFileReadEntireImage(pointerForOop(memory), sizeof(unsigned char), dataSize, imageFile);
	if (bytesRead != dataSize) {
		unableToReadImageError();
	}
	return bytesRead;
}


/*	Arrange for the interpreter to resume execution from a snapshot of saved
	memory and interpreter state. The current object memory and interpreter
	state is discarded, and the interpreter resumes execution at the point of
	the supplied image snapshot. */

usqInt snapshotResumeheapSizeswapBytesoldBaseAddrspecialObjectsOoplastHashsavedWindowSizefullScreenFlagextraVMMemory(sqInt byteArrayOrBitmap, usqInt desiredHeapSize, sqInt swapBytes, sqInt oldBaseAddr, sqInt specialObjects, sqInt hashValue, sqInt windowSize, sqInt fullScreen, sqInt extraMemory) {
register struct foo * foo = &fum;
    size_t  dataSize;
    char *mem;
    char *sourceBytes;
    sqInt slots;
    sqInt header;
    sqInt sz;


	/* Notes - The parameters windowSize, fullScreen and extraMemory are currently
	not used when resuming the VM in a new image. The display size and fullscreen
	mode are probably best set from the image by calling primitiveSetDisplayMode
	prior to primitiveResumeFromSnapshot. The extraMemory parameter is ignored
	here because we are simply copying the new object memory over a previously
	allocated heap space. */

	/* begin byteSizeOf: */
	flag("Dan");
	if ((byteArrayOrBitmap & 1)) {
		dataSize = 0;
		goto l3;
	}
	/* begin slotSizeOf: */
	if ((byteArrayOrBitmap & 1)) {
		slots = 0;
		goto l1;
	}
	/* begin lengthOf: */
	header = longAt(byteArrayOrBitmap);
	/* begin lengthOf:baseHeader:format: */
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(byteArrayOrBitmap - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = header & (SIZE_MASK);
	}
	sz -= header & (SIZE_4_BIT);
	if (((((usqInt) header) >> 8) & 15) <= 4) {
		slots = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l2;
	}
	if (((((usqInt) header) >> 8) & 15) < 8) {
		slots = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l2;
	} else {
		slots = (sz - (BASE_HEADER_SIZE)) - (((((usqInt) header) >> 8) & 15) & 3);
		goto l2;
	}
l2:	/* end lengthOf:baseHeader:format: */;
l1:	/* end slotSizeOf: */;
	if (((((usqInt) (longAt(byteArrayOrBitmap))) >> 8) & 15) >= 8) {
		dataSize = slots;
		goto l3;
	} else {
		dataSize = slots * 4;
		goto l3;
	}
l3:	/* end byteSizeOf: */;
	sourceBytes = firstIndexableField(byteArrayOrBitmap);
	/* begin setSpecialObjectsOop: */
	foo->specialObjectsOop = specialObjects;
	/* begin setLastHash: */
	foo->lastHash = hashValue;
	setMemoryLimitsheapSize(dataSize, desiredHeapSize);
	mem = pointerForOop(memory);
	memcpy(mem, sourceBytes, dataSize);
	swapBytesAndPrepareToInterpretoldBaseAddr(swapBytes, oldBaseAddr);
	initializeSessionID();
	interpret();
	return null;
}


/*	Return one of the objects in the SpecialObjectsArray */

sqInt splObj(sqInt index) {
	return longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (index << (SHIFT_FOR_WORD)));
}


/*	Return what ST would return for <obj> at: index. */

sqInt stObjectat(sqInt array, sqInt index) {
register struct foo * foo = &fum;
    sqInt fixedFields;
    sqInt fmt;
    sqInt hdr;
    sqInt stSize;
    sqInt totalLength;
    sqInt sp;
    sqInt sz;
    sqInt class;
    sqInt classFormat;
    sqInt ccIndex;
    sqInt oop1;

	hdr = longAt(array);
	fmt = (((usqInt) hdr) >> 8) & 15;
	/* begin lengthOf:baseHeader:format: */
	if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(array - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = hdr & (SIZE_MASK);
	}
	sz -= hdr & (SIZE_4_BIT);
	if (fmt <= 4) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l2;
	}
	if (fmt < 8) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l2;
	} else {
		totalLength = (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
		goto l2;
	}
l2:	/* end lengthOf:baseHeader:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt > 4) || (fmt == 2)) {
		fixedFields = 0;
		goto l3;
	}
	if (fmt < 2) {
		fixedFields = totalLength;
		goto l3;
	}
	/* begin fetchClassOf: */
	if ((array & 1)) {
		class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l4;
	}
	ccIndex = (((usqInt) (longAt(array))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		class = (longAt(array - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l4;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l4;
	}
l4:	/* end fetchClassOf: */;
	classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
l3:	/* end fixedFieldsOf:format:length: */;
	if (((fmt == 3) && (!foo->allowAccessBeyondSP)) && ((((((usqInt) hdr) >> 12) & 0x1F) == 13) || ((((((usqInt) hdr) >> 12) & 0x1F) == 14) || (((((usqInt) hdr) >> 12) & 0x1F) == 4)))) {
		/* begin fetchStackPointerOf: */
		sp = longAt((array + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
		if (!((sp & 1))) {
			stSize = 0;
			goto l1;
		}
		stSize = (sp >> 1);
	l1:	/* end fetchStackPointerOf: */;
	} else {
		stSize = totalLength - fixedFields;
	}
	if (((((usqInt) index)) >= (((usqInt) 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) {
		/* begin subscript:with:format: */
		if (fmt <= 4) {
			return longAt((array + (BASE_HEADER_SIZE)) + (((index + fixedFields) - 1) << (SHIFT_FOR_WORD)));
		}
		if (fmt < 8) {
			return positive32BitIntegerFor(long32At((array + (BASE_HEADER_SIZE)) + (((index + fixedFields) - 1) << 2)));
		} else {
			return (((byteAt((array + (BASE_HEADER_SIZE)) + ((index + fixedFields) - 1))) << 1) | 1);
		}
		return null;
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return 0;
	}
	return null;
}


/*	Do what ST would return for <obj> at: index put: value. */

sqInt stObjectatput(sqInt array, sqInt index, sqInt value) {
register struct foo * foo = &fum;
    sqInt fixedFields;
    sqInt fmt;
    sqInt hdr;
    sqInt stSize;
    sqInt totalLength;
    sqInt sp;
    sqInt sz;
    sqInt class;
    sqInt classFormat;
    sqInt valueToStore;
    sqInt ccIndex;
    sqInt oop1;

	hdr = longAt(array);
	fmt = (((usqInt) hdr) >> 8) & 15;
	/* begin lengthOf:baseHeader:format: */
	if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(array - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = hdr & (SIZE_MASK);
	}
	sz -= hdr & (SIZE_4_BIT);
	if (fmt <= 4) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l2;
	}
	if (fmt < 8) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l2;
	} else {
		totalLength = (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
		goto l2;
	}
l2:	/* end lengthOf:baseHeader:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt > 4) || (fmt == 2)) {
		fixedFields = 0;
		goto l3;
	}
	if (fmt < 2) {
		fixedFields = totalLength;
		goto l3;
	}
	/* begin fetchClassOf: */
	if ((array & 1)) {
		class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l4;
	}
	ccIndex = (((usqInt) (longAt(array))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		class = (longAt(array - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l4;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l4;
	}
l4:	/* end fetchClassOf: */;
	classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
l3:	/* end fixedFieldsOf:format:length: */;
	if (((fmt == 3) && (!foo->allowAccessBeyondSP)) && ((((((usqInt) hdr) >> 12) & 0x1F) == 13) || ((((((usqInt) hdr) >> 12) & 0x1F) == 14) || (((((usqInt) hdr) >> 12) & 0x1F) == 4)))) {
		/* begin fetchStackPointerOf: */
		sp = longAt((array + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
		if (!((sp & 1))) {
			stSize = 0;
			goto l1;
		}
		stSize = (sp >> 1);
	l1:	/* end fetchStackPointerOf: */;
	} else {
		stSize = totalLength - fixedFields;
	}
	if (((((usqInt) index)) >= (((usqInt) 1))) && ((((usqInt) index)) <= (((usqInt) stSize)))) {
		/* begin subscript:with:storing:format: */
		if (fmt <= 4) {
			/* begin storePointer:ofObject:withValue: */
			if ((((usqInt) array)) < (((usqInt) foo->youngStart))) {
				possibleRootStoreIntovalue(array, value);
			}
			longAtput((array + (BASE_HEADER_SIZE)) + (((index + fixedFields) - 1) << (SHIFT_FOR_WORD)), value);
		} else {
			if (fmt < 8) {
				valueToStore = positive32BitValueOf(value);
				if (!foo->primFailCode) {
					long32Atput((array + (BASE_HEADER_SIZE)) + (((index + fixedFields) - 1) << 2), valueToStore);
				}
			} else {
				if (!((value & 1))) {
					/* begin primitiveFail */
					if (foo->primFailCode == 0) {
						foo->primFailCode = 1;
					}
				}
				valueToStore = (value >> 1);
				if (!((valueToStore >= 0) && (valueToStore <= 0xFF))) {
					/* begin primitiveFail */
					if (foo->primFailCode == 0) {
						foo->primFailCode = 1;
					}
				}
				if (!foo->primFailCode) {
					byteAtput((array + (BASE_HEADER_SIZE)) + ((index + fixedFields) - 1), valueToStore);
				}
			}
		}
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	return null;
}


/*	Return the number of indexable fields in the given object. (i.e., what Smalltalk would return for <obj> size). */
/*	Note: Assume oop is not a SmallInteger! */

sqInt stSizeOf(sqInt oop) {
register struct foo * foo = &fum;
    sqInt fixedFields;
    sqInt fmt;
    sqInt hdr;
    sqInt totalLength;
    sqInt sp;
    sqInt sz;
    sqInt class;
    sqInt classFormat;
    sqInt ccIndex;
    sqInt oop1;

	hdr = longAt(oop);
	fmt = (((usqInt) hdr) >> 8) & 15;
	/* begin lengthOf:baseHeader:format: */
	if ((hdr & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
	} else {
		sz = hdr & (SIZE_MASK);
	}
	sz -= hdr & (SIZE_4_BIT);
	if (fmt <= 4) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);
		goto l1;
	}
	if (fmt < 8) {
		totalLength = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> 2;
		goto l1;
	} else {
		totalLength = (sz - (BASE_HEADER_SIZE)) - (fmt & 3);
		goto l1;
	}
l1:	/* end lengthOf:baseHeader:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt > 4) || (fmt == 2)) {
		fixedFields = 0;
		goto l2;
	}
	if (fmt < 2) {
		fixedFields = totalLength;
		goto l2;
	}
	/* begin fetchClassOf: */
	if ((oop & 1)) {
		class = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassInteger << (SHIFT_FOR_WORD)));
		goto l3;
	}
	ccIndex = (((usqInt) (longAt(oop))) >> 12) & 0x1F;
	if (ccIndex == 0) {
		class = (longAt(oop - (BASE_HEADER_SIZE))) & (ALL_BUT_TYPE_MASK);
		goto l3;
	} else {
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (CompactClasses << (SHIFT_FOR_WORD)));
		class = longAt((oop1 + (BASE_HEADER_SIZE)) + ((ccIndex - 1) << (SHIFT_FOR_WORD)));
		goto l3;
	}
l3:	/* end fetchClassOf: */;
	classFormat = (longAt((class + (BASE_HEADER_SIZE)) + (InstanceSpecificationIndex << (SHIFT_FOR_WORD)))) - 1;
	fixedFields = (((((usqInt) classFormat) >> 11) & 192) + ((((usqInt) classFormat) >> 2) & 0x3F)) - 1;
l2:	/* end fixedFieldsOf:format:length: */;
	if (((fmt == 3) && (!foo->allowAccessBeyondSP)) && ((((((usqInt) hdr) >> 12) & 0x1F) == 13) || ((((((usqInt) hdr) >> 12) & 0x1F) == 14) || (((((usqInt) hdr) >> 12) & 0x1F) == 4)))) {
		/* begin fetchStackPointerOf: */
		sp = longAt((oop + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
		if (!((sp & 1))) {
			return 0;
		}
		return (sp >> 1);
	} else {
		return totalLength - fixedFields;
	}
	return null;
}


/*	Note: May be called by translated primitive code. */

double stackFloatValue(sqInt offset) {
register struct foo * foo = &fum;
    sqInt floatPointer;
    double  result;

	floatPointer = longAt(foo->stackPointer - (offset * (BYTES_PER_WORD)));
	if (!((fetchClassOf(floatPointer)) == (longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassFloat << (SHIFT_FOR_WORD)))))) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return 0.0;
	}
	;
	fetchFloatAtinto(floatPointer + (BASE_HEADER_SIZE), result);
	return result;
}

sqInt stackIntegerValue(sqInt offset) {
register struct foo * foo = &fum;
    sqInt integerPointer;

	integerPointer = longAt(foo->stackPointer - (offset * (BYTES_PER_WORD)));
	/* begin checkedIntegerValueOf: */
	if ((integerPointer & 1)) {
		return (integerPointer >> 1);
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return 0;
	}
	return null;
}


/*	Ensures that the given object is a real object, not a SmallInteger. */

sqInt stackObjectValue(sqInt offset) {
register struct foo * foo = &fum;
    sqInt oop;

	oop = longAt(foo->stackPointer - (offset * (BYTES_PER_WORD)));
	if ((oop & 1)) {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
		return null;
	}
	return oop;
}

sqInt stackTop(void) {
	return longAt(foo->stackPointer);
}

sqInt stackValue(sqInt offset) {
	return longAt(foo->stackPointer - (offset * (BYTES_PER_WORD)));
}


/*	Note: May be called by translated primitive code. */

sqInt storeIntegerofObjectwithValue(sqInt fieldIndex, sqInt objectPointer, sqInt integerValue) {
register struct foo * foo = &fum;
	if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
		(((((int) integerValue)) ^ ((((int) integerValue)) << 1)) >= 0)
# else
		((integerValue >= -1073741824) && (integerValue <= 0x3FFFFFFF))
# endif  // SQ_HOST32
	) {
		longAtput((objectPointer + (BASE_HEADER_SIZE)) + (fieldIndex << (SHIFT_FOR_WORD)), ((integerValue << 1) | 1));
	} else {
		/* begin primitiveFail */
		if (foo->primFailCode == 0) {
			foo->primFailCode = 1;
		}
	}
	return null;
}


/*	Note must check here for stores of young objects into old ones. */

sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt oop, sqInt valuePointer) {
	if ((((usqInt) oop)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(oop, valuePointer);
	}
	return longAtput((oop + (BASE_HEADER_SIZE)) + (fieldIndex << (SHIFT_FOR_WORD)), valuePointer);
}


/*	Answer a new String copied from a null-terminated C string.
	Caution: This may invoke the garbage collector. */

sqInt stringForCString(const char *aCString) {
    sqInt len;
    sqInt newString;

	len = strlen(aCString);
	newString = instantiateClassindexableSize(longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (ClassString << (SHIFT_FOR_WORD))), len);
	strncpy(arrayValueOf(newString), aCString, len);
	return newString;
}


/*	Set the state of the primitive failure code/success flag, iff successBoolean
	 is false. If primFailCode is non-zero a primitive has failed.  If primFailCode
	 is greater than one then its value indicates the reason for failure. */
/*	Use returnTypeC: #sqInt because that's the way it is defined in sq.h.
	 Use no explicit return so that Slang doesn't fail an inlining type-check when
	 a primitive with return type void uses ^self success: false to exit. */

sqInt success(sqInt successBoolean) {
register struct foo * foo = &fum;
	if (!(successBoolean)) {

		/* Don't overwrite an error code that has already been set. */

		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	return null;
}


/*	Answer the state of the primitive failure code/success flag.  If
	 primFailCode is non-zero a primitive has failed.  If primFailCode
	 is greater than one then its value indicates the reason for failure. */
/*	In C, non-zero is true, so avoid computation by using not the C version. */

sqInt successful(void) {
	return !foo->primFailCode;
}


/*	Return true if there is enough free space after doing a garbage collection. If not, signal that space is low. */

sqInt sufficientSpaceAfterGC(usqInt minFree) {
register struct foo * foo = &fum;
    usqInt growSize;
    usqInt minFreePlus;
    sqInt oldLimit;
    sqInt anOop;

	incrementalGC();
	if (oopisLessThan((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree)) {
		if (foo->signalLowSpace) {
			return 0;
		}
		fullGC();
		minFreePlus = minFree + 15000;
		if (minFreePlus < minFree) {
			return 0;
		}
		if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFreePlus)) {
			return 1;
		}
			while (1) {
			oldLimit = foo->memoryLimit;
			growSize = (minFree - ((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK))) + foo->growHeadroom;
			growObjectMemory(growSize);
			/* begin oop:isGreaterThanOrEqualTo: */
			anOop = (longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK);
			if ((((usqInt) anOop)) >= (((usqInt) minFreePlus))) break;

			/* If the memoryLimit doesn't change then presumably the platform can't grow anymore. */

			if (oldLimit == foo->memoryLimit) {
				return 0;
			}
		}
	}
	return 1;
}


/*	Return true if there is enough space to allocate the given number of bytes,
	perhaps after doing a garbage collection. Sender is responsible for ensuring
	that requested size does result in arithmetic overflow, see note below. */

sqInt sufficientSpaceToAllocate(usqInt bytes) {
register struct foo * foo = &fum;
    usqInt minFree;


	/* Note: Arithmetic overflow may occur in calculation of minFree (indicated by
	minFree < bytes after calculation of minFree). The check is performed by sender
	to avoid redundant test here. */


	/* check for low-space */

	minFree = (foo->lowSpaceThreshold + bytes) + (BASE_HEADER_SIZE);
	if (oopisGreaterThanOrEqualTo((longAt(foo->freeBlock)) & (ALL_BUT_TYPE_MASK), minFree)) {
		return 1;
	} else {
		return sufficientSpaceAfterGC(minFree);
	}
	return null;
}

sqInt superclassOf(sqInt classPointer) {
	return longAt((classPointer + (BASE_HEADER_SIZE)) + (SuperclassIndex << (SHIFT_FOR_WORD)));
}


/*	An object memory has been loaded from a snapshot. Prepare it to be executed by an interpreter. */

sqInt swapBytesAndPrepareToInterpretoldBaseAddr(sqInt swapBytes, sqInt oldBaseAddr) {
register struct foo * foo = &fum;
    sqInt bytesToShift;
    sqInt addr;
    sqInt i;
    sqInt i1;
    sqInt proc;
    sqInt sched;
    sqInt oop;
    sqInt tmp;

	/* begin headerTypeBytesAt:put: */
	foo->headerTypeBytes[0] = ((BYTES_PER_WORD) * 2);
	/* begin headerTypeBytesAt:put: */
	foo->headerTypeBytes[1] = (BYTES_PER_WORD);
	/* begin headerTypeBytesAt:put: */
	foo->headerTypeBytes[2] = 0;
	/* begin headerTypeBytesAt:put: */
	foo->headerTypeBytes[3] = 0;
	if (swapBytes) {
		/* begin reverseBytesInImage */
		/* begin reverseBytesFrom:to: */
		flag("Dan");
		addr = memory;
		while ((((usqInt) addr)) < (((usqInt) foo->endOfMemory))) {
			longAtput(addr, byteSwapped(longAt(addr)));
			addr += BYTES_PER_WORD;
		}
		/* begin byteSwapByteObjects */
		byteSwapByteObjectsFromto(memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]), (sqInt)foo->endOfMemory);
	}
	bytesToShift = memory - oldBaseAddr;
	/* begin initializeInterpreter: */
	/* begin initializeInterpreter */
	foo->semaphoresUseBufferA = 1;
	foo->semaphoresToSignalCountA = 0;
	foo->semaphoresToSignalCountB = 0;
	initializeSessionID();
	interpreterProxy = sqGetInterpreterProxy();
	dummyReferToProxy();
	initializeObjectMemory(bytesToShift);
	initCompilerHooks();
	foo->activeContext = foo->nilObj;
	foo->theHomeContext = foo->nilObj;
	foo->method = foo->nilObj;
	foo->receiver = foo->nilObj;
	foo->messageSelector = foo->nilObj;
	foo->newMethod = foo->nilObj;
	foo->methodClass = foo->nilObj;
	foo->lkupClass = foo->nilObj;
	foo->receiverClass = foo->nilObj;
	foo->newNativeMethod = foo->nilObj;
	/* begin flushMethodCache */
	for (i = 1; i <= MethodCacheSize; i += 1) {
		foo->methodCache[i] = 0;
	}
	/* begin flushAtCache */
	for (i1 = 1; i1 <= AtCacheTotalSize; i1 += 1) {
		foo->atCache[i1] = 0;
	}
	/* begin loadInitialContext */
	/* begin fetchPointer:ofObject: */
	oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	sched = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	proc = longAt((sched + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	foo->activeContext = longAt((proc + (BASE_HEADER_SIZE)) + (SuspendedContextIndex << (SHIFT_FOR_WORD)));
	if ((((usqInt) foo->activeContext)) < (((usqInt) foo->youngStart))) {
		beRootIfOld((sqInt)foo->activeContext);
	}
	/* begin fetchContextRegisters: */
	tmp = longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	if ((tmp & 1)) {
		tmp = longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
		if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
			beRootIfOld(tmp);
		}
	} else {
		tmp = foo->activeContext;
	}
	foo->theHomeContext = tmp;
	foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
	foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
	tmp = ((longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->instructionPointer = ((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2;
	tmp = ((longAt((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
	foo->stackPointer = (foo->activeContext + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD));
	foo->reclaimableContextCount = 0;
	/* begin initialCleanup */
	if (((longAt(foo->activeContext)) & (ROOT_BIT)) == 0) {
		goto l1;
	}
	longAtput(foo->activeContext, (longAt(foo->activeContext)) & (ALL_BUT_ROOT_BIT));
	flushExternalPrimitives();
l1:	/* end initialCleanup */;
	foo->interruptCheckCounter = 0;
	foo->interruptCheckCounterFeedBackReset = 1000;
	foo->interruptChecksEveryNms = 1;
	foo->nextPollTick = 0;
	foo->nextWakeupTick = 0;
	foo->lastTick = 0;
	foo->interruptKeycode = 2094;
	foo->interruptPending = 0;
	foo->deferDisplayUpdates = 0;
	foo->pendingFinalizationSignals = 0;
	foo->jmpDepth = 0;
	foo->jmpMax = MaxJumpBuf;
	isBigEnder();
	if ((imageFormatInitialVersion & 1) == 1) {

		/* Low order bit set, indicating that the image was saved from
			a StackInterpreter (Cog) VM. Storage of all Float objects must be
			returned to older object memory format. */

		normalizeFloatOrderingInImage();
	}
	return null;
}


/*	Sweep memory from youngStart through the end of memory. Free all 
	inaccessible objects and coalesce adjacent free chunks. Clear the mark 
	bits of accessible objects. Compute the starting point for the first pass of 
	incremental compaction (compStart). Return the number of surviving 
	objects.  */
/*	Details: Each time a non-free object is encountered, decrement the 
	number of available forward table entries. If all entries are spoken for 
	(i.e., entriesAvailable reaches zero), set compStart to the last free 
	chunk before that object or, if there is no free chunk before the given 
	object, the first free chunk after it. Thus, at the end of the sweep 
	phase, compStart through compEnd spans the highest collection of 
	non-free objects that can be accomodated by the forwarding table. This 
	information is used by the first pass of incremental compaction to 
	ensure that space is initially freed at the end of memory. Note that 
	there should always be at least one free chunk--the one at the end of 
	the heap. */

sqInt sweepPhase(void) {
register struct foo * foo = &fum;
    usqInt endOfMemoryLocal;
    sqInt entriesAvailable;
    sqInt firstFree;
    sqInt freeChunk;
    sqInt freeChunkSize;
    sqInt hdrBytes;
    usqInt oop;
    sqInt oopHeader;
    sqInt oopHeaderType;
    sqInt oopSize;
    sqInt survivors;

	entriesAvailable = fwdTableInit((BYTES_PER_WORD) * 2);
	survivors = 0;

	/* an invalid object pointer, note that 0 may refer to a meaningful slot */

	freeChunk = -1;

	/* will be updated later */

	firstFree = -1;
	endOfMemoryLocal = foo->endOfMemory;
	oop = foo->youngStart + (foo->headerTypeBytes[(longAt(foo->youngStart)) & TypeMask]);
	while (oop < endOfMemoryLocal) {

		/* get oop's header, header type, size, and header size */

		foo->statSweepCount += 1;
		oopHeader = longAt(oop);
		oopHeaderType = oopHeader & TypeMask;
		hdrBytes = foo->headerTypeBytes[oopHeaderType];
		if ((oopHeaderType & 1) == 1) {
			oopSize = oopHeader & (SIZE_MASK);
		} else {
			if (oopHeaderType == HeaderTypeSizeAndClass) {
				oopSize = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
			} else {

				/* free chunk */

				oopSize = oopHeader & (LONG_SIZE_MASK);
			}
		}
		if ((oopHeader & (MARK_BIT)) == 0) {

			/* object is not marked; free it */
			/* <-- Finalization support: We need to mark each oop chunk as free --> */

			longAtput(oop - hdrBytes, HeaderTypeFree);
			if (freeChunk != -1) {

				/* enlarge current free chunk to include this oop */

				freeChunkSize = (freeChunkSize + oopSize) + hdrBytes;
			} else {

				/* start a new free chunk */


				/* chunk may start 4 or 8 bytes before oop */

				freeChunk = oop - hdrBytes;

				/* adjust size for possible extra header bytes */

				freeChunkSize = oopSize + (oop - freeChunk);
				if (firstFree == -1) {
					firstFree = freeChunk;
				}
			}
		} else {

			/* object is marked; clear its mark bit and possibly adjust 
					the compaction start */

			longAtput(oop, oopHeader & (ALL_BUT_MARK_BIT));
			if (((((usqInt) (longAt(oop))) >> 8) & 15) == 4) {
				finalizeReference(oop);
			}
			if (entriesAvailable > 0) {
				entriesAvailable -= 1;
			} else {

				/* start compaction at the last free chunk before this object */

				firstFree = freeChunk;
			}
			if (freeChunk != -1) {

				/* record the size of the last free chunk */

				longAtput(freeChunk, (freeChunkSize & (LONG_SIZE_MASK)) | HeaderTypeFree);
				freeChunk = -1;
			}
			survivors += 1;
		}
		oop = (oop + oopSize) + (foo->headerTypeBytes[(longAt(oop + oopSize)) & TypeMask]);
	}
	if (freeChunk != -1) {

		/* record size of final free chunk */

		longAtput(freeChunk, (freeChunkSize & (LONG_SIZE_MASK)) | HeaderTypeFree);
	}
	if (!(oop == foo->endOfMemory)) {
		error("sweep failed to find exact end of memory");
	}
	if (firstFree == -1) {
		error("expected to find at least one free object");
	} else {
		foo->compStart = firstFree;
	}
	return survivors;
}


/*	Signal the given semaphore from within the interpreter. */

sqInt synchronousSignal(sqInt aSemaphore) {
register struct foo * foo = &fum;
    sqInt excessSignals;
    sqInt aProcess;
    sqInt activePriority;
    sqInt activeProc;
    sqInt newPriority;
    sqInt oop;
    sqInt oop1;
    sqInt priority;
    sqInt processList;
    sqInt processLists;
    sqInt oop2;
    sqInt oop11;
    sqInt priority1;
    sqInt processList1;
    sqInt processLists1;
    sqInt oop3;
    sqInt oop12;

	if ((longAt((aSemaphore + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)))) == foo->nilObj) {

		/* no process is waiting on this semaphore */

		excessSignals = fetchIntegerofObject(ExcessSignalsIndex, aSemaphore);
		/* begin storeInteger:ofObject:withValue: */
		if (
# ifdef SQ_HOST32  // cast to int for 64 bit image on 32 bit host
			(((((int) (excessSignals + 1))) ^ ((((int) (excessSignals + 1))) << 1)) >= 0)
# else
			(((excessSignals + 1) >= -1073741824) && ((excessSignals + 1) <= 0x3FFFFFFF))
# endif  // SQ_HOST32
		) {
			longAtput((aSemaphore + (BASE_HEADER_SIZE)) + (ExcessSignalsIndex << (SHIFT_FOR_WORD)), (((excessSignals + 1) << 1) | 1));
		} else {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
		}
	} else {
		/* begin resume: */
		aProcess = removeFirstLinkOfList(aSemaphore);
		/* begin fetchPointer:ofObject: */
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
		oop = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
		activeProc = longAt((oop + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
		activePriority = ((longAt((activeProc + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
		newPriority = ((longAt((aProcess + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
		if (newPriority > activePriority) {
			/* begin putToSleep: */
			priority = ((longAt((activeProc + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
			/* begin fetchPointer:ofObject: */
			/* begin fetchPointer:ofObject: */
			oop11 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
			oop2 = longAt((oop11 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
			processLists = longAt((oop2 + (BASE_HEADER_SIZE)) + (ProcessListsIndex << (SHIFT_FOR_WORD)));
			processList = longAt((processLists + (BASE_HEADER_SIZE)) + ((priority - 1) << (SHIFT_FOR_WORD)));
			addLastLinktoList(activeProc, processList);
			transferTo(aProcess);
		} else {
			/* begin putToSleep: */
			priority1 = ((longAt((aProcess + (BASE_HEADER_SIZE)) + (PriorityIndex << (SHIFT_FOR_WORD)))) >> 1);
			/* begin fetchPointer:ofObject: */
			/* begin fetchPointer:ofObject: */
			oop12 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
			oop3 = longAt((oop12 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
			processLists1 = longAt((oop3 + (BASE_HEADER_SIZE)) + (ProcessListsIndex << (SHIFT_FOR_WORD)));
			processList1 = longAt((processLists1 + (BASE_HEADER_SIZE)) + ((priority1 - 1) << (SHIFT_FOR_WORD)));
			addLastLinktoList(aProcess, processList1);
		}
	}
	return null;
}


/*	Do an incremental GC that tenures all surviving young objects to old space. */

sqInt tenuringIncrementalGC(void) {
	foo->forceTenureFlag = 1;
	incrementalGC();
	return null;
}


/*	Returns the top of the remappable oop. Useful when writing loops. */

sqInt topRemappableOop(void) {
register struct foo * foo = &fum;
	return foo->remapBuffer[foo->remapBufferCount];
}


/*	Record a process to be awoken on the next interpreter cycle. 
	ikp 11/24/1999 06:07 -- added hook for external runtime 
	compiler  */

sqInt transferTo(sqInt aProc) {
register struct foo * foo = &fum;
    sqInt newProc;
    sqInt oldProc;
    sqInt sched;
    sqInt oop;
    sqInt aContext;
    sqInt tmp;
    sqInt valuePointer;

	newProc = aProc;
	/* begin fetchPointer:ofObject: */
	oop = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	sched = longAt((oop + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	oldProc = longAt((sched + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)));
	/* begin storePointer:ofObject:withValue: */
	if ((((usqInt) sched)) < (((usqInt) foo->youngStart))) {
		possibleRootStoreIntovalue(sched, newProc);
	}
	longAtput((sched + (BASE_HEADER_SIZE)) + (ActiveProcessIndex << (SHIFT_FOR_WORD)), newProc);
	if (!((imageFormatVersionNumber == 6501) || ((imageFormatVersionNumber == 6502) || (imageFormatVersionNumber == 68000)))) {

		/* Earlier images did not require this but process scheduling has changed so ensure
		that myList is nil here. The check for oldPrims may be unnecessary, but is harmless.  */

		longAtput((newProc + (BASE_HEADER_SIZE)) + (MyListIndex << (SHIFT_FOR_WORD)), foo->nilObj);
	}
	if (foo->compilerInitialized) {
		compilerProcessChangeto(oldProc, newProc);
	} else {
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) oldProc)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(oldProc, (sqInt)foo->activeContext);
		}
		longAtput((oldProc + (BASE_HEADER_SIZE)) + (SuspendedContextIndex << (SHIFT_FOR_WORD)), foo->activeContext);
		/* begin newActiveContext: */
		aContext = longAt((newProc + (BASE_HEADER_SIZE)) + (SuspendedContextIndex << (SHIFT_FOR_WORD)));
		/* begin storeContextRegisters: */
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)), ((((foo->instructionPointer - foo->method) - ((BASE_HEADER_SIZE) - 2)) << 1) | 1));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = (((((((usqInt) ((foo->stackPointer - foo->activeContext) - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD)) - TempFrameStart) + 1) << 1) | 1);
		longAtput((foo->activeContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)), valuePointer);
		if ((((usqInt) aContext)) < (((usqInt) foo->youngStart))) {
			beRootIfOld(aContext);
		}
		foo->activeContext = aContext;
		/* begin fetchContextRegisters: */
		tmp = longAt((aContext + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
		if ((tmp & 1)) {
			tmp = longAt((aContext + (BASE_HEADER_SIZE)) + (HomeIndex << (SHIFT_FOR_WORD)));
			if ((((usqInt) tmp)) < (((usqInt) foo->youngStart))) {
				beRootIfOld(tmp);
			}
		} else {
			tmp = aContext;
		}
		foo->theHomeContext = tmp;
		foo->receiver = longAt((tmp + (BASE_HEADER_SIZE)) + (ReceiverIndex << (SHIFT_FOR_WORD)));
		foo->method = longAt((tmp + (BASE_HEADER_SIZE)) + (MethodIndex << (SHIFT_FOR_WORD)));
		tmp = ((longAt((aContext + (BASE_HEADER_SIZE)) + (InstructionPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
		foo->instructionPointer = ((foo->method + tmp) + (BASE_HEADER_SIZE)) - 2;
		tmp = ((longAt((aContext + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)))) >> 1);
		foo->stackPointer = (aContext + (BASE_HEADER_SIZE)) + (((TempFrameStart + tmp) - 1) * (BYTES_PER_WORD));
		/* begin storePointer:ofObject:withValue: */
		if ((((usqInt) newProc)) < (((usqInt) foo->youngStart))) {
			possibleRootStoreIntovalue(newProc, foo->nilObj);
		}
		longAtput((newProc + (BASE_HEADER_SIZE)) + (SuspendedContextIndex << (SHIFT_FOR_WORD)), foo->nilObj);
	}
	foo->reclaimableContextCount = 0;
	return null;
}

sqInt trueObject(void) {
	return foo->trueObj;
}


/*	update pointers in the given memory range */

sqInt updatePointersInRangeFromto(sqInt memStart, sqInt memEnd) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt fwdBlock;
    sqInt header;
    sqInt realHeader;
    sqInt sz;
    sqInt fieldOffset;
    sqInt fieldOop;
    sqInt fwdBlock3;
    sqInt newOop;
    sqInt contextSize;
    sqInt fmt;
    sqInt fwdBlock1;
    sqInt header1;
    sqInt methodHeader;
    sqInt size;
    sqInt sp;
    sqInt classHeader;
    sqInt classOop;
    sqInt fwdBlock2;
    sqInt newClassHeader;
    sqInt newClassOop;
    sqInt sz1;
    sqInt header2;

	oop = memStart + (foo->headerTypeBytes[(longAt(memStart)) & TypeMask]);
	while ((((usqInt) oop)) < (((usqInt) memEnd))) {
		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
			/* begin remapFieldsAndClassOf: */
			/* begin lastPointerWhileForwarding: */
			header1 = longAt(oop);
			if ((header1 & (MARK_BIT)) != 0) {
				fwdBlock1 = (header1 & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
				if (DoAssertionChecks) {
					/* begin fwdBlockValidate: */
					if (!(((((usqInt) fwdBlock1)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock1)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock1 & 3) == 0)))) {
						error("invalid fwd table entry");
					}
				}
				header1 = longAt(fwdBlock1 + (BYTES_PER_WORD));
			}
			fmt = (((usqInt) header1) >> 8) & 15;
			if (fmt <= 4) {
				if ((fmt == 3) && ((((((usqInt) header1) >> 12) & 0x1F) == 13) || ((((((usqInt) header1) >> 12) & 0x1F) == 14) || (((((usqInt) header1) >> 12) & 0x1F) == 4)))) {
					/* begin fetchStackPointerOf: */
					sp = longAt((oop + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
					if (!((sp & 1))) {
						contextSize = 0;
						goto l4;
					}
					contextSize = (sp >> 1);
				l4:	/* end fetchStackPointerOf: */;
					fieldOffset = (CtxtTempFrameStart + contextSize) * (BYTES_PER_WORD);
					goto l2;
				}
				if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
					size = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
				} else {
					size = header1 & (SIZE_MASK);
				}
				fieldOffset = size - (BASE_HEADER_SIZE);
				goto l2;
			}
			if (fmt < 12) {
				fieldOffset = 0;
				goto l2;
			}
			methodHeader = longAt(oop + (BASE_HEADER_SIZE));
			fieldOffset = (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
		l2:	/* end lastPointerWhileForwarding: */;
			while (fieldOffset >= (BASE_HEADER_SIZE)) {
				fieldOop = longAt(oop + fieldOffset);
				if (((fieldOop & 1) == 0) && (((longAt(fieldOop)) & (MARK_BIT)) != 0)) {
					fwdBlock3 = ((longAt(fieldOop)) & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
					if (DoAssertionChecks) {
						/* begin fwdBlockValidate: */
						if (!(((((usqInt) fwdBlock3)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock3)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock3 & 3) == 0)))) {
							error("invalid fwd table entry");
						}
					}
					newOop = longAt(fwdBlock3);
					longAtput(oop + fieldOffset, newOop);
					if (((((usqInt) oop)) < (((usqInt) foo->youngStart))) && ((((usqInt) newOop)) >= (((usqInt) foo->youngStart)))) {
						beRootWhileForwarding(oop);
					}
				}
				fieldOffset -= BYTES_PER_WORD;
			}
			/* begin remapClassOf: */
			if (((longAt(oop)) & TypeMask) == HeaderTypeShort) {
				goto l3;
			}
			classHeader = longAt(oop - (BYTES_PER_WORD));
			classOop = classHeader & (ALL_BUT_TYPE_MASK);
			if (((classOop & 1) == 0) && (((longAt(classOop)) & (MARK_BIT)) != 0)) {
				fwdBlock2 = ((longAt(classOop)) & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
				if (DoAssertionChecks) {
					/* begin fwdBlockValidate: */
					if (!(((((usqInt) fwdBlock2)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock2)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock2 & 3) == 0)))) {
						error("invalid fwd table entry");
					}
				}
				newClassOop = longAt(fwdBlock2);
				newClassHeader = newClassOop | (classHeader & TypeMask);
				longAtput(oop - (BYTES_PER_WORD), newClassHeader);
				if (((((usqInt) oop)) < (((usqInt) foo->youngStart))) && ((((usqInt) newClassOop)) >= (((usqInt) foo->youngStart)))) {
					beRootWhileForwarding(oop);
				}
			}
		l3:	/* end remapClassOf: */;
		}
		/* begin objectAfterWhileForwarding: */
		header = longAt(oop);
		if ((header & (MARK_BIT)) == 0) {
			/* begin objectAfter: */
			if (DoAssertionChecks) {
				if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
					error("no objects after the end of memory");
				}
			}
			if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
				sz1 = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
			} else {
				/* begin sizeBitsOf: */
				header2 = longAt(oop);
				if ((header2 & TypeMask) == HeaderTypeSizeAndClass) {
					sz1 = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
					goto l5;
				} else {
					sz1 = header2 & (SIZE_MASK);
					goto l5;
				}
			l5:	/* end sizeBitsOf: */;
			}
			oop = (oop + sz1) + (foo->headerTypeBytes[(longAt(oop + sz1)) & TypeMask]);
			goto l1;
		}
		fwdBlock = (header & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
		if (DoAssertionChecks) {
			/* begin fwdBlockValidate: */
			if (!(((((usqInt) fwdBlock)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock & 3) == 0)))) {
				error("invalid fwd table entry");
			}
		}
		realHeader = longAt(fwdBlock + (BYTES_PER_WORD));
		if ((realHeader & TypeMask) == HeaderTypeSizeAndClass) {
			sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		} else {
			sz = realHeader & (SIZE_MASK);
		}
		oop = (oop + sz) + (foo->headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
	l1:	/* end objectAfterWhileForwarding: */;
	}
	return null;
}


/*	update pointers in root objects */

sqInt updatePointersInRootObjectsFromto(sqInt memStart, sqInt memEnd) {
register struct foo * foo = &fum;
    sqInt i;
    sqInt oop;
    sqInt fieldOffset;
    sqInt fieldOop;
    sqInt fwdBlock;
    sqInt newOop;
    sqInt contextSize;
    sqInt fmt;
    sqInt fwdBlock1;
    sqInt header;
    sqInt methodHeader;
    sqInt size;
    sqInt sp;
    sqInt classHeader;
    sqInt classOop;
    sqInt fwdBlock2;
    sqInt newClassHeader;
    sqInt newClassOop;

	for (i = 1; i <= foo->rootTableCount; i += 1) {
		oop = foo->rootTable[i];
		if (((((usqInt) oop)) < (((usqInt) memStart))) || ((((usqInt) oop)) >= (((usqInt) memEnd)))) {

			/* Note: must not remap the fields of any object twice! */
			/* remap this oop only if not in the memory range 
					covered below */

			/* begin remapFieldsAndClassOf: */
			/* begin lastPointerWhileForwarding: */
			header = longAt(oop);
			if ((header & (MARK_BIT)) != 0) {
				fwdBlock1 = (header & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
				if (DoAssertionChecks) {
					/* begin fwdBlockValidate: */
					if (!(((((usqInt) fwdBlock1)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock1)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock1 & 3) == 0)))) {
						error("invalid fwd table entry");
					}
				}
				header = longAt(fwdBlock1 + (BYTES_PER_WORD));
			}
			fmt = (((usqInt) header) >> 8) & 15;
			if (fmt <= 4) {
				if ((fmt == 3) && ((((((usqInt) header) >> 12) & 0x1F) == 13) || ((((((usqInt) header) >> 12) & 0x1F) == 14) || (((((usqInt) header) >> 12) & 0x1F) == 4)))) {
					/* begin fetchStackPointerOf: */
					sp = longAt((oop + (BASE_HEADER_SIZE)) + (StackPointerIndex << (SHIFT_FOR_WORD)));
					if (!((sp & 1))) {
						contextSize = 0;
						goto l1;
					}
					contextSize = (sp >> 1);
				l1:	/* end fetchStackPointerOf: */;
					fieldOffset = (CtxtTempFrameStart + contextSize) * (BYTES_PER_WORD);
					goto l2;
				}
				if ((header & TypeMask) == HeaderTypeSizeAndClass) {
					size = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (ALL_BUT_TYPE_MASK);
				} else {
					size = header & (SIZE_MASK);
				}
				fieldOffset = size - (BASE_HEADER_SIZE);
				goto l2;
			}
			if (fmt < 12) {
				fieldOffset = 0;
				goto l2;
			}
			methodHeader = longAt(oop + (BASE_HEADER_SIZE));
			fieldOffset = (((((usqInt) methodHeader) >> 10) & 0xFF) * (BYTES_PER_WORD)) + (BASE_HEADER_SIZE);
		l2:	/* end lastPointerWhileForwarding: */;
			while (fieldOffset >= (BASE_HEADER_SIZE)) {
				fieldOop = longAt(oop + fieldOffset);
				if (((fieldOop & 1) == 0) && (((longAt(fieldOop)) & (MARK_BIT)) != 0)) {
					fwdBlock = ((longAt(fieldOop)) & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
					if (DoAssertionChecks) {
						/* begin fwdBlockValidate: */
						if (!(((((usqInt) fwdBlock)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock & 3) == 0)))) {
							error("invalid fwd table entry");
						}
					}
					newOop = longAt(fwdBlock);
					longAtput(oop + fieldOffset, newOop);
					if (((((usqInt) oop)) < (((usqInt) foo->youngStart))) && ((((usqInt) newOop)) >= (((usqInt) foo->youngStart)))) {
						beRootWhileForwarding(oop);
					}
				}
				fieldOffset -= BYTES_PER_WORD;
			}
			/* begin remapClassOf: */
			if (((longAt(oop)) & TypeMask) == HeaderTypeShort) {
				goto l3;
			}
			classHeader = longAt(oop - (BYTES_PER_WORD));
			classOop = classHeader & (ALL_BUT_TYPE_MASK);
			if (((classOop & 1) == 0) && (((longAt(classOop)) & (MARK_BIT)) != 0)) {
				fwdBlock2 = ((longAt(classOop)) & (ALL_BUT_MARK_BIT_AND_TYPE_MASK)) << 1;
				if (DoAssertionChecks) {
					/* begin fwdBlockValidate: */
					if (!(((((usqInt) fwdBlock2)) > (((usqInt) foo->endOfMemory))) && (((((usqInt) fwdBlock2)) <= (((usqInt) foo->fwdTableNext))) && ((fwdBlock2 & 3) == 0)))) {
						error("invalid fwd table entry");
					}
				}
				newClassOop = longAt(fwdBlock2);
				newClassHeader = newClassOop | (classHeader & TypeMask);
				longAtput(oop - (BYTES_PER_WORD), newClassHeader);
				if (((((usqInt) oop)) < (((usqInt) foo->youngStart))) && ((((usqInt) newClassOop)) >= (((usqInt) foo->youngStart)))) {
					beRootWhileForwarding(oop);
				}
			}
		l3:	/* end remapClassOf: */;
		}
	}
	return null;
}


/*	Make any run time updates to the primitive table that may be required for supporting
	the current running image. May be called by an interpreter that determines at run time
	that it needs to provide support for an older image.

	References: The SqueakJS dispatch table, which is known to run the full range of Squeak
	images, is used as a reference, along with comparison to the Squeak VM table as of
	January 2005 from VMMaker-tpr.22, which was the last version prior to converting
	images to support full closures  (dtl Dec 2016) */

sqInt updatePrimitiveTable(void) {
	if (!((imageFormatVersionNumber != 6502) && (imageFormatVersionNumber != 68000))) {
		installPrimitiveat(primitiveNext, 65);
		installPrimitiveat(primitiveNextPut, 66);
		installPrimitiveat(primitiveAtEnd, 67);
		installPrimitiveat(primitiveBlockCopy, 80);
		installPrimitiveat(primitiveValue, 81);
		installPrimitiveat(primitiveValueWithArgs, 82);
		installPrimitivefromat("primitiveCopyBits", "BitBltPlugin", 96);
		installPrimitiveat(primitiveValueUninterruptably, 123);
		installPrimitivefromat("primitiveReadJoystick", "JoystickTabletPlugin", 146);
		installPrimitivefromat("primitiveWarpBits", "BitBltPlugin", 147);
		installPrimitivefromat("primitiveFileAtEnd", "FilePlugin", 150);
		installPrimitivefromat("primitiveFileClose", "FilePlugin", 151);
		installPrimitivefromat("primitiveFileGetPosition", "FilePlugin", 152);
		installPrimitivefromat("primitiveFileOpen", "FilePlugin", 153);
		installPrimitivefromat("primitiveFileRead", "FilePlugin", 154);
		installPrimitivefromat("primitiveFileSetPosition", "FilePlugin", 155);
		installPrimitivefromat("primitiveFileDelete", "FilePlugin", 156);
		installPrimitivefromat("primitiveFileSize", "FilePlugin", 157);
		installPrimitivefromat("primitiveFileWrite", "FilePlugin", 158);
		installPrimitivefromat("primitiveFileRename", "FilePlugin", 159);
		installPrimitivefromat("primitiveDirectoryCreate", "FilePlugin", 160);
		installPrimitivefromat("primitiveDirectoryDelimitor", "FilePlugin", 161);
		installPrimitivefromat("primitiveDirectoryLookup", "FilePlugin", 162);
		installPrimitivefromat("primitiveDirectoryDelete", "FilePlugin", 163);
		installPrimitivefromat("primitiveDirectorySetMacTypeAndCreator", "FilePlugin", 169);
		installPrimitivefromat("primitiveSoundStart", "SoundPlugin", 170);
		installPrimitivefromat("primitiveSoundStartWithSemaphore", "SoundPlugin", 171);
		installPrimitivefromat("primitiveSoundStop", "SoundPlugin", 172);
		installPrimitivefromat("primitiveSoundAvailableSpace", "SoundPlugin", 173);
		installPrimitivefromat("primitiveSoundPlaySamples", "SoundPlugin", 174);
		installPrimitivefromat("primitiveSoundPlaySilence", "SoundPlugin", 175);
		installPrimitivefromat("primWaveTableSoundmixSampleCountintostartingAtpan", "SoundGenerationPlugin", 176);
		installPrimitivefromat("primFMSoundmixSampleCountintostartingAtpan", "SoundGenerationPlugin", 177);
		installPrimitivefromat("primPluckedSoundmixSampleCountintostartingAtpan", "SoundGenerationPlugin", 178);
		installPrimitivefromat("primSampledSoundmixSampleCountintostartingAtpan", "SoundGenerationPlugin", 179);
		installPrimitivefromat("primitiveMixFMSound", "SoundGenerationPlugin", 180);
		installPrimitivefromat("primitiveMixPluckedSound", "SoundGenerationPlugin", 181);
		installPrimitivefromat("oldprimSampledSoundmixSampleCountintostartingAtleftVolrightVol", "SoundGenerationPlugin", 182);
		installPrimitivefromat("primitiveApplyReverb", "SoundGenerationPlugin", 183);
		installPrimitivefromat("primitiveMixLoopedSampledSound", "SoundGenerationPlugin", 184);
		installPrimitivefromat("primitiveMixSampledSound", "SoundGenerationPlugin", 185);
		installPrimitivefromat("primitiveSoundInsertSamples", "SoundPlugin", 189);
		installPrimitivefromat("primitiveSoundStopRecording", "SoundPlugin", 191);
		installPrimitivefromat("primitiveSoundGetRecordingSampleRate", "SoundPlugin", 192);
		installPrimitivefromat("primitiveSoundRecordSamples", "SoundPlugin", 193);
		installPrimitivefromat("primitiveSoundSetRecordLevel", "SoundPlugin", 194);
		installPrimitivefromat("primitiveInitializeNetwork", "SocketPlugin", 200);
		installPrimitivefromat("primitiveResolverStartNameLookup", "SocketPlugin", 201);
		installPrimitivefromat("primitiveResolverNameLookupResult", "SocketPlugin", 202);
		installPrimitivefromat("primitiveResolverStartAddressLookup", "SocketPlugin", 203);
		installPrimitivefromat("primitiveResolverAddressLookupResult", "SocketPlugin", 204);
		installPrimitivefromat("primitiveResolverAbortLookup", "SocketPlugin", 205);
		installPrimitivefromat("primitiveResolverLocalAddress", "SocketPlugin", 206);
		installPrimitivefromat("primitiveResolverStatus", "SocketPlugin", 207);
		installPrimitivefromat("primitiveResolverError", "SocketPlugin", 208);
		installPrimitivefromat("primitiveSocketCreate", "SocketPlugin", 209);
		installPrimitivefromat("primitiveSocketDestroy", "SocketPlugin", 210);
		installPrimitivefromat("primitiveSocketConnectionStatus", "SocketPlugin", 211);
		installPrimitivefromat("primitiveSocketError", "SocketPlugin", 212);
		installPrimitivefromat("primitiveSocketLocalAddress", "SocketPlugin", 213);
		installPrimitivefromat("primitiveSocketLocalPort", "SocketPlugin", 214);
		installPrimitivefromat("primitiveSocketRemoteAddress", "SocketPlugin", 215);
		installPrimitivefromat("primitiveSocketRemotePort", "SocketPlugin", 216);
		installPrimitivefromat("primitiveSocketConnectToPort", "SocketPlugin", 217);
		installPrimitivefromat("primitiveSocketListenOnPort", "SocketPlugin", 218);
		installPrimitivefromat("primitiveSocketCloseConnection", "SocketPlugin", 219);
		installPrimitivefromat("primitiveSocketAbortConnection", "SocketPlugin", 220);
		installPrimitivefromat("primitiveSocketReceiveDataBufCount", "SocketPlugin", 221);
		installPrimitivefromat("primitiveSocketReceiveDataAvailable", "SocketPlugin", 222);
		installPrimitivefromat("primitiveSocketSendDataBufCount", "SocketPlugin", 223);
		installPrimitivefromat("primitiveSocketSendDone", "SocketPlugin", 224);
		installPrimitivefromat("primitiveDecompressFromByteArray", "MiscPrimitivePlugin", 234);
		installPrimitivefromat("primitiveCompareString", "MiscPrimitivePlugin", 235);
		installPrimitivefromat("primitiveConvert8BitSigned", "MiscPrimitivePlugin", 236);
		installPrimitivefromat("primitiveCompressToByteArray", "MiscPrimitivePlugin", 237);
		installPrimitivefromat("primitiveSerialPortOpen", "SerialPlugin", 238);
		installPrimitivefromat("primitiveSerialPortClose", "SerialPlugin", 239);
		installPrimitivefromat("primitiveSerialPortWrite", "SerialPlugin", 240);
		installPrimitivefromat("primitiveSerialPortRead", "SerialPlugin", 241);
		installPrimitivefromat("primitiveTranslateStringWithTable", "MiscPrimitivePlugin", 243);
		installPrimitivefromat("primitiveFindFirstInString", "MiscPrimitivePlugin", 244);
		installPrimitivefromat("primitiveIndexOfAsciiInString", "MiscPrimitivePlugin", 245);
		installPrimitivefromat("primitiveFindSubstring", "MiscPrimitivePlugin", 246);
	}
	return null;
}


/*	Verify that every old object that points to a new object 
		has its root bit set, and
		appears in the rootTable.
	This method should not be called if the rootTable is full, because roots
	are no longer recorded, and incremental collections are not attempted.
	If DoAssertionChecks is true, this routine will halt on an unmarked root.
	Otherwise, this routine will merely return true in that case. */

sqInt validateRoots(void) {
register struct foo * foo = &fum;
    sqInt badRoot;
    usqInt fieldAddr;
    usqInt fieldOop;
    sqInt header;
    usqInt oop;
    sqInt sz;
    sqInt header1;

	badRoot = 0;
	oop = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while (oop < foo->youngStart) {
		if (!(((longAt(oop)) & TypeMask) == HeaderTypeFree)) {
			fieldAddr = oop + (lastPointerOf(oop));
			while (fieldAddr > oop) {
				fieldOop = longAt(fieldAddr);
				if ((fieldOop >= foo->youngStart) && (!((fieldOop & 1)))) {

					/* fieldOop is a pointer to a young object */

					header = longAt(oop);
					if ((header & (ROOT_BIT)) == 0) {

						/* Forbidden: points to young obj but root bit not set. */

						if (DoAssertionChecks) {
							error("root bit not set");
						}
						badRoot = 1;
					} else {

						/* Root bit is set */
						/* Extreme test -- validate that oop was entered in rootTable too... */
						/* Disabled for now...
						found := false.
						1 to: rootTableCount do:
							[:i | oop = (rootTable at: i) ifTrue: [found := true]].
						found ifFalse:
							[DoAssertionChecks ifTrue: [self error: 'root table not set'].
							badRoot := true].
						... */

						null;
					}
				}
				fieldAddr -= BYTES_PER_WORD;
			}
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header1 = longAt(oop);
			if ((header1 & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header1 & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
		}
		oop = (oop + sz) + (foo->headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
	}
	return badRoot;
}

sqInt verifyCleanHeaders(void) {
register struct foo * foo = &fum;
    sqInt oop;
    sqInt sz;
    sqInt header;

	oop = memory + (foo->headerTypeBytes[(longAt(memory)) & TypeMask]);
	while ((((usqInt) oop)) < (((usqInt) foo->endOfMemory))) {
		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {

			/* There should only be one free block at end of memory. */

			if (!((objectAfter(oop)) == foo->endOfMemory)) {
				error("Invalid obj with HeaderTypeBits = Free.");
			}
		} else {
			if (((longAt(oop)) & (MARK_BIT)) != 0) {
				error("Invalid obj with MarkBit set.");
			}
		}
		/* begin objectAfter: */
		if (DoAssertionChecks) {
			if ((((usqInt) oop)) >= (((usqInt) foo->endOfMemory))) {
				error("no objects after the end of memory");
			}
		}
		if (((longAt(oop)) & TypeMask) == HeaderTypeFree) {
			sz = (longAt(oop)) & (ALL_BUT_TYPE_MASK);
		} else {
			/* begin sizeBitsOf: */
			header = longAt(oop);
			if ((header & TypeMask) == HeaderTypeSizeAndClass) {
				sz = (longAt(oop - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
				goto l1;
			} else {
				sz = header & (SIZE_MASK);
				goto l1;
			}
		l1:	/* end sizeBitsOf: */;
		}
		oop = (oop + sz) + (foo->headerTypeBytes[(longAt(oop + sz)) & TypeMask]);
	}
	return null;
}


/*	return 0 for little endian, 1 for big endian */

sqInt vmEndianness(void) {
	if (isBigEnder()) {
		return 1;
	} else {
		return 0;
	}
	return null;
}


/*	Return the highest priority process that is ready to run. */
/*	Note: It is a fatal VM error if there is no runnable process. */

sqInt wakeHighestPriority(void) {
register struct foo * foo = &fum;
    sqInt p;
    sqInt processList;
    sqInt schedLists;
    sqInt oop;
    sqInt sz;
    sqInt header;
    sqInt oop1;

	/* begin fetchPointer:ofObject: */
	/* begin fetchPointer:ofObject: */
	oop1 = longAt((foo->specialObjectsOop + (BASE_HEADER_SIZE)) + (SchedulerAssociation << (SHIFT_FOR_WORD)));
	oop = longAt((oop1 + (BASE_HEADER_SIZE)) + (ValueIndex << (SHIFT_FOR_WORD)));
	schedLists = longAt((oop + (BASE_HEADER_SIZE)) + (ProcessListsIndex << (SHIFT_FOR_WORD)));
	/* begin fetchWordLengthOf: */
	/* begin sizeBitsOf: */
	header = longAt(schedLists);
	if ((header & TypeMask) == HeaderTypeSizeAndClass) {
		sz = (longAt(schedLists - ((BYTES_PER_WORD) * 2))) & (LONG_SIZE_MASK);
		goto l1;
	} else {
		sz = header & (SIZE_MASK);
		goto l1;
	}
l1:	/* end sizeBitsOf: */;
	p = ((usqInt) (sz - (BASE_HEADER_SIZE))) >> (SHIFT_FOR_WORD);

	/* index of last indexable field */

	p -= 1;
	processList = longAt((schedLists + (BASE_HEADER_SIZE)) + (p << (SHIFT_FOR_WORD)));
	while ((longAt((processList + (BASE_HEADER_SIZE)) + (FirstLinkIndex << (SHIFT_FOR_WORD)))) == foo->nilObj) {
		p -= 1;
		if (p < 0) {
			error("scheduler could not find a runnable process");
		}
		processList = longAt((schedLists + (BASE_HEADER_SIZE)) + (p << (SHIFT_FOR_WORD)));
	}
	return removeFirstLinkOfList(processList);
}


/*	Return the given 64-bit integer with its halves in the reverse order. */

sqInt wordSwapped(sqInt w) {
	
# if (BYTES_PER_WORD == 8)  // swap 32-bit ends of a 64-bit object word
	return ((((usqInt) w >> 32)) & Bytes3to0Mask) + ((((usqInt) w << 32)) & Bytes7to4Mask);
# else
	error("This cannot happen.");
# endif  // BYTES_PER_WORD == 8
	
	return null;
}

sqInt writeImageFileIOembedded(sqInt imageBytes, sqInt embedded) {
register struct foo * foo = &fum;
    sqInt bytesWritten;
    sqImageFile f;
    sqInt headerSize;
    squeakFileOffsetType  headerStart;
    sqInt i;
    sqInt okToWrite;
    void *sCWIfn;


	/* If the security plugin can be loaded, use it to check for write permission.
	If not, assume it's ok */

	sCWIfn = ioLoadFunctionFrom("secCanWriteImage", "SecurityPlugin");
	if (sCWIfn != 0) {
		okToWrite = ((sqInt (*)(void))sCWIfn)();
		if (!(okToWrite)) {
			/* begin primitiveFail */
			if (foo->primFailCode == 0) {
				foo->primFailCode = 1;
			}
			return null;
		}
	}
	headerStart = 0;

	/* header size in bytes; do not change! */

	headerSize = 16 * (BYTES_PER_WORD);
	f = sqImageFileOpen(imageName, "wb");
	if (f == null) {

		/* could not open the image file for writing */

		/* begin success: */
		if (!(0)) {
			if (!foo->primFailCode) {
				foo->primFailCode = 1;
			}
		}
		return null;
	}
	headerStart = sqImageFileStartLocation(f,imageName,headerSize+imageBytes);
	/* Note: on Unix systems one could put an exec command here, padded to 512 bytes */;
	sqImageFileSeek(f, headerStart);
	putLongtoFile(imageFormatVersionNumber, f);
	putLongtoFile(headerSize, f);
	putLongtoFile(imageBytes, f);
	putLongtoFile((sqInt)memory, f);
	putLongtoFile(foo->specialObjectsOop, f);
	putLongtoFile(foo->lastHash, f);
	putLongtoFile(ioScreenSize(), f);
	putLongtoFile(foo->fullScreenFlag, f);
	putLongtoFile(extraVMMemory, f);
	for (i = 1; i <= 7; i += 1) {
		putLongtoFile(0, f);
	}
	if (!(!foo->primFailCode)) {

		/* file write or seek failure */

		sqImageFileClose(f);
		return null;
	}
	sqImageFileSeek(f, headerStart + headerSize);
	bytesWritten = sqImageFileWrite(pointerForOop(memory), sizeof(unsigned char), imageBytes, f);
	/* begin success: */
	if (!(bytesWritten == imageBytes)) {
		if (!foo->primFailCode) {
			foo->primFailCode = 1;
		}
	}
	if (!(embedded)) {
		setMacFileTypeForImageFile();
	}
	sqImageFileClose(f);
	return null;
}


void* vm_exports[][3] = {
	{"", "primitiveAllObjects", (void*)primitiveAllObjects},
	{"", "addHighPriorityTickee", (void*)addHighPriorityTickee},
	{"", "primitiveDisablePowerManager", (void*)primitiveDisablePowerManager},
	{"", "removeGCRoot", (void*)removeGCRoot},
	{"", "primitiveSetGCSemaphore", (void*)primitiveSetGCSemaphore},
	{"", "printAllStacks", (void*)printAllStacks},
	{"", "addSynchronousTickee", (void*)addSynchronousTickee},
	{"", "reestablishContextPriorToCallback", (void*)reestablishContextPriorToCallback},
	{"", "primitiveRootTableAt", (void*)primitiveRootTableAt},
	{"", "primitiveLocalMicrosecondClock", (void*)primitiveLocalMicrosecondClock},
	{"", "primitiveIsRoot", (void*)primitiveIsRoot},
	{"", "primitiveBytecodeSetsAvailable", (void*)primitiveBytecodeSetsAvailable},
	{"", "primitiveDivideLargeIntegers", (void*)primitiveDivideLargeIntegers},
	{"", "primitiveUTCMicrosecondClock", (void*)primitiveUTCMicrosecondClock},
	{"", "primitiveRemLargeIntegers", (void*)primitiveRemLargeIntegers},
	{"", "primitiveMemorySnapshotBytesWithHeader", (void*)primitiveMemorySnapshotBytesWithHeader},
	{"", "primitiveEqualLargeIntegers", (void*)primitiveEqualLargeIntegers},
	{"", "amInVMThread", (void*)amInVMThread},
	{"", "primitiveQuoLargeIntegers", (void*)primitiveQuoLargeIntegers},
	{"", "getStackPointer", (void*)getStackPointer},
	{"", "callbackLeave", (void*)callbackLeave},
	{"", "primitiveInterpreterStateSnapshot", (void*)primitiveInterpreterStateSnapshot},
	{"", "primitiveSetGCBiasToGrowGCLimit", (void*)primitiveSetGCBiasToGrowGCLimit},
	{"", "primitiveMillisecondClockMask", (void*)primitiveMillisecondClockMask},
	{"", "primitiveRootTable", (void*)primitiveRootTable},
	{"", "primitiveDivLargeIntegers", (void*)primitiveDivLargeIntegers},
	{"", "internalIsMutable", (void*)internalIsMutable},
	{"", "primitiveMultiplyLargeIntegers", (void*)primitiveMultiplyLargeIntegers},
	{"", "moduleUnloaded", (void*)moduleUnloaded},
	{"", "primitiveGreaterOrEqualLargeIntegers", (void*)primitiveGreaterOrEqualLargeIntegers},
	{"", "primitiveAddLargeIntegers", (void*)primitiveAddLargeIntegers},
	{"", "ioUTCMicroseconds", (void*)ioUTCMicroseconds},
	{"", "primitiveBitAndLargeIntegers", (void*)primitiveBitAndLargeIntegers},
	{"", "callInterpreter", (void*)callInterpreter},
	{"", "primitiveModLargeIntegers", (void*)primitiveModLargeIntegers},
	{"", "primitivePlatformSourceVersion", (void*)primitivePlatformSourceVersion},
	{"", "sendInvokeCallbackStackRegistersJmpbuf", (void*)sendInvokeCallbackStackRegistersJmpbuf},
	{"", "primitiveScreenDepth", (void*)primitiveScreenDepth},
	{"", "primitiveMemoryCopy", (void*)primitiveMemoryCopy},
	{"", "primitiveNotEqualLargeIntegers", (void*)primitiveNotEqualLargeIntegers},
	{"", "primitiveMicrosecondClock", (void*)primitiveMicrosecondClock},
	{"", "primitiveLessOrEqualLargeIntegers", (void*)primitiveLessOrEqualLargeIntegers},
	{"", "primitiveBitShiftLargeIntegers", (void*)primitiveBitShiftLargeIntegers},
	{"", "primitiveVMVersion", (void*)primitiveVMVersion},
	{"", "extraHeaderBytes", (void*)extraHeaderBytes},
	{"", "primitiveIsBigEnder", (void*)primitiveIsBigEnder},
	{"", "primitiveGreaterThanLargeIntegers", (void*)primitiveGreaterThanLargeIntegers},
	{"", "primitiveIsYoung", (void*)primitiveIsYoung},
	{"", "primitiveBitXorLargeIntegers", (void*)primitiveBitXorLargeIntegers},
	{"", "primitiveSetGCBiasToGrow", (void*)primitiveSetGCBiasToGrow},
	{"", "primitiveMemorySnapshotWithHeader", (void*)primitiveMemorySnapshotWithHeader},
	{"", "primitiveLessThanLargeIntegers", (void*)primitiveLessThanLargeIntegers},
	{"", "internalIsImmutable", (void*)internalIsImmutable},
	{"", "primitiveImageFormatVersion", (void*)primitiveImageFormatVersion},
	{"", "primitiveUtcWithOffset", (void*)primitiveUtcWithOffset},
	{"", "dumpImage", (void*)dumpImage},
	{"", "primitiveSubtractLargeIntegers", (void*)primitiveSubtractLargeIntegers},
	{"", "callbackEnter", (void*)callbackEnter},
	{"", "primitiveBitOrLargeIntegers", (void*)primitiveBitOrLargeIntegers},
	{"", "primitiveTestShortenIndexableSize", (void*)primitiveTestShortenIndexableSize},
	{"", "primitiveResumeFromSnapshot", (void*)primitiveResumeFromSnapshot},
	{"", "addGCRoot", (void*)addGCRoot},
	{"", "primitiveInterpreterSourceVersion", (void*)primitiveInterpreterSourceVersion},
	{"", "primitiveForceTenure", (void*)primitiveForceTenure},
	{NULL, NULL, NULL}
};
