/* Automatically generated by
	CCodeGeneratorGlobalStructure VMMaker.oscog-eem.2509 uuid: 91e81f64-95de-4914-a960-8f842be3a194
   from
	CoInterpreter VMMaker.oscog-eem.2509 uuid: 91e81f64-95de-4914-a960-8f842be3a194
 */
static char __buildInfo[] = "CoInterpreter VMMaker.oscog-eem.2509 uuid: 91e81f64-95de-4914-a960-8f842be3a194 " __DATE__ ;
char *__interpBuildInfo = __buildInfo;



#if USE_GLOBAL_STRUCT
# define SQ_USE_GLOBAL_STRUCT 1
#else
# define SQ_USE_GLOBAL_STRUCT 0
#endif
#if USE_GLOBAL_STRUCT_REG 
# define SQ_USE_GLOBAL_STRUCT_REG 1
#else
# define SQ_USE_GLOBAL_STRUCT_REG 0
#endif

#include <stddef.h> /* for e.g. alloca */
#include <setjmp.h>
#include <wchar.h> /* for wint_t */
#include "sq.h"
#include "vmCallback.h"
#include "sqMemoryFence.h"
#include "dispdbg.h"
#include "sqCogStackAlignment.h"
#include "cogmethod.h"
#include "cointerp.h"
#include "cogit.h"


/* StackInterpreter class>>preambleCCode */
/* Disable Intel compiler inlining of warning which is used for breakpoints */
#pragma auto_inline(off)
sqInt warnpid, erroronwarn;
void
warning(char *s) { /* Print an error message but don't necessarily exit. */
	if (erroronwarn) error(s);
	if (warnpid)
		printf("\n%s pid %ld\n", s, (long)warnpid);
	else
		printf("\n%s\n", s);
}
void
warningat(char *s, int l) { /* ditto with line number. */
	/* use alloca to call warning so one does not have to remember to set two breakpoints... */
	char *sl = alloca(strlen(s) + 16);
	sprintf(sl, "%s %d", s, l);
	warning(sl);
}
#pragma auto_inline(on)

void
invalidCompactClassError(char *s) { /* Print a (compact) class index error message and exit. */
#if SPURVM
	printf("\nClass %s does not have the required class index\n", s);
#else
	printf("\nClass %s does not have the required compact class index\n", s);
#endif
	exit(-1);
}

/*
 * Define sigsetjmp and siglongjmp to be the most minimal setjmp/longjmp available on the platform.
 * Note: on windows 64 via mingw-w64, the 2nd argument NULL to _setjmp prevents stack unwinding
 */
#undef sigsetjmp
#undef siglongjmp
#if _MSC_VER
# define sigsetjmp(jb,ssmf) _setjmp(jb)
# define siglongjmp(jb,v) longjmp(jb,v)
#elif _WIN64 && __GNUC__
# define sigsetjmp(jb,ssmf) _setjmp(jb,NULL)
# define siglongjmp(jb,v) longjmp(jb,v)
#elif _WIN32
# define sigsetjmp(jb,ssmf) setjmp(jb)
# define siglongjmp(jb,v) longjmp(jb,v)
#else
# define sigsetjmp(jb,ssmf) _setjmp(jb)
# define siglongjmp(jb,v) _longjmp(jb,v)
#endif

#define odd(v) ((int)(v)&1)
#define even(v) (!odd(v))

/* end StackInterpreter class>>preambleCCode */


/*** Constants ***/
#define ActiveProcessIndex 1
#define AlternateHeaderHasPrimFlag 0x80000
#define AlternateHeaderNumLiteralsMask 0x7FFF
#define AltLongStoreBytecode 245
#define BecameActiveClassFlag 8
#define BecameCompiledMethodFlag 2
#define BecamePointerObjectFlag 1
#define BytecodeSetHasDirectedSuperSend 1
#define BytecodeSetHasExtensions 1
#define CacheProbeMax 3
#define CharacterTable null
#define CharacterValueIndex 0
#define CheckAllocationFillerAfterPrimCall 32
#define ClassAlien 52
#define ClassArray 7
#define ClassArrayCompactIndex 51
#define ClassBitmap 4
#define ClassBitmapCompactIndex 53
#define ClassBlockClosure 36
#define ClassBlockClosureCompactIndex 37
#define ClassByteArray 26
#define ClassByteString 6
#define ClassByteStringCompactIndex 52
#define ClassCharacter 19
#define ClassExternalAddress 43
#define ClassExternalData 45
#define ClassExternalFunction 46
#define ClassExternalLibrary 47
#define ClassExternalStructure 44
#define ClassFloat 9
#define ClassFloatCompactIndex 34
#define ClassFullBlockClosure 37
#define ClassFullBlockClosureCompactIndex 38
#define ClassLargeNegativeInteger 42
#define ClassLargeNegativeIntegerCompactIndex 32
#define ClassLargePositiveInteger 13
#define ClassLargePositiveIntegerCompactIndex 33
#define ClassMessage 15
#define ClassMessageCompactIndex 35
#define ClassMethodContext 10
#define ClassMethodContextCompactIndex 36
#define ClassMutex 39
#define ClassPoint 12
#define ClassSemaphore 18
#define ClassSmallInteger 5
#define ClassUnsafeAlien 54
#define ClosureFirstCopiedValueIndex 3
#define ClosureIndex 4
#define ClosureNumArgsIndex 2
#define ClosureOuterContextIndex 0
#define ClosureStartPCIndex 1
#define CMBlock 3
#define CMClosedPIC 4
#define CMMethod 2
#define CMOpenPIC 5
#define COGMTVM 0
#define ConstMinusOne 0xFFFFFFFFFFFFFFF9ULL
#define ConstOne 9
#define ConstTwo 17
#define ConstZero 1
#define CrossedX 258
#define CSCallbackLeave 4
#define CSEnterCriticalSection 5
#define CSExitCriticalSection 6
#define CSResume 7
#define CSSignal 8
#define CSSuspend 9
#define CSWait 10
#define CSYield 11
#define CtxtTempFrameStart 6
#define DisownVMForFFICall 16
#define DisownVMForThreading 32
#define DisownVMLockOutFullGC 8
#define DumpStackOnLowSpace 0
#define EncounteredUnknownBytecode -6
#define EndOfRun 0x101
#define ExcessSignalsIndex 2
#define ExternalObjectsArray 38
#define ExtraRootsSize 2048
#define FailImbalancedPrimitives 1
#define FalseObject 1
#define FirstLinkIndex 0
#define FoxCallerSavedIP 8
#define FoxIFReceiver -40
#define FoxIFrameFlags -24
#define FoxIFSavedIP -32
#define FoxMethod -8
#define FoxMFReceiver -24
#define FoxSavedFP 0
#define FoxThisContext -16
#define FullClosureCompiledBlockIndex 1
#define FullClosureFirstCopiedValueIndex 4
#define FullClosureReceiverIndex 3
#define GCCheckPrimCall 64
#define GCModeBecome 8
#define GCModeFreeSpace 32
#define GCModeFull 1
#define GCModeImageSegment 16
#define GCModeIncremental 4
#define GCModeNewSpace 2
#define HasBeenReturnedFromMCPC -1
#define HasBeenReturnedFromMCPCOop 0xFFFFFFFFFFFFFFF9ULL
#define HashMultiplyConstant 1664525
#define HeaderIndex 0
#define IFrameSlots 7
#if !defined(IMMUTABILITY) /* Allow this to be overridden on the compiler command line */
# define IMMUTABILITY 1
#endif
#define InstanceSpecificationIndex 2
#define InstructionPointerIndex 1
#define KeyIndex 0
#define LargeContextBit 0x100000
#define LargeContextSlots 62
#define LastLinkIndex 1
#define LiteralStart 1
#define LongStoreBytecode 129
#define LookupRuleMNU 259
#define LowcodeVM 0
#define MarkObjectsForEnumerationPrimitives 0
#define MarkOnTenure 5
#define MarkStackRootIndex 0x1000
#define MaxExternalPrimitiveTableSize 4096
#define MaxJumpBuf 32
#define MaxLiteralCountForCompile 60
#define MaxNegativeErrorCode -8
#define MaxPrimitiveIndex 575
#define MaxQuickPrimitiveIndex 519
#define MaxRTRefCount 7
#define MessageArgumentsIndex 1
#define MessageLookupClassIndex 2
#define MessageSelectorIndex 0
#define MethodArrayIndex 1
#define MethodCacheClass 2
#define MethodCacheEntries 0x400
#define MethodCacheEntrySize 4
#define MethodCacheMask 0xFFC
#define MethodCacheMethod 3
#define MethodCachePrimFunction 4
#define MethodCacheSelector 1
#define MethodCacheSize 4096
#define MethodDictionaryIndex 1
#define MethodHeaderArgCountShift 27
#define MethodHeaderFlagBitPosition 31
#define MethodHeaderTempCountShift 21
#define MethodIndex 3
#define MethodTooBig -4
#define MFMethodFlagHasContextFlag 1
#define MFMethodFlagIsBlockFlag 2
#define MFMethodFlagsMask 0x7
#define MFMethodMask -0x8
#define MFrameSlots 5
#define MillisecondClockMask 0x1FFFFFFF
#define MinBackwardJumpCountForCompile 40
#define MournQueueRootIndex 4098
#define MULTIPLEBYTECODESETS 1
#define MyListIndex 3
#define NewspeakVM 0
#define NextLinkIndex 0
#define NilObject 0
#define NotFullyInitialized -1
#define NSMethodCacheActualReceiver 7
#define NSMethodCacheCallingMethod 3
#define NSMethodCacheClassTag 2
#define NSMethodCacheDepthOrLookupRule 4
#define NSMethodCacheMask 0xFF8
#define NSMethodCachePrimFunction 6
#define NSMethodCacheSelector 1
#define NSMethodCacheSize 4096
#define NSMethodCacheTargetMethod 5
#define ObjStackFixedSlots 4
#define ObjStackFreex 2
#define ObjStackLimit 0xFF8
#define ObjStackMyx 1
#define ObjStackNextx 3
#define ObjStackPageSlots 0xFFC
#define ObjStackTopx 0
#define OldBecameNewFlag 4
#define PrimCallCollectsProfileSamples 16
#define PrimCallMayCallBack 4
#define PrimCallNeedsNewMethod 1
#define PrimCallNeedsPrimitiveFunction 2
#define PrimCallOnSmalltalkStack 8
#define PrimErrBadArgument 3
#define PrimErrBadIndex 4
#define PrimErrBadMethod 12
#define PrimErrBadNumArgs 5
#define PrimErrBadReceiver 2
#define PrimErrFFIException 22
#define PrimErrGenericFailure 1
#define PrimErrInappropriate 6
#define PrimErrLimitExceeded 15
#define PrimErrNamedInternal 13
#define PrimErrNoCMemory 10
#define PrimErrNoMemory 9
#define PrimErrNoModification 8
#define PrimErrNotFound 11
#define PrimErrObjectIsPinned 16
#define PrimErrOSError 21
#define PrimErrTableIndex 51
#define PrimErrUnsupported 7
#define PrimErrWritePastObject 17
#define PrimNoErr 0
#define PrimNumberDoExternalCall 218
#define PrimNumberDoPrimitive 118
#define PrimNumberExternalCall 117
#define PrimNumberFFICall 120
#define PrimNumberHashMultiply 159
#define PrimTraceLogSize 256
#define PriorityIndex 2
#define ProcessListsIndex 0
#define ProcessSignalingLowSpace 22
#define ReceiverIndex 5
#define RemapBufferSize 25
#define RememberedSetRootIndex 4099
#define ReturnToInterpreter 1
#define ScavengeInProgress 1
#define SchedulerAssociation 3
#define SelectorAboutToReturn 48
#define SelectorAttemptToAssign 50
#define SelectorCannotInterpret 34
#define SelectorCannotReturn 21
#define SelectorDoesNotUnderstand 20
#define SelectorInvokeCallback 53
#define SelectorMustBeBoolean 25
#define SelectorRunWithIn 49
#define SelectorSistaTrap 59
#define SelectorStart 2
#define SelectorUnknownBytecode 57
#define SenderIndex 0
#define ShouldNotJIT -8
#define SistaV1BytecodeSet 1
#define SistaVM 0
#define SlidingCompactionInProgress 2
#define SmallContextSlots 22
#define SPURVM 1
#define SpecialSelectors 23
#define StackPageReachedButUntraced 1
#define StackPageTraced 2
#define StackPageTraceInvalid -1
#define StackPageUnreached 0
#define StackPointerIndex 2
#define SuperclassIndex 0
#define SuspendedContextIndex 1
#define TempVectReadBarrier 0
#define TenureByAge 1
#define TenureByClass 2
#define TenureToShrinkRT 3
#define TheDisplay 14
#define TheFinalizationSemaphore 41
#define TheInputSemaphore null
#define TheInterruptSemaphore 30
#define TheLowSpaceSemaphore 17
#define TheTimerSemaphore 29
#define TopHashBit 0x200000
#define TopOopBit 0x8000000000000000ULL
#define TraceBlockActivation 17
#define TraceBlockCreation 25
#define TraceBufferSize 768
#define TraceCodeCompaction 49
#define TraceContextSwitch 9
#define TraceFullGC 41
#define TraceIncrementalGC 33
#define TraceIsFromInterpreter 2
#define TraceIsFromMachineCode 1
#define TracePrimitiveFailure 113
#define TracePrimitiveRetry 121
#define TraceStackOverflow 105
#define TraceVMCallback 89
#define TraceVMCallbackReturn 97
#define TrueObject 2
#define V3PrimitiveBitsMask 0x80000FF8U
#define ValueIndex 1
#if !defined(VMBIGENDIAN) /* Allow this to be overridden on the compiler command line */
# define VMBIGENDIAN 0
#endif
#define WeaklingStackRootIndex 0x1001
#define XIndex 0
#define YIndex 1

typedef struct {
	usqInt	sEdenBytes;
	usqInt	sPastBytes;
	usqInt	sRememberedSetSize;
	usqInt	sRememberedSetRedZone;
	usqInt	sRememberedSetLimit;
	usqInt	sStatTenures;
	usqInt	tTenureCriterion;
	usqInt	tTenureThreshold;
	usqInt	tRefCountToShrinkRT;
	usqInt	eSurvivorBytes;
	usqInt	eRememberedSetSize;
	usqInt	eStatTenures;
 } SpurScavengeLogRecord;


typedef struct {
	usqInt	segStart;
	usqInt	segSize;
	sqInt	swizzle;
	usqInt	containsPinned;
	usqInt	savedSegSize;
	usqInt	lastFreeObject;
 } SpurSegmentInfo;


typedef struct {
	usqInt	start;
	usqInt	limit;
 } SpurNewSpaceSpace;


typedef struct {
	usqInt	start;
	usqInt	limit;
	usqInt	top;
 } SpurContiguousObjStack;


typedef struct _StackPage {
	char *stackLimit;
	char *headSP;
	char *headFP;
	char *baseFP;
	char *baseAddress;
	char *realStackLimit;
	char *lastAddress;
	int	trace;
	int	padToWord;
	struct _StackPage *nextPage;
	struct _StackPage *prevPage;
 } StackPage;

#define CogStackPage StackPage



/*** Function Prototypes ***/


#if !PRODUCTION && defined(PlatformNoDbgRegParms)
# define NoDbgRegParms PlatformNoDbgRegParms
#endif

#if !defined(NoDbgRegParms)
# define NoDbgRegParms /*empty*/
#endif



#if !defined(NeverInline)
# define NeverInline /*empty*/
#endif

extern sqInt interpret(void);
static CogMethod * NoDbgRegParms cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod);
static sqInt NoDbgRegParms addressIsInPage(StackPage * self_in_addressIsInPage, char *address);
static sqInt NoDbgRegParms isFree(StackPage * self_in_isFree);
static void NoDbgRegParms freeStackPageNoAssert(StackPage *aPage);
static sqInt NoDbgRegParms freeStackPage(StackPage *aPage);
static void NoDbgRegParms markStackPageMostRecentlyUsed(StackPage *page);
static void NoDbgRegParms markStackPageNextMostRecentlyUsed(StackPage *page);
static StackPage * newStackPage(void);
static sqInt pageListIsWellFormed(void);
static StackPage * NoDbgRegParms stackPageAt(sqInt index);
static StackPage * NoDbgRegParms stackPageFor(void *pointer);
static double statAverageLivePagesWhenMapping(void);
extern signed char accessorDepthForPrimitiveIndex(sqInt primIndex);
static void NoDbgRegParms activateCoggedNewMethod(sqInt inInterpreter);
static void activateNewMethod(void);
static void NoDbgRegParms addNewMethodToCache(sqInt classObj);
extern usqInt argumentCountAddress(void);
static CogMethod * NoDbgRegParms asCogHomeMethod(CogBlockMethod *aCogMethod);
static void NoDbgRegParms assertValidExecutionPointersimbarline(usqInt lip, char *lifp, char *lisp, sqInt inInterpreter, sqInt ln);
extern void assertValidMachineCodeFrame(sqInt instrPtr);
static sqInt NoDbgRegParms assertValidStackedInstructionPointersInline(StackPage *aStackPage, sqInt ln);
static void NoDbgRegParms assertValidStackedInstructionPointers(sqInt ln);
static void NoDbgRegParms attemptToSwitchToMachineCode(sqInt bcpc);
EXPORT(sqInt) callbackEnter(sqInt *callbackID);
extern void callForCogCompiledCodeCompaction(void);
static void NoDbgRegParms callRegisterArgCogMethodatreceiver(CogMethod *cogMethod, sqInt entryOffset, sqInt rcvr);
extern void ceActivateFailingPrimitiveMethod(sqInt aPrimitiveMethod);
extern sqInt ceBaseFrameReturn(sqInt returnValue);
#if IMMUTABILITY
extern sqInt ceCannotAssignTowithIndexvalueToAssign(sqInt immutableObject, sqInt index, sqInt valueToAssign);
#endif /* IMMUTABILITY */
extern sqInt ceCannotResume(void);
extern void ceCheckAndMaybeRetryPrimitive(sqInt primIndex);
extern void ceCheckForInterrupts(void);
extern void ceCheckProfileTick(void);
extern sqInt ceContextinstVar(sqInt maybeContext, sqInt slotIndex);
extern sqInt ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop);
extern sqInt ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr);
extern sqInt ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr);
extern sqInt ceNewHashOf(sqInt anObject);
extern sqInt ceNonLocalReturn(sqInt returnValue);
extern void ceReapAndResetErrorCodeFor(CogMethod *cogMethod);
extern sqInt ceReturnToInterpreter(sqInt anOop);
extern sqInt ceSendAborttonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs);
extern sqInt ceSendFromInLineCacheMiss(CogMethod *cogMethodOrPIC);
extern void ceSendMustBeBooleanTointerpretingAtDelta(sqInt aNonBooleanObject, sqInt jumpSize);
extern sqInt ceSendMustBeBoolean(sqInt anObject);
extern void ceSendaboveClassBindingtonumArgs(sqInt selector, sqInt methodClassBinding, sqInt rcvr, sqInt numArgs);
extern sqInt ceSendabovetonumArgs(sqInt selector, sqInt methodClass, sqInt rcvr, sqInt numArgs);
extern sqInt ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt numArgs);
extern void ceStackOverflow(sqInt contextSwitchIfNotNil);
extern void ceTraceBlockActivation(void);
extern void ceTraceLinkedSend(sqInt theReceiver);
extern void ceTraceStoreOfinto(sqInt aValue, sqInt anObject);
extern void checkAssertsEnabledInCoInterpreter(void);
static sqInt NoDbgRegParms checkCodeIntegrity(sqInt gcModes);
static sqInt checkLogIntegrity(void);
static sqInt NoDbgRegParms checkOkayFields(sqInt oop);
static sqInt checkStackIntegrity(void);
extern void clearTraceLog(void);
extern CogMethod * cogMethodOf(sqInt aMethodOop);
static void commenceCogCompiledCodeCompaction(void);
extern void compilationBreakpointFor(sqInt selectorOop);
static sqInt NoDbgRegParms contextInstructionPointerframe(sqInt theIP, char *theFP);
extern sqInt defaultNativeStackFrameSize(void);
static sqInt NoDbgRegParms deferStackLimitSmashAroundwith(void (*functionSymbol)(sqInt), sqInt arg);
static sqInt NoDbgRegParms divorceAMachineCodeFrameWithCogMethodin(CogMethod *cogMethod, StackPage *aStackPage);
extern void dumpPrimTraceLog(void);
extern void dumpTraceLog(void);
static void NoDbgRegParms ensureContextHasBytecodePC(sqInt aContext);
static void NoDbgRegParms ensureContextIsExecutionSafeAfterAssignToStackPointer(sqInt aContext);
static sqInt enterSmalltalkExecutiveImplementation(void);
extern void executeCogMethodfromLinkedSendWithReceiver(CogMethod *cogMethod, sqInt rcvr);
static void NoDbgRegParms executeCogMethodfromUnlinkedSendWithReceiver(CogMethod *cogMethod, sqInt rcvr);
extern void executeCogPICfromLinkedSendWithReceiverandCacheTag(CogMethod *cogPIC, sqInt rcvr, sqInt cacheTag);
static sqInt executeNewMethod(void);
static sqInt NoDbgRegParms externalInstVarofContext(sqInt offset, sqInt aContext);
static void NoDbgRegParms findNewMethodInClassTag(sqInt classTagArg);
extern void flushExternalPrimitiveOf(sqInt methodObj);
static void flushMethodCache(void);
static void followForwardedFieldsInCurrentMethod(void);
static void NoDbgRegParms followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags);
extern void forceInterruptCheckFromHeartbeat(void);
static sqInt NoDbgRegParms frameCallerContext(char *theFP);
static sqInt NoDbgRegParms frameHasContext(char *theFP);
static sqInt NoDbgRegParms frameIsBlockActivation(char *theFP);
static sqInt NoDbgRegParms frameMethodObject(char *theFP);
static sqInt NoDbgRegParms frameNumArgs(char *theFP);
extern usqInt framePointerAddress(void);
static sqInt NoDbgRegParms frameReceiver(char *theFP);
extern void (*functionPointerForCompiledMethodprimitiveIndex(sqInt methodObj, sqInt primIndex))(void) ;
extern sqInt getCheckAllocFiller(void);
static sqInt getCogVMFlags(void);
extern sqInt getCurrentBytecode(void);
static sqInt NoDbgRegParms handleForwardedSendFaultForReceiverstackDelta(sqInt forwardedReceiver, sqInt stackDelta);
static sqInt NoDbgRegParms handleMNUInMachineCodeToclassForMessage(sqInt selectorIndex, sqInt rcvr, sqInt classForMessage);
static sqInt NoDbgRegParms iframeIsBlockActivation(char *theFP);
static sqInt NoDbgRegParms iframeReceiver(char *theFP);
static sqInt NoDbgRegParms iframeSavedIP(char *theFP);
extern void ifValidWriteBackStackPointersSaveTo(void *theCFP, void *theCSP, char **savedFPP, char **savedSPP);
extern usqInt instructionPointerAddress(void);
static sqInt NoDbgRegParms instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sqInt instrPtr);
extern usqInt interpretAddress(void);
static sqInt NeverInline interpreterAllocationReserveBytes(void);
static sqInt interpretMethodFromMachineCode(void);
extern sqInt isCogMethodReference(sqInt methodHeader);
static sqInt NoDbgRegParms isMachineCodeFrame(char *theFP);
extern sqInt lookupMNUreceiver(sqInt selector, sqInt rcvr);
extern sqInt lookupOrdinaryreceiver(sqInt selector, sqInt rcvr);
static StackPage * NoDbgRegParms makeBaseFrameFor(sqInt aContext);
static void mapPrimTraceLog(void);
static void NeverInline mapStackPages(void);
static void mapTraceLog(void);
extern void markActiveMethodsAndReferents(void);
static void markAndTracePrimTraceLog(void);
static void NoDbgRegParms markAndTraceStackPage(StackPage *thePage);
static void markAndTraceTraceLog(void);
static void NoDbgRegParms markCogMethodsAndReferentsOnPage(StackPage *thePage);
extern sqInt marryFrameCopiesTemps(void);
extern sqInt maxLookupNoMNUErrorCode(void);
static void NoDbgRegParms maybeFlagMethodAsInterpreted(sqInt aMethod);
extern sqInt mcprimFunctionForPrimitiveIndex(sqInt primIndex);
extern void * methodCacheAddress(void);
extern sqInt methodHasCogMethod(sqInt aMethodOop);
extern sqInt methodNeedsLargeContext(sqInt methodObj);
extern sqInt methodShouldBeCogged(sqInt aMethodObj);
static sqInt NoDbgRegParms methodWithHeaderShouldBeCogged(sqInt methodHeader);
static CogBlockMethod * NoDbgRegParms mframeCogMethod(char *theFP);
extern CogMethod * mframeHomeMethodExport(void);
extern CogMethod * mframeHomeMethod(char *theFP);
static sqInt NoDbgRegParms mframeIsBlockActivation(char *theFP);
static sqInt NoDbgRegParms mframeReceiver(char *theFP);
static sqInt minimumUnusedHeadroom(void);
extern sqInt mMethodClass(void);
extern void mnuCompilationBreakpointFor(sqInt selectorOop);
static sqInt NoDbgRegParms mnuMethodOrNilFor(sqInt rcvr);
static char * NoDbgRegParms moveFramesInthroughtoPage(StackPage *oldPage, char *theFP, StackPage *newPage);
static sqInt NoDbgRegParms mustMapMachineCodePCcontext(sqInt theIP, sqInt aOnceMarriedContext);
extern usqInt newMethodAddress(void);
static sqInt NoDbgRegParms newMethodInLookupCacheAtand(sqInt selector, sqInt classTag);
extern usqInt nextProfileTickAddress(void);
extern sqInt noAssertHeaderOf(sqInt methodPointer);
extern sqInt positive32BitIntegerFor(unsigned int integerValue);
extern unsigned int positive32BitValueOf(sqInt oop);
extern sqInt positive64BitIntegerFor(usqLong integerValue);
extern usqLong positive64BitValueOf(sqInt oop);
static void NoDbgRegParms postGCAction(sqInt gcModeArg);
static void NoDbgRegParms preGCAction(sqInt gcModeArg);
extern sqInt primErrTable(void);
extern usqInt primFailCodeAddress(void);
extern usqInt primitiveFailAddress(void);
extern sqInt primitivePropertyFlags(sqInt primIndex);
extern void * primTraceLogAddress(void);
extern usqInt primTraceLogIndexAddress(void);
extern void printCogMethod(CogMethod *cogMethod);
static void NoDbgRegParms printFrameFlagsForFP(char *theFP);
static void NoDbgRegParms printFrameMethodFor(char *theFP);
static void NoDbgRegParms printFrameThingatextraString(char *name, char *address, char *extraStringOrNil);
static void NoDbgRegParms printFrameThingatextra(char *name, char *address, sqInt extraValue);
extern sqInt printFrameWithSP(char *theFP, char *theSP);
static void NoDbgRegParms printLogEntryAt(sqInt i);
extern void printMethodCacheFor(sqInt thing);
static sqInt NoDbgRegParms printPrimLogEntryAt(sqInt i);
extern sqInt quickPrimitiveConstantFor(sqInt aQuickPrimitiveIndex);
extern sqInt (*quickPrimitiveGeneratorFor(sqInt aQuickPrimitiveIndex))(void) ;
extern sqInt quickPrimitiveInstVarIndexFor(sqInt primIndex);
extern sqInt rawHeaderOf(sqInt methodPointer);
extern void rawHeaderOfput(sqInt methodOop, sqInt cogMethodOrMethodHeader);
extern size_t readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squeakFileOffsetType imageOffset);
extern void reportMinimumUnusedHeadroom(void);
static sqInt NoDbgRegParms resumepreemptedYieldingIffrom(sqInt aProcess, sqInt yieldImplicitly, sqInt sourceCode);
static sqInt NoDbgRegParms returnToExecutivepostContextSwitch(sqInt inInterpreter, sqInt switchedContext);
static sqInt NoDbgRegParms returntoExecutive(sqInt returnValue, sqInt inInterpreter);
static void NoDbgRegParms rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void));
static sqInt NoDbgRegParms roomToPushNArgs(sqInt n);
EXPORT(sqInt) sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext);
EXPORT(sqInt) sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr);
static sqInt NoDbgRegParms shortPrintFrame(char *theFP);
extern sqInt signed32BitIntegerFor(sqInt integerValue);
extern int signed32BitValueOf(sqInt oop);
extern sqInt signed64BitIntegerFor(sqLong integerValue);
extern sqLong signed64BitValueOf(sqInt oop);
static sqInt slowPrimitiveResponse(void);
extern sqInt specialSelectorNumArgs(sqInt index);
extern usqInt stackLimitAddress(void);
static sqInt stackLimitOffset(void);
static sqInt stackPageHeadroom(void);
extern usqInt stackPointerAddress(void);
extern sqInt startPCOfMethodHeader(sqInt aCompiledMethodHeader);
extern sqInt startPCOrNilOfLiteralin(sqInt lit, sqInt aMethodObj);
static sqInt NoDbgRegParms synchronousSignal(sqInt aSemaphore);
static void NoDbgRegParms tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFromtoreturnValue(sqInt contextToReturnFrom, sqInt contextToReturnTo, sqInt returnValue);
static void NoDbgRegParms transferTofrom(sqInt newProc, sqInt sourceCode);
extern void updateStackZoneReferencesToCompiledCodePreCompaction(void);
static void NoDbgRegParms updateStateOfSpouseContextForFrameWithSP(char *theFP, char *theSP);
extern sqInt validInstructionPointerinMethodframePointer(usqInt instrPointer, usqInt aMethod, char *fp);
static sqInt NoDbgRegParms validStackPageBaseFrame(StackPage *aPage);
extern usqInt varBaseAddress(void);
static sqInt NoDbgRegParms voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims);
extern char * whereIs(sqInt anOop);
static void NoDbgRegParms NeverInline widowOrForceToBytecodePC(sqInt ctxt);
static sqInt NoDbgRegParms frameIsMarked(sqInt theFPInt);
extern sqInt mcprimHashMultiply(sqInt receiverArg);
static void primitiveClosureCopyWithCopiedValues(void);
static void primitiveCollectCogCodeConstituents(void);
static void primitiveContextXray(void);
static void primitiveEnterCriticalSection(void);
static void primitiveExitCriticalSection(void);
static void primitiveFlushCacheByMethod(void);
static void primitiveFlushCacheBySelector(void);
extern usqInt primitiveFunctionPointerAddress(void);
EXPORT(sqInt) primitiveLongRunningPrimitiveSemaphore(void);
EXPORT(sqInt) primitiveMethodPCData(void);
static void primitiveMethodXray(void);
EXPORT(void) primitiveMinimumUnusedHeadroom(void);
static void primitiveObjectAt(void);
static void primitiveObjectAtPut(void);
EXPORT(sqInt) primitiveProfileSemaphore(void);
static void primitiveResume(void);
static void primitiveSignal(void);
static void primitiveSnapshot(void);
static void primitiveSnapshotEmbedded(void);
static void primitiveSuspend(void);
static void primitiveTerminateTo(void);
static void primitiveVoidVMState(void);
static void primitiveVoidVMStateForMethod(void);
static void primitiveWait(void);
static void primitiveYield(void);
static void unmarkAllFrames(void);
static void NoDbgRegParms initializeStacknumSlotspageSize(char *theStackPages, sqInt stackSlots, sqInt slotsPerPage);
static sqInt NoDbgRegParms pageIndexFor(void *pointer);
#if IMMUTABILITY
static sqInt NoDbgRegParms canBeImmutable(sqInt oop);
#endif /* IMMUTABILITY */
extern char * cStringOrNullFor(sqInt oop);
extern sqInt failed(void);
static sqInt NoDbgRegParms isNegativeIntegerValueOf(sqInt oop);
extern sqInt isPositiveMachineIntegerObject(sqInt oop);
static sqInt NoDbgRegParms magnitude64BitIntegerForneg(usqLong magnitude, sqInt isNegative);
static usqLong NoDbgRegParms magnitude64BitValueOf(sqInt oop);
extern usqIntptr_t positiveMachineIntegerValueOf(sqInt oop);
static void primitiveAdd(void);
EXPORT(void) primitiveAddLargeIntegers(void);
static void primitiveAdoptInstance(void);
EXPORT(void) primitiveAllInstances(void);
EXPORT(void) primitiveAllObjects(void);
static void primitiveArctan(void);
static void primitiveArrayBecome(void);
static void primitiveArrayBecomeOneWay(void);
static void primitiveArrayBecomeOneWayCopyHash(void);
static void primitiveArrayBecomeOneWayNoCopyHash(void);
static void primitiveAsCharacter(void);
static void primitiveAsFloat(void);
static void primitiveAt(void);
static void primitiveAtPut(void);
static void primitiveBeCursor(void);
static void primitiveBeDisplay(void);
static void primitiveBeep(void);
static void primitiveBehaviorHash(void);
static void primitiveBitAnd(void);
EXPORT(void) primitiveBitAndLargeIntegers(void);
static void primitiveBitOr(void);
EXPORT(void) primitiveBitOrLargeIntegers(void);
static void primitiveBitShift(void);
EXPORT(void) primitiveBitShiftLargeIntegers(void);
static void primitiveBitXor(void);
EXPORT(void) primitiveBitXorLargeIntegers(void);
static void primitiveBytesLeft(void);
static void primitiveCalloutToFFI(void);
static void primitiveChangeClass(void);
static void primitiveClass(void);
static void primitiveClearVMProfile(void);
static void primitiveClipboardText(void);
EXPORT(sqInt) primitiveClockLogAddresses(void);
static void primitiveClosureValue(void);
extern void primitiveClosureValueNoContextSwitch(void);
static void primitiveClosureValueWithArgs(void);
static void primitiveCoarseLocalMicrosecondClock(void);
static void primitiveCoarseUTCMicrosecondClock(void);
EXPORT(void) primitiveCompareBytes(void);
EXPORT(void) primitiveCompareWith(void);
static void primitiveConstantFill(void);
static void primitiveControlVMProfiling(void);
static void primitiveCopyObject(void);
EXPORT(sqInt) primitiveCrashVM(void);
EXPORT(sqInt) primitiveDisablePowerManager(void);
static void primitiveDiv(void);
static void primitiveDivide(void);
EXPORT(void) primitiveDivideLargeIntegers(void);
EXPORT(void) primitiveDivLargeIntegers(void);
static void primitiveEqual(void);
EXPORT(void) primitiveEqualLargeIntegers(void);
static void primitiveExitToDebugger(void);
static void primitiveExp(void);
static void primitiveExponent(void);
extern sqInt primitiveFail(void);
extern sqInt primitiveFailForFFIExceptionat(usqLong exceptionCode, usqInt pc);
extern sqInt primitiveFailForOSError(sqLong osError);
extern sqInt primitiveFailFor(sqInt reasonCode);
extern sqInt primitiveFailureCode(void);
static void primitiveFetchNextMourner(void);
static void primitiveFloatAdd(void);
static void primitiveFloatAt(void);
static void primitiveFloatAtPut(void);
static void primitiveFloatDivide(void);
static void primitiveFloatEqual(void);
static void primitiveFloatGreaterOrEqual(void);
static void primitiveFloatGreaterThan(void);
static void primitiveFloatLessOrEqual(void);
static void primitiveFloatLessThan(void);
static void primitiveFloatMultiply(void);
static void primitiveFloatNotEqual(void);
static void primitiveFloatSubtract(void);
static void primitiveFlushCache(void);
static void primitiveFlushExternalPrimitives(void);
static void primitiveForceDisplayUpdate(void);
static void primitiveFormPrint(void);
static void primitiveFractionalPart(void);
static void primitiveFullClosureValue(void);
extern void primitiveFullClosureValueNoContextSwitch(void);
static void primitiveFullClosureValueWithArgs(void);
static void primitiveGetAttribute(void);
EXPORT(sqInt) primitiveGetenv(void);
#if IMMUTABILITY
static void primitiveGetImmutability(void);
#else
# define primitiveGetImmutability (void (*)(void))0
#endif /* IMMUTABILITY */
EXPORT(sqInt) primitiveGetLogDirectory(void);
static void primitiveGetNextEvent(void);
EXPORT(sqInt) primitiveGetWindowLabel(void);
EXPORT(sqInt) primitiveGetWindowSize(void);
static void primitiveGreaterOrEqual(void);
EXPORT(void) primitiveGreaterOrEqualLargeIntegers(void);
static void primitiveGreaterThan(void);
EXPORT(void) primitiveGreaterThanLargeIntegers(void);
static void primitiveGrowMemoryByAtLeast(void);
static void primitiveHashMultiply(void);
EXPORT(sqInt) primitiveHeartbeatFrequency(void);
EXPORT(sqInt) primitiveHighResClock(void);
static void primitiveIdentical(void);
static void primitiveIdentityHash(void);
EXPORT(sqInt) primitiveImageFormatVersion(void);
static void primitiveImageName(void);
static void primitiveImmediateAsInteger(void);
static void primitiveInputSemaphore(void);
static void primitiveInputWord(void);
static void primitiveIntegerAt(void);
static void primitiveIntegerAtPut(void);
EXPORT(sqInt) primitiveInterruptChecksPerMSec(void);
static void primitiveInterruptSemaphore(void);
static void primitiveInvokeObjectAsMethod(void);
EXPORT(sqInt) primitiveIsBigEnder(void);
static void primitiveIsPinned(void);
EXPORT(sqInt) primitiveIsWindowObscured(void);
static void primitiveKbdNext(void);
static void primitiveKbdPeek(void);
static void primitiveLessOrEqual(void);
EXPORT(void) primitiveLessOrEqualLargeIntegers(void);
static void primitiveLessThan(void);
EXPORT(void) primitiveLessThanLargeIntegers(void);
static void primitiveListBuiltinModule(void);
static void primitiveListExternalModule(void);
static void primitiveLoadImageSegment(void);
static void primitiveLocalMicrosecondClock(void);
static void primitiveLogN(void);
static void primitiveLowSpaceSemaphore(void);
static void primitiveMakePoint(void);
static void primitiveMaxIdentityHash(void);
extern usqInt primitiveMethod(void);
static void primitiveMillisecondClock(void);
EXPORT(sqInt) primitiveMillisecondClockMask(void);
static void primitiveMod(void);
EXPORT(void) primitiveModLargeIntegers(void);
static void primitiveMouseButtons(void);
static void primitiveMousePoint(void);
static void primitiveMultiply(void);
EXPORT(void) primitiveMultiplyLargeIntegers(void);
static void primitiveNew(void);
static void primitiveNewMethod(void);
static void primitiveNewWithArg(void);
static void primitiveNextInstance(void);
static void primitiveNextObject(void);
static void primitiveNoop(void);
static void primitiveNotEqual(void);
EXPORT(void) primitiveNotEqualLargeIntegers(void);
static void primitiveNotIdentical(void);
EXPORT(sqInt) primitivePathToUsing(void);
static void primitivePerformInSuperclass(void);
static void primitivePerformWithArgs(void);
EXPORT(sqInt) primitiveProfilePrimitive(void);
EXPORT(sqInt) primitiveProfileSample(void);
EXPORT(sqInt) primitiveProfileStart(void);
static void primitiveQuit(void);
static void primitiveQuo(void);
EXPORT(void) primitiveQuoLargeIntegers(void);
static void primitiveRelinquishProcessor(void);
EXPORT(void) primitiveRemLargeIntegers(void);
static void primitiveScanCharacters(void);
EXPORT(sqInt) primitiveScreenDepth(void);
EXPORT(sqInt) primitiveScreenScaleFactor(void);
static void primitiveScreenSize(void);
static void primitiveSecondsClock(void);
static void primitiveSetDisplayMode(void);
static void primitiveSetFullScreen(void);
#if IMMUTABILITY
static void primitiveSetImmutability(void);
#else
# define primitiveSetImmutability (void (*)(void))0
#endif /* IMMUTABILITY */
static void primitiveSetInterruptKey(void);
EXPORT(sqInt) primitiveSetLogDirectory(void);
static void primitiveSetOrHasIdentityHash(void);
EXPORT(sqInt) primitiveSetWindowLabel(void);
EXPORT(sqInt) primitiveSetWindowSize(void);
static void primitiveShortAt(void);
static void primitiveShortAtPut(void);
static void primitiveShowDisplayRect(void);
static void primitiveSignalAtBytesLeft(void);
static void primitiveSine(void);
static void primitiveSize(void);
static void primitiveSizeInBytes(void);
static void primitiveSizeInBytesOfInstance(void);
static void primitiveSmallFloatAdd(void);
static void primitiveSmallFloatArctan(void);
static void primitiveSmallFloatDivide(void);
static void primitiveSmallFloatEqual(void);
static void primitiveSmallFloatExp(void);
static void primitiveSmallFloatExponent(void);
static void primitiveSmallFloatFractionalPart(void);
static void primitiveSmallFloatGreaterOrEqual(void);
static void primitiveSmallFloatGreaterThan(void);
static void primitiveSmallFloatLessOrEqual(void);
static void primitiveSmallFloatLessThan(void);
static void primitiveSmallFloatLogN(void);
static void primitiveSmallFloatMultiply(void);
static void primitiveSmallFloatNotEqual(void);
static void primitiveSmallFloatSine(void);
static void primitiveSmallFloatSquareRoot(void);
static void primitiveSmallFloatSubtract(void);
static void primitiveSmallFloatTimesTwoPower(void);
static void primitiveSmallFloatTruncated(void);
static void primitiveSomeInstance(void);
static void primitiveSomeObject(void);
static void primitiveSpecialObjectsOop(void);
static void primitiveSquareRoot(void);
static void primitiveStoreImageSegment(void);
static void primitiveStringAt(void);
static void primitiveStringAtPut(void);
static void primitiveStringReplace(void);
static void primitiveSubtract(void);
EXPORT(void) primitiveSubtractLargeIntegers(void);
static void primitiveTestAndSetOwnershipOfCriticalSection(void);
static void primitiveTestDisplayDepth(void);
static void primitiveTimesTwoPower(void);
static void primitiveTruncated(void);
static void primitiveUnloadModule(void);
static void primitiveUpdateTimezone(void);
static void primitiveUTCMicrosecondClock(void);
static void primitiveUtcAndTimezoneOffset(void);
EXPORT(sqInt) primitiveUtcWithOffset(void);
static void primitiveVMPath(void);
static void primitiveVMProfileSamplesInto(void);
extern sqInt signalNoResume(sqInt aSemaphore);
extern sqIntptr_t signedMachineIntegerValueOf(sqInt oop);
extern usqInt sizeOfAlienData(sqInt oop);
extern void * startOfAlienData(sqInt oop);
extern sqInt success(sqInt successBoolean);
extern void ceScheduleScavenge(void);
extern sqInt classSmallFloat(void);
static void clearLeakMapAndMapAccessibleObjects(void);
extern void ensureNoForwardedLiteralsIn(sqInt aMethodObj);
extern usqInt freeStartAddress(void);
extern usqInt getScavengeThreshold(void);
static sqLong NoDbgRegParms headerWhileForwardingOf(sqInt aCompiledMethodObjOop);
extern sqInt isForwardedClassIndex(sqInt maybeClassIndex);
extern sqInt isImmediateClass(sqInt classObj);
extern sqInt isReallyYoungObject(sqInt objOop);
extern sqInt methodHeaderOf(sqInt methodObj);
extern usqInt needGCFlagAddress(void);
extern sqLong nullHeaderForMachineCodeMethod(void);
extern sqInt receiverTagBitsForMethod(sqInt aMethodObj);
extern usqInt scavengeThresholdAddress(void);
extern usqInt specialObjectsArrayAddress(void);
extern sqInt withoutForwardingOnandwithsendToCogit(sqInt obj1, sqInt obj2, sqInt aBool, sqInt (*selector)(sqInt,sqInt,sqInt));
static usqInt NoDbgRegParms addressAfter(sqInt objOop);
static sqInt NoDbgRegParms allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt formatField, sqInt classIndex);
static sqInt NoDbgRegParms allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt formatField, sqInt classIndex);
extern sqInt byteSwapped(sqInt w);
static usqInt NoDbgRegParms bytesInObject(sqInt objOop);
static sqInt NoDbgRegParms changeClassOfto(sqInt rcvr, sqInt argClass);
static double NoDbgRegParms dbgFloatValueOf(sqInt oop);
static sqInt defaultEdenBytes(void);
extern sqInt fetchClassTagOf(sqInt oop);
static sqInt NoDbgRegParms fetchLong32ofFloatObject(sqInt fieldIndex, sqInt oop);
extern sqInt floatObjectOf(double aFloat);
extern double floatValueOf(sqInt oop);
extern sqInt headerIndicatesAlternateBytecodeSet(sqInt methodHeader);
static sqInt NoDbgRegParms initFreeChunkWithBytesat(usqLong numBytes, sqInt address);
static void NoDbgRegParms initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address);
extern sqInt instantiateClassindexableSize(sqInt classObj, usqInt nElements);
extern sqInt integerObjectOf(sqInt value);
extern sqInt integerValueOf(sqInt oop);
static sqInt NoDbgRegParms isImmediateFloat(sqInt oop);
extern sqInt isIntegerObject(sqInt oop);
extern sqInt isIntegerValue(sqInt intValue);
static sqInt NoDbgRegParms isLilliputianSize(sqInt chunkBytes);
extern sqInt isMarked(sqInt objOop);
static sqInt NoDbgRegParms isNonIntegerObject(sqInt oop);
static sqInt NoDbgRegParms isSmallFloatValue(double aFloat);
static sqInt NoDbgRegParms lengthOfformat(sqInt objOop, sqInt fmt);
static sqInt maxSlotsForAlloc(void);
static sqInt numFreeLists(void);
extern sqInt shortentoIndexableSize(sqInt objOop, sqInt indexableSize);
static double NoDbgRegParms smallFloatValueOf(sqInt oop);
extern usqInt smallObjectBytesForSlots(sqInt numSlots);
static sqInt wordIndexableFormat(void);
static void NoDbgRegParms NeverInline addToEphemeronList(sqInt ephemeronCorpse);
static void NoDbgRegParms NeverInline addToWeakList(sqInt weakCorpse);
static sqInt allNewSpaceObjectsHaveZeroRTRefCount(void);
static sqInt allWeakSurvivorsOnWeakList(void);
static void NeverInline computeRefCountToShrinkRT(void);
static sqInt NoDbgRegParms copyAndForwardMourner(sqInt mourner);
static sqInt NoDbgRegParms copyAndForward(sqInt survivor);
static sqInt NoDbgRegParms NeverInline copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSurvivor);
static usqInt NoDbgRegParms firstCorpse(sqInt headOfCorpseList);
static void growRememberedSet(void);
static sqInt NoDbgRegParms isInRememberedSet(sqInt objOop);
static sqInt NoDbgRegParms isMaybeOldScavengeSurvivor(sqInt oop);
static sqInt NoDbgRegParms isScavengeSurvivor(sqInt oop);
static sqInt NoDbgRegParms isonWeaklingList(sqInt oop, sqInt listHead);
static usqInt newSpaceCapacity(void);
static sqInt noUnfiredEphemeronsAtEndOfRememberedSet(void);
extern void openScavengeLog(void);
extern void printRememberedSet(void);
static void processEphemerons(void);
static void processWeaklings(void);
static sqInt NoDbgRegParms processWeakSurvivor(sqInt weakObj);
extern sqInt remember(sqInt objOop);
static void NoDbgRegParms scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress);
static void scavengeLoop(void);
static sqInt NoDbgRegParms scavengeReferentsOf(sqInt referrer);
static void NoDbgRegParms scavengeRememberedSetStartingAt(sqInt n);
static float scavengerTenuringThreshold(void);
static sqInt scavengeUnfiredEphemeronsOnEphemeronList(void);
static void NeverInline writeScavengeLog(void);
static sqInt NoDbgRegParms accessibleObjectAfter(sqInt objOop);
static sqInt NoDbgRegParms NeverInline activeAndDeferredScan(sqInt anEphemeron);
static void NoDbgRegParms addFreeSubTree(sqInt freeTree);
extern sqInt addGCRoot(sqInt *varLoc);
extern sqInt addressCouldBeObj(sqInt address);
extern sqInt addressCouldBeOop(sqInt address);
static sqInt NoDbgRegParms addToFreeListbytes(sqInt freeChunk, sqInt chunkBytes);
static sqInt NoDbgRegParms allInstancesOf(sqInt aClass);
static sqInt allObjects(void);
static sqInt allObjectsUnmarked(void);
static sqInt allOldMarkedWeakObjectsOnWeaklingStack(void);
static sqInt allocateLargestFreeChunk(void);
static sqInt NoDbgRegParms allocateNewSpaceSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex);
static sqInt NoDbgRegParms allocateOldSpaceChunkOfBytes(usqInt chunkBytes);
extern sqInt allocatePinnedSlots(sqInt nSlots);
static sqInt allocationUnit(void);
static sqInt NoDbgRegParms allStrongSlotsOfWeaklingAreMarked(sqInt aWeakling);
static sqInt allUnscannedEphemeronsAreActive(void);
extern sqInt arrayFormat(void);
static sqInt NoDbgRegParms NeverInline assertInnerValidFreeObject(sqInt objOop);
static sqInt NoDbgRegParms becomeEffectFlagsFor(sqInt objOop);
extern sqInt becomewith(sqInt array1, sqInt array2);
static sqInt NoDbgRegParms becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt copyHashFlag);
extern void beRootIfOld(sqInt oop);
static sqInt bitsSetInFreeSpaceMaskForAllFreeLists(void);
static sqInt bridgeSize(void);
static sqInt byteFormatMask(void);
extern sqInt byteSizeOf(sqInt oop);
extern sqInt characterObjectOf(sqInt characterCode);
extern void characterTable(void);
extern usqInt characterValueOf(sqInt oop);
static sqInt NoDbgRegParms cheapAddressCouldBeInHeap(sqInt address);
extern sqInt checkedLongAt(sqInt byteAddress);
static sqInt checkHeapFreeSpaceIntegrity(void);
static sqInt NoDbgRegParms checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid);
extern sqInt checkOkayOop(usqInt oop);
extern sqInt checkOopHasOkayClass(usqInt obj);
static sqInt NoDbgRegParms checkOopIntegritynamed(sqInt obj, char *name);
static sqInt NoDbgRegParms checkOopIntegritynamedindex(sqInt obj, char *name, sqInt i);
extern sqInt classAlien(void);
extern sqInt classArray(void);
extern sqInt classAtIndex(sqInt classIndex);
static sqInt NoDbgRegParms classAtIndexput(sqInt classIndex, sqInt objOop);
extern sqInt classBitmap(void);
extern sqInt classByteArray(void);
extern sqInt classCharacter(void);
extern sqInt classExternalAddress(void);
extern sqInt classExternalData(void);
extern sqInt classExternalFunction(void);
extern sqInt classExternalLibrary(void);
extern sqInt classExternalStructure(void);
extern sqInt classFloat(void);
static sqInt NoDbgRegParms classFormatForInstanceFormat(sqInt aFormat);
static sqInt classIndexFieldWidth(void);
extern sqInt classIndexOf(sqInt objOop);
extern sqInt classLargeNegativeInteger(void);
extern sqInt classLargePositiveInteger(void);
extern sqInt classOrNilAtIndex(sqInt classIndex);
extern sqInt classPoint(void);
extern sqInt classSemaphore(void);
extern sqInt classSmallInteger(void);
extern sqInt classString(void);
extern sqInt classTableMinorIndexMask(void);
extern sqInt classTablePageSize(void);
extern sqInt classTableRootObj(void);
static sqInt classTableRootSlots(void);
extern sqInt classTagForClass(sqInt classObj);
extern sqInt classUnsafeAlien(void);
static void clearLeakMapAndMapAccessibleFreeSpace(void);
static sqInt NoDbgRegParms cloneInOldSpaceforPinning(sqInt objOop, sqInt forPinning);
extern sqInt clone(sqInt objOop);
extern sqInt compactClassIndexOf(sqInt objOop);
static sqInt NoDbgRegParms copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endSeg, sqInt savedFirstFields, sqInt i);
extern void countMarkedAndUnmarkdObjects(sqInt printFlags);
static usqLong currentAllocatedBytes(void);
extern sqInt displayObject(void);
static void NoDbgRegParms doScavenge(sqInt tenuringCriterion);
extern sqInt eeInstantiateClassIndexformatnumSlots(sqInt knownClassIndex, sqInt objFormat, sqInt numSlots);
static void NoDbgRegParms emptyObjStack(sqInt objStack);
static sqInt NoDbgRegParms ensureRoomOnObjStackAt(sqInt objStackRootIndex);
static sqInt NoDbgRegParms enterIntoClassTable(sqInt aBehavior);
static sqInt ephemeronFormat(void);
static sqInt NoDbgRegParms existInstancesInNewSpaceOf(sqInt classObj);
static void NoDbgRegParms expungeFromClassTable(sqInt aBehavior);
extern sqInt falseObject(void);
extern sqInt fetchByteofObject(sqInt byteIndex, sqInt objOop);
static sqInt NoDbgRegParms NeverInline fetchClassOfNonImm(sqInt objOop);
extern sqInt fetchClassOf(sqInt oop);
static sqInt NoDbgRegParms fetchClassTagOfNonImm(sqInt obj);
extern sqInt fetchLong32ofObject(sqInt fieldIndex, sqInt oop);
static sqInt NoDbgRegParms fetchPointerofFreeChunk(sqInt fieldIndex, sqInt objOop);
extern sqInt fetchPointerofObject(sqInt fieldIndex, sqInt objOop);
static sqInt findLargestFreeChunk(void);
extern void findStringBeginningWith(char *aCString);
extern void findString(char *aCString);
static sqInt firstAccessibleObject(void);
static void * NoDbgRegParms firstFixedFieldOfMaybeImmediate(sqInt oop);
extern void * firstFixedField(sqInt objOop);
extern void * firstIndexableField(sqInt objOop);
extern sqInt fixedFieldsOfClassFormatMask(void);
extern sqInt fixedFieldsOfClassFormat(sqInt classFormat);
static sqInt NoDbgRegParms fixedFieldsOfClass(sqInt objOop);
static sqInt NoDbgRegParms fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength);
static sqInt NoDbgRegParms NeverInline fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue);
static sqInt NoDbgRegParms followFieldofObject(sqInt fieldIndex, sqInt anObject);
extern sqInt followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth);
extern sqInt followForwarded(sqInt objOop);
static sqInt NoDbgRegParms followObjFieldofObject(sqInt fieldIndex, sqInt anObject);
extern sqInt formatOfClass(sqInt classPointer);
static sqInt NoDbgRegParms formatOf(sqInt objOop);
static sqInt forwardedFormat(void);
static sqInt NoDbgRegParms forwardersIn(sqInt anObject);
static sqInt freeChunkNextIndex(void);
static sqInt freeChunkParentIndex(void);
static sqInt freeChunkPrevIndex(void);
static sqInt NoDbgRegParms freeChunkWithBytesat(sqInt bytes, sqInt address);
extern sqInt freeObject(sqInt objOop);
extern usqLong NeverInline fullGC(void);
static float getHeapGrowthToSizeGCRatio(void);
static sqInt NoDbgRegParms goodContextSize(sqInt oop);
static sqInt NoDbgRegParms growOldSpaceByAtLeast(sqInt minAmmount);
extern usqLong headerForSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex);
static usqLong NoDbgRegParms headerForSlotshashformatclassIndex(sqInt numSlots, sqInt hash, sqInt formatField, sqInt classIndex);
static sqInt hiddenRootSlots(void);
static sqInt hiddenRootsObject(void);
static sqInt imageSegmentVersion(void);
#if IMMUTABILITY
extern sqInt immutableBitMask(void);
#endif /* IMMUTABILITY */
extern void incrementalGC(void);
extern sqInt indexOfin(sqInt anElement, sqInt anObject);
static void NoDbgRegParms inFreeTreeReplacewith(sqInt treeNode, sqInt newNode);
static sqInt NoDbgRegParms initialInstanceOf(sqInt classObj);
static void NeverInline initializeNewSpaceVariables(void);
static void NoDbgRegParms initializeObjectMemory(sqInt bytesToShift);
extern void inOrderPrintFreeTreeprintList(sqInt freeChunk, sqInt printNextList);
static void NoDbgRegParms NeverInline inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag);
extern sqInt instanceSizeOf(sqInt classObj);
static sqInt NoDbgRegParms instantiateClass(sqInt classObj);
extern sqInt instSpecOfClassFormat(sqInt classFormat);
static sqInt NoDbgRegParms instSpecOfClass(sqInt classPointer);
static sqInt NoDbgRegParms isAnyPointerFormat(sqInt format);
extern sqInt isArrayNonImm(sqInt oop);
extern sqInt isArray(sqInt oop);
extern sqInt isBytes(sqInt oop);
extern sqInt isCharacterObject(sqInt oop);
extern sqInt isCharacterValue(sqInt anInteger);
static sqInt NoDbgRegParms isClassAtUniqueIndex(sqInt aClass);
static sqInt NoDbgRegParms isCompiledMethodFormat(sqInt format);
static sqInt NoDbgRegParms isCompiledMethodHeader(sqInt objHeader);
extern sqInt isCompiledMethod(sqInt objOop);
static sqInt NoDbgRegParms isContextHeader(sqInt aHeader);
static sqInt NoDbgRegParms isContext(sqInt oop);
static sqInt NoDbgRegParms isCopiedIntoSegment(sqInt anObjectInTheHeap);
static sqInt NoDbgRegParms isEmptyObjStack(sqInt objStack);
static sqInt NoDbgRegParms isEnumerableObjectNoAssert(sqInt objOop);
static sqInt NoDbgRegParms isEnumerableObject(sqInt objOop);
static sqInt NoDbgRegParms isEphemeronFormat(sqInt format);
static sqInt NoDbgRegParms isEphemeron(sqInt objOop);
extern sqInt isFixedSizePointerFormat(sqInt format);
static sqInt NoDbgRegParms isForwardedClassTag(sqInt classIndex);
extern sqInt isForwarded(sqInt objOop);
static sqInt NoDbgRegParms isFreeObject(sqInt objOop);
static sqInt NoDbgRegParms isFreeOop(sqInt oop);
extern sqInt isImmediate(sqInt oop);
static sqInt NoDbgRegParms isInClassTable(sqInt objOop);
extern sqInt isIndexable(sqInt objOop);
static sqInt NoDbgRegParms isInEden(sqInt objOop);
static sqInt NoDbgRegParms isInFutureSpace(sqInt address);
extern sqInt isInMemory(sqInt address);
static sqInt NoDbgRegParms isInNewSpace(sqInt objOop);
extern sqInt isInOldSpace(sqInt address);
static sqInt NoDbgRegParms isInPastSpace(sqInt address);
static sqInt NoDbgRegParms isLargeFreeObject(sqInt objOop);
static sqInt NoDbgRegParms isMaybeFiredEphemeron(sqInt objOop);
extern sqInt isNonImmediate(sqInt oop);
static sqInt NoDbgRegParms isObjEphemeron(sqInt objOop);
static sqInt NoDbgRegParms isObjImmutable(sqInt anOop);
extern sqInt isOldObject(sqInt objOop);
extern sqInt isOopCompiledMethod(sqInt oop);
extern sqInt isOopForwarded(sqInt oop);
extern sqInt isOopImmutable(sqInt oop);
extern sqInt isOopMutable(sqInt oop);
extern sqInt isPinned(sqInt objOop);
extern sqInt isPointers(sqInt oop);
static sqInt NoDbgRegParms isPureBitsFormat(sqInt format);
extern sqInt isReallyYoung(sqInt oop);
static sqInt NoDbgRegParms isRemembered(sqInt objOop);
static sqInt NoDbgRegParms isSegmentBridge(sqInt objOop);
static sqInt NoDbgRegParms isSemaphoreOop(sqInt anOop);
extern sqInt isUnambiguouslyForwarder(sqInt objOop);
extern sqInt isUnmarked(sqInt objOop);
extern sqInt isValidClassTag(sqInt classIndex);
static sqInt NoDbgRegParms isValidObjStackAt(sqInt objStackRootIndex);
static sqInt NoDbgRegParms isValidObjStackPagemyIndex(sqInt objStackPage, sqInt myx);
static sqInt NoDbgRegParms isValidObjStackPagemyIndexfirstPage(sqInt objStackPage, sqInt myx, sqInt isFirstPage);
static sqInt NoDbgRegParms isValidObjStack(sqInt objStack);
static sqInt NoDbgRegParms isWeakFormat(sqInt format);
static sqInt NoDbgRegParms isWeakNonImm(sqInt objOop);
extern sqInt isWeak(sqInt oop);
extern sqInt isWordsOrBytes(sqInt oop);
extern sqInt isWords(sqInt oop);
extern sqInt isYoungObject(sqInt objOop);
extern sqInt isYoung(sqInt oop);
static sqInt NoDbgRegParms isinstanceOfcompactClassIndex(sqInt oop, sqInt classOop, sqInt compactClassIndex);
static sqInt NoDbgRegParms isonObjStack(sqInt oop, sqInt objStack);
static sqInt NoDbgRegParms keyOfEphemeron(sqInt objOop);
static sqInt NoDbgRegParms knownClassAtIndex(sqInt classIndex);
static sqInt lastPointerFormat(void);
extern sqInt lastPointerOfWhileSwizzling(sqInt objOop);
extern sqInt lastPointerOf(sqInt objOop);
extern sqInt leakCheckBecome(void);
extern sqInt leakCheckFullGC(void);
extern sqInt leakCheckIncremental(void);
extern sqInt leakCheckNewSpaceGC(void);
static sqInt NoDbgRegParms lengthOfMaybeImmediate(sqInt oop);
extern sqInt lengthOf(sqInt objOop);
extern sqInt literalCountOfMethodHeader(sqInt header);
extern sqInt literalCountOf(sqInt methodPointer);
static sqInt NoDbgRegParms NeverInline loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray);
extern void longPrintInstancesOf(sqInt aClassOop);
extern void longPrintInstancesWithClassIndex(sqInt classIndex);
extern void longPrintReferencesTo(sqInt anOop);
static void mapExtraRoots(void);
static void NeverInline mapMournQueue(void);
static sqInt NoDbgRegParms mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointerArray, sqInt savedOutHashes);
static void NoDbgRegParms markAndTraceClassOf(sqInt objOop);
static void NoDbgRegParms markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents);
extern void NeverInline markAndTrace(sqInt objOop);
static sqInt markInactiveEphemerons(void);
static void NoDbgRegParms NeverInline markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged);
static void markWeaklingsAndMarkAndFireEphemerons(void);
extern sqInt maybeMethodClassOfseemsToBeInstantiating(sqInt methodObj, sqInt format);
extern sqInt maybeSplObj(sqInt index);
extern sqInt minSlotsForShortening(void);
static sqInt NoDbgRegParms newHashBitsOf(sqInt objOop);
static sqInt newObjectHash(void);
static sqInt newSpaceIsEmpty(void);
extern sqInt nilObject(void);
static void NeverInline nilUnmarkedWeaklingSlots(void);
static sqInt NoDbgRegParms noCheckClassAtIndex(sqInt classIndex);
static sqInt NoDbgRegParms noCheckPushonObjStack(sqInt objOop, sqInt objStack);
static sqInt NoDbgRegParms noFixupFollowFieldofObject(sqInt fieldIndex, sqInt anObject);
static sqInt NoDbgRegParms noInlineFollowForwarded(sqInt objOop);
static sqInt NoDbgRegParms noInlineObjectAfterlimit(sqInt objOop, sqInt limit);
extern sqInt nonIndexablePointerFormat(void);
static sqInt noUnscannedEphemerons(void);
static sqInt NoDbgRegParms numBytesOfBytes(sqInt objOop);
extern sqInt numBytesOf(sqInt objOop);
extern sqInt numPointerSlotsOf(sqInt objOop);
static usqInt NoDbgRegParms numSlotsOfAny(sqInt objOop);
extern usqInt numSlotsOf(sqInt objOop);
static sqInt NoDbgRegParms numStrongSlotsOfInephemeral(sqInt objOop);
extern sqInt numStrongSlotsOfWeakling(sqInt objOop);
extern sqInt objectAfter(sqInt objOop);
extern sqInt objectBefore(sqInt objOop);
static sqInt NoDbgRegParms objectStartingAt(sqInt address);
static sqInt NoDbgRegParms NeverInline objectsReachableFromRoots(sqInt arrayOfRoots);
extern sqInt obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop);
static sqInt NoDbgRegParms okayOop(sqInt signedOop);
extern sqInt oldSpaceObjectAfter(sqInt objOop);
static void NoDbgRegParms NeverInline outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag);
extern sqInt pinObject(sqInt objOop);
static sqInt NoDbgRegParms popObjStack(sqInt objStack);
extern sqInt popRemappableOop(void);
static void NoDbgRegParms postBecomeScanClassTable(sqInt effectsFlags);
extern sqInt primitiveErrorTable(void);
extern void printActivationsOf(sqInt aMethodObj);
extern void printBogons(void);
extern void printContextReferencesTo(sqInt anOop);
extern void printEntity(sqInt oop);
extern void printForwarders(void);
extern void printFreeChunks(void);
extern void printFreeChunk(sqInt freeChunk);
static void NoDbgRegParms printFreeChunkprintAsTreeNode(sqInt freeChunk, sqInt printAsTreeNode);
extern void printFreeListHeads(void);
extern sqInt printFreeList(sqInt chunkOrIndex);
extern void printFreeTree(void);
static void NoDbgRegParms printFreeTreeChunk(sqInt chunkOrZero);
extern void printHeaderOf(sqInt objOop);
static void NoDbgRegParms printHeaderTypeOf(sqInt objOop);
extern void printInstancesOf(sqInt aClassOop);
extern void printInstancesWithClassIndex(sqInt classIndex);
extern void printInvalidClassTableEntries(void);
#if LLDB
extern void printMarkedOops(void);
#endif /* LLDB */
extern void printMethodImplementorsOf(sqInt anOop);
extern void printMethodReferencesTo(sqInt anOop);
extern void printObjectsFromto(sqInt startAddress, sqInt endAddress);
extern void printObjectsWithHash(sqInt hash);
static void NoDbgRegParms printObjStackPagemyIndexpageType(sqInt objStackPage, sqInt myx, sqInt pageType);
static void NoDbgRegParms printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType);
extern void printObjStack(sqInt objStack);
extern void NeverInline printOopsExcept(sqInt (*function)(sqInt));
extern void printOopsFromto(sqInt startAddress, sqInt endAddress);
extern void NeverInline printOopsSuchThat(sqInt (*function)(sqInt));
extern void printReferencesTo(sqInt anOop);
#if LLDB
extern void printUnmarkedOops(void);
#endif /* LLDB */
static sqInt NoDbgRegParms pushOnUnscannedEphemeronsStack(sqInt anEphemeron);
extern void pushRemappableOop(sqInt oop);
static void NoDbgRegParms queueMourner(sqInt anEphemeronOrWeakArray);
extern sqInt rawHashBitsOf(sqInt objOop);
static sqInt NoDbgRegParms relocateObjStackForPlanningCompactor(sqInt objStack);
extern sqInt removeGCRoot(sqInt *varLoc);
static sqInt NoDbgRegParms returnrestoringObjectsInsavedFirstFieldsandsavedHashes(sqInt errCode, sqInt firstArray, sqInt savedFirstFields, sqInt secondArray, sqInt savedHashes);
static sqInt NoDbgRegParms returnrestoringObjectsInupTosavedFirstFields(sqInt errCode, sqInt firstArray, sqInt limitOrTag, sqInt savedFirstFields);
static void NoDbgRegParms NeverInline reverseBytesIn32BitWordsIn(sqInt segmentWordArray);
static void NoDbgRegParms runLeakCheckerForFreeSpace(sqInt gcModes);
static void NoDbgRegParms runLeakCheckerFor(sqInt gcModes);
static void NoDbgRegParms runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid);
static void NoDbgRegParms scavengingGCTenuringIf(sqInt tenuringCriterion);
static sqInt NoDbgRegParms NeverInline setHeapBasememoryLimitendOfMemory(sqInt baseOfHeap, sqInt memLimit, sqInt memEnd);
extern void shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress);
extern sqInt shouldRemapOop(sqInt oop);
static sqInt NoDbgRegParms sizeOfObjStack(sqInt objStack);
static sqInt slidingCompactionInProgress(void);
extern sqInt slotSizeOf(sqInt oop);
extern sqInt splObj(sqInt index);
static usqInt NoDbgRegParms startOfObject(sqInt objOop);
EXPORT(sqInt) statNumGCs(void);
extern usqInt storeCheckBoundary(void);
static sqInt NoDbgRegParms storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointerArrayArg, sqInt arrayOfRootsArg);
extern sqInt storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
extern sqInt storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer);
extern sqInt stringForCString(const char *aCString);
static sqInt NoDbgRegParms sufficientSpaceAfterGC(sqInt numBytes);
static sqInt NoDbgRegParms swizzleObjStackAt(sqInt objStackRootIndex);
extern void tenuringIncrementalGC(void);
static sqInt NoDbgRegParms topOfObjStack(sqInt objStack);
extern sqInt topRemappableOop(void);
static sqInt totalFreeListBytes(void);
extern sqInt trueObject(void);
static sqInt NoDbgRegParms unlinkFreeChunkchunkBytes(sqInt freeChunk, sqInt chunkBytes);
static sqInt NoDbgRegParms NeverInline unlinkLilliputianChunkindex(sqInt freeChunk, sqInt index);
static void NoDbgRegParms unlinkSolitaryFreeTreeNode(sqInt freeTreeNode);
extern sqInt unpinObject(sqInt objOop);
static void NoDbgRegParms updateListStartingAt(sqInt freeNode);
static sqInt validClassTableHashes(void);
static sqInt validClassTableRootPages(void);
extern sqInt validFreeTree(void);
static sqInt NoDbgRegParms validFreeTreeChunk(sqInt chunk);
static const char * NoDbgRegParms validFreeTreeChunkparent(sqInt chunk, sqInt parent);
static sqInt validObjStacks(void);
extern sqInt vmEndianness(void);
static void NeverInline compact(void);
static sqInt NeverInline copyAndUnmarkMobileObjects(void);
static void NoDbgRegParms NeverInline copyAndUnmark(sqInt firstPass);
static void NoDbgRegParms freeFromupTonextObject(usqInt initialToFinger, usqInt limit, sqInt nextObject);
static sqInt initializeScanCheckingForFullyCompactedHeap(void);
static sqInt NoDbgRegParms isMobile(sqInt obj);
static sqInt NoDbgRegParms isPostMobile(sqInt obj);
static sqInt NeverInline planCompactSavingForwarders(void);
static void NoDbgRegParms reinitializeScanFrom(sqInt initialObject);
extern sqInt remapObj(sqInt objOop);
static sqInt savedFirstFieldsSpaceWasAllocated(void);
static sqInt NoDbgRegParms scanForFirstFreeAndFirstMobileObjectFrom(sqInt initialObject);
extern sqInt shouldRemapObj(sqInt objOop);
static void NeverInline updatePointers(void);
static void NoDbgRegParms updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr);
static sqInt NoDbgRegParms useSegmentForSavedFirstFieldsSpace(sqInt spaceEstimate);
static sqInt NoDbgRegParms validRelocationPlanInPass(sqInt onePass);
static usqInt NoDbgRegParms segLimit(SpurSegmentInfo * self_in_segLimit);
static SpurSegmentInfo * NoDbgRegParms addSegmentOfSize(sqInt ammount);
static void NoDbgRegParms adjustSegmentSwizzlesBy(sqInt firstSegmentShift);
static sqInt allBridgesMarked(void);
static void allocateOrExtendSegmentInfos(void);
static sqInt NoDbgRegParms bridgeAt(sqInt segIndex);
static sqInt NoDbgRegParms bridgeFor(SpurSegmentInfo *aSegment);
static void NoDbgRegParms bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil);
static void checkSegments(void);
static void collapseSegmentsPostSwizzle(void);
static void * NoDbgRegParms firstGapOfSizeAtLeast(sqInt size);
static sqInt NoDbgRegParms isEmptySegment(SpurSegmentInfo *seg);
static sqInt NoDbgRegParms isInSegments(usqInt address);
static sqInt NoDbgRegParms isValidSegmentBridge(sqInt objOop);
static SpurSegmentInfo * NoDbgRegParms nextNonEmptySegmentAfter(sqInt i);
static void postSnapshot(void);
static void NeverInline prepareForSnapshot(void);
static sqInt NoDbgRegParms readHeapFromImageFiledataBytes(sqImageFile f, sqInt numBytes);
EXPORT(SpurSegmentInfo *) segmentContainingObj(sqInt objOop);
static sqInt segmentOverlap(void);
static sqInt NoDbgRegParms shrinkObjectMemory(usqInt delta);
static sqInt someSegmentContainsPinned(void);
static sqInt NoDbgRegParms swizzleObj(sqInt objOop);
static usqInt totalBytesInSegments(void);
static sqInt NoDbgRegParms writeImageSegmentsToFile(sqImageFile aBinaryStream);
static sqInt NoDbgRegParms writeSegmentnextSegmenttoFile(SpurSegmentInfo *segment, SpurSegmentInfo *nextSegment, sqImageFile aBinaryStream);
extern sqInt activeProcess(void);
extern void addIdleUsecs(sqInt idleUsecs);
static void NoDbgRegParms addLastLinktoList(sqInt proc, sqInt aList);
static sqInt NoDbgRegParms addressCouldBeClassObj(sqInt maybeClassObj);
static char * allOnesAsCharStar(void);
extern sqInt argumentCountOfClosure(sqInt closurePointer);
extern sqInt argumentCountOfMethodHeader(sqInt header);
extern sqInt argumentCountOf(sqInt methodPointer);
extern void * arrayValueOf(sqInt arrayOop);
static sqInt NoDbgRegParms asciiOfCharacter(sqInt characterObj);
extern void assertValidExecutionPointers(usqInt lip, char *lifp, char *lisp);
static void NoDbgRegParms assertValidStackLimits(sqInt ln);
extern sqInt booleanValueOf(sqInt obj);
EXPORT(sqInt) callbackLeave(sqInt cbID);
extern sqInt canContextSwitchIfActivatingheader(sqInt theMethod, sqInt methodHeader);
extern sqInt characterForAscii(sqInt ascii);
extern sqInt checkAllAccessibleObjectsOkay(void);
static sqInt checkDeliveryOfLongRunningPrimitiveSignal(void);
extern sqInt checkedIntegerValueOf(sqInt intOop);
static sqInt NoDbgRegParms checkForEventsMayContextSwitch(sqInt mayContextSwitch);
static sqInt NoDbgRegParms checkImageVersionFromstartingAt(sqImageFile f, squeakFileOffsetType imageOffset);
static sqInt checkInterpreterIntegrity(void);
static sqInt NoDbgRegParms checkIsStillMarriedContextcurrentFP(sqInt aContext, char *currentFP);
extern sqInt checkOkayInterpreterObjects(sqInt writeBack);
static sqInt NoDbgRegParms checkOkayStackPage(StackPage *thePage);
static sqInt NoDbgRegParms checkOkayStackZone(sqInt writeBack);
static void NoDbgRegParms checkProfileTick(sqInt aPrimitiveMethod);
static sqInt NoDbgRegParms checkStackPointerForMaybeMarriedContext(sqInt aContext);
static sqInt NoDbgRegParms checkStackPointerIndexForFrame(char *theFP);
static sqInt NoDbgRegParms classNameOfIs(sqInt aClass, char *className);
static sqInt NoDbgRegParms contexthasSender(sqInt thisCntx, sqInt aContext);
static sqInt NoDbgRegParms contexthasValidInversePCMappingOfin(sqInt aContext, sqInt theIP, char *theFP);
extern sqInt copiedValueCountOfClosure(sqInt closurePointer);
extern sqInt copiedValueCountOfFullClosure(sqInt closurePointer);
extern sqInt copyBits(void);
extern sqInt copyBitsFromtoat(sqInt x0, sqInt x1, sqInt y);
static sqInt NoDbgRegParms NeverInline couldBeProcess(sqInt oop);
static void cr(void);
static void NoDbgRegParms createActualMessageTo(sqInt lookupClass);
static sqInt defaultNumStackPages(void);
extern sqInt disownVM(sqInt flags);
static sqInt divorceAllFrames(void);
static void NoDbgRegParms divorceFramesIn(StackPage *aStackPage);
static sqInt NoDbgRegParms doPrimitiveDivby(sqInt rcvr, sqInt arg);
static sqInt NoDbgRegParms doPrimitiveModby(sqInt rcvr, sqInt arg);
extern sqInt doSignalSemaphoreWithIndex(sqInt index);
static void dummyReferToProxy(void);
static sqInt NoDbgRegParms ensureCallerContext(char *theFP);
static void NoDbgRegParms ensureImageFormatIsUpToDate(sqInt swapBytes);
static char * NoDbgRegParms establishFrameForContextToReturnTo(sqInt contextToReturnTo);
static void NoDbgRegParms externalDivorceFrameandContext(char *theFP, sqInt ctxt);
static char * NoDbgRegParms externalEnsureIsBaseFrame(char *aFramePtr);
static sqInt NoDbgRegParms externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop);
static sqInt externalQuickPrimitiveResponse(void);
static void failUnbalancedPrimitive(void);
extern void * fetchArrayofObject(sqInt fieldIndex, sqInt objectPointer);
extern double fetchFloatofObject(sqInt fieldIndex, sqInt objectPointer);
extern sqInt fetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer);
static sqInt NoDbgRegParms fetchPointerofMarriedContext(sqInt offset, sqInt aContext);
static sqInt NoDbgRegParms fetchStackPointerOf(sqInt aContext);
static sqInt NoDbgRegParms findClassContainingMethodstartingAt(sqInt meth, sqInt classObj);
extern sqInt findClassOfMethodforReceiver(sqInt meth, sqInt rcvr);
static char * NoDbgRegParms findFrameAboveinPage(char *theFP, StackPage *thePage);
static sqInt NoDbgRegParms findHomeForContext(sqInt aContext);
static sqInt NoDbgRegParms findMethodWithPrimitiveFromContextUpToContext(sqInt primitive, sqInt senderContext, sqInt homeContext);
extern sqInt findSelectorOfMethod(sqInt meth);
static char * NoDbgRegParms findSPOfon(char *theFP, StackPage *thePage);
static sqInt NoDbgRegParms findUnwindThroughContext(sqInt homeContext);
static void NoDbgRegParms flushMethodCacheForMethod(sqInt oldMethod);
static void NoDbgRegParms followForwardedFrameContentsstackPointer(char *theFP, char *theSP);
extern sqInt forceInterruptCheck(void);
static sqInt NoDbgRegParms frameContext(char *theFP);
static char * NoDbgRegParms frameOfMarriedContext(sqInt aContext);
static sqInt NoDbgRegParms frameStackedReceiverOffsetNumArgs(sqInt numArgs);
static sqInt NoDbgRegParms frameStackedReceiverOffset(char *theFP);
static sqInt NoDbgRegParms frameStackedReceivernumArgs(char *theFP, sqInt numArgs);
static void freeUntracedStackPages(void);
extern sqInt fullDisplayUpdate(void);
extern void (*functionPointerForinClass(sqInt primIdx,sqInt theClass))(void) ;
static sqInt getErrorObjectFromPrimFailCode(void);
extern sqInt getFullScreenFlag(void);
extern sqInt getInterruptKeycode(void);
extern sqInt getInterruptPending(void);
extern usqLong getNextWakeupUsecs(void);
extern sqInt getSavedWindowSize(void);
static sqInt NoDbgRegParms getShortFromFileswap(sqImageFile aFile, sqInt swapFlag);
static sqInt getSnapshotScreenSize(void);
extern sqInt * getStackPointer(void);
extern sqInt getThisSessionID(void);
static sqInt NoDbgRegParms getWord32FromFileswap(sqImageFile aFile, sqInt swapFlag);
static sqInt NoDbgRegParms handleForwardedSelectorFaultFor(sqInt selectorOop);
static sqInt NoDbgRegParms handleForwardedSendFaultForTag(sqInt classTag);
static sqInt NoDbgRegParms handleSpecialSelectorSendFaultForfpsp(sqInt obj, char *theFP, char *theSP);
static void NeverInline handleStackOverflow(void);
static sqInt NoDbgRegParms handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch);
extern sqInt highBit(usqInt anUnsignedValue);
static sqInt NoDbgRegParms ifCurrentStackPageHasValidHeadPointers(StackPage *thePage);
static usqInt NoDbgRegParms iframeMethod(char *theFP);
extern sqInt includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass);
extern void ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean);
static sqInt NoDbgRegParms isBaseFrame(char *theFP);
extern sqInt isBooleanObject(sqInt oop);
extern sqInt isFloatObject(sqInt oop);
static sqInt NoDbgRegParms isFrameonPage(char *aFrame, StackPage *aPage);
extern sqInt isKindOfInteger(sqInt oop);
extern sqInt isLargeIntegerObject(sqInt oop);
extern sqInt isLargeNegativeIntegerObject(sqInt oop);
extern sqInt isLargePositiveIntegerObject(sqInt oop);
static sqInt NoDbgRegParms isLiveContext(sqInt oop);
static sqInt NoDbgRegParms isMarriedOrWidowedContext(sqInt aContext);
static sqInt NoDbgRegParms isMetaPrimitiveIndex(sqInt primIndex);
static sqInt NoDbgRegParms isNullExternalPrimitiveCall(sqInt aMethodObj);
static sqInt isPrimitiveFunctionPointerAnIndex(void);
extern sqInt isQuickPrimitiveIndex(sqInt anInteger);
extern sqInt isReadMediatedContextInstVarIndex(sqInt index);
static sqInt NoDbgRegParms isSingleContext(sqInt aContext);
static sqInt NoDbgRegParms isVanillaBlockClosure(sqInt aClosure);
static sqInt NoDbgRegParms isWidowedContextDuringGC(sqInt aOnceMarriedContext);
static sqInt NoDbgRegParms isWidowedContext(sqInt aOnceMarriedContext);
extern sqInt isWriteMediatedContextInstVarIndex(sqInt index);
extern sqInt isKindOfClass(sqInt oop, sqInt aClass);
extern sqInt isKindOf(sqInt oop, char *className);
extern sqInt isMemberOf(sqInt oop, char *className);
static sqInt NoDbgRegParms lengthOfNameOfClass(sqInt classOop);
extern sqInt literalofMethod(sqInt offset, sqInt methodPointer);
extern sqInt loadBitBltFrom(sqInt bb);
extern void loadInitialContext(void);
extern void longPrintOop(sqInt oop);
extern sqInt longStoreBytecodeForHeader(sqInt methodHeader);
static sqInt NoDbgRegParms lookupInMethodCacheSelclassTag(sqInt selector, sqInt classTag);
static sqInt NoDbgRegParms lookupMethodInClass(sqInt class);
static sqInt NoDbgRegParms lookupMNUInClass(sqInt class);
static sqInt NoDbgRegParms lookupOrdinaryNoMNUEtcInClass(sqInt class);
extern sqInt lookupSelectorinClass(sqInt selector, sqInt class);
static void NoDbgRegParms makeContextSnapshotSafe(sqInt ctxt);
extern usqInt makePointwithxValueyValue(sqInt xValue, sqInt yValue);
static void mapInterpreterOops(void);
static sqInt NoDbgRegParms markAndTraceStackPages(sqInt fullGCFlag);
static void markAndTraceUntracedReachableStackPages(void);
static sqInt NoDbgRegParms marriedContextpointsTostackDeltaForCurrentFrame(sqInt spouseContext, sqInt anOop, sqInt stackDeltaForCurrentFrame);
static void NoDbgRegParms marryContextInNewStackPageAndInitializeInterpreterRegisters(sqInt aContext);
static sqInt NoDbgRegParms marryFrameSP(char *theFP, char *theSP);
static sqInt NoDbgRegParms maybeLeakCheckExternalPrimCall(sqInt aMethodObj);
extern sqInt maybeSelectorOfMethod(sqInt methodObj);
extern sqInt methodArgumentCount(void);
extern sqInt methodClassAssociationOf(sqInt methodPointer);
extern sqInt methodClassOf(sqInt methodPointer);
static sqInt NoDbgRegParms methodHeaderIndicatesLargeFrame(sqInt methodHeader);
extern sqInt methodPrimitiveIndex(void);
extern sqInt methodReturnBool(sqInt boolean);
extern sqInt methodReturnFloat(double aFloat);
extern sqInt methodReturnInteger(sqInt integer);
extern sqInt methodReturnReceiver(void);
extern sqInt methodReturnString(char *aCString);
extern sqInt methodReturnValue(sqInt oop);
extern sqInt methodUsesAlternateBytecodeSet(sqInt aMethodObj);
static sqInt NoDbgRegParms methodUsesPrimitiveErrorCode(sqInt aMethodObj);
EXPORT(void) moduleUnloaded(char *aModuleName);
static char * NoDbgRegParms nameOfClass(sqInt classOop);
static sqInt NoDbgRegParms noInlineTemporaryin(sqInt offset, char *theFP);
static sqInt NoDbgRegParms noInlineTemporaryinput(sqInt offset, char *theFP, sqInt valueOop);
static sqInt NoDbgRegParms noMarkedContextsOnPage(StackPage *thePage);
static sqInt NoDbgRegParms numSlotsOfMarriedContext(sqInt aContext);
static sqInt numStkPages(void);
extern sqInt objCouldBeClassObj(sqInt objOop);
extern sqInt ownVM(sqInt threadIndexAndFlags);
extern sqInt penultimateLiteralOf(sqInt aMethodOop);
extern sqInt popStack(void);
extern sqInt pop(sqInt nItems);
extern void popthenPush(sqInt nItems, sqInt oop);
static sqInt NoDbgRegParms positiveMachineIntegerFor(usqIntptr_t value);
static sqInt postGCUpdateDisplayBits(void);
EXPORT(void) primitiveEventProcessingControl(void);
extern sqInt primitiveIndexOfMethodheader(sqInt theMethod, sqInt methodHeader);
extern sqInt primitiveIndexOf(sqInt methodPointer);
static void NoDbgRegParms printActivationNameForSelectorstartClass(sqInt aSelector, sqInt startClass);
static void NoDbgRegParms printActivationNameForreceiverisBlockfirstTemporary(sqInt aMethod, sqInt anObject, sqInt isBlock, sqInt maybeMessage);
extern void printAllStacks(void);
extern void printCallStack(void);
static sqInt NoDbgRegParms printCallStackFP(char *theFP);
extern sqInt printCallStackOf(sqInt aContextOrProcessOrFrame);
static sqInt NoDbgRegParms printCallStackOfcurrentFP(sqInt aContext, char *currFP);
extern void printChar(sqInt aByte);
static sqInt NoDbgRegParms printContextCallStackOf(sqInt aContext);
extern void printContext(sqInt aContext);
static void NoDbgRegParms printDecodeMethodHeaderOop(sqInt methodHeaderOop);
extern void printExternalHeadFrame(void);
static sqInt NoDbgRegParms printFrameAndCallersSPshort(char *theFP, char *theSP, sqInt printShort);
static void NoDbgRegParms printFrameOopat(char *name, char *address);
static void NoDbgRegParms printFrameOopindexat(char *name, sqInt idx, char *address);
EXPORT(void) printFramesInPage(StackPage *thePage);
EXPORT(void) printFramesOnStackPageListInUse(void);
static void NoDbgRegParms printFrameThingandFrameat(char *name, char *theFP, char *address);
static void NoDbgRegParms printFrameThingat(char *name, char *address);
extern sqInt printFrame(char *theFP);
extern sqInt printHexnp(usqInt n);
extern void printHex(usqInt n);
extern void printLikelyImplementorsOfSelector(sqInt selector);
extern void printMethodCache(void);
extern void printMethodDictionaryOf(sqInt behavior);
extern void printMethodDictionary(sqInt dictionary);
static void NoDbgRegParms printNameOfClasscount(sqInt classOop, sqInt cnt);
static void NoDbgRegParms printNum(sqInt n);
static void NoDbgRegParms printOopShort(sqInt oop);
extern sqInt printOop(sqInt oop);
extern void printProcessStack(sqInt aProcess);
extern sqInt printProcsOnList(sqInt procList);
extern sqInt printStackCallStackOf(sqInt aContextOrProcessOrFrame);
extern void printStackPageList(void);
extern void printStackPageListInUse(void);
extern void printStackPages(void);
extern void printStackPagesInUse(void);
static void NoDbgRegParms printStackPageuseCount(StackPage *page, sqInt n);
extern void printStackReferencesTo(sqInt oop);
static void NoDbgRegParms printStringOf(sqInt oop);
extern void print(char *s);
extern void pushBool(sqInt trueOrFalse);
static sqInt NoDbgRegParms pushedReceiverOrClosureOfFrame(char *theFP);
extern void pushFloat(double f);
extern sqInt pushInteger(sqInt integerValue);
extern void push(sqInt object);
static void NoDbgRegParms putLongtoFile(sqInt aLong, sqImageFile aFile);
static void NoDbgRegParms putShorttoFile(short aShort, sqImageFile aFile);
static void NoDbgRegParms putToSleepyieldingIf(sqInt aProcess, sqInt yieldImplicitly);
static void NoDbgRegParms putWord32toFile(int aWord32, sqImageFile aFile);
static sqInt NoDbgRegParms quickFetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer);
extern sqInt readableFormat(sqInt imageVersion);
static void NoDbgRegParms NeverInline reapAndResetErrorCodeToheader(char *theSP, sqInt methodHeader);
EXPORT(sqInt) reestablishContextPriorToCallback(sqInt callbackContext);
static sqInt NoDbgRegParms removeFirstLinkOfList(sqInt aList);
static sqInt retryPrimitiveOnFailure(void);
EXPORT(sqInt) returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext);
static sqInt NoDbgRegParms reverseDisplayFromto(sqInt startIndex, sqInt endIndex);
static sqInt NoDbgRegParms safeMethodClassOf(sqInt methodPointer);
static sqInt NoDbgRegParms saneFunctionPointerForFailureOfPrimIndex(sqInt primIndex);
static sqInt schedulerPointer(void);
extern void setBreakMNUSelector(char *aString);
extern void setBreakSelector(char *aString);
extern void setFullScreenFlag(sqInt value);
EXPORT(void (*setInterruptCheckChain(void (*aFunction)(void)))()) ;
extern void setInterruptKeycode(sqInt value);
extern void setInterruptPending(sqInt value);
extern void setNextWakeupUsecs(usqLong value);
extern void setSavedWindowSize(sqInt value);
static void setSignalLowSpaceFlagAndSaveProcess(void);
static void NoDbgRegParms setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext);
static sqInt NoDbgRegParms shortPrintContext(sqInt aContext);
static sqInt NoDbgRegParms shortPrintFrameAndCallers(char *theFP);
EXPORT(void) shortPrintFramesInPage(StackPage *thePage);
EXPORT(void) shortPrintFramesOnStackPageListInUse(void);
extern void shortPrintFrameAndNCallers(char *theFP, sqInt n);
static sqInt NoDbgRegParms shortPrintOop(sqInt oop);
static sqInt NoDbgRegParms shortReversePrintFrameAndCallers(char *aFramePointer);
extern sqInt showDisplayBitsLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b);
static sqInt signalExternalSemaphores(void);
extern sqInt sizeOfCallPrimitiveBytecode(sqInt methodHeader);
extern sqInt sizeOfLongStoreTempBytecode(sqInt methodHeader);
extern sqInt sizeOfSTArrayFromCPrimitive(void *cPtr);
static sqInt NoDbgRegParms snapshot(sqInt embedded);
static void space(void);
extern sqInt specialSelector(sqInt index);
static void NoDbgRegParms spurPostBecomeAction(sqInt theBecomeEffectsFlags);
extern double stackFloatValue(sqInt offset);
extern sqInt stackIntegerValue(sqInt offset);
static sqInt stackLimitBytes(void);
extern sqInt stackObjectValue(sqInt offset);
static sqInt stackPageByteSize(void);
static sqInt NoDbgRegParms stackPointerForMaybeMarriedContext(sqInt aContext);
static sqInt NoDbgRegParms stackPointerIndexForFrame(char *theFP);
extern usqIntptr_t stackPositiveMachineIntegerValue(sqInt offset);
extern sqIntptr_t stackSignedMachineIntegerValue(sqInt offset);
extern sqInt stackTop(void);
extern sqInt stackValue(sqInt offset);
extern sqInt startPCOfMethod(sqInt aCompiledMethod);
extern sqInt stObjectat(sqInt array, sqInt index);
extern sqInt stObjectatput(sqInt array, sqInt index, sqInt value);
extern sqInt storeIntegerofObjectwithValue(sqInt fieldIndex, sqInt objectPointer, sqInt integerValue);
static char * NoDbgRegParms storeSenderOfFramewithValue(char *theFP, sqInt anOop);
extern sqInt stSizeOf(sqInt oop);
extern sqInt superclassOf(sqInt classPointer);
extern sqInt tempCountOf(sqInt methodPointer);
extern sqInt temporaryCountOfMethodHeader(sqInt header);
extern sqInt ultimateLiteralOf(sqInt aMethodOop);
static sqInt NoDbgRegParms NeverInline unfollowatIndex(sqInt litVar, sqInt literalIndex);
static sqInt NoDbgRegParms updateDisplayLeftTopRightBottom(sqInt l, sqInt t, sqInt r, sqInt b);
static sqInt NoDbgRegParms validBCPCinMethod(sqInt thePC, usqInt aMethod);
static sqInt NoDbgRegParms validInstructionPointerinFrame(usqInt anInstrPointer, char *fp);
static sqInt validStackPageBaseFrames(void);
static void NoDbgRegParms NeverInline voidLongRunningPrimitive(char *reason);
static sqInt wakeHighestPriority(void);
static sqInt NeverInline writeImageFileIO(void);
static sqInt NoDbgRegParms cloneContext(sqInt aContext);
static sqInt NoDbgRegParms fieldOrSenderFPofContext(sqInt index, sqInt contextObj);
static sqInt NoDbgRegParms fieldofFrame(sqInt index, char *theFP);
static sqInt NoDbgRegParms isAppropriateForCopyObject(sqInt oop);
static double NoDbgRegParms NeverInline noInlineLoadFloatOrIntFrom(sqInt floatOrInt);
static void NoDbgRegParms primitiveAllVMParameters(sqInt paramsArraySize);
static void primitiveClone(void);
static void primitiveContextAt(void);
static void primitiveContextAtPut(void);
static void primitiveContextSize(void);
static void primitiveDeferDisplayUpdates(void);
static void primitiveDoNamedPrimitiveWithArgs(void);
static void primitiveDoPrimitiveWithArgs(void);
static void primitiveExecuteMethod(void);
static void primitiveExecuteMethodArgsArray(void);
static void primitiveExternalCall(void);
static void primitiveFindHandlerContext(void);
static void primitiveFindNextUnwindContext(void);
static void primitiveFullGC(void);
static sqInt NoDbgRegParms primitiveGetVMParameter(sqInt arg);
static void primitiveIncrementalGC(void);
static void primitiveInstVarAt(void);
static void primitiveInstVarAtPut(void);
EXPORT(sqInt) primitiveLongRunningPrimitive(void);
static void primitiveObjectPointsTo(void);
static void primitivePerform(void);
static void primitivePin(void);
EXPORT(void) primitiveSetGCSemaphore(void);
static void primitiveSignalAtMilliseconds(void);
static void primitiveSignalAtUTCMicroseconds(void);
static void primitiveSlotAt(void);
static void primitiveSlotAtPut(void);
static void primitiveStoreStackp(void);
static void primitiveVMParameter(void);
EXPORT(void) primitiveVoidReceiver(void);
static void NoDbgRegParms pruneStackstackp(sqInt stack, sqInt stackp);
static void unmarkAfterPathTo(void);

/*** Variables ***/
#if SQ_USE_GLOBAL_STRUCT
# define _iss /* define in-struct static as void */
static struct foo {
#else
# define _iss static
#endif
_iss char * stackPointer;
_iss sqInt primFailCode;
_iss char * framePointer;
_iss usqInt method;
_iss sqInt nilObj;
_iss StackPage * stackPage;
_iss sqInt argumentCount;
_iss sqInt bytecodeSetSelector;
_iss usqInt freeStart;
_iss usqInt instructionPointer;
_iss sqInt specialObjectsOop;
_iss usqInt newMethod;
_iss usqInt endOfMemory;
_iss sqInt messageSelector;
_iss StackPage * pages;
_iss usqInt newSpaceLimit;
_iss usqInt oldSpaceStart;
_iss char * stackBasePlus1;
_iss SpurSegmentInfo * segments;
_iss sqInt trueObj;
_iss usqInt totalFreeOldSpace;
_iss sqInt falseObj;
_iss usqInt newSpaceStart;
_iss sqInt hiddenRootsObj;
_iss sqInt needGCFlag;
_iss usqInt pastSpaceStart;
_iss sqInt bytesPerPage;
_iss sqInt numSegments;
_iss sqInt traceLogIndex;
_iss sqInt * freeLists;
_iss usqInt scavengeThreshold;
_iss sqInt markStack;
_iss char * stackLimit;
_iss sqInt rememberedSetSize;
_iss sqInt classTableFirstPage;
_iss unsigned char primTraceLogIndex;
_iss sqInt * rememberedSet;
_iss SpurContiguousObjStack savedFirstFieldsSpace;
_iss sqInt weaklingStack;
_iss usqInt freeListsMask;
_iss StackPage * mostRecentlyUsedPage;
_iss usqInt firstFreeObject;
_iss sqInt remapBufferCount;
_iss SpurContiguousObjStack unscannedEphemerons;
_iss SpurNewSpaceSpace pastSpace;
_iss sqInt numStackPages;
_iss SpurScavengeLogRecord scavengeLogRecord;
_iss usqInt lastMobileObject;
_iss sqInt tempOop;
_iss sqInt lkupClass;
_iss sqInt futureSurvivorStart;
_iss sqInt numClassTablePages;
_iss sqInt profileProcess;
_iss sqInt classTableIndex;
_iss sqInt numRememberedEphemerons;
_iss sqInt profileSemaphore;
_iss SpurNewSpaceSpace futureSpace;
_iss sqInt jmpDepth;
_iss sqInt mobileStart;
_iss sqLong nextProfileTick;
_iss sqInt profileMethod;
_iss sqInt longRunningPrimitiveCheckSemaphore;
_iss sqInt mournQueue;
_iss SpurNewSpaceSpace eden;
_iss sqInt tenureThreshold;
_iss sqInt becomeEffectsFlags;
_iss sqInt lastCoggableInterpretedBlockMethod;
_iss sqInt lastUncoggableInterpretedBlockMethod;
_iss char * objStackInvalidBecause;
_iss sqInt sweepIndex;
_iss sqInt ephemeronList;
_iss sqInt longRunningPrimitiveCheckMethod;
_iss sqInt tenureCriterion;
_iss usqInt totalHeapSizeIncludingBridges;
_iss usqInt freeOldSpaceStart;
_iss sqInt growHeadroom;
_iss sqInt extraRootCount;
_iss sqInt invalidObjStackPage;
_iss usqInt objectAfterLastMobileObject;
_iss sqInt previousRememberedSetSize;
_iss sqInt tempOop2;
_iss sqInt classNameIndex;
_iss sqInt cogCompiledCodeCompactionCalledFor;
_iss sqInt gcPhaseInProgress;
_iss sqInt pendingFinalizationSignals;
_iss sqInt cogCodeSize;
_iss sqInt metaAccessorDepth;
_iss sqInt metaclassNumSlots;
_iss sqInt numSegInfos;
_iss sqInt savedFirstFieldsSpaceNotInOldSpace;
_iss usqInt firstMobileObject;
_iss sqInt gcMode;
_iss sqInt highestRunnableProcessPriority;
_iss usqLong nextWakeupUsecs;
_iss usqLong statGCEndUsecs;
_iss usqLong longRunningPrimitiveStartUsecs;
_iss usqLong longRunningPrimitiveStopUsecs;
_iss sqInt preemptionYields;
_iss usqLong statCheckForEvents;
_iss sqInt statTenures;
_iss sqInt weakList;
_iss sqInt externalPrimitiveTableFirstFreeIndex;
_iss usqLong gcStartUsecs;
_iss sqInt marking;
_iss sqLong oldSpaceUsePriorToScavenge;
_iss sqInt rememberedSetLimit;
_iss sqInt statSurvivorCount;
_iss sqInt thisClassIndex;
_iss sqInt firstFieldOfRememberedSet;
_iss sqInt firstSegmentSize;
_iss usqInt lowSpaceThreshold;
_iss sqInt newFinalization;
_iss FILE * scavengeLog;
_iss sqInt shrinkThreshold;
_iss usqLong statIOProcessEvents;
_iss sqInt statMaxAllocSegmentTime;
_iss sqInt statScavenges;
_iss sqInt biasForGC;
_iss sqInt edenBytes;
_iss sqInt flagInterpretedMethods;
_iss sqInt lastHash;
_iss sqInt lastMethodCacheProbeWrite;
_iss usqInt memory;
_iss sqInt rememberedSetRedZone;
_iss sqInt savedWindowSize;
_iss usqLong statAllocatedBytes;
_iss sqInt statFullGCs;
_iss sqInt statNumMaps;
_iss sqInt anomaly;
_iss sqInt bogon;
_iss sqInt fullScreenFlag;
_iss float heapGrowthToSizeGCRatio;
_iss usqInt heapSizeAtPreviousGC;
_iss sqInt interruptKeycode;
_iss sqInt interruptPending;
_iss sqInt longRunningPrimitiveCheckSequenceNumber;
_iss sqInt methodDictLinearSearchLimit;
_iss usqLong nextPollUsecs;
_iss sqLong osErrorCode;
_iss usqLong statCompactionUsecs;
_iss usqLong statForceInterruptCheck;
_iss usqLong statFullGCUsecs;
_iss sqInt statGrowMemory;
_iss usqLong statIdleUsecs;
_iss usqLong statMarkUsecs;
_iss sqInt statMaxPageCountWhenMapping;
_iss sqInt statPageCountWhenMappingSum;
_iss usqLong statProcessSwitch;
_iss usqLong statScavengeGCUsecs;
_iss sqInt statShrinkMemory;
_iss usqLong statStackOverflow;
_iss usqLong statStackPageDivorce;
_iss usqLong statSweepUsecs;
_iss sqInt canSwizzle;
_iss sqInt deferSmash;
_iss sqInt deferredSmash;
_iss sqInt extraFramesToMoveOnOverflow;
_iss sqInt globalSessionID;
_iss sqInt imageFloatsBigEndian;
_iss sqInt imageHeaderFlags;
_iss sqInt inFFIFlags;
_iss sqInt longRunningPrimitiveSignalUndelivered;
_iss sqInt maxExtSemTabSizeSet;
_iss sqInt refCountToShrinkRT;
_iss sqInt signalLowSpace;
_iss sqInt statCodeCompactionCount;
_iss usqLong statCodeCompactionUsecs;
_iss sqInt statMarkCount;
_iss sqInt statRootTableCount;
_iss usqLong statSGCDeltaUsecs;
_iss double tenuringProportion;
_iss sqInt classByteArrayCompactIndex;
_iss usqInt exceptionPC;
_iss sqInt gcSemaphoreIndex;
_iss usqLong gcSweepEndUsecs;
_iss usqLong longRunningPrimitiveGCUsecs;
_iss sqInt overflowLimit;
_iss StackPage * overflowedPage;
_iss sqInt statCompactPassCount;
_iss usqLong statIGCDeltaUsecs;
_iss sqInt statPendingFinalizationSignals;
_iss sqInt statRootTableOverflows;
_iss sqInt tenuringClassIndex;
_iss sqInt the2ndUnknownShort;
_iss sqInt statIncrGCs;
_iss sqIntptr_t methodCache[MethodCacheSize + 1 /* 4097 */];
_iss sqInt traceLog[TraceBufferSize /* 768 */];
_iss sqInt primTraceLog[256];
_iss sqInt remapBuffer[RemapBufferSize + 1 /* 26 */];
_iss sqInt *extraRoots[ExtraRootsSize + 1 /* 2049 */];
_iss usqInt suspendedCallbacks[MaxJumpBuf + 1 /* 33 */];
_iss usqInt suspendedMethods[MaxJumpBuf + 1 /* 33 */];
_iss jmp_buf jmpBuf[MaxJumpBuf + 1 /* 33 */];
_iss usqInt byteCount;
_iss sqInt preferredPinningSegment;
_iss sqInt statCoalesces;
_iss usqLong statFGCDeltaUsecs;
_iss usqLong statIncrGCUsecs;
_iss sqInt theUnknownShort;
#undef _iss
#if SQ_USE_GLOBAL_STRUCT
 } fum;
 #if SQ_USE_GLOBAL_STRUCT_REG
# define DECL_MAYBE_SQ_GLOBAL_STRUCT /* using a global reg pointer */
# define DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT /* using a global reg pointer */
#else
# define DECL_MAYBE_SQ_GLOBAL_STRUCT register struct foo * foo = &fum;
# define DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT volatile register struct foo * foo = &fum;
#endif
# define GIV(interpreterInstVar) (foo->interpreterInstVar)
#else
# define DECL_MAYBE_SQ_GLOBAL_STRUCT /* oh, no mr bill! */
# define DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT /* oh no, mr bill! */
# define GIV(interpreterInstVar) interpreterInstVar
#endif
#if SQ_USE_GLOBAL_STRUCT
#if SQ_USE_GLOBAL_STRUCT_REG
#define fooxstr(s) foostr(s)
#define foostr(s)  #s
register struct foo * foo asm(fooxstr(USE_GLOBAL_STRUCT_REG));
#else
static struct foo * foo = &fum;
#endif
#endif
static void (*primitiveFunctionPointer)();
sqInt maxLiteralCountForCompile = MaxLiteralCountForCompile /* 60 */;
sqInt checkForLeaks;
jmp_buf reenterInterpreter; /* private export */;
sqInt debugCallbackPath;
void * displayBits;
sqInt checkAllocFiller;
sqInt breakLookupClassTag;
sqInt breakSelectorLength = MinSmallInteger;
sqInt desiredEdenBytes;
sqInt desiredNumStackPages;
sqInt extraVMMemory;
int displayWidth;
int displayDepth;
sqInt desiredCogCodeSize;
int displayHeight;
usqInt maxOldSpaceSize;
char * breakSelector;
usqInt heapBase;
sqInt inIOProcessEvents;
sqInt sendWheelEvents;
int (*showSurfaceFn)(sqIntptr_t, int, int, int, int);
sqInt deferDisplayUpdates;
struct VirtualMachine* interpreterProxy;
static void (*interruptCheckChain)(void) = 0;
sqInt suppressHeartbeatFlag;
sqInt debugCallbackInvokes;
sqInt debugCallbackReturns;
sqInt ffiExceptionResponse;
static int (*sHEAFn)() = 0;
static void (*externalPrimitiveTable[MaxExternalPrimitiveTableSize + 1 /* 4097 */])(void);
static void (*primitiveTable[MaxPrimitiveIndex + 2 /* 577 */])(void) = {
	/* 0 */ (void (*)(void))0,
	/* 1 */ primitiveAdd,
	/* 2 */ primitiveSubtract,
	/* 3 */ primitiveLessThan,
	/* 4 */ primitiveGreaterThan,
	/* 5 */ primitiveLessOrEqual,
	/* 6 */ primitiveGreaterOrEqual,
	/* 7 */ primitiveEqual,
	/* 8 */ primitiveNotEqual,
	/* 9 */ primitiveMultiply,
	/* 10 */ primitiveDivide,
	/* 11 */ primitiveMod,
	/* 12 */ primitiveDiv,
	/* 13 */ primitiveQuo,
	/* 14 */ primitiveBitAnd,
	/* 15 */ primitiveBitOr,
	/* 16 */ primitiveBitXor,
	/* 17 */ primitiveBitShift,
	/* 18 */ primitiveMakePoint,
	/* 19 */ (void (*)(void))0,
	/* 20 */ primitiveRemLargeIntegers,
	/* 21 */ primitiveAddLargeIntegers,
	/* 22 */ primitiveSubtractLargeIntegers,
	/* 23 */ primitiveLessThanLargeIntegers,
	/* 24 */ primitiveGreaterThanLargeIntegers,
	/* 25 */ primitiveLessOrEqualLargeIntegers,
	/* 26 */ primitiveGreaterOrEqualLargeIntegers,
	/* 27 */ primitiveEqualLargeIntegers,
	/* 28 */ primitiveNotEqualLargeIntegers,
	/* 29 */ primitiveMultiplyLargeIntegers,
	/* 30 */ primitiveDivideLargeIntegers,
	/* 31 */ primitiveModLargeIntegers,
	/* 32 */ primitiveDivLargeIntegers,
	/* 33 */ primitiveQuoLargeIntegers,
	/* 34 */ primitiveBitAndLargeIntegers,
	/* 35 */ primitiveBitOrLargeIntegers,
	/* 36 */ primitiveBitXorLargeIntegers,
	/* 37 */ primitiveBitShiftLargeIntegers,
	/* 38 */ primitiveFloatAt,
	/* 39 */ primitiveFloatAtPut,
	/* 40 */ primitiveAsFloat,
	/* 41 */ primitiveFloatAdd,
	/* 42 */ primitiveFloatSubtract,
	/* 43 */ primitiveFloatLessThan,
	/* 44 */ primitiveFloatGreaterThan,
	/* 45 */ primitiveFloatLessOrEqual,
	/* 46 */ primitiveFloatGreaterOrEqual,
	/* 47 */ primitiveFloatEqual,
	/* 48 */ primitiveFloatNotEqual,
	/* 49 */ primitiveFloatMultiply,
	/* 50 */ primitiveFloatDivide,
	/* 51 */ primitiveTruncated,
	/* 52 */ primitiveFractionalPart,
	/* 53 */ primitiveExponent,
	/* 54 */ primitiveTimesTwoPower,
	/* 55 */ primitiveSquareRoot,
	/* 56 */ primitiveSine,
	/* 57 */ primitiveArctan,
	/* 58 */ primitiveLogN,
	/* 59 */ primitiveExp,
	/* 60 */ primitiveAt,
	/* 61 */ primitiveAtPut,
	/* 62 */ primitiveSize,
	/* 63 */ primitiveStringAt,
	/* 64 */ primitiveStringAtPut,
	/* 65 */ (void (*)(void))0,
	/* 66 */ (void (*)(void))0,
	/* 67 */ (void (*)(void))0,
	/* 68 */ primitiveObjectAt,
	/* 69 */ primitiveObjectAtPut,
	/* 70 */ primitiveNew,
	/* 71 */ primitiveNewWithArg,
	/* 72 */ primitiveArrayBecomeOneWay,
	/* 73 */ primitiveInstVarAt,
	/* 74 */ primitiveInstVarAtPut,
	/* 75 */ primitiveIdentityHash,
	/* 76 */ primitiveStoreStackp,
	/* 77 */ primitiveSomeInstance,
	/* 78 */ primitiveNextInstance,
	/* 79 */ primitiveNewMethod,
	/* 80 */ (void (*)(void))0,
	/* 81 */ (void (*)(void))0,
	/* 82 */ (void (*)(void))0,
	/* 83 */ primitivePerform,
	/* 84 */ primitivePerformWithArgs,
	/* 85 */ primitiveSignal,
	/* 86 */ primitiveWait,
	/* 87 */ primitiveResume,
	/* 88 */ primitiveSuspend,
	/* 89 */ primitiveFlushCache,
	/* 90 */ primitiveMousePoint,
	/* 91 */ primitiveTestDisplayDepth,
	/* 92 */ primitiveSetDisplayMode,
	/* 93 */ primitiveInputSemaphore,
	/* 94 */ primitiveGetNextEvent,
	/* 95 */ primitiveInputWord,
	/* 96 */ (void (*)(void))0,
	/* 97 */ primitiveSnapshot,
	/* 98 */ primitiveStoreImageSegment,
	/* 99 */ primitiveLoadImageSegment,
	/* 100 */ primitivePerformInSuperclass,
	/* 101 */ primitiveBeCursor,
	/* 102 */ primitiveBeDisplay,
	/* 103 */ primitiveScanCharacters,
	/* 104 */ (void (*)(void))0,
	/* 105 */ primitiveStringReplace,
	/* 106 */ primitiveScreenSize,
	/* 107 */ primitiveMouseButtons,
	/* 108 */ primitiveKbdNext,
	/* 109 */ primitiveKbdPeek,
	/* 110 */ primitiveIdentical,
	/* 111 */ primitiveClass,
	/* 112 */ primitiveBytesLeft,
	/* 113 */ primitiveQuit,
	/* 114 */ primitiveExitToDebugger,
	/* 115 */ primitiveChangeClass,
	/* 116 */ primitiveFlushCacheByMethod,
	/* 117 */ primitiveExternalCall,
	/* 118 */ primitiveDoPrimitiveWithArgs,
	/* 119 */ primitiveFlushCacheBySelector,
	/* 120 */ primitiveCalloutToFFI,
	/* 121 */ primitiveImageName,
	/* 122 */ primitiveNoop,
	/* 123 */ (void (*)(void))0,
	/* 124 */ primitiveLowSpaceSemaphore,
	/* 125 */ primitiveSignalAtBytesLeft,
	/* 126 */ primitiveDeferDisplayUpdates,
	/* 127 */ primitiveShowDisplayRect,
	/* 128 */ primitiveArrayBecome,
	/* 129 */ primitiveSpecialObjectsOop,
	/* 130 */ primitiveFullGC,
	/* 131 */ primitiveIncrementalGC,
	/* 132 */ primitiveObjectPointsTo,
	/* 133 */ primitiveSetInterruptKey,
	/* 134 */ primitiveInterruptSemaphore,
	/* 135 */ primitiveMillisecondClock,
	/* 136 */ primitiveSignalAtMilliseconds,
	/* 137 */ primitiveSecondsClock,
	/* 138 */ primitiveSomeObject,
	/* 139 */ primitiveNextObject,
	/* 140 */ primitiveBeep,
	/* 141 */ primitiveClipboardText,
	/* 142 */ primitiveVMPath,
	/* 143 */ primitiveShortAt,
	/* 144 */ primitiveShortAtPut,
	/* 145 */ primitiveConstantFill,
	/* 146 */ (void (*)(void))0,
	/* 147 */ (void (*)(void))0,
	/* 148 */ primitiveClone,
	/* 149 */ primitiveGetAttribute,
	/* 150 */ (void (*)(void))0,
	/* 151 */ (void (*)(void))0,
	/* 152 */ (void (*)(void))0,
	/* 153 */ (void (*)(void))0,
	/* 154 */ (void (*)(void))0,
	/* 155 */ (void (*)(void))0,
	/* 156 */ (void (*)(void))0,
	/* 157 */ (void (*)(void))0,
	/* 158 */ primitiveCompareWith,
	/* 159 */ primitiveHashMultiply,
	/* 160 */ primitiveAdoptInstance,
	/* 161 */ primitiveSetOrHasIdentityHash,
	/* 162 */ (void (*)(void))0,
	/* 163 */ primitiveGetImmutability,
	/* 164 */ primitiveSetImmutability,
	/* 165 */ primitiveIntegerAt,
	/* 166 */ primitiveIntegerAtPut,
	/* 167 */ primitiveYield,
	/* 168 */ primitiveCopyObject,
	/* 169 */ primitiveNotIdentical,
	/* 170 */ primitiveAsCharacter,
	/* 171 */ primitiveImmediateAsInteger,
	/* 172 */ primitiveFetchNextMourner,
	/* 173 */ primitiveSlotAt,
	/* 174 */ primitiveSlotAtPut,
	/* 175 */ primitiveBehaviorHash,
	/* 176 */ primitiveMaxIdentityHash,
	/* 177 */ primitiveAllInstances,
	/* 178 */ primitiveAllObjects,
	/* 179 */ (void (*)(void))0,
	/* 180 */ primitiveGrowMemoryByAtLeast,
	/* 181 */ primitiveSizeInBytesOfInstance,
	/* 182 */ primitiveSizeInBytes,
	/* 183 */ primitiveIsPinned,
	/* 184 */ primitivePin,
	/* 185 */ primitiveExitCriticalSection,
	/* 186 */ primitiveEnterCriticalSection,
	/* 187 */ primitiveTestAndSetOwnershipOfCriticalSection,
	/* 188 */ primitiveExecuteMethodArgsArray,
	/* 189 */ primitiveExecuteMethod,
	/* 190 */ (void (*)(void))0,
	/* 191 */ (void (*)(void))0,
	/* 192 */ (void (*)(void))0,
	/* 193 */ (void (*)(void))0,
	/* 194 */ (void (*)(void))0,
	/* 195 */ primitiveFindNextUnwindContext,
	/* 196 */ primitiveTerminateTo,
	/* 197 */ primitiveFindHandlerContext,
	/* 198 */ (void (*)(void))0,
	/* 199 */ (void (*)(void))0,
	/* 200 */ primitiveClosureCopyWithCopiedValues,
	/* 201 */ primitiveClosureValue,
	/* 202 */ primitiveClosureValue,
	/* 203 */ primitiveClosureValue,
	/* 204 */ primitiveClosureValue,
	/* 205 */ primitiveClosureValue,
	/* 206 */ primitiveClosureValueWithArgs,
	/* 207 */ primitiveFullClosureValue,
	/* 208 */ primitiveFullClosureValueWithArgs,
	/* 209 */ primitiveFullClosureValueNoContextSwitch,
	/* 210 */ primitiveContextAt,
	/* 211 */ primitiveContextAtPut,
	/* 212 */ primitiveContextSize,
	/* 213 */ primitiveContextXray,
	/* 214 */ primitiveVoidVMState,
	/* 215 */ primitiveVoidVMStateForMethod,
	/* 216 */ primitiveMethodXray,
	/* 217 */ (void (*)(void))0,
	/* 218 */ primitiveDoNamedPrimitiveWithArgs,
	/* 219 */ (void (*)(void))0,
	/* 220 */ (void (*)(void))0,
	/* 221 */ primitiveClosureValueNoContextSwitch,
	/* 222 */ primitiveClosureValueNoContextSwitch,
	/* 223 */ (void (*)(void))0,
	/* 224 */ (void (*)(void))0,
	/* 225 */ (void (*)(void))0,
	/* 226 */ (void (*)(void))0,
	/* 227 */ (void (*)(void))0,
	/* 228 */ (void (*)(void))0,
	/* 229 */ (void (*)(void))0,
	/* 230 */ primitiveRelinquishProcessor,
	/* 231 */ primitiveForceDisplayUpdate,
	/* 232 */ primitiveFormPrint,
	/* 233 */ primitiveSetFullScreen,
	/* 234 */ (void (*)(void))0,
	/* 235 */ (void (*)(void))0,
	/* 236 */ (void (*)(void))0,
	/* 237 */ (void (*)(void))0,
	/* 238 */ (void (*)(void))0,
	/* 239 */ (void (*)(void))0,
	/* 240 */ primitiveUTCMicrosecondClock,
	/* 241 */ primitiveLocalMicrosecondClock,
	/* 242 */ primitiveSignalAtUTCMicroseconds,
	/* 243 */ primitiveUpdateTimezone,
	/* 244 */ primitiveUtcAndTimezoneOffset,
	/* 245 */ primitiveCoarseUTCMicrosecondClock,
	/* 246 */ primitiveCoarseLocalMicrosecondClock,
	/* 247 */ primitiveSnapshotEmbedded,
	/* 248 */ primitiveArrayBecomeOneWayNoCopyHash,
	/* 249 */ primitiveArrayBecomeOneWayCopyHash,
	/* 250 */ primitiveClearVMProfile,
	/* 251 */ primitiveControlVMProfiling,
	/* 252 */ primitiveVMProfileSamplesInto,
	/* 253 */ primitiveCollectCogCodeConstituents,
	/* 254 */ primitiveVMParameter,
	/* 255 */ (void (*)(void))0,
	/* 256 */ (void (*)(void))256,
	/* 257 */ (void (*)(void))257,
	/* 258 */ (void (*)(void))258,
	/* 259 */ (void (*)(void))259,
	/* 260 */ (void (*)(void))260,
	/* 261 */ (void (*)(void))261,
	/* 262 */ (void (*)(void))262,
	/* 263 */ (void (*)(void))263,
	/* 264 */ (void (*)(void))264,
	/* 265 */ (void (*)(void))265,
	/* 266 */ (void (*)(void))266,
	/* 267 */ (void (*)(void))267,
	/* 268 */ (void (*)(void))268,
	/* 269 */ (void (*)(void))269,
	/* 270 */ (void (*)(void))270,
	/* 271 */ (void (*)(void))271,
	/* 272 */ (void (*)(void))272,
	/* 273 */ (void (*)(void))273,
	/* 274 */ (void (*)(void))274,
	/* 275 */ (void (*)(void))275,
	/* 276 */ (void (*)(void))276,
	/* 277 */ (void (*)(void))277,
	/* 278 */ (void (*)(void))278,
	/* 279 */ (void (*)(void))279,
	/* 280 */ (void (*)(void))280,
	/* 281 */ (void (*)(void))281,
	/* 282 */ (void (*)(void))282,
	/* 283 */ (void (*)(void))283,
	/* 284 */ (void (*)(void))284,
	/* 285 */ (void (*)(void))285,
	/* 286 */ (void (*)(void))286,
	/* 287 */ (void (*)(void))287,
	/* 288 */ (void (*)(void))288,
	/* 289 */ (void (*)(void))289,
	/* 290 */ (void (*)(void))290,
	/* 291 */ (void (*)(void))291,
	/* 292 */ (void (*)(void))292,
	/* 293 */ (void (*)(void))293,
	/* 294 */ (void (*)(void))294,
	/* 295 */ (void (*)(void))295,
	/* 296 */ (void (*)(void))296,
	/* 297 */ (void (*)(void))297,
	/* 298 */ (void (*)(void))298,
	/* 299 */ (void (*)(void))299,
	/* 300 */ (void (*)(void))300,
	/* 301 */ (void (*)(void))301,
	/* 302 */ (void (*)(void))302,
	/* 303 */ (void (*)(void))303,
	/* 304 */ (void (*)(void))304,
	/* 305 */ (void (*)(void))305,
	/* 306 */ (void (*)(void))306,
	/* 307 */ (void (*)(void))307,
	/* 308 */ (void (*)(void))308,
	/* 309 */ (void (*)(void))309,
	/* 310 */ (void (*)(void))310,
	/* 311 */ (void (*)(void))311,
	/* 312 */ (void (*)(void))312,
	/* 313 */ (void (*)(void))313,
	/* 314 */ (void (*)(void))314,
	/* 315 */ (void (*)(void))315,
	/* 316 */ (void (*)(void))316,
	/* 317 */ (void (*)(void))317,
	/* 318 */ (void (*)(void))318,
	/* 319 */ (void (*)(void))319,
	/* 320 */ (void (*)(void))320,
	/* 321 */ (void (*)(void))321,
	/* 322 */ (void (*)(void))322,
	/* 323 */ (void (*)(void))323,
	/* 324 */ (void (*)(void))324,
	/* 325 */ (void (*)(void))325,
	/* 326 */ (void (*)(void))326,
	/* 327 */ (void (*)(void))327,
	/* 328 */ (void (*)(void))328,
	/* 329 */ (void (*)(void))329,
	/* 330 */ (void (*)(void))330,
	/* 331 */ (void (*)(void))331,
	/* 332 */ (void (*)(void))332,
	/* 333 */ (void (*)(void))333,
	/* 334 */ (void (*)(void))334,
	/* 335 */ (void (*)(void))335,
	/* 336 */ (void (*)(void))336,
	/* 337 */ (void (*)(void))337,
	/* 338 */ (void (*)(void))338,
	/* 339 */ (void (*)(void))339,
	/* 340 */ (void (*)(void))340,
	/* 341 */ (void (*)(void))341,
	/* 342 */ (void (*)(void))342,
	/* 343 */ (void (*)(void))343,
	/* 344 */ (void (*)(void))344,
	/* 345 */ (void (*)(void))345,
	/* 346 */ (void (*)(void))346,
	/* 347 */ (void (*)(void))347,
	/* 348 */ (void (*)(void))348,
	/* 349 */ (void (*)(void))349,
	/* 350 */ (void (*)(void))350,
	/* 351 */ (void (*)(void))351,
	/* 352 */ (void (*)(void))352,
	/* 353 */ (void (*)(void))353,
	/* 354 */ (void (*)(void))354,
	/* 355 */ (void (*)(void))355,
	/* 356 */ (void (*)(void))356,
	/* 357 */ (void (*)(void))357,
	/* 358 */ (void (*)(void))358,
	/* 359 */ (void (*)(void))359,
	/* 360 */ (void (*)(void))360,
	/* 361 */ (void (*)(void))361,
	/* 362 */ (void (*)(void))362,
	/* 363 */ (void (*)(void))363,
	/* 364 */ (void (*)(void))364,
	/* 365 */ (void (*)(void))365,
	/* 366 */ (void (*)(void))366,
	/* 367 */ (void (*)(void))367,
	/* 368 */ (void (*)(void))368,
	/* 369 */ (void (*)(void))369,
	/* 370 */ (void (*)(void))370,
	/* 371 */ (void (*)(void))371,
	/* 372 */ (void (*)(void))372,
	/* 373 */ (void (*)(void))373,
	/* 374 */ (void (*)(void))374,
	/* 375 */ (void (*)(void))375,
	/* 376 */ (void (*)(void))376,
	/* 377 */ (void (*)(void))377,
	/* 378 */ (void (*)(void))378,
	/* 379 */ (void (*)(void))379,
	/* 380 */ (void (*)(void))380,
	/* 381 */ (void (*)(void))381,
	/* 382 */ (void (*)(void))382,
	/* 383 */ (void (*)(void))383,
	/* 384 */ (void (*)(void))384,
	/* 385 */ (void (*)(void))385,
	/* 386 */ (void (*)(void))386,
	/* 387 */ (void (*)(void))387,
	/* 388 */ (void (*)(void))388,
	/* 389 */ (void (*)(void))389,
	/* 390 */ (void (*)(void))390,
	/* 391 */ (void (*)(void))391,
	/* 392 */ (void (*)(void))392,
	/* 393 */ (void (*)(void))393,
	/* 394 */ (void (*)(void))394,
	/* 395 */ (void (*)(void))395,
	/* 396 */ (void (*)(void))396,
	/* 397 */ (void (*)(void))397,
	/* 398 */ (void (*)(void))398,
	/* 399 */ (void (*)(void))399,
	/* 400 */ (void (*)(void))400,
	/* 401 */ (void (*)(void))401,
	/* 402 */ (void (*)(void))402,
	/* 403 */ (void (*)(void))403,
	/* 404 */ (void (*)(void))404,
	/* 405 */ (void (*)(void))405,
	/* 406 */ (void (*)(void))406,
	/* 407 */ (void (*)(void))407,
	/* 408 */ (void (*)(void))408,
	/* 409 */ (void (*)(void))409,
	/* 410 */ (void (*)(void))410,
	/* 411 */ (void (*)(void))411,
	/* 412 */ (void (*)(void))412,
	/* 413 */ (void (*)(void))413,
	/* 414 */ (void (*)(void))414,
	/* 415 */ (void (*)(void))415,
	/* 416 */ (void (*)(void))416,
	/* 417 */ (void (*)(void))417,
	/* 418 */ (void (*)(void))418,
	/* 419 */ (void (*)(void))419,
	/* 420 */ (void (*)(void))420,
	/* 421 */ (void (*)(void))421,
	/* 422 */ (void (*)(void))422,
	/* 423 */ (void (*)(void))423,
	/* 424 */ (void (*)(void))424,
	/* 425 */ (void (*)(void))425,
	/* 426 */ (void (*)(void))426,
	/* 427 */ (void (*)(void))427,
	/* 428 */ (void (*)(void))428,
	/* 429 */ (void (*)(void))429,
	/* 430 */ (void (*)(void))430,
	/* 431 */ (void (*)(void))431,
	/* 432 */ (void (*)(void))432,
	/* 433 */ (void (*)(void))433,
	/* 434 */ (void (*)(void))434,
	/* 435 */ (void (*)(void))435,
	/* 436 */ (void (*)(void))436,
	/* 437 */ (void (*)(void))437,
	/* 438 */ (void (*)(void))438,
	/* 439 */ (void (*)(void))439,
	/* 440 */ (void (*)(void))440,
	/* 441 */ (void (*)(void))441,
	/* 442 */ (void (*)(void))442,
	/* 443 */ (void (*)(void))443,
	/* 444 */ (void (*)(void))444,
	/* 445 */ (void (*)(void))445,
	/* 446 */ (void (*)(void))446,
	/* 447 */ (void (*)(void))447,
	/* 448 */ (void (*)(void))448,
	/* 449 */ (void (*)(void))449,
	/* 450 */ (void (*)(void))450,
	/* 451 */ (void (*)(void))451,
	/* 452 */ (void (*)(void))452,
	/* 453 */ (void (*)(void))453,
	/* 454 */ (void (*)(void))454,
	/* 455 */ (void (*)(void))455,
	/* 456 */ (void (*)(void))456,
	/* 457 */ (void (*)(void))457,
	/* 458 */ (void (*)(void))458,
	/* 459 */ (void (*)(void))459,
	/* 460 */ (void (*)(void))460,
	/* 461 */ (void (*)(void))461,
	/* 462 */ (void (*)(void))462,
	/* 463 */ (void (*)(void))463,
	/* 464 */ (void (*)(void))464,
	/* 465 */ (void (*)(void))465,
	/* 466 */ (void (*)(void))466,
	/* 467 */ (void (*)(void))467,
	/* 468 */ (void (*)(void))468,
	/* 469 */ (void (*)(void))469,
	/* 470 */ (void (*)(void))470,
	/* 471 */ (void (*)(void))471,
	/* 472 */ (void (*)(void))472,
	/* 473 */ (void (*)(void))473,
	/* 474 */ (void (*)(void))474,
	/* 475 */ (void (*)(void))475,
	/* 476 */ (void (*)(void))476,
	/* 477 */ (void (*)(void))477,
	/* 478 */ (void (*)(void))478,
	/* 479 */ (void (*)(void))479,
	/* 480 */ (void (*)(void))480,
	/* 481 */ (void (*)(void))481,
	/* 482 */ (void (*)(void))482,
	/* 483 */ (void (*)(void))483,
	/* 484 */ (void (*)(void))484,
	/* 485 */ (void (*)(void))485,
	/* 486 */ (void (*)(void))486,
	/* 487 */ (void (*)(void))487,
	/* 488 */ (void (*)(void))488,
	/* 489 */ (void (*)(void))489,
	/* 490 */ (void (*)(void))490,
	/* 491 */ (void (*)(void))491,
	/* 492 */ (void (*)(void))492,
	/* 493 */ (void (*)(void))493,
	/* 494 */ (void (*)(void))494,
	/* 495 */ (void (*)(void))495,
	/* 496 */ (void (*)(void))496,
	/* 497 */ (void (*)(void))497,
	/* 498 */ (void (*)(void))498,
	/* 499 */ (void (*)(void))499,
	/* 500 */ (void (*)(void))500,
	/* 501 */ (void (*)(void))501,
	/* 502 */ (void (*)(void))502,
	/* 503 */ (void (*)(void))503,
	/* 504 */ (void (*)(void))504,
	/* 505 */ (void (*)(void))505,
	/* 506 */ (void (*)(void))506,
	/* 507 */ (void (*)(void))507,
	/* 508 */ (void (*)(void))508,
	/* 509 */ (void (*)(void))509,
	/* 510 */ (void (*)(void))510,
	/* 511 */ (void (*)(void))511,
	/* 512 */ (void (*)(void))512,
	/* 513 */ (void (*)(void))513,
	/* 514 */ (void (*)(void))514,
	/* 515 */ (void (*)(void))515,
	/* 516 */ (void (*)(void))516,
	/* 517 */ (void (*)(void))517,
	/* 518 */ (void (*)(void))518,
	/* 519 */ (void (*)(void))519,
	/* 520 */ (void (*)(void))0,
	/* 521 */ (void (*)(void))0,
	/* 522 */ (void (*)(void))0,
	/* 523 */ (void (*)(void))0,
	/* 524 */ (void (*)(void))0,
	/* 525 */ (void (*)(void))0,
	/* 526 */ (void (*)(void))0,
	/* 527 */ (void (*)(void))0,
	/* 528 */ (void (*)(void))0,
	/* 529 */ (void (*)(void))0,
	/* 530 */ (void (*)(void))0,
	/* 531 */ (void (*)(void))0,
	/* 532 */ (void (*)(void))0,
	/* 533 */ (void (*)(void))0,
	/* 534 */ (void (*)(void))0,
	/* 535 */ (void (*)(void))0,
	/* 536 */ (void (*)(void))0,
	/* 537 */ (void (*)(void))0,
	/* 538 */ (void (*)(void))0,
	/* 539 */ (void (*)(void))0,
	/* 540 */ (void (*)(void))0,
	/* 541 */ primitiveSmallFloatAdd,
	/* 542 */ primitiveSmallFloatSubtract,
	/* 543 */ primitiveSmallFloatLessThan,
	/* 544 */ primitiveSmallFloatGreaterThan,
	/* 545 */ primitiveSmallFloatLessOrEqual,
	/* 546 */ primitiveSmallFloatGreaterOrEqual,
	/* 547 */ primitiveSmallFloatEqual,
	/* 548 */ primitiveSmallFloatNotEqual,
	/* 549 */ primitiveSmallFloatMultiply,
	/* 550 */ primitiveSmallFloatDivide,
	/* 551 */ primitiveSmallFloatTruncated,
	/* 552 */ primitiveSmallFloatFractionalPart,
	/* 553 */ primitiveSmallFloatExponent,
	/* 554 */ primitiveSmallFloatTimesTwoPower,
	/* 555 */ primitiveSmallFloatSquareRoot,
	/* 556 */ primitiveSmallFloatSine,
	/* 557 */ primitiveSmallFloatArctan,
	/* 558 */ primitiveSmallFloatLogN,
	/* 559 */ primitiveSmallFloatExp,
	/* 560 */ (void (*)(void))0,
	/* 561 */ (void (*)(void))0,
	/* 562 */ (void (*)(void))0,
	/* 563 */ (void (*)(void))0,
	/* 564 */ (void (*)(void))0,
	/* 565 */ (void (*)(void))0,
	/* 566 */ (void (*)(void))0,
	/* 567 */ (void (*)(void))0,
	/* 568 */ (void (*)(void))0,
	/* 569 */ (void (*)(void))0,
	/* 570 */ primitiveFlushExternalPrimitives,
	/* 571 */ primitiveUnloadModule,
	/* 572 */ primitiveListBuiltinModule,
	/* 573 */ primitiveListExternalModule,
	/* 574 */ (void (*)(void))0,
	/* 575 */ (void (*)(void))0,
 0 };
static signed char primitiveAccessorDepthTable[MaxPrimitiveIndex + 2 /* 577 */] = {
/*0*/	-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0,-1,-1, 0,-1,-1, 0, 0, 0,-1,
/*20*/	0, 0, 0,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0,-1,-1,-1, 0, 0, 0,
/*40*/	0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*60*/	0, 0, 0,-1,-1,-1,-1,-1, 0, 0,-1,-1, 0, 1, 1, 0, 0, 0, 0, 0,
/*80*/	-1,-1,-1, 0,-1,-1, 0, 0, 1,-1,-1, 0, 0, 0, 0,-1,-1,-1, 0, 0,
/*100*/	1, 1, 3, 2,-1,-1,-1,-1,-1,-1, 0, 0,-1,-1,-1, 1,-1,-1, 1, 0,
/*120*/	-1, 0,-1,-1, 0, 0, 0, 0, 0,-1,-1,-1, 1, 0, 0,-1, 0,-1,-1,-1,
/*140*/	-1, 1,-1, 1, 0,-1,-1,-1, 0, 0,-1,-1,-1,-1,-1,-1,-1,-1, 1, 1,
/*160*/	0, 0,-1, 0, 0,-1,-1,-1, 1, 0, 0, 1,-1, 1, 1,-1,-1,-1,-1,-1,
/*180*/	0,-1,-1, 0, 0, 0, 1, 1, 1, 0,-1,-1,-1,-1,-1, 1, 2,-1,-1,-1,
/*200*/	-1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1,-1, 0,-1,-1, 3,-1,
/*220*/	-1, 2, 2,-1,-1,-1,-1,-1,-1,-1, 0,-1, 2, 0,-1,-1,-1,-1,-1,-1,
/*240*/	-1,-1, 0,-1, 0,-1,-1,-1, 0,-1,-1, 0, 0, 0, 0,-1,-1,-1,-1,-1,
/*260*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*280*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*300*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*320*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*340*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*360*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*380*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*400*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*420*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*440*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*460*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*480*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*500*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*520*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
/*540*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0,-1,-1,-1,-1,-1,
/*560*/	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, 0, 0, 0,-1,-1
	};
sqInt checkedPluginName;
char expensiveAsserts = 0;
const char *interpreterVersion = "Croquet Closure Cog[Spur] VM [CoInterpreterPrimitives VMMaker.oscog-eem.2509]";
sqInt minBackwardJumpCountForCompile = MinBackwardJumpCountForCompile /* 40 */;
volatile int sendTrace;


/*** Macros ***/
#define cPICNumCases stackCheckOffset
#define cPICNumCasesHack hack hack hack i.e. the getter macro does all the work
#define nextOpenPIC methodObject
#define nextOpenPICHack hack hack hack i.e. the getter macro does all the work
#define mostRecentlyUsedPage() GIV(mostRecentlyUsedPage)
#define stackPageAtpages(index,pages) ((pages) + (index))
#define statMaxPageCountWhenMapping() GIV(statMaxPageCountWhenMapping)
#define compilationBreakpointisMNUCase(sel, len, isMNU) do { \
	if ((len) == (isMNU ? -breakSelectorLength : breakSelectorLength) \
	 && !strncmp((char *)((sel) + BaseHeaderSize), breakSelector, (isMNU ? -breakSelectorLength : breakSelectorLength))) { \
		suppressHeartbeatFlag = 1; \
		compilationBreakpointFor(sel); \
	} \
} while (0)
#define getCodeCompactionCount() integerObjectOf(GIV(statCodeCompactionCount))
#define getCodeCompactionMSecs() integerObjectOf((GIV(statCodeCompactionUsecs) + 500) / 1000)
#define getCogCodeSize() integerObjectOf(GIV(cogCodeSize))
#define getDesiredCogCodeSize() integerObjectOf(desiredCogCodeSize)
#define heapBase() heapBase
#define mnuCompilationBreakpoint(sel, len) do { \
	if ((len) == -breakSelectorLength \
	 && !strncmp((char *)((sel) + BaseHeaderSize), breakSelector, -breakSelectorLength)) { \
		suppressHeartbeatFlag = 1; \
		compilationBreakpointFor(sel); \
	} \
} while (0)
#define primNumberExternalCall() 117
#define primTraceLogIndex(aValue) (GIV(primTraceLogIndex) = (aValue))
#define pageIndexForstackBasePlus1bytesPerPage(pointer,stkBasePlus1,pageByteSize) (((char *)(pointer) - (stkBasePlus1)) / (pageByteSize))
#define startOfMemory() heapBase
#define numTagBits() 3
#define shiftForWord() 3
#define smallFloatExponentBits() 8
#define smallFloatExponentOffset() 896
#define smallFloatMantissaBits() 52
#define smallFloatTag() 4
#define tagMask() 0x7
#define wordSize() 8
#define eden() GIV(eden)
#define futureSpace() GIV(futureSpace)
#define futureSurvivorStart() GIV(futureSurvivorStart)
#define pastSpace() GIV(pastSpace)
#define rememberedSetLimit() GIV(rememberedSetLimit)
#define rememberedSetSize() GIV(rememberedSetSize)
#define arrayClassIndexPun() 16
#define characterTag() 2
#define classIndexMask() 0x3FFFFF
#define classIsItselfClassIndexPun() 31
#define classTableFirstPage() classTableFirstPage
#define classTableMajorIndexShift() 10
#define endOfMemory() GIV(endOfMemory)
#define firstByteFormat() 16
#define firstClassIndexPun() 16
#define firstCompiledMethodFormat() 24
#define firstLongFormat() 10
#define firstShortFormat() 12
#define fixedFieldsFieldWidth() 16
#define formatFieldWidthShift() 5
#define formatMask() 0x1F
#define formatShift() 24
#define freeStart() GIV(freeStart)
#define greyBitShift() 31
#define identityHashFullWordShift() 32
#define identityHashHalfWordMask() 0x3FFFFF
#define immutableBitShift() 23
#define indexablePointersFormat() 3
#define isForwardedObjectClassIndexPun() 8
#define isFreeObjectClassIndexPun() 0
#define lastClassIndexPun() 31
#define markedBitFullShift() 55
#define markedBitHalfShift() 23
#define maxOldSpaceSize() maxOldSpaceSize
#define memory() GIV(memory)
#define newSpaceLimit() GIV(newSpaceLimit)
#define numSlotsFullShift() 56
#define numSlotsHalfShift() 24
#define numSlotsMask() 0xFF
#define oldSpaceStart() GIV(oldSpaceStart)
#define pastSpaceStart() GIV(pastSpaceStart)
#define pinnedBitShift() 30
#define remapBufferCount() GIV(remapBufferCount)
#define rememberedBitShift() 29
#define rootTableCapacity() GIV(rememberedSetLimit)
#define rootTableCount() GIV(rememberedSetSize)
#define segmentBridgePun() 3
#define sixtyFourBitIndexableFormat() 9
#define sixtyFourBitLongsClassIndexPun() 19
#define smallIntegerTag() 1
#define thirtyTwoBitLongsClassIndexPun() 18
#define weakArrayClassIndexPun() 17
#define weakArrayFormat() 4
#define numSegments() GIV(numSegments)
#define segments() GIV(segments)
#define alternateHeaderNumLiteralsMask() 0x7FFF
#define checkAllocFiller() GIV(checkAllocFiller)
#define dispatchFunctionPointer(aFunctionPointer) (aFunctionPointer)()
#define enterSmalltalkExecutive() enterSmalltalkExecutiveImplementation()
#define flush() fflush(stdout)
#define initialEnterSmalltalkExecutive() enterSmalltalkExecutiveImplementation()
#define printFloat(f) printf("%g", f)
#define remoteIsInstVarAccess() 128
#define stackPageFrameBytes() (256 * BytesPerWord)
#define allocatype(numElements, elementType) alloca((numElements)*sizeof(elementType))
#define numElementsIn(anArray) (sizeof(anArray)/sizeof(anArray[0]))
#define oopisGreaterThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) >= (usqInt)(otherOop))
#define oopisGreaterThanOrEqualToandLessThanOrEqualTo(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) <= (usqInt)(limitOop))
#define oopisGreaterThanOrEqualToandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) >= (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop))
#define oopisGreaterThan(anOop,otherOop) ((usqInt)(anOop) > (usqInt)(otherOop))
#define oopisGreaterThanandLessThan(anOop,baseOop,limitOop) ((usqInt)(anOop) > (usqInt)(baseOop) && (usqInt)(anOop) < (usqInt)(limitOop))
#define oopisLessThanOrEqualTo(anOop,otherOop) ((usqInt)(anOop) <= (usqInt)(otherOop))
#define oopisLessThan(anOop,otherOop) ((usqInt)(anOop) < (usqInt)(otherOop))



/*	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.
 */
/*	If stacklimit is zero then the stack pages have not been initialized. */

	/* StackInterpreter>>#interpret */
sqInt
interpret(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt currentBytecode;
    sqInt extA;
    sqInt extB;
    sqInt lkupClassTag;
    char * localFP;
    char * localIP;
    sqInt localReturnValue;
    char * localSP;
    sqInt numExtB;
    sqInt stackPageBytes;
    sqInt stackPagesBytes;
    char *theStackMemory;

	if (GIV(stackLimit) == 0) {
		/* begin initStackPagesAndInterpret */
		stackPageBytes = stackPageByteSize();
		/* begin computeStackZoneSize */
		stackPagesBytes = (GIV(numStackPages) * ((sizeof(CogStackPage)) + (stackPageByteSize()))) + BytesPerWord;
		theStackMemory = alloca(stackPagesBytes);
		memset(theStackMemory, 0, stackPagesBytes);
		sqMakeMemoryNotExecutableFromTo(((usqInt)(startOfMemory())), ((usqInt)GIV(endOfMemory)));
		sqMakeMemoryNotExecutableFromTo(((usqInt)theStackMemory), (((usqInt)theStackMemory)) + stackPagesBytes);
		initializeStacknumSlotspageSize(theStackMemory, stackPagesBytes / BytesPerWord, stackPageBytes / BytesPerWord);
		assert((minimumUnusedHeadroom()) == stackPageBytes);
		loadInitialContext();
		ioInitHeartbeat();
		initialEnterSmalltalkExecutive();
		return null;
	}
	browserPluginInitialiseIfNeeded();
	/* begin internalizeIPandSP */
	assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
	localIP = pointerForOop(GIV(instructionPointer));
	localSP = pointerForOop(GIV(stackPointer));
	localFP = pointerForOop(GIV(framePointer));
	/* begin initExtensions */
	extA = (numExtB = (extB = 0));
	/* begin fetchNextBytecode */
	currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
	while (1) {
		bytecodeDispatchDebugHook();

		VM_LABEL(bytecodeDispatch);
		switch (currentBytecode) {
		case 0:
		case 256: /*0*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 1:
		case 257: /*1*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode1);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 8 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 2:
		case 258: /*2*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode2);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 16 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 3:
		case 259: /*3*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode3);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 24 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 4:
		case 260: /*4*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode4);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 32 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 5:
		case 261: /*5*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode5);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 40 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 6:
		case 262: /*6*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode6);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 48 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 7:
		case 263: /*7*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode7);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 56 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 8:
		case 264: /*8*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode8);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 64 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 9:
		case 265: /*9*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode9);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 72 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 10:
		case 266: /*10*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode10);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 80 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 11:
		case 267: /*11*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode11);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 88 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 12:
		case 268: /*12*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode12);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 96 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 13:
		case 269: /*13*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode13);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 104 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 14:
		case 270: /*14*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode14);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 112 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 15:
		case 271: /*15*/
			/* pushReceiverVariableBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverVariableBytecode15);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushReceiverVariable: */
				object = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + 120 /* (currentBytecode bitAnd: 15) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 16:
		case 320: /*64*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (0 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 17:
		case 321: /*65*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode1);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (1 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 1 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 1 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 18:
		case 322: /*66*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode2);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (2 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 2 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 2 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 19:
		case 323: /*67*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode3);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (3 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 3 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 3 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 20:
		case 324: /*68*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode4);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (4 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 4 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 4 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 21:
		case 325: /*69*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode5);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (5 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 5 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 5 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 22:
		case 326: /*70*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode6);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (6 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 6 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 6 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 23:
		case 327: /*71*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode7);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (7 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 7 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 7 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 24:
		case 328: /*72*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode8);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (8 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 8 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 8 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 25:
		case 329: /*73*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode9);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (9 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 9 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 9 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 26:
		case 330: /*74*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode10);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (10 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 10 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 10 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 27:
		case 331: /*75*/
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode11);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (11 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 11 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 11 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 28:
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode12);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (12 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 12 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 12 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 29:
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode13);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (13 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 13 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 13 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 30:
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode14);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (14 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 14 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 14 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 31:
			/* pushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt object;

				VM_LABEL(pushTemporaryVariableBytecode15);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushTemporaryVariable: */
				object = (15 /* currentBytecode bitAnd: 15 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - 15 /* currentBytecode bitAnd: 15 */) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 15 /* currentBytecode bitAnd: 15 */) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 32:
		case 288: /*32*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 8 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 33:
		case 289: /*33*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode1);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 16 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 34:
		case 290: /*34*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode2);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 24 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 35:
		case 291: /*35*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode3);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 32 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 36:
		case 292: /*36*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode4);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 40 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 37:
		case 293: /*37*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode5);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 48 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 38:
		case 294: /*38*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode6);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 56 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 39:
		case 295: /*39*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode7);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 64 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 40:
		case 296: /*40*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode8);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 72 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 41:
		case 297: /*41*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode9);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 80 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 42:
		case 298: /*42*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode10);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 88 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 43:
		case 299: /*43*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode11);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 96 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 44:
		case 300: /*44*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode12);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 104 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 45:
		case 301: /*45*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode13);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 112 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 46:
		case 302: /*46*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode14);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 120 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 47:
		case 303: /*47*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode15);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 128 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 48:
		case 304: /*48*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode16);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 136 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 49:
		case 305: /*49*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode17);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 144 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 50:
		case 306: /*50*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode18);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 152 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 51:
		case 307: /*51*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode19);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 160 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 52:
		case 308: /*52*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode20);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 168 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 53:
		case 309: /*53*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode21);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 176 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 54:
		case 310: /*54*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode22);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 184 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 55:
		case 311: /*55*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode23);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 192 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 56:
		case 312: /*56*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode24);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 200 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 57:
		case 313: /*57*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode25);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 208 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 58:
		case 314: /*58*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode26);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 216 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 59:
		case 315: /*59*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode27);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 224 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 60:
		case 316: /*60*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode28);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 232 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 61:
		case 317: /*61*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode29);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 240 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 62:
		case 318: /*62*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode30);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 0xF8 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 63:
		case 319: /*63*/
			/* pushLiteralConstantBytecode */
			{
				sqInt object;

				VM_LABEL(pushLiteralConstantBytecode31);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + 256 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 64:
		case 272: /*16*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 8 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 0 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 65:
		case 273: /*17*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode1);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 16 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 1 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 66:
		case 274: /*18*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode2);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 24 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 2 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 67:
		case 275: /*19*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode3);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 32 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 3 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 68:
		case 276: /*20*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode4);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 40 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 4 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 69:
		case 277: /*21*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode5);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 48 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 5 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 70:
		case 278: /*22*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode6);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 56 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 6 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 71:
		case 279: /*23*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode7);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 64 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 7 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 72:
		case 280: /*24*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode8);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 72 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 8 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 73:
		case 281: /*25*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode9);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 80 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 9 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 74:
		case 282: /*26*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode10);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 88 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 10 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 75:
		case 283: /*27*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode11);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 96 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 11 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 76:
		case 284: /*28*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode12);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 104 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 12 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 77:
		case 285: /*29*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode13);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 112 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 13 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 78:
		case 286: /*30*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode14);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 120 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 14 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 79:
		case 287: /*31*/
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode15);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 128 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 15 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 80:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode16);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 136 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 16 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 81:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode17);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 144 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 17 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 82:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode18);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 152 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 18 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 83:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode19);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 160 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 19 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 84:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode20);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 168 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 20 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 85:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode21);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 176 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 21 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 86:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode22);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 184 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 22 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 87:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode23);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 192 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 23 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 88:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode24);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 200 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 24 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 89:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode25);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 208 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 25 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 90:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode26);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 216 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 26 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 91:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode27);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 224 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 27 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 92:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode28);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 232 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 28 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 93:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode29);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 240 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 29 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 94:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode30);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 0xF8 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 30 /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 95:
			/* pushLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt object;

				VM_LABEL(pushLiteralVariableBytecode31);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + 256 /* ((currentBytecode bitAnd: 31) + LiteralStart) << self shiftForWord */);
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, 0x1F /* currentBytecode bitAnd: 31 */);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + 8 /* ValueIndex << self shiftForWord */);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 96:
		case 97:
		case 98:
		case 99:
		case 100:
		case 101:
		case 102:
		case 103:
			/* storeAndPopReceiverVariableBytecode */
			{
				sqInt instVarIndex;
				sqInt rcvr;
				sqInt top;

				VM_LABEL(storeAndPopReceiverVariableBytecode);
				/* begin receiver */
				rcvr = longAt(localFP + FoxIFReceiver);
				/* begin internalStackTop */
				top = longAtPointer(localSP);
				instVarIndex = currentBytecode & 7;
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
				/* begin storePointerImmutabilityCheck:ofObject:withValue: */
				
#        if IMMUTABILITY
				assert(!((isImmediate(rcvr))));
				if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) {
					/* begin cannotAssign:to:withIndex: */
					longAtPointerput((localSP -= BytesPerOop), rcvr);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), top);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), (((usqInt)(instVarIndex + 1) << 3) | 1));
					/* begin splObj: */
					GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
					GIV(argumentCount) = 2;
					goto normalSend;
					/* return self */
					goto l12;
				}
#        endif /* IMMUTABILITY */
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(rcvr)));
				if ((assert(isNonImmediate(rcvr)),
				oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((top & (tagMask())) == 0)
					 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(rcvr);
						}
					}
				}
				longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(instVarIndex) << (shiftForWord())))), top);
	l12:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
			break;
		case 104:
		case 464: /*208*/
			/* storeAndPopTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;

				VM_LABEL(storeAndPopTemporaryVariableBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin itemporary:in:put: */
				if (0 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
					longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs) * BytesPerWord), longAtPointer(localSP));
				}
				else {
					longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs) * BytesPerWord), longAtPointer(localSP));
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 105:
		case 465: /*209*/
			/* storeAndPopTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;

				VM_LABEL(storeAndPopTemporaryVariableBytecode1);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin itemporary:in:put: */
				if (1 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
					longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 1 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				else {
					longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 1 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 106:
		case 466: /*210*/
			/* storeAndPopTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;

				VM_LABEL(storeAndPopTemporaryVariableBytecode2);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin itemporary:in:put: */
				if (2 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
					longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 2 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				else {
					longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 2 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 107:
		case 467: /*211*/
			/* storeAndPopTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;

				VM_LABEL(storeAndPopTemporaryVariableBytecode3);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin itemporary:in:put: */
				if (3 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
					longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 3 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				else {
					longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 3 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 108:
		case 468: /*212*/
			/* storeAndPopTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;

				VM_LABEL(storeAndPopTemporaryVariableBytecode4);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin itemporary:in:put: */
				if (4 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
					longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 4 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				else {
					longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 4 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 109:
		case 469: /*213*/
			/* storeAndPopTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;

				VM_LABEL(storeAndPopTemporaryVariableBytecode5);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin itemporary:in:put: */
				if (5 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
					longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 5 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				else {
					longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 5 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 110:
		case 470: /*214*/
			/* storeAndPopTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;

				VM_LABEL(storeAndPopTemporaryVariableBytecode6);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin itemporary:in:put: */
				if (6 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
					longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 6 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				else {
					longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 6 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 111:
		case 471: /*215*/
			/* storeAndPopTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;

				VM_LABEL(storeAndPopTemporaryVariableBytecode7);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin itemporary:in:put: */
				if (7 /* currentBytecode bitAnd: 7 */ < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
					longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - 7 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				else {
					longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - 7 /* currentBytecode bitAnd: 7 */) * BytesPerWord), longAtPointer(localSP));
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 112:
		case 332: /*76*/
			/* pushReceiverBytecode */
			{
				sqInt object;

				VM_LABEL(pushReceiverBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				object = longAt(localFP + FoxIFReceiver);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 113:
		case 333: /*77*/
			/* pushConstantTrueBytecode */
			{
				sqInt object;

				VM_LABEL(pushConstantTrueBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				object = GIV(trueObj);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 114:
		case 334: /*78*/
			/* pushConstantFalseBytecode */
			{
				sqInt object;

				VM_LABEL(pushConstantFalseBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				object = GIV(falseObj);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 115:
		case 335: /*79*/
			/* pushConstantNilBytecode */
			{
				sqInt object;

				VM_LABEL(pushConstantNilBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				object = GIV(nilObj);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 116:
			/* pushConstantMinusOneBytecode */
			{
				VM_LABEL(pushConstantMinusOneBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), ConstMinusOne);
			}
			break;
		case 117:
		case 336: /*80*/
			/* pushConstantZeroBytecode */
			{
				VM_LABEL(pushConstantZeroBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), ConstZero);
			}
			break;
		case 118:
		case 337: /*81*/
			/* pushConstantOneBytecode */
			{
				VM_LABEL(pushConstantOneBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), ConstOne);
			}
			break;
		case 119:
			/* pushConstantTwoBytecode */
			{
				VM_LABEL(pushConstantTwoBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), ConstTwo);
			}
			break;
		case 120:
			/* returnReceiver */
			{
				VM_LABEL(returnReceiver);
				/* begin receiver */
				localReturnValue = longAt(localFP + FoxIFReceiver);
				/* goto commonReturn */
			}
			
		commonReturn:
			/* commonReturn */
			{
				sqInt aMethodObj;
				sqInt callerContextOrNil;
				sqInt callerContextOrNil1;
				sqInt callerContextOrNil2;
				char *callerFP;
				sqInt closure;
				sqInt contextToReturnTo;
				sqInt currentCtx;
				char *frameToReturnTo;
				sqInt home;
				StackPage *newPage;
				sqInt nextCntx;
				sqInt objOop;
				sqInt objOop1;
				sqInt ourContext;
				sqInt ourContext1;
				sqInt ourContext2;
				sqInt ourContext3;
				sqInt senderOop;
				sqInt senderOop1;
				char *theFP;
				char *theFP1;
				char *theFP2;
				StackPage *thePage;
				StackPage *thePage1;
				StackPage *thePage2;
				StackPage *thePage3;
				sqInt unwindContextOrNilOrZero;
				sqInt valuePointer;
				sqInt valuePointer1;

				VM_LABEL(commonReturn);
				
				/* If this is a method simply return to the  sender/caller. */
				frameToReturnTo = ((char *) 0);
				if (!((byteAt((localFP + FoxIFrameFlags) + 3)) != 0)) {
					goto commonCallerReturn;
					goto l735;
				}
				/* begin writeBackHeadFramePointers */
				assert(GIV(stackPage) == (mostRecentlyUsedPage()));
				/* begin setHeadFP:andSP:inPage: */
				assert(localSP < localFP);
				assert((localSP < ((GIV(stackPage)->baseAddress)))
				 && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
				assert((localFP < ((GIV(stackPage)->baseAddress)))
				 && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
				(GIV(stackPage)->headFP = localFP);
				(GIV(stackPage)->headSP = localSP);
				assert(pageListIsWellFormed());
				/* begin externalizeIPandSP */
				assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
				GIV(instructionPointer) = oopForPointer(localIP);
				GIV(stackPointer) = localSP;
				GIV(framePointer) = localFP;
				closure = longAt(localFP + (frameStackedReceiverOffset(localFP)));

				/* avoid compiler warning */
				/* Walk the closure's lexical chain to find the context or frame to return from (home).
				   If home is missing (Sista closures) then throw cannotReturn rather than crash. */
				home = null;
				while (closure != GIV(nilObj)) {
					/* begin followField:ofObject: */
					objOop = longAt((closure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))));
					if (((objOop & (tagMask())) == 0)
					 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						objOop = fixFollowedFieldofObjectwithInitialValue(ClosureOuterContextIndex, closure, objOop);
					}
					home = objOop;
					if (!(((home & (tagMask())) == 0)
						 && (((longAt(home)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
						/* begin internalCannotReturn: */
						if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())
							? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
							: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
							assert(isContext(frameContext(localFP)));
							ourContext = longAt(localFP + FoxThisContext);
							goto l764;
						}
						ourContext = marryFrameSP(localFP, localSP);
	l764:	/* end ensureFrameIsMarried:SP: */;
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), ourContext);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), localReturnValue);
						/* begin splObj: */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorCannotReturn) << (shiftForWord())))));
						GIV(argumentCount) = 1;
						goto normalSend;
						goto l735;
					}
					/* begin followField:ofObject: */
					objOop1 = longAt((home + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureIndex) << (shiftForWord())))));
					if (((objOop1 & (tagMask())) == 0)
					 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						objOop1 = fixFollowedFieldofObjectwithInitialValue(ClosureIndex, home, objOop1);
					}
					closure = objOop1;
				}
				unwindContextOrNilOrZero = findUnwindThroughContext(home);
				if (unwindContextOrNilOrZero == GIV(nilObj)) {

					/* error: can't find home on chain; cannot return */
					/* begin internalCannotReturn: */
					if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())
						? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
						: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
						assert(isContext(frameContext(localFP)));
						ourContext1 = longAt(localFP + FoxThisContext);
						goto l756;
					}
					ourContext1 = marryFrameSP(localFP, localSP);
	l756:	/* end ensureFrameIsMarried:SP: */;
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), ourContext1);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), localReturnValue);
					/* begin splObj: */
					GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorCannotReturn) << (shiftForWord())))));
					GIV(argumentCount) = 1;
					goto normalSend;
					goto l735;
				}
				if (unwindContextOrNilOrZero != 0) {
					/* begin internalAboutToReturn:through: */
					if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())
						? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
						: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
						assert(isContext(frameContext(localFP)));
						ourContext2 = longAt(localFP + FoxThisContext);
						goto l749;
					}
					ourContext2 = marryFrameSP(localFP, localSP);
	l749:	/* end ensureFrameIsMarried:SP: */;
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), ourContext2);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), localReturnValue);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), unwindContextOrNilOrZero);
					/* begin splObj: */
					GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAboutToReturn) << (shiftForWord())))));
					GIV(argumentCount) = 2;
					goto normalSend;
					goto l735;
				}
				contextToReturnTo = null;
				if (((((longAt((home + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
					assert(checkIsStillMarriedContextcurrentFP(home, localFP));
					/* begin frameOfMarriedContext: */
					senderOop = longAt((home + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
					assert((((senderOop) & 7) == 1));
					theFP = pointerForOop(senderOop - 1);
					if ((longAt(theFP + FoxSavedFP)) == 0) {
						/* begin frameCallerContext: */
						assert(isBaseFrame(theFP));
						/* begin stackPageFor: */
						thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
						pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
						callerContextOrNil = longAt((thePage1->baseAddress));
						assert(addressCouldBeObj(callerContextOrNil));
						assert((callerContextOrNil == (nilObject()))
						 || (isContext(callerContextOrNil)));
						contextToReturnTo = callerContextOrNil;
					}
					else {
						frameToReturnTo = pointerForOop(longAt(theFP + FoxSavedFP));
					}
				}
				else {
					/* begin fetchPointer:ofObject: */
					contextToReturnTo = longAt((home + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
					if ((((contextToReturnTo & (tagMask())) == 0)
					 && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex))
					 && (((((longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))) {
						assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, localFP));
						/* begin frameOfMarriedContext: */
						senderOop1 = longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
						assert((((senderOop1) & 7) == 1));
						frameToReturnTo = pointerForOop(senderOop1 - 1);
						contextToReturnTo = null;
					}
				}
				if (contextToReturnTo != null) {
					frameToReturnTo = establishFrameForContextToReturnTo(contextToReturnTo);
					if (frameToReturnTo == 0) {

						/* error: home's sender is dead; cannot return */
						/* begin internalCannotReturn: */
						if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())
							? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
							: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
							assert(isContext(frameContext(localFP)));
							ourContext3 = longAt(localFP + FoxThisContext);
							goto l742;
						}
						ourContext3 = marryFrameSP(localFP, localSP);
	l742:	/* end ensureFrameIsMarried:SP: */;
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), ourContext3);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), localReturnValue);
						/* begin splObj: */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorCannotReturn) << (shiftForWord())))));
						GIV(argumentCount) = 1;
						goto normalSend;
						goto l735;
					}
				}
				assert(pageListIsWellFormed());
				/* begin stackPageFor: */
				newPage = stackPageAtpages((assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))),
				pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
				if (newPage != GIV(stackPage)) {
					/* begin frameCallerContext: */
					theFP2 = (GIV(stackPage)->baseFP);
					assert(isBaseFrame(theFP2));
					/* begin stackPageFor: */
					thePage3 = stackPageAtpages((assert((((((char *) theFP2)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP2)) <= (((char *) GIV(pages)))))),
					pageIndexForstackBasePlus1bytesPerPage(theFP2, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
					callerContextOrNil2 = longAt((thePage3->baseAddress));
					assert(addressCouldBeObj(callerContextOrNil2));
					assert((callerContextOrNil2 == (nilObject()))
					 || (isContext(callerContextOrNil2)));
					currentCtx = callerContextOrNil2;
					freeStackPage(GIV(stackPage));
					while (1) {
						assert(isContext(currentCtx));
						if ((((((longAt((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
						 && ((stackPageFor((theFP = frameOfMarriedContext(currentCtx)))) == newPage)) break;
						if (((((longAt((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
							/* begin stackPageFor: */
							thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
							pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
							if (theFP != ((thePage->headFP))) {

								/* Since we've just deallocated a page we know that newStackPage won't deallocate an existing one. */
								moveFramesInthroughtoPage(thePage, findFrameAboveinPage(theFP, thePage), newStackPage());
							}
							/* begin frameCallerContext: */
							theFP1 = (thePage->baseFP);
							assert(isBaseFrame(theFP1));
							/* begin stackPageFor: */
							thePage2 = stackPageAtpages((assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))),
							pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
							callerContextOrNil1 = longAt((thePage2->baseAddress));
							assert(addressCouldBeObj(callerContextOrNil1));
							assert((callerContextOrNil1 == (nilObject()))
							 || (isContext(callerContextOrNil1)));
							currentCtx = callerContextOrNil1;
							freeStackPage(thePage);
						}
						else {
							/* begin fetchPointer:ofObject: */
							nextCntx = longAt((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
							/* begin markContextAsDead: */
							assert(isContext(currentCtx));
							/* begin storePointerUnchecked:ofObject:withValue: */
							valuePointer = GIV(nilObj);
							assert(!(isOopForwarded(currentCtx)));
							longAtput((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer);
							/* begin storePointerUnchecked:ofObject:withValue: */
							valuePointer1 = GIV(nilObj);
							assert(!(isOopForwarded(currentCtx)));
							longAtput((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1);
							currentCtx = nextCntx;
						}
					}
					/* begin setStackPageAndLimit: */
					assert(newPage != 0);
					GIV(stackPage) = newPage;
					if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
						GIV(stackLimit) = (GIV(stackPage)->stackLimit);
					}
					markStackPageMostRecentlyUsed(newPage);
					localSP = (GIV(stackPage)->headSP);
					localFP = (GIV(stackPage)->headFP);
				}
				if (localFP == frameToReturnTo) {

					/* pop the saved IP, push the return value and continue. */
					localIP = pointerForOop(longAtPointer(localSP));
				}
				else {
					do {
						callerFP = localFP;
						localFP = pointerForOop(longAt(localFP + FoxSavedFP));
					} while(localFP != frameToReturnTo);
					localIP = pointerForOop(longAt(callerFP + FoxCallerSavedIP));
					localSP = ((assert(!(isBaseFrame(callerFP))),
(callerFP + (frameStackedReceiverOffset(callerFP))) + BytesPerWord)) - BytesPerWord;
				}
				/* begin maybeReturnToMachineCodeFrame */
				if ((((usqInt)localIP)) < (startOfMemory())) {
					if ((((usqInt)localIP)) != (ceReturnToInterpreterPC())) {

						/* localIP in the cog method zone indicates a return to machine code. */
						/* begin returnToMachineCodeFrame */
						assertCStackWellAligned();
						assert((((usqInt)localIP)) < (startOfMemory()));
						assert(isMachineCodeFrame(localFP));
						assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 0, __LINE__);
						longAtPointerput(localSP, localIP);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), localReturnValue);
						/* begin externalizeFPandSP */
						assert((localSP < ((GIV(stackPage)->baseAddress)))
						 && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
						GIV(stackPointer) = localSP;
						GIV(framePointer) = localFP;
						ceEnterCogCodePopReceiverReg();
						goto l762;
					}
					localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
				}
	l762:	/* end maybeReturnToMachineCodeFrame */;
				/* begin setMethod: */
				aMethodObj = longAt(localFP + FoxMethod);
				assert((((usqInt)aMethodObj)) >= (startOfMemory()));
				GIV(method) = aMethodObj;
				assert(isOopCompiledMethod(GIV(method)));
				
#        if MULTIPLEBYTECODESETS
				GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
					? 256
					: 0);
#        endif /* MULTIPLEBYTECODESETS */
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				longAtPointerput(localSP, localReturnValue);
			}
	l735:	/* end case */;
			break;
		case 121:
		case 345: /*89*/
			/* returnTrue */
			{
				VM_LABEL(returnTrue);
				/* begin trueObject */
				localReturnValue = GIV(trueObj);
				goto commonReturn;
			}
			break;
		case 122:
		case 346: /*90*/
			/* returnFalse */
			{
				VM_LABEL(returnFalse);
				/* begin falseObject */
				localReturnValue = GIV(falseObj);
				goto commonReturn;
			}
			break;
		case 123:
		case 347: /*91*/
			/* returnNil */
			{
				VM_LABEL(returnNil);
				/* begin nilObject */
				localReturnValue = GIV(nilObj);
				goto commonReturn;
			}
			break;
		case 124:
		case 348: /*92*/
			/* returnTopFromMethod */
			{
				VM_LABEL(returnTopFromMethod);
				/* begin internalStackTop */
				localReturnValue = longAtPointer(localSP);
				goto commonReturn;
			}
			break;
		case 125:
			/* returnTopFromBlock */
			{
				VM_LABEL(returnTopFromBlock);
				/* begin internalStackTop */
				localReturnValue = longAtPointer(localSP);
				/* goto commonCallerReturn */
			}
			
		commonCallerReturn:
			/* commonCallerReturn */
			{
				sqInt aMethodObj;
				sqInt aMethodObj1;
				sqInt callerContextOrNil;
				char *callerFP;
				char *callersFPOrNull;
				sqInt contextToReturnFrom;
				sqInt contextToReturnTo;
				char *fp;
				char *frameAbove;
				StackPage *lruOrFree;
				StackPage *newPage;
				sqInt retToContext;
				sqInt senderOop;
				char *sp;
				char *sp1;
				char *sp2;
				char *theFP;
				StackPage *thePage;
				StackPage *thePage1;
				char *theSP;

				VM_LABEL(commonCallerReturn);
				
				/* TODO: Store/restore the nativeSP more properly, when it exists */
				callersFPOrNull = pointerForOop(longAt(localFP + FoxSavedFP));
				if (callersFPOrNull == 0) {

					/* baseFrame */
					assert(localFP == ((GIV(stackPage)->baseFP)));
					/* begin baseFrameReturn */
					assert(isBaseFrame(localFP));
					/* begin stackPageFor: */
					thePage1 = stackPageAtpages((assert((((((char *) localFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) localFP)) <= (((char *) GIV(pages)))))),
					pageIndexForstackBasePlus1bytesPerPage(localFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
					callerContextOrNil = longAt((thePage1->baseAddress));
					assert(addressCouldBeObj(callerContextOrNil));
					assert((callerContextOrNil == (nilObject()))
					 || (isContext(callerContextOrNil)));
					contextToReturnTo = callerContextOrNil;
					freeStackPageNoAssert(GIV(stackPage));
					retToContext = ((contextToReturnTo & (tagMask())) == 0)
					 && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex);
					if (retToContext
					 && ((((((longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
					 && (!(isWidowedContext(contextToReturnTo))))) {
						/* begin frameOfMarriedContext: */
						senderOop = longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
						assert((((senderOop) & 7) == 1));
						theFP = pointerForOop(senderOop - 1);
						/* begin stackPageFor: */
						thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
						pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
						if (theFP == ((thePage->headFP))) {
							theSP = (thePage->headSP);
						}
						else {

							/* Returning to some interior frame, presumably because of a sender assignment.
							   Move the frames above to another page (they may be in use, e.g. via coroutining).
							   Make the interior frame the top frame. */
							/* begin findFrameAbove:inPage: */
							fp = (thePage->headFP);
							if (fp == theFP) {
								frameAbove = 0;
								goto l775;
							}
							while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) {
								if (callerFP == theFP) {
									frameAbove = fp;
									goto l775;
								}
								fp = callerFP;
							}
							error("did not find theFP in stack page");
							frameAbove = 0;
	l775:	/* end findFrameAbove:inPage: */;
							/* begin newStackPage */
							lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage);
							if (((lruOrFree->baseFP)) == 0) {
								newPage = lruOrFree;
								goto l770;
							}
							divorceFramesIn(lruOrFree);
							newPage = lruOrFree;
	l770:	/* end newStackPage */;
							assert(newPage == GIV(stackPage));
							moveFramesInthroughtoPage(thePage, frameAbove, newPage);
							markStackPageMostRecentlyUsed(newPage);
							theFP = (thePage->headFP);
							theSP = (thePage->headSP);
						}
					}
					else {
						if (!(retToContext
							 && (((((longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))) & 7) == 1)))) {
							contextToReturnFrom = longAt(((GIV(stackPage)->baseAddress)) - BytesPerWord);
							tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFromtoreturnValue(contextToReturnFrom, contextToReturnTo, localReturnValue);
							/* begin externalCannotReturn:from: */
							longAtput((sp = GIV(stackPointer) - BytesPerWord), contextToReturnFrom);
							GIV(stackPointer) = sp;
							/* begin push: */
							longAtput((sp1 = GIV(stackPointer) - BytesPerWord), localReturnValue);
							GIV(stackPointer) = sp1;
							/* begin push: */
							longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
							GIV(stackPointer) = sp2;
							ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), contextToReturnFrom, 1);
							goto l766;
						}
						GIV(instructionPointer) = 0;
						thePage = makeBaseFrameFor(contextToReturnTo);
						theFP = (thePage->headFP);
						theSP = (thePage->headSP);
					}
					/* begin setStackPageAndLimit: */
					assert(thePage != 0);
					GIV(stackPage) = thePage;
					if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
						GIV(stackLimit) = (GIV(stackPage)->stackLimit);
					}
					markStackPageMostRecentlyUsed(thePage);
					assert((stackPageFor(theFP)) == GIV(stackPage));
					localSP = theSP;
					localFP = theFP;
					localIP = pointerForOop(longAtPointer(localSP));
					if ((((usqInt)localIP)) < (startOfMemory())) {
						if ((((usqInt)localIP)) != (ceReturnToInterpreterPC())) {

							/* localIP in the cog method zone indicates a return to machine code. */
							/* begin returnToMachineCodeFrame */
							assertCStackWellAligned();
							assert((((usqInt)localIP)) < (startOfMemory()));
							assert(isMachineCodeFrame(localFP));
							assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 0, __LINE__);
							longAtPointerput(localSP, localIP);
							/* begin internalPush: */
							longAtPointerput((localSP -= BytesPerOop), localReturnValue);
							/* begin externalizeFPandSP */
							assert((localSP < ((GIV(stackPage)->baseAddress)))
							 && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
							GIV(stackPointer) = localSP;
							GIV(framePointer) = localFP;
							ceEnterCogCodePopReceiverReg();
							goto l766;
						}
						localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
					}
					assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, localFP));
					/* begin setMethod: */
					aMethodObj = longAt(localFP + FoxMethod);
					assert((((usqInt)aMethodObj)) >= (startOfMemory()));
					GIV(method) = aMethodObj;
					assert(isOopCompiledMethod(GIV(method)));
					
#          if MULTIPLEBYTECODESETS
					GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
						? 256
						: 0);
#          endif /* MULTIPLEBYTECODESETS */
					longAtPointerput(localSP, localReturnValue);
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l766;
				}
				localIP = pointerForOop(longAt(localFP + FoxCallerSavedIP));
				localSP = localFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())
	? ((mframeCogMethod(localFP))->cmNumArgs)
	: byteAt((localFP + FoxIFrameFlags) + 1))));
				localFP = callersFPOrNull;
				if ((((usqInt)localIP)) < (startOfMemory())) {
					if ((((usqInt)localIP)) != (ceReturnToInterpreterPC())) {

						/* localIP in the cog method zone indicates a return to machine code. */
						/* begin returnToMachineCodeFrame */
						assertCStackWellAligned();
						assert((((usqInt)localIP)) < (startOfMemory()));
						assert(isMachineCodeFrame(localFP));
						assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 0, __LINE__);
						longAtPointerput(localSP, localIP);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), localReturnValue);
						/* begin externalizeFPandSP */
						assert((localSP < ((GIV(stackPage)->baseAddress)))
						 && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
						GIV(stackPointer) = localSP;
						GIV(framePointer) = localFP;
						ceEnterCogCodePopReceiverReg();
						goto l766;
					}
					localIP = pointerForOop(longAt(localFP + FoxIFSavedIP));
				}
				/* begin setMethod: */
				aMethodObj1 = longAt(localFP + FoxMethod);
				assert((((usqInt)aMethodObj1)) >= (startOfMemory()));
				GIV(method) = aMethodObj1;
				assert(isOopCompiledMethod(GIV(method)));
				
#        if MULTIPLEBYTECODESETS
				GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
					? 256
					: 0);
#        endif /* MULTIPLEBYTECODESETS */
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				longAtPointerput(localSP, localReturnValue);
			}
	l766:	/* end case */;
			break;
		case 126:
		case 127:
			/* unknownBytecode */
			{
				VM_LABEL(unknownBytecode);
				/* goto respondToUnknownBytecode */
			}
			
		respondToUnknownBytecode:
			/* respondToUnknownBytecode */
			{
				sqInt ourContext;
				char *theFP;
				char *theSP;

				VM_LABEL(respondToUnknownBytecode);
				GIV(messageSelector) = (SelectorUnknownBytecode < (numSlotsOf(GIV(specialObjectsOop)))
					? (/* begin fetchPointer:ofObject: */
						longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorUnknownBytecode) << (shiftForWord()))))))
					: 0);
				if ((GIV(messageSelector) == null)
				 || (GIV(messageSelector) == GIV(nilObj))) {
					error("Unknown bytecode");
				}
				/* begin ensureFrameIsMarried:SP: */
				theFP = localFP;
				theSP = localSP;
				if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
					: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
					assert(isContext(frameContext(theFP)));
					ourContext = longAt(theFP + FoxThisContext);
					goto l776;
				}
				ourContext = marryFrameSP(theFP, theSP);
	l776:	/* end ensureFrameIsMarried:SP: */;
				localIP -= 1;
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), ourContext);
				GIV(argumentCount) = 0;
				goto normalSend;
			}
			break;
		case 128:
			/* extendedPushBytecode */
			{
				sqInt descriptor;
				sqInt frameNumArgs;
				sqInt litVar;
				sqInt object;
				sqInt object1;
				sqInt object2;
				sqInt object3;
				sqInt variableIndex;
				sqInt variableType;

				VM_LABEL(extendedPushBytecode);
				descriptor = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				variableType = (((usqInt) descriptor) >> 6) & 3;
				variableIndex = descriptor & 0x3F;
				if (variableType == 0) {
					/* begin pushReceiverVariable: */
					object1 = longAt(((longAt(localFP + FoxIFReceiver)) + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))));
					longAtPointerput((localSP -= BytesPerOop), object1);
					goto l35;
				}
				if (variableType == 1) {
					/* begin pushTemporaryVariable: */
					object = (variableIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
						? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - variableIndex) * BytesPerWord))
						: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord)));
					longAtPointerput((localSP -= BytesPerOop), object);
					goto l35;
				}
				if (variableType == 2) {
					/* begin pushLiteralConstant: */
					assert(GIV(method) == (iframeMethod(localFP)));
					/* begin fetchPointer:ofObject: */
					object2 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord())))));
					longAtPointerput((localSP -= BytesPerOop), object2);
					goto l35;
				}
				if (variableType == 3) {
					/* begin pushLiteralVariable: */
					
					/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
					   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
					   all methods in the stack zone, and the entire method on return, and global variables are relatively
					   rare; in my work image 8.7% of literals are globals). */
					assert(GIV(method) == (iframeMethod(localFP)));
					/* begin fetchPointer:ofObject: */
					litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord())))));
					if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
						litVar = unfollowatIndex(litVar, variableIndex);
					}
					/* begin internalPush: */
					object3 = longAt((litVar + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
					longAtPointerput((localSP -= BytesPerOop), object3);
					goto l35;
				}
			}
	l35:	/* end case */;
			break;
		case 129:
			/* extendedStoreBytecode */
			{
				sqInt descriptor;
				sqInt frameNumArgs;
				sqInt litVar;
				sqInt objOop;
				sqInt value;
				sqInt variableIndex;
				sqInt variableType;

				VM_LABEL(extendedStoreBytecode);
				/* begin extendedStoreBytecodePop: */
				descriptor = byteAtPointer(++localIP);
				variableType = (((usqInt) descriptor) >> 6) & 3;
				variableIndex = descriptor & 0x3F;
				value = longAtPointer(localSP);
				if (variableType == 0) {
					/* begin storePointerImmutabilityCheck:ofObject:withValue: */
					objOop = longAt(localFP + FoxIFReceiver);
					
#          if IMMUTABILITY
					assert(!((isImmediate(objOop))));
					if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) {
						/* begin cannotAssign:to:withIndex: */
						longAtPointerput((localSP -= BytesPerOop), objOop);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), value);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), (((usqInt)(variableIndex + 1) << 3) | 1));
						/* begin splObj: */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
						GIV(argumentCount) = 2;
						goto normalSend;
						/* return self */
						goto l42;
					}
#          endif /* IMMUTABILITY */
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(objOop)));
					if ((assert(isNonImmediate(objOop)),
					oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((value & (tagMask())) == 0)
						 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(objOop);
							}
						}
					}
					longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value);
	l42:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l54;
				}
				if (variableType == 1) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					if (variableIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
						longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - variableIndex) * BytesPerWord), value);
					}
					else {
						longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value);
					}
					goto l54;
				}
				if (variableType == 3) {
					/* begin storeLiteralVariable:withValue: */

					/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
					   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
					   all methods in the stack zone, and the entire method on return, and global variables are relatively
					   rare; in my work image 8.7% of literals are globals). */
					assert(GIV(method) == (iframeMethod(localFP)));
					/* begin fetchPointer:ofObject: */
					litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord())))));
					if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
						litVar = unfollowatIndex(litVar, variableIndex);
					}
					/* begin storePointerImmutabilityCheck:ofObject:withValue: */
					
#          if IMMUTABILITY
					assert(!((isImmediate(litVar))));
					if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) {
						/* begin cannotAssign:to:withIndex: */
						longAtPointerput((localSP -= BytesPerOop), litVar);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), value);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), (((usqInt)(ValueIndex + 1) << 3) | 1));
						/* begin splObj: */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
						GIV(argumentCount) = 2;
						goto normalSend;
						/* return self */
						goto l50;
					}
#          endif /* IMMUTABILITY */
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(litVar)));
					if ((assert(isNonImmediate(litVar)),
					oopisGreaterThanOrEqualTo(litVar, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((value & (tagMask())) == 0)
						 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(litVar))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(litVar);
							}
						}
					}
					longAtput((litVar + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))), value);
	l50:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l54;
				}
				error("illegal store");
	l54:	/* end extendedStoreBytecodePop: */;
			}
			break;
		case 130:
			/* extendedStoreAndPopBytecode */
			{
				sqInt descriptor;
				sqInt frameNumArgs;
				sqInt litVar;
				sqInt objOop;
				sqInt value;
				sqInt variableIndex;
				sqInt variableType;

				VM_LABEL(extendedStoreAndPopBytecode);
				/* begin extendedStoreBytecodePop: */
				descriptor = byteAtPointer(++localIP);
				variableType = (((usqInt) descriptor) >> 6) & 3;
				variableIndex = descriptor & 0x3F;
				value = longAtPointer(localSP);
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
				if (variableType == 0) {
					/* begin storePointerImmutabilityCheck:ofObject:withValue: */
					objOop = longAt(localFP + FoxIFReceiver);
					
#          if IMMUTABILITY
					assert(!((isImmediate(objOop))));
					if (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0) {
						/* begin cannotAssign:to:withIndex: */
						longAtPointerput((localSP -= BytesPerOop), objOop);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), value);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), (((usqInt)(variableIndex + 1) << 3) | 1));
						/* begin splObj: */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
						GIV(argumentCount) = 2;
						goto normalSend;
						/* return self */
						goto l55;
					}
#          endif /* IMMUTABILITY */
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(objOop)));
					if ((assert(isNonImmediate(objOop)),
					oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((value & (tagMask())) == 0)
						 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(objOop);
							}
						}
					}
					longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value);
	l55:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l67;
				}
				if (variableType == 1) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					if (variableIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
						longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - variableIndex) * BytesPerWord), value);
					}
					else {
						longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - variableIndex) * BytesPerWord), value);
					}
					goto l67;
				}
				if (variableType == 3) {
					/* begin storeLiteralVariable:withValue: */

					/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
					   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
					   all methods in the stack zone, and the entire method on return, and global variables are relatively
					   rare; in my work image 8.7% of literals are globals). */
					assert(GIV(method) == (iframeMethod(localFP)));
					/* begin fetchPointer:ofObject: */
					litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord())))));
					if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
						litVar = unfollowatIndex(litVar, variableIndex);
					}
					/* begin storePointerImmutabilityCheck:ofObject:withValue: */
					
#          if IMMUTABILITY
					assert(!((isImmediate(litVar))));
					if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) {
						/* begin cannotAssign:to:withIndex: */
						longAtPointerput((localSP -= BytesPerOop), litVar);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), value);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), (((usqInt)(ValueIndex + 1) << 3) | 1));
						/* begin splObj: */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
						GIV(argumentCount) = 2;
						goto normalSend;
						/* return self */
						goto l63;
					}
#          endif /* IMMUTABILITY */
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(litVar)));
					if ((assert(isNonImmediate(litVar)),
					oopisGreaterThanOrEqualTo(litVar, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((value & (tagMask())) == 0)
						 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(litVar))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(litVar);
							}
						}
					}
					longAtput((litVar + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))), value);
	l63:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l67;
				}
				error("illegal store");
	l67:	/* end extendedStoreBytecodePop: */;
			}
			break;
		case 131:
			/* singleExtendedSendBytecode */
			{
				sqInt descriptor;

				VM_LABEL(singleExtendedSendBytecode);
				/* begin fetchByte */
				descriptor = byteAtPointer(++localIP);
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((descriptor & 0x1F) + LiteralStart)) << (shiftForWord())))));
				GIV(argumentCount) = ((usqInt) descriptor) >> 5;
				/* goto normalSend */
			}
			
		normalSend:
			/* normalSend */
			{
				sqInt rcvr;
				sqInt tagBits;

				VM_LABEL(normalSend);
				/* begin internalStackValue: */
				rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
				lkupClassTag = (((tagBits = rcvr & (tagMask()))) != 0
					? tagBits
					: (longAt(rcvr)) & (classIndexMask()));
				assert(lkupClassTag != (nilObject()));
				
			commonSendOrdinary:
				/* commonSendOrdinary */
				{
					usqInt aMethodObj;
					usqInt aMethodObj1;
					sqInt aValue;
					sqInt classOrInteger;
					sqInt classTablePage;
					sqInt classTablePage1;
					CogMethod *cogMethod;
					CogMethod *cogMethod1;
					sqInt fieldIndex;
					sqInt fieldIndex1;
					sqInt fieldIndex11;
					sqInt fieldIndex2;
					sqInt hash;
					sqInt i;
					sqInt localPrimIndex;
					sqInt methodHeader;
					sqInt methodHeader1;
					sqInt methodHeader2;
					sqInt nArgs;
					sqInt numTemps;
					sqInt object;
					sqInt ok;
					sqInt probe;
					sqInt rcvr;
					char *savedFramePointer;
					char *savedStackPointer;
					sqInt selector;
					sqInt selector1;
					sqInt succeeded;
					sqInt switched;

					VM_LABEL(commonSendOrdinary);
					nArgs = 0;
					savedFramePointer = ((char *) 0);
					savedStackPointer = ((char *) 0);
					/* begin sendBreakpoint:receiver: */
					sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)));
					if (recordSendTrace()) {
						/* begin recordTrace:thing:source: */
						assert((lkupClassTag >= 0)
						 && ((lkupClassTag <= (tagMask()))
						 || ((lkupClassTag >= (arrayClassIndexPun()))
						 && (lkupClassTag <= (classIndexMask())))));
						/* begin fetchPointer:ofObject: */
						fieldIndex = ((usqInt) lkupClassTag) >> (classTableMajorIndexShift());
						classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
						if (classTablePage == GIV(nilObj)) {
							classOrInteger = null;
							goto l793;
						}
						/* begin fetchPointer:ofObject: */
						fieldIndex1 = lkupClassTag & ((1U << (classTableMajorIndexShift())) - 1);
						classOrInteger = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	l793:	/* end classAtIndex: */;
						GIV(traceLog)[GIV(traceLogIndex)] = classOrInteger;
						GIV(traceLog)[GIV(traceLogIndex) + 1] = GIV(messageSelector);
						GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter;
						GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
						if (printOnTrace()) {
							printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(lkupClassTag));
							/* begin cr */
							printf("\n");
						}
					}
					/* begin internalFindNewMethodOrdinary */
					hash = GIV(messageSelector) ^ (((sqInt)((usqInt)(lkupClassTag) << 2)));

					/* first probe */
					probe = hash & MethodCacheMask;
					if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector))
					 && ((GIV(methodCache)[probe + MethodCacheClass]) == lkupClassTag)) {
						GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod];
						primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction]));
						ok = 1;
						goto l778;
					}

					/* second probe */
					probe = (((usqInt) hash) >> 1) & MethodCacheMask;
					if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector))
					 && ((GIV(methodCache)[probe + MethodCacheClass]) == lkupClassTag)) {
						GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod];
						primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction]));
						ok = 1;
						goto l778;
					}
					probe = (((usqInt) hash) >> 2) & MethodCacheMask;
					if (((GIV(methodCache)[probe + MethodCacheSelector]) == GIV(messageSelector))
					 && ((GIV(methodCache)[probe + MethodCacheClass]) == lkupClassTag)) {
						GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod];
						primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction]));
						ok = 1;
						goto l778;
					}
					ok = 0;
	l778:	/* end inlineLookupInMethodCacheSel:classTag: */;
					if (ok) {
						/* begin ifAppropriateCompileToNativeCode:selector: */
						aMethodObj = GIV(newMethod);
						selector = GIV(messageSelector);
						/* begin fetchPointer:ofObject: */
						methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
						if ((assert(((((methodHeader) & 7) == 1))
							 || (((((usqInt)methodHeader)) < (startOfMemory()))
							 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
						(methodHeader & (smallIntegerTag())) == 0)) {

							/* makeBaseFrame: can create cog methods with nil selectors. */
							cogMethod = ((CogMethod *) methodHeader);
							if (((cogMethod->selector)) == GIV(nilObj)) {
								setSelectorOfto(cogMethod, selector);
							}
						}
						else {
							if (((assert((((methodHeader) & 7) == 1)),
							((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
								cogselector(aMethodObj, selector);
							}
							else {
								maybeFlagMethodAsInterpreted(aMethodObj);
							}
						}
					}
					else {
						/* begin externalizeIPandSP */
						assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
						GIV(instructionPointer) = oopForPointer(localIP);
						GIV(stackPointer) = localSP;
						GIV(framePointer) = localFP;
						if ((((GIV(messageSelector) & (tagMask())) == 0)
						 && (((longAt(GIV(messageSelector))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))
						 || (lkupClassTag == (isForwardedObjectClassIndexPun()))) {
							if (((GIV(messageSelector) & (tagMask())) == 0)
							 && (((longAt(GIV(messageSelector))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
								GIV(messageSelector) = handleForwardedSelectorFaultFor(GIV(messageSelector));
							}
							if (lkupClassTag == (isForwardedObjectClassIndexPun())) {
								lkupClassTag = handleForwardedSendFaultForTag(lkupClassTag);
							}
							if (lookupInMethodCacheSelclassTag(GIV(messageSelector), lkupClassTag)) {
								/* begin ifAppropriateCompileToNativeCode:selector: */
								aMethodObj1 = GIV(newMethod);
								selector1 = GIV(messageSelector);
								/* begin fetchPointer:ofObject: */
								methodHeader1 = longAt((aMethodObj1 + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
								if ((assert(((((methodHeader1) & 7) == 1))
									 || (((((usqInt)methodHeader1)) < (startOfMemory()))
									 && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))),
								(methodHeader1 & (smallIntegerTag())) == 0)) {

									/* makeBaseFrame: can create cog methods with nil selectors. */
									cogMethod1 = ((CogMethod *) methodHeader1);
									if (((cogMethod1->selector)) == GIV(nilObj)) {
										setSelectorOfto(cogMethod1, selector1);
									}
								}
								else {
									if (((assert((((methodHeader1) & 7) == 1)),
									((methodHeader1 >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
										cogselector(aMethodObj1, selector1);
									}
									else {
										maybeFlagMethodAsInterpreted(aMethodObj1);
									}
								}
								goto l794;
							}
						}
						/* begin classAtIndex: */
						assert((lkupClassTag >= 0)
						 && ((lkupClassTag <= (tagMask()))
						 || ((lkupClassTag >= (arrayClassIndexPun()))
						 && (lkupClassTag <= (classIndexMask())))));
						/* begin fetchPointer:ofObject: */
						fieldIndex2 = ((usqInt) lkupClassTag) >> (classTableMajorIndexShift());
						classTablePage1 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))));
						if (classTablePage1 == GIV(nilObj)) {
							GIV(lkupClass) = null;
							goto l790;
						}
						/* begin fetchPointer:ofObject: */
						fieldIndex11 = lkupClassTag & ((1U << (classTableMajorIndexShift())) - 1);
						GIV(lkupClass) = longAt((classTablePage1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex11) << (shiftForWord())))));
	l790:	/* end classAtIndex: */;
						assert((GIV(lkupClass) != null)
						 && (addressCouldBeClassObj(GIV(lkupClass))));
						lookupMethodInClass(GIV(lkupClass));
						/* begin internalizeIPandSP */
						assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
						localIP = pointerForOop(GIV(instructionPointer));
						localSP = pointerForOop(GIV(stackPointer));
						localFP = pointerForOop(GIV(framePointer));
						addNewMethodToCache(GIV(lkupClass));
					}
	l794:	/* end internalFindNewMethodOrdinary */;
					/* begin internalExecuteNewMethod */
					if (primitiveFunctionPointer != 0) {
						if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) {
							/* begin internalQuickPrimitiveResponse */
							assert(isPrimitiveFunctionPointerAnIndex());
							localPrimIndex = ((sqInt) primitiveFunctionPointer);
							assert((localPrimIndex > 0xFF)
							 && (localPrimIndex < 520));
							if (localPrimIndex >= 264) {
								/* begin internalStackTopPut: */
								aValue = longAt(((longAtPointer(localSP)) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord())))));
								longAtPointerput(localSP, aValue);
								goto l782;
							}
							if (localPrimIndex == 256) {
								goto l782;
							}
							if (localPrimIndex == 257) {
								/* begin internalStackTopPut: */
								longAtPointerput(localSP, GIV(trueObj));
								goto l782;
							}
							if (localPrimIndex == 258) {
								/* begin internalStackTopPut: */
								longAtPointerput(localSP, GIV(falseObj));
								goto l782;
							}
							if (localPrimIndex == 259) {
								/* begin internalStackTopPut: */
								longAtPointerput(localSP, GIV(nilObj));
								goto l782;
							}
							longAtPointerput(localSP, (((usqInt)(localPrimIndex - 261) << 3) | 1));
							goto l782;
						}
						/* begin externalizeIPandSP */
						assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
						GIV(instructionPointer) = oopForPointer(localIP);
						GIV(stackPointer) = localSP;
						GIV(framePointer) = localFP;
						/* begin slowPrimitiveResponse */
						if (recordPrimTrace()) {
							/* begin fastLogPrim: */
							GIV(primTraceLog)[GIV(primTraceLogIndex)] = GIV(messageSelector);
							primTraceLogIndex(GIV(primTraceLogIndex) + 1);
						}
						assert(!(isOopForwarded(stackValue(GIV(argumentCount)))));
						assert((remapBufferCount()) == 0);
						nArgs = GIV(argumentCount);
						savedStackPointer = GIV(stackPointer);
						savedFramePointer = GIV(framePointer);
						/* begin initPrimCall */
						GIV(primFailCode) = 0;
						dispatchFunctionPointer(primitiveFunctionPointer);
						assert(maybeLeakCheckExternalPrimCall(GIV(newMethod)));
						/* begin maybeRetryPrimitiveOnFailure */
						if (GIV(primFailCode)) {
							retryPrimitiveOnFailure();
						}
						/* begin maybeFailForLastObjectOverwrite */
						if (checkAllocFiller) {
							if (((freeStart()) < GIV(scavengeThreshold))
							 && ((longAt(freeStart())) != (freeStart()))) {
								/* begin primitiveFailFor: */
								GIV(primFailCode) = PrimErrWritePastObject;
							}
						}
						if ((!GIV(primFailCode))
						 && ((GIV(framePointer) == savedFramePointer)
						 && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {

							/* Don't fail if primitive has done something radical, e.g. perform: */
							if (GIV(stackPointer) != (savedStackPointer + (nArgs * BytesPerWord))) {
								flag("Would be nice to make this a message send of e.g. unbalancedPrimitive to the current process or context");
								failUnbalancedPrimitive();
								GIV(stackPointer) = savedStackPointer;
							}
						}
						if (GIV(nextProfileTick) > 0) {
							checkProfileTick(GIV(newMethod));
						}
						succeeded = !GIV(primFailCode);
						if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
							/* begin iframeSavedIP: */
							GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
						}
						/* begin internalizeIPandSP */
						assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
						localIP = pointerForOop(GIV(instructionPointer));
						localSP = pointerForOop(GIV(stackPointer));
						localFP = pointerForOop(GIV(framePointer));
						if (succeeded) {
							returntoExecutive(popStack(), 1);
							browserPluginReturnIfNeeded();
							goto l782;
						}
					}
					if ((assert(isNonImmediate(GIV(newMethod))),
					isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
						/* begin iframeSavedIP:put: */
						assert(!(isMachineCodeFrame(localFP)));
						longAtput(localFP + FoxIFSavedIP, ((sqInt)localIP));
						GIV(instructionPointer) = ceReturnToInterpreterPC();
						/* begin externalizeFPandSP */
						assert((localSP < ((GIV(stackPage)->baseAddress)))
						 && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
						GIV(stackPointer) = localSP;
						GIV(framePointer) = localFP;
						activateCoggedNewMethod(1);
						/* begin internalizeIPandSP */
						assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
						localIP = pointerForOop(GIV(instructionPointer));
						localSP = pointerForOop(GIV(stackPointer));
						localFP = pointerForOop(GIV(framePointer));
											}
					else {
						/* begin internalActivateNewMethod */
						methodHeader2 = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
						assert(!(isCogMethodReference(methodHeader2)));
						numTemps = (((usqInt) methodHeader2) >> MethodHeaderTempCountShift) & 0x3F;
						assert(GIV(argumentCount) == (argumentCountOfMethodHeader(methodHeader2)));

						/* could new rcvr be set at point of send? */
						rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
						assert(!(isOopForwarded(rcvr)));
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), localIP);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), localFP);
						localFP = localSP;
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), GIV(newMethod));
						/* begin setMethod:methodHeader: */
						GIV(method) = GIV(newMethod);
						assert(isOopCompiledMethod(GIV(method)));
						assert((methodHeaderOf(GIV(method))) == methodHeader2);
						
#            if MULTIPLEBYTECODESETS
						GIV(bytecodeSetSelector) = ((((sqLong) methodHeader2)) < 0
							? 256
							: 0);
#            endif /* MULTIPLEBYTECODESETS */
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), GIV(nilObj));
						/* begin internalPush: */
						object = (VMBIGENDIAN
							? ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15)) << ((BytesPerWord * 8) - 8))))) + (0)) + (0)
							: ((1 + (((sqInt)((usqInt)(((((usqInt) methodHeader2) >> MethodHeaderArgCountShift) & 15)) << 8)))) + (0)) + (0));
						longAtPointerput((localSP -= BytesPerOop), object);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), 0);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), rcvr);
						for (i = (GIV(argumentCount) + 1); i <= numTemps; i += 1) {
							/* begin internalPush: */
							longAtPointerput((localSP -= BytesPerOop), GIV(nilObj));
						}
						localIP = pointerForOop(((GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader2) & 7) == 1)),
((methodHeader2 >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1);
						if ((/* begin alternateHeaderHasPrimitiveFlag: */
						methodHeader2 & AlternateHeaderHasPrimFlag)) {

							/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
							   with a long store temp.  Strictly no need to skip the store because it's effectively a noop. */
							localIP += 3;
							if (GIV(primFailCode) != 0) {
								reapAndResetErrorCodeToheader(localSP, methodHeader2);
							}
						}
						assert((frameNumArgs(localFP)) == GIV(argumentCount));
						assert(!(frameIsBlockActivation(localFP)));
						assert(!(frameHasContext(localFP)));
						if (localSP < GIV(stackLimit)) {
							/* begin externalizeIPandSP */
							assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
							GIV(instructionPointer) = oopForPointer(localIP);
							GIV(stackPointer) = localSP;
							GIV(framePointer) = localFP;
							switched = handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader2));
							returnToExecutivepostContextSwitch(1, switched);
							/* begin internalizeIPandSP */
							assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
							localIP = pointerForOop(GIV(instructionPointer));
							localSP = pointerForOop(GIV(stackPointer));
							localFP = pointerForOop(GIV(framePointer));
													}
					}
	l782:	/* end internalExecuteNewMethod */;
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				}
			}
			break;
		case 132:
			/* doubleExtendedDoAnythingBytecode */
			{
				sqInt byte2;
				sqInt byte3;
				sqInt callerContextOrNil;
				char *callerFP;
				sqInt litVar;
				sqInt litVar1;
				sqInt obj;
				sqInt obj1;
				sqInt object;
				sqInt object11;
				sqInt object2;
				sqInt object3;
				int onCurrentPage;
				sqInt opType;
				sqInt result;
				sqInt senderOop;
				sqInt senderOop1;
				char *spouseFP;
				char * theFP;
				StackPage *thePage;
				StackPage * thePage1;
				sqInt thePC;
				sqInt thePC1;
				sqInt top;
				sqInt value;

				VM_LABEL(doubleExtendedDoAnythingBytecode);
				byte2 = byteAtPointer(++localIP);
				byte3 = byteAtPointer(++localIP);
				opType = ((usqInt) byte2) >> 5;
				if (opType == 0) {
					assert(GIV(method) == (iframeMethod(localFP)));
					/* begin literal:ofMethod: */
					GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord())))));
					GIV(argumentCount) = byte2 & 0x1F;
					goto normalSend;
					goto l70;
				}
				if (opType == 1) {
					assert(GIV(method) == (iframeMethod(localFP)));
					/* begin literal:ofMethod: */
					GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord())))));
					GIV(argumentCount) = byte2 & 0x1F;
					goto superclassSend;
					goto l70;
				}
				if (opType == 2) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					/* begin pushMaybeContextReceiverVariable: */
					obj = longAt(localFP + FoxIFReceiver);
					if ((byte3 <= StackPointerIndex)
					 && (((longAt(obj)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
						/* begin internalPush: */
						assert(byte3 < MethodIndex);
						assert(isContext(obj));
						/* begin writeBackHeadFramePointers */
						assert(GIV(stackPage) == (mostRecentlyUsedPage()));
						/* begin setHeadFP:andSP:inPage: */
						assert(localSP < localFP);
						assert((localSP < ((GIV(stackPage)->baseAddress)))
						 && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
						assert((localFP < ((GIV(stackPage)->baseAddress)))
						 && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
						(GIV(stackPage)->headFP = localFP);
						(GIV(stackPage)->headSP = localSP);
						assert(pageListIsWellFormed());
						if (!(((((longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))) {
							value = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))));
							if ((byte3 == InstructionPointerIndex)
							 && (((((value) & 7) == 1))
							 && ((((int) value)) < 0))) {
								/* begin internalMustMapMachineCodePC:context: */
								assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
								GIV(instructionPointer) = oopForPointer(localIP);
								GIV(stackPointer) = localSP;
								GIV(framePointer) = localFP;
								result = mustMapMachineCodePCcontext((value >> 3), obj);
								/* begin internalizeIPandSP */
								assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
								localIP = pointerForOop(GIV(instructionPointer));
								localSP = pointerForOop(GIV(stackPointer));
								localFP = pointerForOop(GIV(framePointer));
								value = result;
							}
							object3 = value;
							goto l99;
						}
						if (isWidowedContext(obj)) {
							object3 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))));
							goto l99;
						}
						/* begin frameOfMarriedContext: */
						senderOop = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
						assert((((senderOop) & 7) == 1));
						spouseFP = pointerForOop(senderOop - 1);
						if (byte3 == SenderIndex) {
							/* begin ensureCallerContext: */
							callerFP = pointerForOop(longAt(spouseFP + FoxSavedFP));
							if (callerFP == 0) {

								/* base frame, context in saved ip slot (or base of stack in Cog) */
								/* begin frameCallerContext: */
								assert(isBaseFrame(spouseFP));
								/* begin stackPageFor: */
								thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))),
								pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
								callerContextOrNil = longAt((thePage->baseAddress));
								assert(addressCouldBeObj(callerContextOrNil));
								assert((callerContextOrNil == (nilObject()))
								 || (isContext(callerContextOrNil)));
								object3 = callerContextOrNil;
								goto l99;
							}
							/* begin ensureFrameIsMarried:SP: */
							if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory())
								? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
								: (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) {
								assert(isContext(frameContext(callerFP)));
								object3 = longAt(callerFP + FoxThisContext);
								goto l99;
							}
							object3 = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))),
							(spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord));
							goto l99;
						}
						if (byte3 == StackPointerIndex) {
							assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj)));
							object3 = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 3) | 1);
							goto l99;
						}
						if (byte3 == InstructionPointerIndex) {
							object3 = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP));
							goto l99;
						}
						error("bad index");
						object3 = 0;
	l99:	/* end instVar:ofContext: */;
						longAtPointerput((localSP -= BytesPerOop), object3);
					}
					else {
						/* begin internalPush: */
						object11 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))));
						longAtPointerput((localSP -= BytesPerOop), object11);
					}
					goto l70;
				}
				if (opType == 3) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					/* begin pushLiteralConstant: */
					assert(GIV(method) == (iframeMethod(localFP)));
					/* begin fetchPointer:ofObject: */
					object = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord())))));
					longAtPointerput((localSP -= BytesPerOop), object);
					goto l70;
				}
				if (opType == 4) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					/* begin pushLiteralVariable: */
					
					/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
					   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
					   all methods in the stack zone, and the entire method on return, and global variables are relatively
					   rare; in my work image 8.7% of literals are globals). */
					assert(GIV(method) == (iframeMethod(localFP)));
					/* begin fetchPointer:ofObject: */
					litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord())))));
					if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
						litVar = unfollowatIndex(litVar, byte3);
					}
					/* begin internalPush: */
					object2 = longAt((litVar + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
					longAtPointerput((localSP -= BytesPerOop), object2);
					goto l70;
				}
				top = longAtPointer(localSP);
				if (opType == 7) {
					/* begin storeLiteralVariable:withValue: */

					/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
					   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
					   all methods in the stack zone, and the entire method on return, and global variables are relatively
					   rare; in my work image 8.7% of literals are globals). */
					assert(GIV(method) == (iframeMethod(localFP)));
					/* begin fetchPointer:ofObject: */
					litVar1 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((byte3 + LiteralStart)) << (shiftForWord())))));
					if (((longAt(litVar1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
						litVar1 = unfollowatIndex(litVar1, byte3);
					}
					/* begin storePointerImmutabilityCheck:ofObject:withValue: */
					
#          if IMMUTABILITY
					assert(!((isImmediate(litVar1))));
					if (((((usqInt) (longAt(litVar1))) >> (immutableBitShift())) & 1) != 0) {
						/* begin cannotAssign:to:withIndex: */
						longAtPointerput((localSP -= BytesPerOop), litVar1);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), top);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), (((usqInt)(ValueIndex + 1) << 3) | 1));
						/* begin splObj: */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
						GIV(argumentCount) = 2;
						goto normalSend;
						/* return self */
						goto l85;
					}
#          endif /* IMMUTABILITY */
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(litVar1)));
					if ((assert(isNonImmediate(litVar1)),
					oopisGreaterThanOrEqualTo(litVar1, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((top & (tagMask())) == 0)
						 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(litVar1))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(litVar1);
							}
						}
					}
					longAtput((litVar1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))), top);
	l85:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l70;
				}
				if (opType == 6) {
					/* begin internalPop: */
					localSP += 1 * BytesPerOop;
				}
				/* begin storeMaybeContextReceiverVariable:withValue: */
				obj1 = longAt(localFP + FoxIFReceiver);
				if ((byte3 <= ReceiverIndex)
				 && ((((longAt(obj1)) & (classIndexMask())) == ClassMethodContextCompactIndex)
				 && ((((((longAt((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
				 || ((byte3 == MethodIndex)
				 && (((((int) ((thePC = longAt((top + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))))) < 0)
				 && ((((thePC) & 7) == 1))))))) {
					/* begin instVar:ofContext:put: */
					assert(isMarriedOrWidowedContext(obj1));
					assert(!((isObjImmutable(obj1))));
					/* begin writeBackHeadFramePointers */
					assert(GIV(stackPage) == (mostRecentlyUsedPage()));
					/* begin setHeadFP:andSP:inPage: */
					assert(localSP < localFP);
					assert((localSP < ((GIV(stackPage)->baseAddress)))
					 && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
					assert((localFP < ((GIV(stackPage)->baseAddress)))
					 && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
					(GIV(stackPage)->headFP = localFP);
					(GIV(stackPage)->headSP = localSP);
					assert(pageListIsWellFormed());
					if (!((((((longAt((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
						 && (!(isWidowedContext(obj1))))) {
						/* begin storePointer:ofObject:withValue: */
						assert(!(isForwarded(obj1)));
						if ((assert(isNonImmediate(obj1)),
						oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart)))) {

							/* most stores into young objects */
							if (((top & (tagMask())) == 0)
							 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
								/* begin possibleRootStoreInto: */
								if (!(((((usqInt) (longAt(obj1))) >> (rememberedBitShift())) & 1) != 0)) {
									remember(obj1);
								}
							}
						}
						longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top);
						if (byte3 == StackPointerIndex) {
							ensureContextIsExecutionSafeAfterAssignToStackPointer(obj1);
						}
						goto l94;
					}
					/* begin frameOfMarriedContext: */
					senderOop1 = longAt((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
					assert((((senderOop1) & 7) == 1));
					theFP = pointerForOop(senderOop1 - 1);
					if (byte3 == SenderIndex) {
						/* begin stackPageFor: */
						thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
						pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
						assert(GIV(stackPage) == (mostRecentlyUsedPage()));
						onCurrentPage = thePage1 == GIV(stackPage);
						storeSenderOfFramewithValue(theFP, top);
						if (onCurrentPage) {
							localFP = (GIV(stackPage)->headFP);
							localSP = (GIV(stackPage)->headSP);
						}
						else {
							markStackPageMostRecentlyUsed(GIV(stackPage));
						}
						goto l94;
					}
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					externalDivorceFrameandContext(theFP, obj1);
					if ((byte3 == MethodIndex)
					 && (((((int) ((thePC1 = longAt((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))))) < 0)
					 && ((((thePC1) & 7) == 1)))) {
						ensureContextHasBytecodePC(obj1);
					}
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(obj1)));
					if ((assert(isNonImmediate(obj1)),
					oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((top & (tagMask())) == 0)
						 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(obj1))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(obj1);
							}
						}
					}
					longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top);
					if (byte3 == StackPointerIndex) {
						ensureContextIsExecutionSafeAfterAssignToStackPointer(obj1);
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					markStackPageMostRecentlyUsed(GIV(stackPage));
					assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__);
	l94:	/* end instVar:ofContext:put: */;
				}
				else {
					/* begin storePointerImmutabilityCheck:ofObject:withValue: */
					
#          if IMMUTABILITY
					assert(!((isImmediate(obj1))));
					if (((((usqInt) (longAt(obj1))) >> (immutableBitShift())) & 1) != 0) {
						/* begin cannotAssign:to:withIndex: */
						longAtPointerput((localSP -= BytesPerOop), obj1);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), top);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), (((usqInt)(byte3 + 1) << 3) | 1));
						/* begin splObj: */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
						GIV(argumentCount) = 2;
						goto normalSend;
						/* return self */
						goto l100;
					}
#          endif /* IMMUTABILITY */
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(obj1)));
					if ((assert(isNonImmediate(obj1)),
					oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((top & (tagMask())) == 0)
						 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(obj1))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(obj1);
							}
						}
					}
					longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(byte3) << (shiftForWord())))), top);
	l100:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
				}
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
	l70:	/* end case */;
			break;
		case 133:
			/* singleExtendedSuperBytecode */
			{
				sqInt descriptor;

				VM_LABEL(singleExtendedSuperBytecode);
				/* begin fetchByte */
				descriptor = byteAtPointer(++localIP);
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((descriptor & 0x1F) + LiteralStart)) << (shiftForWord())))));
				GIV(argumentCount) = ((usqInt) descriptor) >> 5;
				/* goto superclassSend */
			}
			
		superclassSend:
			/* superclassSend */
			{
				sqInt aValue;
				sqInt classPointer;
				sqInt err;
				sqInt hash;
				sqInt literal;
				sqInt objOop;
				sqInt objOop1;
				sqInt objOop11;
				sqInt objOop2;
				sqInt offset;
				sqInt referent;
				sqInt superclass;

				VM_LABEL(superclassSend);
				/* begin superclassOf: */
				offset = (literalCountOfMethodHeader(methodHeaderOf(GIV(method)))) - 1;
				/* begin followField:ofObject: */
				objOop11 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
				if (((objOop11 & (tagMask())) == 0)
				 && (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop11 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, GIV(method), objOop11);
				}
				literal = objOop11;
				if ((literal != GIV(nilObj))
				 && (((literal & (tagMask())) == 0)
				 && (((((usqInt) (longAt(literal))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))) {
					assert((numSlotsOf(literal)) > ValueIndex);
					/* begin followField:ofObject: */
					objOop2 = longAt((literal + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
					if (((objOop2 & (tagMask())) == 0)
					 && (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						objOop2 = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop2);
					}
					classPointer = objOop2;
				}
				else {
					/* begin nilObject */
					classPointer = GIV(nilObj);
				}
				/* begin followField:ofObject: */
				objOop = longAt((classPointer + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
				if (((objOop & (tagMask())) == 0)
				 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classPointer, objOop);
				}
				superclass = objOop;

				/* To maintain the invariant that all receivers are unforwarded we need an explicit
				   read barrier in the super send cases.  Even though we always follow receivers
				   on become  e.g. super doSomethingWith: (self become: other) forwards the receiver
				   self pushed on the stack. */
				assert(addressCouldBeClassObj(superclass));
				lkupClassTag = (((hash = (long32At(superclass + 4)) & (identityHashHalfWordMask()))) != 0
					? hash
					: (objCouldBeClassObj(superclass)
							? (((err = enterIntoClassTable(superclass))) != 0
									? -err
									: (/* begin rawHashBitsOf: */
										(long32At(superclass + 4)) & (identityHashHalfWordMask())))
							: -PrimErrBadReceiver));
				/* begin ensureReceiverUnforwarded */
				if ((((longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))) & (tagMask())) == 0)
				 && (((longAt(longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin internalStackValue:put: */
					objOop1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
					assert(isUnambiguouslyForwarder(objOop1));
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord())));
					while (((referent & (tagMask())) == 0)
					 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
					}
					aValue = referent;
					longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), aValue);
				}
				assert(lkupClassTag != (nilObject()));
				goto commonSendOrdinary;
			}
			break;
		case 134:
			/* secondExtendedSendBytecode */
			{
				sqInt descriptor;

				VM_LABEL(secondExtendedSendBytecode);
				/* begin fetchByte */
				descriptor = byteAtPointer(++localIP);
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((descriptor & 0x3F) + LiteralStart)) << (shiftForWord())))));
				GIV(argumentCount) = ((usqInt) descriptor) >> 6;
				goto normalSend;
			}
			break;
		case 135:
		case 472: /*216*/
			/* popStackBytecode */
			{
				VM_LABEL(popStackBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 136:
		case 339: /*83*/
			/* duplicateTopBytecode */
			{
				sqInt object;

				VM_LABEL(duplicateTopBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				object = longAtPointer(localSP);
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 137:
			/* pushActiveContextBytecode */
			{
				sqInt ourContext;
				char *theFP;
				char *theSP;

				VM_LABEL(pushActiveContextBytecode);
				/* begin ensureFrameIsMarried:SP: */
				theFP = localFP;
				theSP = localSP;
				if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
					: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
					assert(isContext(frameContext(theFP)));
					ourContext = longAt(theFP + FoxThisContext);
					goto l109;
				}
				ourContext = marryFrameSP(theFP, theSP);
	l109:	/* end ensureFrameIsMarried:SP: */;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), ourContext);
			}
			break;
		case 138:
			/* pushNewArrayBytecode */
			{
				usqInt array;
				sqInt i;
				usqInt newObj;
				usqInt numBytes;
				int popValues;
				sqInt size;
				sqInt valuePointer;
				sqInt valuePointer1;

				VM_LABEL(pushNewArrayBytecode);
				/* begin fetchByte */
				size = byteAtPointer(++localIP);
				popValues = size > 0x7F;
				size = size & 0x7F;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin externalizeIPandSP */
				assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
				GIV(instructionPointer) = oopForPointer(localIP);
				GIV(stackPointer) = localSP;
				GIV(framePointer) = localFP;
				/* begin eeInstantiateSmallClassIndex:format:numSlots: */
				assert((size >= 0)
				 && ((knownClassAtIndex(ClassArrayCompactIndex)) != GIV(nilObj)));
				assert((2 /* arrayFormat */) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex))));
				/* begin allocateSmallNewSpaceSlots:format:classIndex: */
				assert(size < (numSlotsMask()));
				newObj = GIV(freeStart);
				numBytes = BaseHeaderSize + ((size < 1
	? 8 /* allocationUnit */
	: size * BytesPerOop));
				assert((numBytes % (allocationUnit())) == 0);
				assert((newObj % (allocationUnit())) == 0);
				if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
					if (!GIV(needGCFlag)) {
						/* begin scheduleScavenge */
						GIV(needGCFlag) = 1;
						forceInterruptCheck();
					}
					if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
						error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
						array = 0;
						goto l110;
					}
				}
				long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex);
				GIV(freeStart) += numBytes;
				array = newObj;
	l110:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
				if (popValues) {
					for (i = 0; i < size; i += 1) {

						/* Assume: have just allocated a new Array; it must be young. Thus, can use unchecked stores. */
						/* begin storePointerUnchecked:ofObject:withValue: */
						valuePointer = longAtPointer(localSP + (((size - i) - 1) * BytesPerOop));
						assert(!(isOopForwarded(array)));
						longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer);
					}
					/* begin internalPop: */
					localSP += size * BytesPerOop;
				}
				else {
					for (i = 0; i < size; i += 1) {
						/* begin storePointerUnchecked:ofObject:withValue: */
						valuePointer1 = GIV(nilObj);
						assert(!(isOopForwarded(array)));
						longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer1);
					}
				}
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), array);
			}
			break;
		case 139:
			/* callPrimitiveBytecode */
			{
				sqInt header;
				sqInt header2;

				VM_LABEL(callPrimitiveBytecode);
				/* begin methodHeaderOf: */
				assert(isCompiledMethod(GIV(method)));
				header2 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
				if ((((header2) & 7) == 1)) {
					header = header2;
				}
				else {
					assert((((usqInt)header2)) < GIV(newSpaceStart));
					assert((((((CogMethod *) header2))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
					header = ((((CogMethod *) header2))->methodHeader);
				}
				if (((/* begin alternateHeaderHasPrimitiveFlag: */
				header & AlternateHeaderHasPrimFlag))
				 && ((((sqInt)localIP)) == ((GIV(method) + ((LiteralStart + ((assert((((header) & 7) == 1)),
((header >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize))) {
					localIP = (localIP + (3)) - 1;
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l116;
				}
				else {
					goto respondToUnknownBytecode;
					goto l116;
				}
			}
	l116:	/* end case */;
			break;
		case 140:
		case 507: /*251*/
			/* pushRemoteTempLongBytecode */
			{
				sqInt frameNumArgs;
				sqInt remoteTempIndex;
				sqInt tempVector;
				sqInt tempVectorIndex;

				VM_LABEL(pushRemoteTempLongBytecode);
				/* begin fetchByte */
				remoteTempIndex = byteAtPointer(++localIP);
				/* begin fetchByte */
				tempVectorIndex = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin pushRemoteTemp:inVectorAt: */
				tempVector = (tempVectorIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)));
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), longAt((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord()))))));
			}
			break;
		case 141:
		case 508: /*252*/
			/* storeRemoteTempLongBytecode */
			{
				sqInt frameNumArgs;
				sqInt remoteTempIndex;
				sqInt tempVector;
				sqInt tempVectorIndex;

				VM_LABEL(storeRemoteTempLongBytecode);
				/* begin fetchByte */
				remoteTempIndex = byteAtPointer(++localIP);
				/* begin fetchByte */
				tempVectorIndex = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin storeRemoteTemp:inVectorAt: */
				tempVector = (tempVectorIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)));
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(tempVector)));
				if ((assert(isNonImmediate(tempVector)),
				oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if ((((longAtPointer(localSP)) & (tagMask())) == 0)
					 && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(tempVector);
						}
					}
				}
				longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP));
			}
			break;
		case 142:
		case 509: /*253*/
			/* storeAndPopRemoteTempLongBytecode */
			{
				sqInt frameNumArgs;
				sqInt remoteTempIndex;
				sqInt tempVector;
				sqInt tempVectorIndex;

				VM_LABEL(storeAndPopRemoteTempLongBytecode);
				/* begin storeRemoteTempLongBytecode */
				remoteTempIndex = byteAtPointer(++localIP);
				/* begin fetchByte */
				tempVectorIndex = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin storeRemoteTemp:inVectorAt: */
				tempVector = (tempVectorIndex < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - tempVectorIndex) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - tempVectorIndex) * BytesPerWord)));
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(tempVector)));
				if ((assert(isNonImmediate(tempVector)),
				oopisGreaterThanOrEqualTo(tempVector, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if ((((longAtPointer(localSP)) & (tagMask())) == 0)
					 && (oopisLessThan(longAtPointer(localSP), GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(tempVector))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(tempVector);
						}
					}
				}
				longAtput((tempVector + BaseHeaderSize) + (((sqInt)((usqInt)(remoteTempIndex) << (shiftForWord())))), longAtPointer(localSP));
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 143:
			/* pushClosureCopyCopiedValuesBytecode */
			{
				sqInt blockSize;
				sqInt context;
				sqInt i;
				sqInt initialIP;
				usqInt newClosure;
				usqInt newClosure1;
				usqInt newObj;
				sqInt numArgs;
				sqInt numArgsNumCopied;
				usqInt numBytes;
				sqInt numCopied;
				sqInt numSlots;
				sqInt objFormat;
				char *theFP;
				char *theSP;

				VM_LABEL(pushClosureCopyCopiedValuesBytecode);
				/* begin fetchByte */
				numArgsNumCopied = byteAtPointer(++localIP);
				numArgs = numArgsNumCopied & 15;

				/* Split blockSize := (self fetchByte * 256) + self fetchByte. into two because evaluation order in C is undefined. */
				numCopied = ((usqInt) numArgsNumCopied >> 4);
				blockSize = ((sqInt)((usqInt)((byteAtPointer(++localIP))) << 8));
				blockSize += byteAtPointer(++localIP);
				/* begin pushClosureNumArgs:copiedValues:blockSize: */
				theFP = localFP;
				theSP = localSP + (numCopied * BytesPerOop);
				if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
					: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
					assert(isContext(frameContext(theFP)));
					context = longAt(theFP + FoxThisContext);
					goto l142;
				}
				context = marryFrameSP(theFP, theSP);
	l142:	/* end ensureFrameIsMarried:SP: */;
				/* begin closureIn:numArgs:instructionPointer:numCopiedValues: */
				initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize);
				/* begin eeInstantiateSmallClassIndex:format:numSlots: */
				objFormat = indexablePointersFormat();
				numSlots = ClosureFirstCopiedValueIndex + numCopied;
				assert((numSlots >= 0)
				 && ((knownClassAtIndex(ClassBlockClosureCompactIndex)) != GIV(nilObj)));
				assert(((objFormat < (firstByteFormat())
					? objFormat
					: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassBlockClosureCompactIndex))));
				/* begin allocateSmallNewSpaceSlots:format:classIndex: */
				assert(numSlots < (numSlotsMask()));
				newObj = GIV(freeStart);
				numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
				assert((numBytes % (allocationUnit())) == 0);
				assert((newObj % (allocationUnit())) == 0);
				if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
					if (!GIV(needGCFlag)) {
						/* begin scheduleScavenge */
						GIV(needGCFlag) = 1;
						forceInterruptCheck();
					}
					if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
						error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
						newClosure1 = 0;
						goto l137;
					}
				}
				long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex);
				GIV(freeStart) += numBytes;
				newClosure1 = newObj;
	l137:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(newClosure1)));
				longAtput((newClosure1 + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))), context);
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(newClosure1)));
				longAtput((newClosure1 + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))), (((usqInt)initialIP << 3) | 1));
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(newClosure1)));
				longAtput((newClosure1 + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))), (((usqInt)numArgs << 3) | 1));
				newClosure = newClosure1;
				if (recordSendTrace()) {
					/* begin recordTrace:thing:source: */
					GIV(traceLog)[GIV(traceLogIndex)] = TraceBlockCreation;
					GIV(traceLog)[GIV(traceLogIndex) + 1] = newClosure;
					GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter;
					GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
				}
				if (numCopied > 0) {
					for (i = 0; i < numCopied; i += 1) {

						/* Assume: have just allocated a new BlockClosure; it must be young.
						   Thus, can use unchecked stores. */
						/* begin storePointerUnchecked:ofObject:withValue: */
						assert(!(isOopForwarded(newClosure)));
						longAtput((newClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + ClosureFirstCopiedValueIndex)) << (shiftForWord())))), longAtPointer(localSP + (((numCopied - i) - 1) * BytesPerOop)));
					}
					/* begin internalPop: */
					localSP += numCopied * BytesPerOop;
				}
				localIP += blockSize;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), newClosure);
			}
			break;
		case 144:
		case 432: /*176*/
			/* shortUnconditionalJump */
			{
				sqInt offset;

				VM_LABEL(shortUnconditionalJump);
				/* begin jump: */
				offset = 1 /* (currentBytecode bitAnd: 7) + 1 */;
				localIP = (localIP + offset) + 1;
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = byteAtPointer(localIP);
#        endif /* MULTIPLEBYTECODESETS */
			}
			break;
		case 145:
		case 433: /*177*/
			/* shortUnconditionalJump */
			{
				sqInt offset;

				VM_LABEL(shortUnconditionalJump1);
				/* begin jump: */
				offset = 2 /* (currentBytecode bitAnd: 7) + 1 */;
				localIP = (localIP + offset) + 1;
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = byteAtPointer(localIP);
#        endif /* MULTIPLEBYTECODESETS */
			}
			break;
		case 146:
		case 434: /*178*/
			/* shortUnconditionalJump */
			{
				sqInt offset;

				VM_LABEL(shortUnconditionalJump2);
				/* begin jump: */
				offset = 3 /* (currentBytecode bitAnd: 7) + 1 */;
				localIP = (localIP + offset) + 1;
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = byteAtPointer(localIP);
#        endif /* MULTIPLEBYTECODESETS */
			}
			break;
		case 147:
		case 435: /*179*/
			/* shortUnconditionalJump */
			{
				sqInt offset;

				VM_LABEL(shortUnconditionalJump3);
				/* begin jump: */
				offset = 4 /* (currentBytecode bitAnd: 7) + 1 */;
				localIP = (localIP + offset) + 1;
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = byteAtPointer(localIP);
#        endif /* MULTIPLEBYTECODESETS */
			}
			break;
		case 148:
		case 436: /*180*/
			/* shortUnconditionalJump */
			{
				sqInt offset;

				VM_LABEL(shortUnconditionalJump4);
				/* begin jump: */
				offset = 5 /* (currentBytecode bitAnd: 7) + 1 */;
				localIP = (localIP + offset) + 1;
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = byteAtPointer(localIP);
#        endif /* MULTIPLEBYTECODESETS */
			}
			break;
		case 149:
		case 437: /*181*/
			/* shortUnconditionalJump */
			{
				sqInt offset;

				VM_LABEL(shortUnconditionalJump5);
				/* begin jump: */
				offset = 6 /* (currentBytecode bitAnd: 7) + 1 */;
				localIP = (localIP + offset) + 1;
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = byteAtPointer(localIP);
#        endif /* MULTIPLEBYTECODESETS */
			}
			break;
		case 150:
		case 438: /*182*/
			/* shortUnconditionalJump */
			{
				sqInt offset;

				VM_LABEL(shortUnconditionalJump6);
				/* begin jump: */
				offset = 7 /* (currentBytecode bitAnd: 7) + 1 */;
				localIP = (localIP + offset) + 1;
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = byteAtPointer(localIP);
#        endif /* MULTIPLEBYTECODESETS */
			}
			break;
		case 151:
		case 439: /*183*/
			/* shortUnconditionalJump */
			{
				sqInt offset;

				VM_LABEL(shortUnconditionalJump7);
				/* begin jump: */
				offset = 8 /* (currentBytecode bitAnd: 7) + 1 */;
				localIP = (localIP + offset) + 1;
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = byteAtPointer(localIP);
#        endif /* MULTIPLEBYTECODESETS */
			}
			break;
		case 152:
		case 153:
		case 154:
		case 155:
		case 156:
		case 157:
		case 158:
		case 159:
			/* shortConditionalJumpFalse */
			{
				sqInt boolean;
				sqInt offset;

				VM_LABEL(shortConditionalJumpFalse);
				/* begin jumplfFalseBy: */
				offset = (currentBytecode & 7) + 1;
				/* begin internalStackTop */
				boolean = longAtPointer(localSP);
				if (boolean == GIV(falseObj)) {
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
				}
				else {
					if (!(boolean == GIV(trueObj))) {
						/* begin internalMustBeBoolean */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorMustBeBoolean) << (shiftForWord())))));
						GIV(argumentCount) = 0;
						goto normalSend;
						goto l150;
					}
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
	l150:	/* end jumplfFalseBy: */;
			}
			break;
		case 160:
		case 161:
		case 162:
		case 163:
		case 164:
		case 165:
		case 166:
		case 167:
			/* longUnconditionalJump */
			{
				sqInt backwardJumpCountByte;
				sqInt offset;
				sqInt switched;

				VM_LABEL(longUnconditionalJump);
				offset = (((currentBytecode & 7) - 4) * 256) + (byteAtPointer(++localIP));
				localIP += offset;
				/* begin ifBackwardsCheckForEvents: */
				if (offset >= 0) {
					goto l153;
				}
				if (localSP < GIV(stackLimit)) {
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					switched = checkForEventsMayContextSwitch(1);
					returnToExecutivepostContextSwitch(1, switched);
					browserPluginReturnIfNeeded();
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (switched) {
						goto l153;
					}
				}
				backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN
	? (FoxIFrameFlags + BytesPerWord) - 1
	: FoxIFrameFlags)));
				if (((backwardJumpCountByte -= 2)) == 1) {
					if (methodWithHeaderShouldBeCogged(methodHeaderOf(GIV(method)))) {
						/* begin externalizeIPandSP */
						assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
						GIV(instructionPointer) = oopForPointer(localIP);
						GIV(stackPointer) = localSP;
						GIV(framePointer) = localFP;
						attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - offset) - GIV(method)) - BaseHeaderSize) - 1);
					}
					backwardJumpCountByte = 0x7F;
				}
				else {
					if (backwardJumpCountByte == -1) {

						/* initialize the count */
						assert(minBackwardJumpCountForCompile <= 128);
						backwardJumpCountByte = (((sqInt)((usqInt)((minBackwardJumpCountForCompile - 1)) << 1))) + 1;
					}
				}
				/* begin iframeBackwardBranchByte:put: */
				byteAtput(localFP + ((VMBIGENDIAN
	? (FoxIFrameFlags + BytesPerWord) - 1
	: FoxIFrameFlags)), backwardJumpCountByte);
	l153:	/* end ifBackwardsCheckForEvents: */;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
			break;
		case 168:
		case 169:
		case 170:
		case 171:
			/* longJumpIfTrue */
			{
				sqInt boolean;
				sqInt offset;

				VM_LABEL(longJumpIfTrue);
				/* begin jumplfTrueBy: */
				offset = ((currentBytecode & 3) * 256) + (byteAtPointer(++localIP));
				/* begin internalStackTop */
				boolean = longAtPointer(localSP);
				if (boolean == GIV(trueObj)) {
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
				}
				else {
					if (!(boolean == GIV(falseObj))) {
						/* begin internalMustBeBoolean */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorMustBeBoolean) << (shiftForWord())))));
						GIV(argumentCount) = 0;
						goto normalSend;
						goto l156;
					}
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
	l156:	/* end jumplfTrueBy: */;
			}
			break;
		case 172:
		case 173:
		case 174:
		case 175:
			/* longJumpIfFalse */
			{
				sqInt boolean;
				sqInt offset;

				VM_LABEL(longJumpIfFalse);
				/* begin jumplfFalseBy: */
				offset = ((currentBytecode & 3) * 256) + (byteAtPointer(++localIP));
				/* begin internalStackTop */
				boolean = longAtPointer(localSP);
				if (boolean == GIV(falseObj)) {
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
				}
				else {
					if (!(boolean == GIV(trueObj))) {
						/* begin internalMustBeBoolean */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorMustBeBoolean) << (shiftForWord())))));
						GIV(argumentCount) = 0;
						goto normalSend;
						goto l160;
					}
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
	l160:	/* end jumplfFalseBy: */;
			}
			break;
		case 176:
			/* bytecodePrimAdd */
			{
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				sqInt result;
				double result1;
				double result2;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				char *sp;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimAdd);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					result = ((rcvr >> 3)) + ((arg >> 3));
					if ((((((usqInt) result) >> 60) + 1) & 15) <= 1) {
						/* begin internalPop:thenPush: */
						longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 3) | 1));
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l162;
					}
				}
				else {
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin primitiveFloatAdd:toArg: */
					if (((tagBits = rcvr & (tagMask()))) != 0) {
						if (tagBits == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(rcvr));
							rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
							if (rot > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
							bits = rot;
							memcpy((&value), (&bits), sizeof(value));
							rcvr1 = value;
							goto l163;
						}
						if ((tagBits == (smallIntegerTag()))
						 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
							rcvr1 = ((double) ((rcvr >> 3)) );
							goto l163;
						}
					}
					else {
						if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(rcvr + BaseHeaderSize, result2);
							rcvr1 = result2;
							goto l163;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					rcvr1 = 0.0;
	l163:	/* end loadFloatOrIntFrom: */;
					/* begin loadFloatOrIntFrom: */
					if (((tagBits1 = arg & (tagMask()))) != 0) {
						if (tagBits1 == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(arg));
							rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
							if (rot1 > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
							bits1 = rot1;
							memcpy((&value1), (&bits1), sizeof(value1));
							arg1 = value1;
							goto l167;
						}
						if ((tagBits1 == (smallIntegerTag()))
						 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
							arg1 = ((double) ((arg >> 3)) );
							goto l167;
						}
					}
					else {
						if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(arg + BaseHeaderSize, result1);
							arg1 = result1;
							goto l167;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					arg1 = 0.0;
	l167:	/* end loadFloatOrIntFrom: */;
					if (!GIV(primFailCode)) {
						/* begin pop:thenPushFloat: */
						longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1));
						GIV(stackPointer) = sp;
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l162;
					}
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((0 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l162:	/* end case */;
			break;
		case 177:
			/* bytecodePrimSubtract */
			{
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				sqInt result;
				double result1;
				double result2;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				char *sp;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimSubtract);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					result = ((rcvr >> 3)) - ((arg >> 3));
					if ((((((usqInt) result) >> 60) + 1) & 15) <= 1) {
						/* begin internalPop:thenPush: */
						longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 3) | 1));
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l173;
					}
				}
				else {
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin primitiveFloatSubtract:fromArg: */
					if (((tagBits = rcvr & (tagMask()))) != 0) {
						if (tagBits == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(rcvr));
							rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
							if (rot > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
							bits = rot;
							memcpy((&value), (&bits), sizeof(value));
							rcvr1 = value;
							goto l174;
						}
						if ((tagBits == (smallIntegerTag()))
						 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
							rcvr1 = ((double) ((rcvr >> 3)) );
							goto l174;
						}
					}
					else {
						if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(rcvr + BaseHeaderSize, result2);
							rcvr1 = result2;
							goto l174;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					rcvr1 = 0.0;
	l174:	/* end loadFloatOrIntFrom: */;
					/* begin loadFloatOrIntFrom: */
					if (((tagBits1 = arg & (tagMask()))) != 0) {
						if (tagBits1 == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(arg));
							rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
							if (rot1 > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
							bits1 = rot1;
							memcpy((&value1), (&bits1), sizeof(value1));
							arg1 = value1;
							goto l178;
						}
						if ((tagBits1 == (smallIntegerTag()))
						 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
							arg1 = ((double) ((arg >> 3)) );
							goto l178;
						}
					}
					else {
						if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(arg + BaseHeaderSize, result1);
							arg1 = result1;
							goto l178;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					arg1 = 0.0;
	l178:	/* end loadFloatOrIntFrom: */;
					if (!GIV(primFailCode)) {
						/* begin pop:thenPushFloat: */
						longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1));
						GIV(stackPointer) = sp;
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l173;
					}
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((1 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l173:	/* end case */;
			break;
		case 178:
			/* bytecodePrimLessThan */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimLessThan);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {

					/* The C code can avoid detagging since tagged integers are still signed.
					   But this means the simulator must override to do detagging. */
					/* begin booleanCheat: */
					if (rcvr < arg) {
						/* goto booleanCheatTrue */
					}
					else {
						goto booleanCheatFalse;
					}
					goto l184;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatLess:thanArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l190;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l190;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l190;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l190:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l189;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l189;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l189;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l189:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 < arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheat: */
					if (aBool) {
						goto booleanCheatTrue;
					}
					else {
						goto booleanCheatFalse;
					}
					goto l184;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((2 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l184:	/* end case */;
			
		booleanCheatTrue:
			/* booleanCheatTrue */
			{
				sqInt bytecode;
				sqInt offset;

				VM_LABEL(booleanCheatTrue);
				
				/* assume next bytecode is jumpIfFalse (99%) */
				bytecode = byteAtPointer(++localIP);
				/* begin internalPop: */
				localSP += 2 * BytesPerOop;
				if ((bytecode < 173)
				 && (bytecode > 151)) {
					if (bytecode < 160) {

						/* short jumpIfFalse 152 - 159 */
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l810;
					}
					if (bytecode == 172) {

						/* long jumpIfFalse */
						byteAtPointer(++localIP);
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l810;
					}
					if (bytecode > 167) {

						/* long jumpIfTrue 168 - 171 */
						offset = (((sqInt)((usqInt)((bytecode - 168)) << 8))) + (byteAtPointer(++localIP));
						/* begin jump: */
						localIP = (localIP + offset) + 1;
						
#            if MULTIPLEBYTECODESETS
						currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#            else /* MULTIPLEBYTECODESETS */
						currentBytecode = byteAtPointer(localIP);
#            endif /* MULTIPLEBYTECODESETS */
						goto l810;
					}
				}
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = bytecode + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = bytecode;
#        endif /* MULTIPLEBYTECODESETS */
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), GIV(trueObj));
			}
	l810:	/* end case */;
			break;
		case 179:
			/* bytecodePrimGreaterThan */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimGreaterThan);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {

					/* The C code can avoid detagging since tagged integers are still signed.
					   But this means the simulator must override to do detagging. */
					/* begin booleanCheat: */
					if (rcvr > arg) {
						goto booleanCheatTrue;
					}
					else {
						/* goto booleanCheatFalse */
					}
					goto l194;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatGreater:thanArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l200;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l200;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l200;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l200:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l199;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l199;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l199;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l199:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 > arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheat: */
					if (aBool) {
						goto booleanCheatTrue;
					}
					else {
						goto booleanCheatFalse;
					}
					goto l194;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((3 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l194:	/* end case */;
			
		booleanCheatFalse:
			/* booleanCheatFalse */
			{
				sqInt bytecode;
				sqInt offset;

				VM_LABEL(booleanCheatFalse);
				
				/* assume next bytecode is jumpIfFalse (99%) */
				bytecode = byteAtPointer(++localIP);
				/* begin internalPop: */
				localSP += 2 * BytesPerOop;
				if ((bytecode < 160)
				 && (bytecode > 151)) {

					/* short jumpIfFalse */
					/* begin jump: */
					localIP = (localIP + (bytecode - 151)) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
					goto l813;
				}
				if (bytecode == 172) {

					/* long jumpIfFalse */
					offset = byteAtPointer(++localIP);
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
					goto l813;
				}
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = bytecode + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = bytecode;
#        endif /* MULTIPLEBYTECODESETS */
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), GIV(falseObj));
			}
	l813:	/* end case */;
			break;
		case 180:
			/* bytecodePrimLessOrEqual */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimLessOrEqual);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {

					/* The C code can avoid detagging since tagged integers are still signed.
					   But this means the simulator must override to do detagging. */
					/* begin booleanCheat: */
					if (rcvr <= arg) {
						goto booleanCheatTrue;
					}
					else {
						goto booleanCheatFalse;
					}
					goto l204;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatLessOrEqual:toArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l210;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l210;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l210;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l210:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l209;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l209;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l209;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l209:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 <= arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheat: */
					if (aBool) {
						goto booleanCheatTrue;
					}
					else {
						goto booleanCheatFalse;
					}
					goto l204;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((4 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l204:	/* end case */;
			break;
		case 181:
			/* bytecodePrimGreaterOrEqual */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimGreaterOrEqual);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {

					/* The C code can avoid detagging since tagged integers are still signed.
					   But this means the simulator must override to do detagging. */
					/* begin booleanCheat: */
					if (rcvr >= arg) {
						goto booleanCheatTrue;
					}
					else {
						goto booleanCheatFalse;
					}
					goto l214;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatGreaterOrEqual:toArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l220;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l220;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l220;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l220:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l219;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l219;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l219;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l219:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 >= arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheat: */
					if (aBool) {
						goto booleanCheatTrue;
					}
					else {
						goto booleanCheatFalse;
					}
					goto l214;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((5 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l214:	/* end case */;
			break;
		case 182:
			/* bytecodePrimEqual */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimEqual);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					/* begin booleanCheat: */
					if (rcvr == arg) {
						goto booleanCheatTrue;
					}
					else {
						goto booleanCheatFalse;
					}
					goto l224;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatEqual:toArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l230;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l230;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l230;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l230:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l229;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l229;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l229;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l229:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 == arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheat: */
					if (aBool) {
						goto booleanCheatTrue;
					}
					else {
						goto booleanCheatFalse;
					}
					goto l224;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((6 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l224:	/* end case */;
			break;
		case 183:
			/* bytecodePrimNotEqual */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimNotEqual);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					/* begin booleanCheat: */
					if (rcvr != arg) {
						goto booleanCheatTrue;
					}
					else {
						goto booleanCheatFalse;
					}
					goto l234;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatEqual:toArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l240;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l240;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l240;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l240:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l239;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l239;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l239;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l239:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 == arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheat: */
					if (!aBool) {
						goto booleanCheatTrue;
					}
					else {
						goto booleanCheatFalse;
					}
					goto l234;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((7 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l234:	/* end case */;
			break;
		case 184:
			/* bytecodePrimMultiply */
			{
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt oop;
				sqInt overflow;
				sqInt rcvr;
				double rcvr1;
				sqInt result;
				double result1;
				double result2;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				char *sp;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimMultiply);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					rcvr = (rcvr >> 3);
					arg = (arg >> 3);
					overflow = (rcvr > 0
						? (arg > 0
								? rcvr > ((MaxSmallInteger) / arg)
								: arg < ((MinSmallInteger) / rcvr))
						: (arg > 0
								? rcvr < ((MinSmallInteger) / arg)
								: (rcvr < 0)
									 && (arg < ((MaxSmallInteger) / rcvr))));
					if (!overflow) {
						result = rcvr * arg;
						oop = (((usqInt)result << 3) | 1);
						/* begin internalPop:thenPush: */
						longAtPointerput((localSP += (2 - 1) * BytesPerOop), oop);
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l244;
					}
				}
				else {
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin primitiveFloatMultiply:byArg: */
					if (((tagBits = rcvr & (tagMask()))) != 0) {
						if (tagBits == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(rcvr));
							rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
							if (rot > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
							bits = rot;
							memcpy((&value), (&bits), sizeof(value));
							rcvr1 = value;
							goto l245;
						}
						if ((tagBits == (smallIntegerTag()))
						 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
							rcvr1 = ((double) ((rcvr >> 3)) );
							goto l245;
						}
					}
					else {
						if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(rcvr + BaseHeaderSize, result2);
							rcvr1 = result2;
							goto l245;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					rcvr1 = 0.0;
	l245:	/* end loadFloatOrIntFrom: */;
					/* begin loadFloatOrIntFrom: */
					if (((tagBits1 = arg & (tagMask()))) != 0) {
						if (tagBits1 == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(arg));
							rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
							if (rot1 > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
							bits1 = rot1;
							memcpy((&value1), (&bits1), sizeof(value1));
							arg1 = value1;
							goto l249;
						}
						if ((tagBits1 == (smallIntegerTag()))
						 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
							arg1 = ((double) ((arg >> 3)) );
							goto l249;
						}
					}
					else {
						if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(arg + BaseHeaderSize, result1);
							arg1 = result1;
							goto l249;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					arg1 = 0.0;
	l249:	/* end loadFloatOrIntFrom: */;
					if (!GIV(primFailCode)) {
						/* begin pop:thenPushFloat: */
						longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1));
						GIV(stackPointer) = sp;
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l244;
					}
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((8 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l244:	/* end case */;
			break;
		case 185:
			/* bytecodePrimDivide */
			{
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				sqInt result;
				double result1;
				double result2;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				char *sp;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimDivide);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					rcvr = (rcvr >> 3);
					arg = (arg >> 3);
					if ((arg != 0)
					 && ((rcvr % arg) == 0)) {

						/* generates C / operation */
						result = rcvr / arg;
						if ((((((usqInt) result) >> 60) + 1) & 15) <= 1) {
							/* begin internalPop:thenPush: */
							longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 3) | 1));
							/* begin fetchNextBytecode */
							currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
							goto l255;
						}
					}
				}
				else {
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin primitiveFloatDivide:byArg: */
					if (((tagBits = rcvr & (tagMask()))) != 0) {
						if (tagBits == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(rcvr));
							rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
							if (rot > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
							bits = rot;
							memcpy((&value), (&bits), sizeof(value));
							rcvr1 = value;
							goto l256;
						}
						if ((tagBits == (smallIntegerTag()))
						 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
							rcvr1 = ((double) ((rcvr >> 3)) );
							goto l256;
						}
					}
					else {
						if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(rcvr + BaseHeaderSize, result2);
							rcvr1 = result2;
							goto l256;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					rcvr1 = 0.0;
	l256:	/* end loadFloatOrIntFrom: */;
					/* begin loadFloatOrIntFrom: */
					if (((tagBits1 = arg & (tagMask()))) != 0) {
						if (tagBits1 == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(arg));
							rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
							if (rot1 > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
							bits1 = rot1;
							memcpy((&value1), (&bits1), sizeof(value1));
							arg1 = value1;
							goto l260;
						}
						if ((tagBits1 == (smallIntegerTag()))
						 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
							arg1 = ((double) ((arg >> 3)) );
							goto l260;
						}
					}
					else {
						if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(arg + BaseHeaderSize, result1);
							arg1 = result1;
							goto l260;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					arg1 = 0.0;
	l260:	/* end loadFloatOrIntFrom: */;
					/* begin success: */
					if (!(arg1 != 0.0)) {

						/* Don't overwrite an error code that has already been set. */
						if (!GIV(primFailCode)) {
							GIV(primFailCode) = 1;
						}
					}
					if (!GIV(primFailCode)) {
						/* begin pop:thenPushFloat: */
						longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 / arg1));
						GIV(stackPointer) = sp;
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l255;
					}
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((9 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l255:	/* end case */;
			break;
		case 186:
			/* bytecodePrimMod */
			{
				sqInt mod;
				sqInt objOop;

				VM_LABEL(bytecodePrimMod);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				mod = doPrimitiveModby(longAtPointer(localSP + (1 * BytesPerOop)), longAtPointer(localSP + (0 * BytesPerOop)));
				if (!GIV(primFailCode)) {
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)mod << 3) | 1));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l266;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((10 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l266:	/* end case */;
			break;
		case 187:
			/* bytecodePrimMakePoint */
			{
				sqInt arg;
				sqInt classObj;
				sqInt knownClassIndex;
				usqInt newObj;
				usqInt numBytes;
				sqInt numSlots;
				sqInt objFormat;
				sqInt objOop;
				usqInt pt;
				sqInt rcvr;

				VM_LABEL(bytecodePrimMakePoint);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP);
				if (((rcvr & (tagMask())
					? !(rcvr & (characterTag()))
					: ((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex))
				 && ((arg & (tagMask())
					? !(arg & (characterTag()))
					: ((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex))) {
					/* begin eeInstantiateSmallClass:numSlots: */
					classObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
					numSlots = YIndex + 1;
					assert((rawHashBitsOf(classObj)) != 0);
					/* begin eeInstantiateSmallClassIndex:format:numSlots: */
					knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
					/* begin instSpecOfClassFormat: */
					objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3))) >> (fixedFieldsFieldWidth())) & (formatMask());
					assert((numSlots >= 0)
					 && ((knownClassIndex != 0)
					 && ((knownClassAtIndex(knownClassIndex)) != GIV(nilObj))));
					assert(((objFormat < (firstByteFormat())
						? objFormat
						: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex))));
					/* begin allocateSmallNewSpaceSlots:format:classIndex: */
					assert(numSlots < (numSlotsMask()));
					newObj = GIV(freeStart);
					numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
					assert((numBytes % (allocationUnit())) == 0);
					assert((newObj % (allocationUnit())) == 0);
					if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
						if (!GIV(needGCFlag)) {
							/* begin scheduleScavenge */
							GIV(needGCFlag) = 1;
							forceInterruptCheck();
						}
						if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
							error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
							pt = 0;
							goto l273;
						}
					}
					long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex);
					GIV(freeStart) += numBytes;
					pt = newObj;
	l273:	/* end eeInstantiateSmallClass:numSlots: */;
					/* begin storePointerUnchecked:ofObject:withValue: */
					assert(!(isOopForwarded(pt)));
					longAtput((pt + BaseHeaderSize) + (((sqInt)((usqInt)(XIndex) << (shiftForWord())))), rcvr);
					/* begin storePointerUnchecked:ofObject:withValue: */
					assert(!(isOopForwarded(pt)));
					longAtput((pt + BaseHeaderSize) + (((sqInt)((usqInt)(YIndex) << (shiftForWord())))), arg);
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP += (2 - 1) * BytesPerOop), pt);
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l270;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((11 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l270:	/* end case */;
			break;
		case 188:
			/* bytecodePrimBitShift */
			{
				sqInt integerArgument;
				sqInt integerReceiver;
				sqInt objOop;
				sqInt shifted;
				char *sp;

				VM_LABEL(bytecodePrimBitShift);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin externalizeIPandSP */
				assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
				GIV(instructionPointer) = oopForPointer(localIP);
				GIV(stackPointer) = localSP;
				GIV(framePointer) = localFP;
				/* begin primitiveBitShift */
				integerArgument = longAt(GIV(stackPointer));
				if (!((((integerArgument) & 7) == 1))) {
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					goto l283;
				}
				integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
				integerReceiver = signed64BitValueOf(integerReceiver);
				if (!GIV(primFailCode)) {
					if (((integerArgument = (integerArgument >> 3))) >= 0) {

						/* Left shift -- must fail bits would be lost */
						if (!(integerArgument <= 61 /* numSmallIntegerBits */)) {
							/* begin primitiveFail */
							if (!GIV(primFailCode)) {
								GIV(primFailCode) = 1;
							}
							goto l283;
						}
						shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument));
						if (!(integerReceiver == (((sqInt) shifted) >> integerArgument))) {
							/* begin primitiveFail */
							if (!GIV(primFailCode)) {
								GIV(primFailCode) = 1;
							}
							goto l283;
						}
					}
					else {

						/* Right shift -- OK to lose bits */
						if (!(integerArgument >= (-61 /* numSmallIntegerBits */))) {
							/* begin primitiveFail */
							if (!GIV(primFailCode)) {
								GIV(primFailCode) = 1;
							}
							goto l283;
						}
						shifted = ((sqInt) integerReceiver) >> (0 - integerArgument);
					}
					shifted = ((((((usqInt) shifted) >> 60) + 1) & 15) <= 1
						? (((usqInt)shifted << 3) | 1)
						: signed64BitIntegerFor(shifted));
					/* begin pop:thenPush: */
					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
					GIV(stackPointer) = sp;
				}
	l283:	/* end primitiveBitShift */;
				/* begin internalizeIPandSP */
				assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
				localIP = pointerForOop(GIV(instructionPointer));
				localSP = pointerForOop(GIV(stackPointer));
				localFP = pointerForOop(GIV(framePointer));
				if (!GIV(primFailCode)) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l279;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((12 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l279:	/* end case */;
			break;
		case 189:
			/* bytecodePrimDiv */
			{
				sqInt objOop;
				sqInt quotient;

				VM_LABEL(bytecodePrimDiv);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				quotient = doPrimitiveDivby(longAtPointer(localSP + (1 * BytesPerOop)), longAtPointer(localSP + (0 * BytesPerOop)));
				if (!GIV(primFailCode)) {
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)quotient << 3) | 1));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l285;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((13 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l285:	/* end case */;
			break;
		case 190:
			/* bytecodePrimBitAnd */
			{
				sqInt arg;
				sqInt objOop;
				sqInt rcvr;

				VM_LABEL(bytecodePrimBitAnd);
				arg = longAtPointer(localSP);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				if (((((arg) & 7) == 1))
				 && ((((rcvr) & 7) == 1))) {
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP += (2 - 1) * BytesPerOop), arg & rcvr);
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l289;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin externalizeIPandSP */
				assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
				GIV(instructionPointer) = oopForPointer(localIP);
				GIV(stackPointer) = localSP;
				GIV(framePointer) = localFP;
				primitiveBitAnd();
				/* begin internalizeIPandSP */
				assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
				localIP = pointerForOop(GIV(instructionPointer));
				localSP = pointerForOop(GIV(stackPointer));
				localFP = pointerForOop(GIV(framePointer));
				if (!GIV(primFailCode)) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l289;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((14 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l289:	/* end case */;
			break;
		case 191:
			/* bytecodePrimBitOr */
			{
				sqInt arg;
				sqInt objOop;
				sqInt rcvr;

				VM_LABEL(bytecodePrimBitOr);
				arg = longAtPointer(localSP);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				if (((((arg) & 7) == 1))
				 && ((((rcvr) & 7) == 1))) {
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP += (2 - 1) * BytesPerOop), arg | rcvr);
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l294;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin externalizeIPandSP */
				assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
				GIV(instructionPointer) = oopForPointer(localIP);
				GIV(stackPointer) = localSP;
				GIV(framePointer) = localFP;
				primitiveBitOr();
				/* begin internalizeIPandSP */
				assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
				localIP = pointerForOop(GIV(instructionPointer));
				localSP = pointerForOop(GIV(stackPointer));
				localFP = pointerForOop(GIV(framePointer));
				if (!GIV(primFailCode)) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l294;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((15 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l294:	/* end case */;
			break;
		case 192:
		case 368: /*112*/
			/* bytecodePrimAt */
			{
				sqInt objOop;

				VM_LABEL(bytecodePrimAt);
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((16 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
			break;
		case 193:
		case 369: /*113*/
			/* bytecodePrimAtPut */
			{
				sqInt objOop;

				VM_LABEL(bytecodePrimAtPut);
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((17 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 2;
				goto normalSend;
			}
			break;
		case 194:
			/* bytecodePrimSize */
			{
				sqInt ccIndex;
				sqInt ccIndex1;
				sqInt classOop;
				sqInt classOop1;
				sqInt fmt;
				sqInt fmt1;
				sqInt isArray;
				sqInt isString;
				usqInt numSlots;
				usqInt numSlots1;
				usqInt numSlots11;
				usqInt numSlots2;
				sqInt objOop;
				sqInt rcvr;
				sqInt sz;

				VM_LABEL(bytecodePrimSize);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;

				/* Shortcut the mega-lookup for ByteString and Array, the two big consumers of cycles
				   here. Both of these have compact class indices and neither has any added fields. */
				rcvr = longAtPointer(localSP);
				/* begin is:instanceOf:compactClassIndex: */
				classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassByteString) << (shiftForWord())))));
				if (rcvr & (tagMask())) {
					isString = 0;
					goto l312;
				}
				/* begin isClassOfNonImm:equalTo:compactClassIndex: */
				assert(!(isImmediate(rcvr)));
				/* begin classIndexOf: */
				ccIndex = (longAt(rcvr)) & (classIndexMask());
				isString = ClassByteStringCompactIndex == ccIndex;
				goto l312;
	l312:	/* end is:instanceOf:compactClassIndex: */;
				if (isString) {
					/* begin lengthOf:format: */
					fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
					/* begin numSlotsOfAny: */
					numSlots1 = byteAt(rcvr + 7);
					numSlots = (numSlots1 == (numSlotsMask())
						? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
						: numSlots1);
					if (fmt <= 5 /* ephemeronFormat */) {
						sz = numSlots;
						goto l314;
					}
					if (fmt >= (firstByteFormat())) {

						/* bytes, including CompiledMethod */
						sz = (numSlots << (shiftForWord())) - (fmt & 7);
						goto l314;
					}
					if (fmt >= (firstShortFormat())) {
						sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
						goto l314;
					}
					if (fmt >= (firstLongFormat())) {
						sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
						goto l314;
					}
					if (fmt == (sixtyFourBitIndexableFormat())) {
						sz = numSlots;
						goto l314;
					}
					sz = 0;
	l314:	/* end lengthOf:format: */;
					longAtPointerput(localSP, (((usqInt)sz << 3) | 1));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l303;
				}
				/* begin is:instanceOf:compactClassIndex: */
				classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassArray) << (shiftForWord())))));
				if (rcvr & (tagMask())) {
					isArray = 0;
					goto l315;
				}
				/* begin isClassOfNonImm:equalTo:compactClassIndex: */
				assert(!(isImmediate(rcvr)));
				/* begin classIndexOf: */
				ccIndex1 = (longAt(rcvr)) & (classIndexMask());
				isArray = ClassArrayCompactIndex == ccIndex1;
				goto l315;
	l315:	/* end is:instanceOf:compactClassIndex: */;
				if (isArray) {
					/* begin lengthOf:format: */
					fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
					/* begin numSlotsOfAny: */
					numSlots11 = byteAt(rcvr + 7);
					numSlots2 = (numSlots11 == (numSlotsMask())
						? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
						: numSlots11);
					if (fmt1 <= 5 /* ephemeronFormat */) {
						sz = numSlots2;
						goto l313;
					}
					if (fmt1 >= (firstByteFormat())) {

						/* bytes, including CompiledMethod */
						sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7);
						goto l313;
					}
					if (fmt1 >= (firstShortFormat())) {
						sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3);
						goto l313;
					}
					if (fmt1 >= (firstLongFormat())) {
						sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1);
						goto l313;
					}
					if (fmt1 == (sixtyFourBitIndexableFormat())) {
						sz = numSlots2;
						goto l313;
					}
					sz = 0;
	l313:	/* end lengthOf:format: */;
					longAtPointerput(localSP, (((usqInt)sz << 3) | 1));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l303;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((18 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 0;
				goto normalSend;
			}
	l303:	/* end case */;
			break;
		case 195:
		case 371: /*115*/
			/* bytecodePrimNext */
			{
				sqInt objOop;

				VM_LABEL(bytecodePrimNext);
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((19 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = ((fetchPointerofObject((19 * 2) + 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord()))))))) >> 3);
				goto normalSend;
			}
			break;
		case 196:
		case 372: /*116*/
			/* bytecodePrimNextPut */
			{
				sqInt objOop;

				VM_LABEL(bytecodePrimNextPut);
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((20 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = ((fetchPointerofObject((20 * 2) + 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord()))))))) >> 3);
				goto normalSend;
			}
			break;
		case 197:
		case 373: /*117*/
			/* bytecodePrimAtEnd */
			{
				sqInt objOop;

				VM_LABEL(bytecodePrimAtEnd);
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((21 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = ((fetchPointerofObject((21 * 2) + 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord()))))))) >> 3);
				goto normalSend;
			}
			break;
		case 198:
			/* bytecodePrimIdentical */
			{
				sqInt arg;
				sqInt rcvr;

				VM_LABEL(bytecodePrimIdentical);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				if (((rcvr & (tagMask())) == 0)
				 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					rcvr = handleSpecialSelectorSendFaultForfpsp(rcvr, localFP, localSP);
				}
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if (((arg & (tagMask())) == 0)
				 && (((longAt(arg)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					arg = handleSpecialSelectorSendFaultForfpsp(arg, localFP, localSP);
				}
				/* begin booleanCheat: */
				if (rcvr == arg) {
					goto booleanCheatTrue;
				}
				else {
					goto booleanCheatFalse;
				}
			}
			break;
		case 199:
		case 375: /*119*/
			/* bytecodePrimClass */
			{
				sqInt aValue;
				sqInt rcvr;
				sqInt tagBits;

				VM_LABEL(bytecodePrimClass);
				rcvr = longAtPointer(localSP);
				if (((rcvr & (tagMask())) == 0)
				 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					rcvr = handleSpecialSelectorSendFaultForfpsp(rcvr, localFP, localSP);
				}
				/* begin internalStackTopPut: */
				aValue = (((tagBits = rcvr & (tagMask()))) != 0
					? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))
					: fetchClassOfNonImm(rcvr));
				longAtPointerput(localSP, aValue);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
			break;
		case 200:
			/* bytecodePrimNotIdentical */
			{
				sqInt arg;
				sqInt rcvr;

				VM_LABEL(bytecodePrimNotIdentical);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				if (((rcvr & (tagMask())) == 0)
				 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					rcvr = handleSpecialSelectorSendFaultForfpsp(rcvr, localFP, localSP);
				}
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if (((arg & (tagMask())) == 0)
				 && (((longAt(arg)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					arg = handleSpecialSelectorSendFaultForfpsp(arg, localFP, localSP);
				}
				/* begin booleanCheat: */
				if (rcvr != arg) {
					goto booleanCheatTrue;
				}
				else {
					goto booleanCheatFalse;
				}
			}
			break;
		case 201:
			/* bytecodePrimValue */
			{
				sqInt ccIndex;
				sqInt classOop;
				sqInt isBlock;
				sqInt objOop;
				sqInt rcvr;

				VM_LABEL(bytecodePrimValue);
				rcvr = longAtPointer(localSP);
				GIV(argumentCount) = 0;
				/* begin is:instanceOf:compactClassIndex: */
				classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassBlockClosure) << (shiftForWord())))));
				if (rcvr & (tagMask())) {
					isBlock = 0;
					goto l326;
				}
				/* begin isClassOfNonImm:equalTo:compactClassIndex: */
				assert(!(isImmediate(rcvr)));
				/* begin classIndexOf: */
				ccIndex = (longAt(rcvr)) & (classIndexMask());
				isBlock = ClassBlockClosureCompactIndex == ccIndex;
				goto l326;
	l326:	/* end is:instanceOf:compactClassIndex: */;
				if (isBlock) {
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					primitiveClosureValue();
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l324;
					}
					GIV(primFailCode) = 0;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((25 * 2)) << (shiftForWord())))));
				goto normalSend;
			}
	l324:	/* end case */;
			break;
		case 202:
			/* bytecodePrimValueWithArg */
			{
				sqInt ccIndex;
				sqInt classOop;
				sqInt isBlock;
				sqInt objOop;
				sqInt rcvr;

				VM_LABEL(bytecodePrimValueWithArg);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				GIV(argumentCount) = 1;
				/* begin is:instanceOf:compactClassIndex: */
				classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassBlockClosure) << (shiftForWord())))));
				if (rcvr & (tagMask())) {
					isBlock = 0;
					goto l332;
				}
				/* begin isClassOfNonImm:equalTo:compactClassIndex: */
				assert(!(isImmediate(rcvr)));
				/* begin classIndexOf: */
				ccIndex = (longAt(rcvr)) & (classIndexMask());
				isBlock = ClassBlockClosureCompactIndex == ccIndex;
				goto l332;
	l332:	/* end is:instanceOf:compactClassIndex: */;
				if (isBlock) {
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					primitiveClosureValue();
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l330;
					}
					GIV(primFailCode) = 0;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((26 * 2)) << (shiftForWord())))));
				goto normalSend;
			}
	l330:	/* end case */;
			break;
		case 203:
		case 379: /*123*/
			/* bytecodePrimDo */
			{
				sqInt objOop;

				VM_LABEL(bytecodePrimDo);
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((27 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = ((fetchPointerofObject((27 * 2) + 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord()))))))) >> 3);
				goto normalSend;
			}
			break;
		case 204:
		case 380: /*124*/
			/* bytecodePrimNew */
			{
				sqInt objOop;

				VM_LABEL(bytecodePrimNew);
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((28 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 0;
				goto normalSend;
			}
			break;
		case 205:
		case 381: /*125*/
			/* bytecodePrimNewWithArg */
			{
				sqInt objOop;

				VM_LABEL(bytecodePrimNewWithArg);
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((29 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
			break;
		case 206:
			/* bytecodePrimPointX */
			{
				sqInt classOop;
				sqInt objOop;
				sqInt ok;
				sqInt rcvr;

				VM_LABEL(bytecodePrimPointX);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				rcvr = longAtPointer(localSP);
				/* begin assertClassOf:is: */
				classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
				/* begin isNonImmediate: */
				ok = (rcvr & (tagMask())) == 0;
				if (ok) {
					/* begin isClassOfNonImm:equalTo: */
					assert(isNonImmediate(rcvr));
					ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask()));
				}
				/* begin success: */
				if (!ok) {

					/* Don't overwrite an error code that has already been set. */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
				}
				if (!GIV(primFailCode)) {
					/* begin internalStackTopPut: */
					longAtPointerput(localSP, longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(XIndex) << (shiftForWord()))))));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l342;
				}
				GIV(primFailCode) = 0;
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((30 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 0;
				goto normalSend;
			}
	l342:	/* end case */;
			break;
		case 207:
			/* bytecodePrimPointY */
			{
				sqInt classOop;
				sqInt objOop;
				sqInt ok;
				sqInt rcvr;

				VM_LABEL(bytecodePrimPointY);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				rcvr = longAtPointer(localSP);
				/* begin assertClassOf:is: */
				classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
				/* begin isNonImmediate: */
				ok = (rcvr & (tagMask())) == 0;
				if (ok) {
					/* begin isClassOfNonImm:equalTo: */
					assert(isNonImmediate(rcvr));
					ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask()));
				}
				/* begin success: */
				if (!ok) {

					/* Don't overwrite an error code that has already been set. */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
				}
				if (!GIV(primFailCode)) {
					/* begin internalStackTopPut: */
					longAtPointerput(localSP, longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(YIndex) << (shiftForWord()))))));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l350;
				}
				GIV(primFailCode) = 0;
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((0x1F * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 0;
				goto normalSend;
			}
	l350:	/* end case */;
			break;
		case 208:
		case 209:
		case 210:
		case 211:
		case 212:
		case 213:
		case 214:
		case 215:
		case 216:
		case 217:
		case 218:
		case 219:
		case 220:
		case 221:
		case 222:
		case 223:
		case 384: /*128*/
		case 385: /*129*/
		case 386: /*130*/
		case 387: /*131*/
		case 388: /*132*/
		case 389: /*133*/
		case 390: /*134*/
		case 391: /*135*/
		case 392: /*136*/
		case 393: /*137*/
		case 394: /*138*/
		case 395: /*139*/
		case 396: /*140*/
		case 397: /*141*/
		case 398: /*142*/
		case 399: /*143*/
			/* sendLiteralSelector0ArgsBytecode */
			{
				sqInt rcvr;
				sqInt tagBits;

				VM_LABEL(sendLiteralSelector0ArgsBytecode);
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((currentBytecode & 15) + LiteralStart)) << (shiftForWord())))));
				GIV(argumentCount) = 0;
				/* begin internalStackValue: */
				rcvr = longAtPointer(localSP + (0 * BytesPerOop));
				lkupClassTag = (((tagBits = rcvr & (tagMask()))) != 0
					? tagBits
					: (longAt(rcvr)) & (classIndexMask()));
				assert(lkupClassTag != (nilObject()));
				goto commonSendOrdinary;
			}
			break;
		case 224:
		case 225:
		case 226:
		case 227:
		case 228:
		case 229:
		case 230:
		case 231:
		case 232:
		case 233:
		case 234:
		case 235:
		case 236:
		case 237:
		case 238:
		case 239:
		case 400: /*144*/
		case 401: /*145*/
		case 402: /*146*/
		case 403: /*147*/
		case 404: /*148*/
		case 405: /*149*/
		case 406: /*150*/
		case 407: /*151*/
		case 408: /*152*/
		case 409: /*153*/
		case 410: /*154*/
		case 411: /*155*/
		case 412: /*156*/
		case 413: /*157*/
		case 414: /*158*/
		case 415: /*159*/
			/* sendLiteralSelector1ArgBytecode */
			{
				sqInt rcvr;
				sqInt tagBits;

				VM_LABEL(sendLiteralSelector1ArgBytecode);
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((currentBytecode & 15) + LiteralStart)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				/* begin internalStackValue: */
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				lkupClassTag = (((tagBits = rcvr & (tagMask()))) != 0
					? tagBits
					: (longAt(rcvr)) & (classIndexMask()));
				assert(lkupClassTag != (nilObject()));
				goto commonSendOrdinary;
			}
			break;
		case 240:
		case 241:
		case 242:
		case 243:
		case 244:
		case 245:
		case 246:
		case 247:
		case 248:
		case 249:
		case 250:
		case 251:
		case 252:
		case 253:
		case 254:
		case 255:
		case 416: /*160*/
		case 417: /*161*/
		case 418: /*162*/
		case 419: /*163*/
		case 420: /*164*/
		case 421: /*165*/
		case 422: /*166*/
		case 423: /*167*/
		case 424: /*168*/
		case 425: /*169*/
		case 426: /*170*/
		case 427: /*171*/
		case 428: /*172*/
		case 429: /*173*/
		case 430: /*174*/
		case 431: /*175*/
			/* sendLiteralSelector2ArgsBytecode */
			{
				sqInt rcvr;
				sqInt tagBits;

				VM_LABEL(sendLiteralSelector2ArgsBytecode);
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(((currentBytecode & 15) + LiteralStart)) << (shiftForWord())))));
				GIV(argumentCount) = 2;
				/* begin internalStackValue: */
				rcvr = longAtPointer(localSP + (2 * BytesPerOop));
				lkupClassTag = (((tagBits = rcvr & (tagMask()))) != 0
					? tagBits
					: (longAt(rcvr)) & (classIndexMask()));
				assert(lkupClassTag != (nilObject()));
				goto commonSendOrdinary;
			}
			break;
		case 338: /*82*/
			/* extPushPseudoVariable */
			{
				sqInt objOop;
				sqInt objOop1;
				sqInt theThingToPush;

				VM_LABEL(extPushPseudoVariable);
				
				switch (extB) {
				case 0:
					/* begin ensureFrameIsMarried:SP: */
					if (((((usqInt)(longAt(localFP + FoxMethod)))) < (startOfMemory())
						? ((longAt(localFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
						: (byteAt((localFP + FoxIFrameFlags) + 2)) != 0)) {
						assert(isContext(frameContext(localFP)));
						theThingToPush = longAt(localFP + FoxThisContext);
						goto l383;
					}
					theThingToPush = marryFrameSP(localFP, localSP);
	l383:	/* end ensureFrameIsMarried:SP: */;
					break;
				case 1:
					/* begin activeProcess */
					objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
					objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
					theThingToPush = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
					break;
				default:
					goto respondToUnknownBytecode;

				}
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), theThingToPush);
				extB = 0;
				numExtB = 0;
			}
			break;
		case 340: /*84*/
		case 341: /*85*/
		case 342: /*86*/
		case 343: /*87*/
		case 474: /*218*/
		case 475: /*219*/
		case 476: /*220*/
		case 477: /*221*/
		case 478: /*222*/
		case 479: /*223*/
		case 486: /*230*/
		case 502: /*246*/
		case 503: /*247*/
		case 510: /*254*/
		case 511: /*255*/
			/* unknownBytecode */
			{
				VM_LABEL(unknownBytecode1);
				goto respondToUnknownBytecode;
			}
			break;
		case 344: /*88*/
			/* returnReceiver */
			{
				VM_LABEL(returnReceiver1);
				/* begin receiver */
				localReturnValue = longAt(localFP + FoxIFReceiver);
				goto commonReturn;
			}
			break;
		case 349: /*93*/
			/* returnNilFromBlock */
			{
				VM_LABEL(returnNilFromBlock);
				/* begin nilObject */
				localReturnValue = GIV(nilObj);
				goto commonCallerReturn;
			}
			break;
		case 350: /*94*/
			/* returnTopFromBlock */
			{
				VM_LABEL(returnTopFromBlock1);
				/* begin internalStackTop */
				localReturnValue = longAtPointer(localSP);
				goto commonCallerReturn;
			}
			break;
		case 351: /*95*/
			/* extNopBytecode */
			{
				VM_LABEL(extNopBytecode);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				numExtB = (extA = (extB = 0));
			}
			break;
		case 352: /*96*/
			/* bytecodePrimAdd */
			{
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				sqInt result;
				double result1;
				double result2;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				char *sp;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimAdd1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					result = ((rcvr >> 3)) + ((arg >> 3));
					if ((((((usqInt) result) >> 60) + 1) & 15) <= 1) {
						/* begin internalPop:thenPush: */
						longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 3) | 1));
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l393;
					}
				}
				else {
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin primitiveFloatAdd:toArg: */
					if (((tagBits = rcvr & (tagMask()))) != 0) {
						if (tagBits == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(rcvr));
							rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
							if (rot > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
							bits = rot;
							memcpy((&value), (&bits), sizeof(value));
							rcvr1 = value;
							goto l394;
						}
						if ((tagBits == (smallIntegerTag()))
						 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
							rcvr1 = ((double) ((rcvr >> 3)) );
							goto l394;
						}
					}
					else {
						if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(rcvr + BaseHeaderSize, result2);
							rcvr1 = result2;
							goto l394;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					rcvr1 = 0.0;
	l394:	/* end loadFloatOrIntFrom: */;
					/* begin loadFloatOrIntFrom: */
					if (((tagBits1 = arg & (tagMask()))) != 0) {
						if (tagBits1 == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(arg));
							rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
							if (rot1 > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
							bits1 = rot1;
							memcpy((&value1), (&bits1), sizeof(value1));
							arg1 = value1;
							goto l398;
						}
						if ((tagBits1 == (smallIntegerTag()))
						 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
							arg1 = ((double) ((arg >> 3)) );
							goto l398;
						}
					}
					else {
						if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(arg + BaseHeaderSize, result1);
							arg1 = result1;
							goto l398;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					arg1 = 0.0;
	l398:	/* end loadFloatOrIntFrom: */;
					if (!GIV(primFailCode)) {
						/* begin pop:thenPushFloat: */
						longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 + arg1));
						GIV(stackPointer) = sp;
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l393;
					}
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((0 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l393:	/* end case */;
			break;
		case 353: /*97*/
			/* bytecodePrimSubtract */
			{
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				sqInt result;
				double result1;
				double result2;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				char *sp;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimSubtract1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					result = ((rcvr >> 3)) - ((arg >> 3));
					if ((((((usqInt) result) >> 60) + 1) & 15) <= 1) {
						/* begin internalPop:thenPush: */
						longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 3) | 1));
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l404;
					}
				}
				else {
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin primitiveFloatSubtract:fromArg: */
					if (((tagBits = rcvr & (tagMask()))) != 0) {
						if (tagBits == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(rcvr));
							rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
							if (rot > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
							bits = rot;
							memcpy((&value), (&bits), sizeof(value));
							rcvr1 = value;
							goto l405;
						}
						if ((tagBits == (smallIntegerTag()))
						 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
							rcvr1 = ((double) ((rcvr >> 3)) );
							goto l405;
						}
					}
					else {
						if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(rcvr + BaseHeaderSize, result2);
							rcvr1 = result2;
							goto l405;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					rcvr1 = 0.0;
	l405:	/* end loadFloatOrIntFrom: */;
					/* begin loadFloatOrIntFrom: */
					if (((tagBits1 = arg & (tagMask()))) != 0) {
						if (tagBits1 == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(arg));
							rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
							if (rot1 > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
							bits1 = rot1;
							memcpy((&value1), (&bits1), sizeof(value1));
							arg1 = value1;
							goto l409;
						}
						if ((tagBits1 == (smallIntegerTag()))
						 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
							arg1 = ((double) ((arg >> 3)) );
							goto l409;
						}
					}
					else {
						if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(arg + BaseHeaderSize, result1);
							arg1 = result1;
							goto l409;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					arg1 = 0.0;
	l409:	/* end loadFloatOrIntFrom: */;
					if (!GIV(primFailCode)) {
						/* begin pop:thenPushFloat: */
						longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 - arg1));
						GIV(stackPointer) = sp;
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l404;
					}
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((1 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l404:	/* end case */;
			break;
		case 354: /*98*/
			/* bytecodePrimLessThanSistaV1 */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimLessThanSistaV1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {

					/* The C code can avoid detagging since tagged integers are still signed.
					   But this means the simulator must override to do detagging. */
					/* begin booleanCheatSistaV1: */
					if (rcvr < arg) {
						/* goto booleanCheatTrueSistaV1 */
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l415;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatLess:thanArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l421;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l421;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l421;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l421:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l420;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l420;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l420;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l420:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 < arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheatSistaV1: */
					if (aBool) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l415;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((2 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l415:	/* end case */;
			
		booleanCheatTrueSistaV1:
			/* booleanCheatTrueSistaV1 */
			{
				sqInt bytecode;
				sqInt offset;

				VM_LABEL(booleanCheatTrueSistaV1);
				
				/* assume next bytecode is jumpIfFalse (99%) */
				bytecode = byteAtPointer(++localIP);
				/* begin internalPop: */
				localSP += 2 * BytesPerOop;
				if (bytecode >= 192) {
					if (bytecode <= 199) {

						/* short jumpIfFalse 192 - 199 */
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l814;
					}
					if (bytecode == 239) {

						/* long jumpIfFalse */
						byteAtPointer(++localIP);
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l814;
					}
					if (bytecode == 238) {

						/* long jumpIfTrue 238 */
						offset = byteAtPointer(++localIP);
						/* begin jump: */
						localIP = (localIP + offset) + 1;
						
#            if MULTIPLEBYTECODESETS
						currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#            else /* MULTIPLEBYTECODESETS */
						currentBytecode = byteAtPointer(localIP);
#            endif /* MULTIPLEBYTECODESETS */
						goto l814;
					}
				}
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = bytecode + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = bytecode;
#        endif /* MULTIPLEBYTECODESETS */
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), GIV(trueObj));
			}
	l814:	/* end case */;
			break;
		case 355: /*99*/
			/* bytecodePrimGreaterThanSistaV1 */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimGreaterThanSistaV1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {

					/* The C code can avoid detagging since tagged integers are still signed.
					   But this means the simulator must override to do detagging. */
					/* begin booleanCheatSistaV1: */
					if (rcvr > arg) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						/* goto booleanCheatFalseSistaV1 */
					}
					goto l425;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatGreater:thanArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l431;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l431;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l431;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l431:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l430;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l430;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l430;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l430:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 > arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheatSistaV1: */
					if (aBool) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l425;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((3 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l425:	/* end case */;
			
		booleanCheatFalseSistaV1:
			/* booleanCheatFalseSistaV1 */
			{
				sqInt bytecode;
				sqInt offset;

				VM_LABEL(booleanCheatFalseSistaV1);
				
				/* assume next bytecode is jumpIfFalse (99%) */
				bytecode = byteAtPointer(++localIP);
				/* begin internalPop: */
				localSP += 2 * BytesPerOop;
				if ((bytecode < 199)
				 && (bytecode > 191)) {

					/* short jumpIfFalse */
					/* begin jump: */
					localIP = (localIP + (bytecode - 191)) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
					goto l817;
				}
				if (bytecode == 239) {

					/* long jumpIfFalse */
					offset = byteAtPointer(++localIP);
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
					goto l817;
				}
				
#        if MULTIPLEBYTECODESETS
				currentBytecode = bytecode + GIV(bytecodeSetSelector);
#        else /* MULTIPLEBYTECODESETS */
				currentBytecode = bytecode;
#        endif /* MULTIPLEBYTECODESETS */
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), GIV(falseObj));
			}
	l817:	/* end case */;
			break;
		case 356: /*100*/
			/* bytecodePrimLessOrEqualSistaV1 */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimLessOrEqualSistaV1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {

					/* The C code can avoid detagging since tagged integers are still signed.
					   But this means the simulator must override to do detagging. */
					/* begin booleanCheatSistaV1: */
					if (rcvr <= arg) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l435;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatLessOrEqual:toArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l441;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l441;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l441;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l441:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l440;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l440;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l440;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l440:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 <= arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheatSistaV1: */
					if (aBool) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l435;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((4 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l435:	/* end case */;
			break;
		case 357: /*101*/
			/* bytecodePrimGreaterOrEqualSistaV1 */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimGreaterOrEqualSistaV1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {

					/* The C code can avoid detagging since tagged integers are still signed.
					   But this means the simulator must override to do detagging. */
					/* begin booleanCheatSistaV1: */
					if (rcvr >= arg) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l445;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatGreaterOrEqual:toArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l451;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l451;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l451;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l451:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l450;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l450;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l450;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l450:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 >= arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheatSistaV1: */
					if (aBool) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l445;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((5 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l445:	/* end case */;
			break;
		case 358: /*102*/
			/* bytecodePrimEqualSistaV1 */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimEqualSistaV1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					/* begin booleanCheatSistaV1: */
					if (rcvr == arg) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l455;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatEqual:toArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l461;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l461;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l461;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l461:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l460;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l460;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l460;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l460:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 == arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheatSistaV1: */
					if (aBool) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l455;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((6 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l455:	/* end case */;
			break;
		case 359: /*103*/
			/* bytecodePrimNotEqualSistaV1 */
			{
				sqInt aBool;
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				double result;
				double result1;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimNotEqualSistaV1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					/* begin booleanCheatSistaV1: */
					if (rcvr != arg) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l465;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin primitiveFloatEqual:toArg: */
				if (((tagBits = rcvr & (tagMask()))) != 0) {
					if (tagBits == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(rcvr));
						rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
						if (rot > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
						bits = rot;
						memcpy((&value), (&bits), sizeof(value));
						rcvr1 = value;
						goto l471;
					}
					if ((tagBits == (smallIntegerTag()))
					 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
						rcvr1 = ((double) ((rcvr >> 3)) );
						goto l471;
					}
				}
				else {
					if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(rcvr + BaseHeaderSize, result);
						rcvr1 = result;
						goto l471;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				rcvr1 = 0.0;
	l471:	/* end loadFloatOrIntFrom: */;
				/* begin loadFloatOrIntFrom: */
				if (((tagBits1 = arg & (tagMask()))) != 0) {
					if (tagBits1 == (smallFloatTag())) {
						/* begin smallFloatValueOf: */
						assert(isImmediateFloat(arg));
						rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
						if (rot1 > 1) {

							/* a.k.a. ~= +/-0.0 */
							rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
						}
						/* begin rotateRight: */
						rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
						bits1 = rot1;
						memcpy((&value1), (&bits1), sizeof(value1));
						arg1 = value1;
						goto l470;
					}
					if ((tagBits1 == (smallIntegerTag()))
					 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
					(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
						arg1 = ((double) ((arg >> 3)) );
						goto l470;
					}
				}
				else {
					if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
						fetchFloatAtinto(arg + BaseHeaderSize, result1);
						arg1 = result1;
						goto l470;
					}
				}
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				arg1 = 0.0;
	l470:	/* end loadFloatOrIntFrom: */;
				aBool = rcvr1 == arg1;
				if (!GIV(primFailCode)) {
					/* begin booleanCheatSistaV1: */
					if (!aBool) {
						goto booleanCheatTrueSistaV1;
					}
					else {
						goto booleanCheatFalseSistaV1;
					}
					goto l465;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((7 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l465:	/* end case */;
			break;
		case 360: /*104*/
			/* bytecodePrimMultiply */
			{
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt oop;
				sqInt overflow;
				sqInt rcvr;
				double rcvr1;
				sqInt result;
				double result1;
				double result2;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				char *sp;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimMultiply1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					rcvr = (rcvr >> 3);
					arg = (arg >> 3);
					overflow = (rcvr > 0
						? (arg > 0
								? rcvr > ((MaxSmallInteger) / arg)
								: arg < ((MinSmallInteger) / rcvr))
						: (arg > 0
								? rcvr < ((MinSmallInteger) / arg)
								: (rcvr < 0)
									 && (arg < ((MaxSmallInteger) / rcvr))));
					if (!overflow) {
						result = rcvr * arg;
						oop = (((usqInt)result << 3) | 1);
						/* begin internalPop:thenPush: */
						longAtPointerput((localSP += (2 - 1) * BytesPerOop), oop);
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l475;
					}
				}
				else {
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin primitiveFloatMultiply:byArg: */
					if (((tagBits = rcvr & (tagMask()))) != 0) {
						if (tagBits == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(rcvr));
							rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
							if (rot > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
							bits = rot;
							memcpy((&value), (&bits), sizeof(value));
							rcvr1 = value;
							goto l476;
						}
						if ((tagBits == (smallIntegerTag()))
						 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
							rcvr1 = ((double) ((rcvr >> 3)) );
							goto l476;
						}
					}
					else {
						if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(rcvr + BaseHeaderSize, result2);
							rcvr1 = result2;
							goto l476;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					rcvr1 = 0.0;
	l476:	/* end loadFloatOrIntFrom: */;
					/* begin loadFloatOrIntFrom: */
					if (((tagBits1 = arg & (tagMask()))) != 0) {
						if (tagBits1 == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(arg));
							rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
							if (rot1 > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
							bits1 = rot1;
							memcpy((&value1), (&bits1), sizeof(value1));
							arg1 = value1;
							goto l480;
						}
						if ((tagBits1 == (smallIntegerTag()))
						 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
							arg1 = ((double) ((arg >> 3)) );
							goto l480;
						}
					}
					else {
						if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(arg + BaseHeaderSize, result1);
							arg1 = result1;
							goto l480;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					arg1 = 0.0;
	l480:	/* end loadFloatOrIntFrom: */;
					if (!GIV(primFailCode)) {
						/* begin pop:thenPushFloat: */
						longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 * arg1));
						GIV(stackPointer) = sp;
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l475;
					}
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((8 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l475:	/* end case */;
			break;
		case 361: /*105*/
			/* bytecodePrimDivide */
			{
				sqInt arg;
				double arg1;
				usqLong bits;
				usqLong bits1;
				sqInt objOop;
				sqInt rcvr;
				double rcvr1;
				sqInt result;
				double result1;
				double result2;
				usqLong rot;
				usqLong rot1;
				sqInt shift;
				sqInt shift1;
				char *sp;
				sqInt tagBits;
				sqInt tagBits1;
				double value;
				double value1;

				VM_LABEL(bytecodePrimDivide1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if ((rcvr & arg) & (smallIntegerTag())) {
					rcvr = (rcvr >> 3);
					arg = (arg >> 3);
					if ((arg != 0)
					 && ((rcvr % arg) == 0)) {

						/* generates C / operation */
						result = rcvr / arg;
						if ((((((usqInt) result) >> 60) + 1) & 15) <= 1) {
							/* begin internalPop:thenPush: */
							longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)result << 3) | 1));
							/* begin fetchNextBytecode */
							currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
							goto l486;
						}
					}
				}
				else {
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin primitiveFloatDivide:byArg: */
					if (((tagBits = rcvr & (tagMask()))) != 0) {
						if (tagBits == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(rcvr));
							rot = ((usqInt) (((usqInt)rcvr))) >> (numTagBits());
							if (rot > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
							bits = rot;
							memcpy((&value), (&bits), sizeof(value));
							rcvr1 = value;
							goto l487;
						}
						if ((tagBits == (smallIntegerTag()))
						 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(rcvr) << shift)))) >> shift) == rcvr))) {
							rcvr1 = ((double) ((rcvr >> 3)) );
							goto l487;
						}
					}
					else {
						if (((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(rcvr + BaseHeaderSize, result2);
							rcvr1 = result2;
							goto l487;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					rcvr1 = 0.0;
	l487:	/* end loadFloatOrIntFrom: */;
					/* begin loadFloatOrIntFrom: */
					if (((tagBits1 = arg & (tagMask()))) != 0) {
						if (tagBits1 == (smallFloatTag())) {
							/* begin smallFloatValueOf: */
							assert(isImmediateFloat(arg));
							rot1 = ((usqInt) (((usqInt)arg))) >> (numTagBits());
							if (rot1 > 1) {

								/* a.k.a. ~= +/-0.0 */
								rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
							}
							/* begin rotateRight: */
							rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
							bits1 = rot1;
							memcpy((&value1), (&bits1), sizeof(value1));
							arg1 = value1;
							goto l491;
						}
						if ((tagBits1 == (smallIntegerTag()))
						 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
						(((sqInt) (((sqInt)((usqInt)(arg) << shift1)))) >> shift1) == arg))) {
							arg1 = ((double) ((arg >> 3)) );
							goto l491;
						}
					}
					else {
						if (((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex) {
							fetchFloatAtinto(arg + BaseHeaderSize, result1);
							arg1 = result1;
							goto l491;
						}
					}
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					arg1 = 0.0;
	l491:	/* end loadFloatOrIntFrom: */;
					/* begin success: */
					if (!(arg1 != 0.0)) {

						/* Don't overwrite an error code that has already been set. */
						if (!GIV(primFailCode)) {
							GIV(primFailCode) = 1;
						}
					}
					if (!GIV(primFailCode)) {
						/* begin pop:thenPushFloat: */
						longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr1 / arg1));
						GIV(stackPointer) = sp;
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l486;
					}
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((9 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l486:	/* end case */;
			break;
		case 362: /*106*/
			/* bytecodePrimMod */
			{
				sqInt mod;
				sqInt objOop;

				VM_LABEL(bytecodePrimMod1);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				mod = doPrimitiveModby(longAtPointer(localSP + (1 * BytesPerOop)), longAtPointer(localSP + (0 * BytesPerOop)));
				if (!GIV(primFailCode)) {
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)mod << 3) | 1));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l497;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((10 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l497:	/* end case */;
			break;
		case 363: /*107*/
			/* bytecodePrimMakePoint */
			{
				sqInt arg;
				sqInt classObj;
				sqInt knownClassIndex;
				usqInt newObj;
				usqInt numBytes;
				sqInt numSlots;
				sqInt objFormat;
				sqInt objOop;
				usqInt pt;
				sqInt rcvr;

				VM_LABEL(bytecodePrimMakePoint1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP);
				if (((rcvr & (tagMask())
					? !(rcvr & (characterTag()))
					: ((longAt(rcvr)) & (classIndexMask())) == ClassFloatCompactIndex))
				 && ((arg & (tagMask())
					? !(arg & (characterTag()))
					: ((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex))) {
					/* begin eeInstantiateSmallClass:numSlots: */
					classObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
					numSlots = YIndex + 1;
					assert((rawHashBitsOf(classObj)) != 0);
					/* begin eeInstantiateSmallClassIndex:format:numSlots: */
					knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
					/* begin instSpecOfClassFormat: */
					objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3))) >> (fixedFieldsFieldWidth())) & (formatMask());
					assert((numSlots >= 0)
					 && ((knownClassIndex != 0)
					 && ((knownClassAtIndex(knownClassIndex)) != GIV(nilObj))));
					assert(((objFormat < (firstByteFormat())
						? objFormat
						: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex))));
					/* begin allocateSmallNewSpaceSlots:format:classIndex: */
					assert(numSlots < (numSlotsMask()));
					newObj = GIV(freeStart);
					numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
					assert((numBytes % (allocationUnit())) == 0);
					assert((newObj % (allocationUnit())) == 0);
					if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
						if (!GIV(needGCFlag)) {
							/* begin scheduleScavenge */
							GIV(needGCFlag) = 1;
							forceInterruptCheck();
						}
						if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
							error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
							pt = 0;
							goto l504;
						}
					}
					long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex);
					GIV(freeStart) += numBytes;
					pt = newObj;
	l504:	/* end eeInstantiateSmallClass:numSlots: */;
					/* begin storePointerUnchecked:ofObject:withValue: */
					assert(!(isOopForwarded(pt)));
					longAtput((pt + BaseHeaderSize) + (((sqInt)((usqInt)(XIndex) << (shiftForWord())))), rcvr);
					/* begin storePointerUnchecked:ofObject:withValue: */
					assert(!(isOopForwarded(pt)));
					longAtput((pt + BaseHeaderSize) + (((sqInt)((usqInt)(YIndex) << (shiftForWord())))), arg);
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP += (2 - 1) * BytesPerOop), pt);
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l501;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((11 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l501:	/* end case */;
			break;
		case 364: /*108*/
			/* bytecodePrimBitShift */
			{
				sqInt integerArgument;
				sqInt integerReceiver;
				sqInt objOop;
				sqInt shifted;
				char *sp;

				VM_LABEL(bytecodePrimBitShift1);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin externalizeIPandSP */
				assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
				GIV(instructionPointer) = oopForPointer(localIP);
				GIV(stackPointer) = localSP;
				GIV(framePointer) = localFP;
				/* begin primitiveBitShift */
				integerArgument = longAt(GIV(stackPointer));
				if (!((((integerArgument) & 7) == 1))) {
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					goto l514;
				}
				integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
				integerReceiver = signed64BitValueOf(integerReceiver);
				if (!GIV(primFailCode)) {
					if (((integerArgument = (integerArgument >> 3))) >= 0) {

						/* Left shift -- must fail bits would be lost */
						if (!(integerArgument <= 61 /* numSmallIntegerBits */)) {
							/* begin primitiveFail */
							if (!GIV(primFailCode)) {
								GIV(primFailCode) = 1;
							}
							goto l514;
						}
						shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument));
						if (!(integerReceiver == (((sqInt) shifted) >> integerArgument))) {
							/* begin primitiveFail */
							if (!GIV(primFailCode)) {
								GIV(primFailCode) = 1;
							}
							goto l514;
						}
					}
					else {

						/* Right shift -- OK to lose bits */
						if (!(integerArgument >= (-61 /* numSmallIntegerBits */))) {
							/* begin primitiveFail */
							if (!GIV(primFailCode)) {
								GIV(primFailCode) = 1;
							}
							goto l514;
						}
						shifted = ((sqInt) integerReceiver) >> (0 - integerArgument);
					}
					shifted = ((((((usqInt) shifted) >> 60) + 1) & 15) <= 1
						? (((usqInt)shifted << 3) | 1)
						: signed64BitIntegerFor(shifted));
					/* begin pop:thenPush: */
					longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
					GIV(stackPointer) = sp;
				}
	l514:	/* end primitiveBitShift */;
				/* begin internalizeIPandSP */
				assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
				localIP = pointerForOop(GIV(instructionPointer));
				localSP = pointerForOop(GIV(stackPointer));
				localFP = pointerForOop(GIV(framePointer));
				if (!GIV(primFailCode)) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l510;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((12 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l510:	/* end case */;
			break;
		case 365: /*109*/
			/* bytecodePrimDiv */
			{
				sqInt objOop;
				sqInt quotient;

				VM_LABEL(bytecodePrimDiv1);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				quotient = doPrimitiveDivby(longAtPointer(localSP + (1 * BytesPerOop)), longAtPointer(localSP + (0 * BytesPerOop)));
				if (!GIV(primFailCode)) {
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP += (2 - 1) * BytesPerOop), (((usqInt)quotient << 3) | 1));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l516;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((13 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l516:	/* end case */;
			break;
		case 366: /*110*/
			/* bytecodePrimBitAnd */
			{
				sqInt arg;
				sqInt objOop;
				sqInt rcvr;

				VM_LABEL(bytecodePrimBitAnd1);
				arg = longAtPointer(localSP);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				if (((((arg) & 7) == 1))
				 && ((((rcvr) & 7) == 1))) {
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP += (2 - 1) * BytesPerOop), arg & rcvr);
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l520;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin externalizeIPandSP */
				assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
				GIV(instructionPointer) = oopForPointer(localIP);
				GIV(stackPointer) = localSP;
				GIV(framePointer) = localFP;
				primitiveBitAnd();
				/* begin internalizeIPandSP */
				assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
				localIP = pointerForOop(GIV(instructionPointer));
				localSP = pointerForOop(GIV(stackPointer));
				localFP = pointerForOop(GIV(framePointer));
				if (!GIV(primFailCode)) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l520;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((14 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l520:	/* end case */;
			break;
		case 367: /*111*/
			/* bytecodePrimBitOr */
			{
				sqInt arg;
				sqInt objOop;
				sqInt rcvr;

				VM_LABEL(bytecodePrimBitOr1);
				arg = longAtPointer(localSP);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				if (((((arg) & 7) == 1))
				 && ((((rcvr) & 7) == 1))) {
					/* begin internalPop:thenPush: */
					longAtPointerput((localSP += (2 - 1) * BytesPerOop), arg | rcvr);
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l525;
				}
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				/* begin externalizeIPandSP */
				assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
				GIV(instructionPointer) = oopForPointer(localIP);
				GIV(stackPointer) = localSP;
				GIV(framePointer) = localFP;
				primitiveBitOr();
				/* begin internalizeIPandSP */
				assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
				localIP = pointerForOop(GIV(instructionPointer));
				localSP = pointerForOop(GIV(stackPointer));
				localFP = pointerForOop(GIV(framePointer));
				if (!GIV(primFailCode)) {
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l525;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((15 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 1;
				goto normalSend;
			}
	l525:	/* end case */;
			break;
		case 370: /*114*/
			/* bytecodePrimSize */
			{
				sqInt ccIndex;
				sqInt ccIndex1;
				sqInt classOop;
				sqInt classOop1;
				sqInt fmt;
				sqInt fmt1;
				sqInt isArray;
				sqInt isString;
				usqInt numSlots;
				usqInt numSlots1;
				usqInt numSlots11;
				usqInt numSlots2;
				sqInt objOop;
				sqInt rcvr;
				sqInt sz;

				VM_LABEL(bytecodePrimSize1);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;

				/* Shortcut the mega-lookup for ByteString and Array, the two big consumers of cycles
				   here. Both of these have compact class indices and neither has any added fields. */
				rcvr = longAtPointer(localSP);
				/* begin is:instanceOf:compactClassIndex: */
				classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassByteString) << (shiftForWord())))));
				if (rcvr & (tagMask())) {
					isString = 0;
					goto l543;
				}
				/* begin isClassOfNonImm:equalTo:compactClassIndex: */
				assert(!(isImmediate(rcvr)));
				/* begin classIndexOf: */
				ccIndex = (longAt(rcvr)) & (classIndexMask());
				isString = ClassByteStringCompactIndex == ccIndex;
				goto l543;
	l543:	/* end is:instanceOf:compactClassIndex: */;
				if (isString) {
					/* begin lengthOf:format: */
					fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
					/* begin numSlotsOfAny: */
					numSlots1 = byteAt(rcvr + 7);
					numSlots = (numSlots1 == (numSlotsMask())
						? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
						: numSlots1);
					if (fmt <= 5 /* ephemeronFormat */) {
						sz = numSlots;
						goto l545;
					}
					if (fmt >= (firstByteFormat())) {

						/* bytes, including CompiledMethod */
						sz = (numSlots << (shiftForWord())) - (fmt & 7);
						goto l545;
					}
					if (fmt >= (firstShortFormat())) {
						sz = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
						goto l545;
					}
					if (fmt >= (firstLongFormat())) {
						sz = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
						goto l545;
					}
					if (fmt == (sixtyFourBitIndexableFormat())) {
						sz = numSlots;
						goto l545;
					}
					sz = 0;
	l545:	/* end lengthOf:format: */;
					longAtPointerput(localSP, (((usqInt)sz << 3) | 1));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l534;
				}
				/* begin is:instanceOf:compactClassIndex: */
				classOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassArray) << (shiftForWord())))));
				if (rcvr & (tagMask())) {
					isArray = 0;
					goto l546;
				}
				/* begin isClassOfNonImm:equalTo:compactClassIndex: */
				assert(!(isImmediate(rcvr)));
				/* begin classIndexOf: */
				ccIndex1 = (longAt(rcvr)) & (classIndexMask());
				isArray = ClassArrayCompactIndex == ccIndex1;
				goto l546;
	l546:	/* end is:instanceOf:compactClassIndex: */;
				if (isArray) {
					/* begin lengthOf:format: */
					fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
					/* begin numSlotsOfAny: */
					numSlots11 = byteAt(rcvr + 7);
					numSlots2 = (numSlots11 == (numSlotsMask())
						? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
						: numSlots11);
					if (fmt1 <= 5 /* ephemeronFormat */) {
						sz = numSlots2;
						goto l544;
					}
					if (fmt1 >= (firstByteFormat())) {

						/* bytes, including CompiledMethod */
						sz = (numSlots2 << (shiftForWord())) - (fmt1 & 7);
						goto l544;
					}
					if (fmt1 >= (firstShortFormat())) {
						sz = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3);
						goto l544;
					}
					if (fmt1 >= (firstLongFormat())) {
						sz = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1);
						goto l544;
					}
					if (fmt1 == (sixtyFourBitIndexableFormat())) {
						sz = numSlots2;
						goto l544;
					}
					sz = 0;
	l544:	/* end lengthOf:format: */;
					longAtPointerput(localSP, (((usqInt)sz << 3) | 1));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l534;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((18 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 0;
				goto normalSend;
			}
	l534:	/* end case */;
			break;
		case 374: /*118*/
			/* bytecodePrimIdenticalSistaV1 */
			{
				sqInt arg;
				sqInt rcvr;

				VM_LABEL(bytecodePrimIdenticalSistaV1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if (((rcvr & (tagMask())) == 0)
				 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					rcvr = handleSpecialSelectorSendFaultForfpsp(rcvr, localFP, localSP);
				}
				if (((arg & (tagMask())) == 0)
				 && (((longAt(arg)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					arg = handleSpecialSelectorSendFaultForfpsp(arg, localFP, localSP);
				}
				/* begin booleanCheatSistaV1: */
				if (rcvr == arg) {
					goto booleanCheatTrueSistaV1;
				}
				else {
					goto booleanCheatFalseSistaV1;
				}
			}
			break;
		case 376: /*120*/
			/* bytecodePrimNotIdenticalSistaV1 */
			{
				sqInt arg;
				sqInt rcvr;

				VM_LABEL(bytecodePrimNotIdenticalSistaV1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				arg = longAtPointer(localSP + (0 * BytesPerOop));
				if (((rcvr & (tagMask())) == 0)
				 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					rcvr = handleSpecialSelectorSendFaultForfpsp(rcvr, localFP, localSP);
				}
				if (((arg & (tagMask())) == 0)
				 && (((longAt(arg)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					arg = handleSpecialSelectorSendFaultForfpsp(arg, localFP, localSP);
				}
				/* begin booleanCheatSistaV1: */
				if (rcvr != arg) {
					goto booleanCheatTrueSistaV1;
				}
				else {
					goto booleanCheatFalseSistaV1;
				}
			}
			break;
		case 377: /*121*/
			/* bytecodePrimValue */
			{
				sqInt ccIndex;
				sqInt classOop;
				sqInt isBlock;
				sqInt objOop;
				sqInt rcvr;

				VM_LABEL(bytecodePrimValue1);
				rcvr = longAtPointer(localSP);
				GIV(argumentCount) = 0;
				/* begin is:instanceOf:compactClassIndex: */
				classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassBlockClosure) << (shiftForWord())))));
				if (rcvr & (tagMask())) {
					isBlock = 0;
					goto l557;
				}
				/* begin isClassOfNonImm:equalTo:compactClassIndex: */
				assert(!(isImmediate(rcvr)));
				/* begin classIndexOf: */
				ccIndex = (longAt(rcvr)) & (classIndexMask());
				isBlock = ClassBlockClosureCompactIndex == ccIndex;
				goto l557;
	l557:	/* end is:instanceOf:compactClassIndex: */;
				if (isBlock) {
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					primitiveClosureValue();
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l555;
					}
					GIV(primFailCode) = 0;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((25 * 2)) << (shiftForWord())))));
				goto normalSend;
			}
	l555:	/* end case */;
			break;
		case 378: /*122*/
			/* bytecodePrimValueWithArg */
			{
				sqInt ccIndex;
				sqInt classOop;
				sqInt isBlock;
				sqInt objOop;
				sqInt rcvr;

				VM_LABEL(bytecodePrimValueWithArg1);
				rcvr = longAtPointer(localSP + (1 * BytesPerOop));
				GIV(argumentCount) = 1;
				/* begin is:instanceOf:compactClassIndex: */
				classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassBlockClosure) << (shiftForWord())))));
				if (rcvr & (tagMask())) {
					isBlock = 0;
					goto l563;
				}
				/* begin isClassOfNonImm:equalTo:compactClassIndex: */
				assert(!(isImmediate(rcvr)));
				/* begin classIndexOf: */
				ccIndex = (longAt(rcvr)) & (classIndexMask());
				isBlock = ClassBlockClosureCompactIndex == ccIndex;
				goto l563;
	l563:	/* end is:instanceOf:compactClassIndex: */;
				if (isBlock) {
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					/* begin initPrimCall */
					GIV(primFailCode) = 0;
					primitiveClosureValue();
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (!GIV(primFailCode)) {
						/* begin fetchNextBytecode */
						currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
						goto l561;
					}
					GIV(primFailCode) = 0;
				}
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((26 * 2)) << (shiftForWord())))));
				goto normalSend;
			}
	l561:	/* end case */;
			break;
		case 382: /*126*/
			/* bytecodePrimPointX */
			{
				sqInt classOop;
				sqInt objOop;
				sqInt ok;
				sqInt rcvr;

				VM_LABEL(bytecodePrimPointX1);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				rcvr = longAtPointer(localSP);
				/* begin assertClassOf:is: */
				classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
				/* begin isNonImmediate: */
				ok = (rcvr & (tagMask())) == 0;
				if (ok) {
					/* begin isClassOfNonImm:equalTo: */
					assert(isNonImmediate(rcvr));
					ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask()));
				}
				/* begin success: */
				if (!ok) {

					/* Don't overwrite an error code that has already been set. */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
				}
				if (!GIV(primFailCode)) {
					/* begin internalStackTopPut: */
					longAtPointerput(localSP, longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(XIndex) << (shiftForWord()))))));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l573;
				}
				GIV(primFailCode) = 0;
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((30 * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 0;
				goto normalSend;
			}
	l573:	/* end case */;
			break;
		case 383: /*127*/
			/* bytecodePrimPointY */
			{
				sqInt classOop;
				sqInt objOop;
				sqInt ok;
				sqInt rcvr;

				VM_LABEL(bytecodePrimPointY1);
				/* begin initPrimCall */
				GIV(primFailCode) = 0;
				rcvr = longAtPointer(localSP);
				/* begin assertClassOf:is: */
				classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
				/* begin isNonImmediate: */
				ok = (rcvr & (tagMask())) == 0;
				if (ok) {
					/* begin isClassOfNonImm:equalTo: */
					assert(isNonImmediate(rcvr));
					ok = ((longAt(rcvr)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask()));
				}
				/* begin success: */
				if (!ok) {

					/* Don't overwrite an error code that has already been set. */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
				}
				if (!GIV(primFailCode)) {
					/* begin internalStackTopPut: */
					longAtPointerput(localSP, longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(YIndex) << (shiftForWord()))))));
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l581;
				}
				GIV(primFailCode) = 0;
				/* begin fetchPointer:ofObject: */
				objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
				GIV(messageSelector) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((0x1F * 2)) << (shiftForWord())))));
				GIV(argumentCount) = 0;
				goto normalSend;
			}
	l581:	/* end case */;
			break;
		case 440: /*184*/
		case 441: /*185*/
		case 442: /*186*/
		case 443: /*187*/
		case 444: /*188*/
		case 445: /*189*/
		case 446: /*190*/
		case 447: /*191*/
			/* shortConditionalJumpTrue */
			{
				sqInt boolean;
				sqInt offset;

				VM_LABEL(shortConditionalJumpTrue);
				/* begin jumplfTrueBy: */
				offset = (currentBytecode & 7) + 1;
				/* begin internalStackTop */
				boolean = longAtPointer(localSP);
				if (boolean == GIV(trueObj)) {
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
				}
				else {
					if (!(boolean == GIV(falseObj))) {
						/* begin internalMustBeBoolean */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorMustBeBoolean) << (shiftForWord())))));
						GIV(argumentCount) = 0;
						goto normalSend;
						goto l597;
					}
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
	l597:	/* end jumplfTrueBy: */;
			}
			break;
		case 448: /*192*/
		case 449: /*193*/
		case 450: /*194*/
		case 451: /*195*/
		case 452: /*196*/
		case 453: /*197*/
		case 454: /*198*/
		case 455: /*199*/
			/* shortConditionalJumpFalse */
			{
				sqInt boolean;
				sqInt offset;

				VM_LABEL(shortConditionalJumpFalse1);
				/* begin jumplfFalseBy: */
				offset = (currentBytecode & 7) + 1;
				/* begin internalStackTop */
				boolean = longAtPointer(localSP);
				if (boolean == GIV(falseObj)) {
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
				}
				else {
					if (!(boolean == GIV(trueObj))) {
						/* begin internalMustBeBoolean */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorMustBeBoolean) << (shiftForWord())))));
						GIV(argumentCount) = 0;
						goto normalSend;
						goto l601;
					}
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
	l601:	/* end jumplfFalseBy: */;
			}
			break;
		case 456: /*200*/
		case 457: /*201*/
		case 458: /*202*/
		case 459: /*203*/
		case 460: /*204*/
		case 461: /*205*/
		case 462: /*206*/
		case 463: /*207*/
			/* storeAndPopReceiverVariableBytecode */
			{
				sqInt instVarIndex;
				sqInt rcvr;
				sqInt top;

				VM_LABEL(storeAndPopReceiverVariableBytecode1);
				/* begin receiver */
				rcvr = longAt(localFP + FoxIFReceiver);
				/* begin internalStackTop */
				top = longAtPointer(localSP);
				instVarIndex = currentBytecode & 7;
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
				/* begin storePointerImmutabilityCheck:ofObject:withValue: */
				
#        if IMMUTABILITY
				assert(!((isImmediate(rcvr))));
				if (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0) {
					/* begin cannotAssign:to:withIndex: */
					longAtPointerput((localSP -= BytesPerOop), rcvr);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), top);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), (((usqInt)(instVarIndex + 1) << 3) | 1));
					/* begin splObj: */
					GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
					GIV(argumentCount) = 2;
					goto normalSend;
					/* return self */
					goto l603;
				}
#        endif /* IMMUTABILITY */
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(rcvr)));
				if ((assert(isNonImmediate(rcvr)),
				oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((top & (tagMask())) == 0)
					 && (oopisLessThan(top, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(rcvr);
						}
					}
				}
				longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(instVarIndex) << (shiftForWord())))), top);
	l603:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
			break;
		case 473: /*217*/
			/* unconditionnalTrapBytecode */
			{
				VM_LABEL(unconditionnalTrapBytecode);
				goto respondToUnknownBytecode;
				goto l613;
			}
	l613:	/* end case */;
			break;
		case 480: /*224*/
			/* extABytecode */
			{
				VM_LABEL(extABytecode);
				extA = (((usqInt) extA << 8)) + (byteAtPointer(++localIP));
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
			break;
		case 481: /*225*/
			/* extBBytecode */
			{
				sqInt byte;

				VM_LABEL(extBBytecode);
				byte = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				extB = ((numExtB == 0)
				 && (byte > 0x7F)
					? byte - 256
					: (((usqInt) extB << 8)) + byte);
				numExtB += 1;
			}
			break;
		case 482: /*226*/
			/* extPushReceiverVariableBytecode */
			{
				sqInt callerContextOrNil;
				char *callerFP;
				sqInt index;
				sqInt obj;
				sqInt object;
				sqInt object1;
				sqInt result;
				sqInt senderOop;
				char *spouseFP;
				StackPage *thePage;
				sqInt value;

				VM_LABEL(extPushReceiverVariableBytecode);
				index = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8)));
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				extA = 0;
				/* begin pushMaybeContextReceiverVariable: */
				obj = longAt(localFP + FoxIFReceiver);
				if ((index <= StackPointerIndex)
				 && (((longAt(obj)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
					/* begin internalPush: */
					assert(index < MethodIndex);
					assert(isContext(obj));
					/* begin writeBackHeadFramePointers */
					assert(GIV(stackPage) == (mostRecentlyUsedPage()));
					/* begin setHeadFP:andSP:inPage: */
					assert(localSP < localFP);
					assert((localSP < ((GIV(stackPage)->baseAddress)))
					 && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
					assert((localFP < ((GIV(stackPage)->baseAddress)))
					 && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
					(GIV(stackPage)->headFP = localFP);
					(GIV(stackPage)->headSP = localSP);
					assert(pageListIsWellFormed());
					if (!(((((longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))) {
						value = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
						if ((index == InstructionPointerIndex)
						 && (((((value) & 7) == 1))
						 && ((((int) value)) < 0))) {
							/* begin internalMustMapMachineCodePC:context: */
							assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
							GIV(instructionPointer) = oopForPointer(localIP);
							GIV(stackPointer) = localSP;
							GIV(framePointer) = localFP;
							result = mustMapMachineCodePCcontext((value >> 3), obj);
							/* begin internalizeIPandSP */
							assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
							localIP = pointerForOop(GIV(instructionPointer));
							localSP = pointerForOop(GIV(stackPointer));
							localFP = pointerForOop(GIV(framePointer));
							value = result;
						}
						object = value;
						goto l616;
					}
					if (isWidowedContext(obj)) {
						object = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
						goto l616;
					}
					/* begin frameOfMarriedContext: */
					senderOop = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
					assert((((senderOop) & 7) == 1));
					spouseFP = pointerForOop(senderOop - 1);
					if (index == SenderIndex) {
						/* begin ensureCallerContext: */
						callerFP = pointerForOop(longAt(spouseFP + FoxSavedFP));
						if (callerFP == 0) {

							/* base frame, context in saved ip slot (or base of stack in Cog) */
							/* begin frameCallerContext: */
							assert(isBaseFrame(spouseFP));
							/* begin stackPageFor: */
							thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))),
							pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
							callerContextOrNil = longAt((thePage->baseAddress));
							assert(addressCouldBeObj(callerContextOrNil));
							assert((callerContextOrNil == (nilObject()))
							 || (isContext(callerContextOrNil)));
							object = callerContextOrNil;
							goto l616;
						}
						/* begin ensureFrameIsMarried:SP: */
						if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory())
							? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
							: (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) {
							assert(isContext(frameContext(callerFP)));
							object = longAt(callerFP + FoxThisContext);
							goto l616;
						}
						object = marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))),
						(spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord));
						goto l616;
					}
					if (index == StackPointerIndex) {
						assert((ReceiverIndex + (stackPointerIndexForFrame(spouseFP))) < (lengthOf(obj)));
						object = (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 3) | 1);
						goto l616;
					}
					if (index == InstructionPointerIndex) {
						object = instructionPointerForFramecurrentFPcurrentIP(spouseFP, localFP, oopForPointer(localIP));
						goto l616;
					}
					error("bad index");
					object = 0;
	l616:	/* end instVar:ofContext: */;
					longAtPointerput((localSP -= BytesPerOop), object);
				}
				else {
					/* begin internalPush: */
					object1 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
					longAtPointerput((localSP -= BytesPerOop), object1);
				}
			}
			break;
		case 483: /*227*/
			/* extPushLiteralVariableBytecode */
			{
				sqInt index;
				sqInt litVar;
				sqInt object;

				VM_LABEL(extPushLiteralVariableBytecode);
				index = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8)));
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				extA = 0;
				/* begin pushLiteralVariable: */
				
				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((index + LiteralStart)) << (shiftForWord())))));
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, index);
				}
				/* begin internalPush: */
				object = longAt((litVar + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 484: /*228*/
			/* extPushLiteralBytecode */
			{
				sqInt index;
				sqInt object;

				VM_LABEL(extPushLiteralBytecode);
				index = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8)));
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				extA = 0;
				/* begin pushLiteralConstant: */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				object = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((index + LiteralStart)) << (shiftForWord())))));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 485: /*229*/
			/* longPushTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt index;
				sqInt object;

				VM_LABEL(longPushTemporaryVariableBytecode);
				index = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				object = (index < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))
					? longAt((localFP + FoxCallerSavedIP) + ((frameNumArgs - index) * BytesPerWord))
					: longAt(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - index) * BytesPerWord)));
				longAtPointerput((localSP -= BytesPerOop), object);
			}
			break;
		case 487: /*231*/
			/* pushNewArrayBytecode */
			{
				usqInt array;
				sqInt i;
				usqInt newObj;
				usqInt numBytes;
				int popValues;
				sqInt size;
				sqInt valuePointer;
				sqInt valuePointer1;

				VM_LABEL(pushNewArrayBytecode1);
				/* begin fetchByte */
				size = byteAtPointer(++localIP);
				popValues = size > 0x7F;
				size = size & 0x7F;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin externalizeIPandSP */
				assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
				GIV(instructionPointer) = oopForPointer(localIP);
				GIV(stackPointer) = localSP;
				GIV(framePointer) = localFP;
				/* begin eeInstantiateSmallClassIndex:format:numSlots: */
				assert((size >= 0)
				 && ((knownClassAtIndex(ClassArrayCompactIndex)) != GIV(nilObj)));
				assert((2 /* arrayFormat */) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex))));
				/* begin allocateSmallNewSpaceSlots:format:classIndex: */
				assert(size < (numSlotsMask()));
				newObj = GIV(freeStart);
				numBytes = BaseHeaderSize + ((size < 1
	? 8 /* allocationUnit */
	: size * BytesPerOop));
				assert((numBytes % (allocationUnit())) == 0);
				assert((newObj % (allocationUnit())) == 0);
				if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
					if (!GIV(needGCFlag)) {
						/* begin scheduleScavenge */
						GIV(needGCFlag) = 1;
						forceInterruptCheck();
					}
					if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
						error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
						array = 0;
						goto l629;
					}
				}
				long64Atput(newObj, (((((usqLong) size)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex);
				GIV(freeStart) += numBytes;
				array = newObj;
	l629:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
				if (popValues) {
					for (i = 0; i < size; i += 1) {

						/* Assume: have just allocated a new Array; it must be young. Thus, can use unchecked stores. */
						/* begin storePointerUnchecked:ofObject:withValue: */
						valuePointer = longAtPointer(localSP + (((size - i) - 1) * BytesPerOop));
						assert(!(isOopForwarded(array)));
						longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer);
					}
					/* begin internalPop: */
					localSP += size * BytesPerOop;
				}
				else {
					for (i = 0; i < size; i += 1) {
						/* begin storePointerUnchecked:ofObject:withValue: */
						valuePointer1 = GIV(nilObj);
						assert(!(isOopForwarded(array)));
						longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer1);
					}
				}
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), array);
			}
			break;
		case 488: /*232*/
			/* extPushIntegerBytecode */
			{
				sqInt value;

				VM_LABEL(extPushIntegerBytecode);
				value = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extB) << 8)));
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				extB = 0;
				numExtB = 0;
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), (((usqInt)value << 3) | 1));
			}
			break;
		case 489: /*233*/
			/* extPushCharacterBytecode */
			{
				sqInt object;
				sqInt value;

				VM_LABEL(extPushCharacterBytecode);
				value = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extB) << 8)));
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				object = (((sqInt)((usqInt)(value) << (numTagBits())))) + (characterTag());
				longAtPointerput((localSP -= BytesPerOop), object);
				numExtB = (extB = 0);
			}
			break;
		case 490: /*234*/
			/* extSendBytecode */
			{
				sqInt byte;
				sqInt rcvr;
				sqInt tagBits;

				VM_LABEL(extSendBytecode);
				byte = byteAtPointer(++localIP);
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin literal:ofMethod: */
				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((((((usqInt) byte) >> 3) + (((sqInt)((usqInt)(extA) << 5)))) + LiteralStart)) << (shiftForWord())))));
				extA = 0;
				GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3)));
				extB = 0;
				numExtB = 0;
				rcvr = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
				lkupClassTag = (((tagBits = rcvr & (tagMask()))) != 0
					? tagBits
					: (longAt(rcvr)) & (classIndexMask()));
				goto commonSendOrdinary;
			}
			break;
		case 491: /*235*/
			/* extSendSuperBytecode */
			{
				sqInt byte;

				VM_LABEL(extSendSuperBytecode);
				byte = byteAtPointer(++localIP);
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin literal:ofMethod: */
				GIV(messageSelector) = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((((((usqInt) byte) >> 3) + (((sqInt)((usqInt)(extA) << 5)))) + LiteralStart)) << (shiftForWord())))));
				extA = 0;
				if (extB >= 64) {
					GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)((extB - 64)) << 3)));
					extB = 0;
					numExtB = 0;
					/* goto directedSuperclassSend */
					goto l638;
				}
				GIV(argumentCount) = (byte & 7) + (((sqInt)((usqInt)(extB) << 3)));
				extB = 0;
				numExtB = 0;
				goto superclassSend;
			}
	l638:	/* end case */;
			
		directedSuperclassSend:
			/* directedSuperclassSend */
			{
				sqInt aValue;
				sqInt class;
				sqInt err;
				sqInt hash;
				sqInt objOop;
				sqInt objOop1;
				sqInt referent;
				sqInt referent1;
				sqInt superclass;
				sqInt top;

				VM_LABEL(directedSuperclassSend);
				/* begin internalPopStack */
				top = longAt(localSP);
				localSP += BytesPerOop;
				class = top;
				if (((longAt(class)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					/* begin followForwarded: */
					assert(isUnambiguouslyForwarder(class));
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((class + BaseHeaderSize) + (0U << (shiftForWord())));
					while (((referent & (tagMask())) == 0)
					 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
					}
					class = referent;
				}
				/* begin followField:ofObject: */
				objOop = longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
				if (((objOop & (tagMask())) == 0)
				 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, class, objOop);
				}
				superclass = objOop;

				/* To maintain the invariant that all receivers are unforwarded we need an explicit
				   read barrier in the super send cases.  Even though we always follow receivers
				   on become  e.g. super doSomethingWith: (self become: other) forwards the receiver
				   self pushed on the stack. */
				assert(addressCouldBeClassObj(superclass));
				lkupClassTag = (((hash = (long32At(superclass + 4)) & (identityHashHalfWordMask()))) != 0
					? hash
					: (objCouldBeClassObj(superclass)
							? (((err = enterIntoClassTable(superclass))) != 0
									? -err
									: (/* begin rawHashBitsOf: */
										(long32At(superclass + 4)) & (identityHashHalfWordMask())))
							: -PrimErrBadReceiver));
				/* begin ensureReceiverUnforwarded */
				if ((((longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop))) & (tagMask())) == 0)
				 && (((longAt(longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop)))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin internalStackValue:put: */
					objOop1 = longAtPointer(localSP + (GIV(argumentCount) * BytesPerOop));
					assert(isUnambiguouslyForwarder(objOop1));
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent1 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord())));
					while (((referent1 & (tagMask())) == 0)
					 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
					}
					aValue = referent1;
					longAtPointerput(localSP + (GIV(argumentCount) * BytesPerOop), aValue);
				}
				assert(lkupClassTag != (nilObject()));
				goto commonSendOrdinary;
			}
			break;
		case 492: /*236*/
			/* callMappedInlinedPrimitive */
			{
				VM_LABEL(callMappedInlinedPrimitive);
				localIP -= 2;
				goto respondToUnknownBytecode;
			}
			break;
		case 493: /*237*/
			/* extUnconditionalJump */
			{
				sqInt backwardJumpCountByte;
				sqInt bcpcDelta;
				sqInt byte;
				sqInt offset;
				sqInt switched;

				VM_LABEL(extUnconditionalJump);
				byte = byteAtPointer(++localIP);
				offset = byte + (((sqInt)((usqInt)(extB) << 8)));
				bcpcDelta = (offset < 0
					? numExtB * 2
					: 0);
				extB = 0;
				numExtB = 0;
				localIP += offset;
				/* begin ifBackwardsCheckForEvents: */
				if ((offset + bcpcDelta) >= 0) {
					goto l642;
				}
				if (localSP < GIV(stackLimit)) {
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					switched = checkForEventsMayContextSwitch(1);
					returnToExecutivepostContextSwitch(1, switched);
					browserPluginReturnIfNeeded();
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					if (switched) {
						goto l642;
					}
				}
				backwardJumpCountByte = byteAt(localFP + ((VMBIGENDIAN
	? (FoxIFrameFlags + BytesPerWord) - 1
	: FoxIFrameFlags)));
				if (((backwardJumpCountByte -= 2)) == 1) {
					if (methodWithHeaderShouldBeCogged(methodHeaderOf(GIV(method)))) {
						/* begin externalizeIPandSP */
						assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
						GIV(instructionPointer) = oopForPointer(localIP);
						GIV(stackPointer) = localSP;
						GIV(framePointer) = localFP;
						attemptToSwitchToMachineCode(((((oopForPointer(localIP)) - (offset + bcpcDelta)) - GIV(method)) - BaseHeaderSize) - 1);
					}
					backwardJumpCountByte = 0x7F;
				}
				else {
					if (backwardJumpCountByte == -1) {

						/* initialize the count */
						assert(minBackwardJumpCountForCompile <= 128);
						backwardJumpCountByte = (((sqInt)((usqInt)((minBackwardJumpCountForCompile - 1)) << 1))) + 1;
					}
				}
				/* begin iframeBackwardBranchByte:put: */
				byteAtput(localFP + ((VMBIGENDIAN
	? (FoxIFrameFlags + BytesPerWord) - 1
	: FoxIFrameFlags)), backwardJumpCountByte);
	l642:	/* end ifBackwardsCheckForEvents: */;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
			break;
		case 494: /*238*/
			/* extJumpIfTrue */
			{
				sqInt boolean;
				sqInt byte;
				sqInt offset;

				VM_LABEL(extJumpIfTrue);
				byte = byteAtPointer(++localIP);
				offset = byte + (((sqInt)((usqInt)(extB) << 8)));
				numExtB = (extB = (extA = 0));
				/* begin jumplfTrueBy: */
				boolean = longAtPointer(localSP);
				if (boolean == GIV(trueObj)) {
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
				}
				else {
					if (!(boolean == GIV(falseObj))) {
						/* begin internalMustBeBoolean */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorMustBeBoolean) << (shiftForWord())))));
						GIV(argumentCount) = 0;
						goto normalSend;
						goto l645;
					}
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
	l645:	/* end jumplfTrueBy: */;
			}
			break;
		case 495: /*239*/
			/* extJumpIfFalse */
			{
				sqInt boolean;
				sqInt byte;
				sqInt offset;

				VM_LABEL(extJumpIfFalse);
				byte = byteAtPointer(++localIP);
				offset = byte + (((sqInt)((usqInt)(extB) << 8)));
				numExtB = (extB = (extA = 0));
				/* begin jumplfFalseBy: */
				boolean = longAtPointer(localSP);
				if (boolean == GIV(falseObj)) {
					/* begin jump: */
					localIP = (localIP + offset) + 1;
					
#          if MULTIPLEBYTECODESETS
					currentBytecode = (byteAtPointer(localIP)) + GIV(bytecodeSetSelector);
#          else /* MULTIPLEBYTECODESETS */
					currentBytecode = byteAtPointer(localIP);
#          endif /* MULTIPLEBYTECODESETS */
				}
				else {
					if (!(boolean == GIV(trueObj))) {
						/* begin internalMustBeBoolean */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorMustBeBoolean) << (shiftForWord())))));
						GIV(argumentCount) = 0;
						goto normalSend;
						goto l649;
					}
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
	l649:	/* end jumplfFalseBy: */;
			}
			break;
		case 496: /*240*/
			/* extStoreAndPopReceiverVariableBytecode */
			{
				sqInt obj;
				int onCurrentPage;
				sqInt senderOop;
				char * theFP;
				StackPage * thePage;
				sqInt thePC;
				sqInt thePC1;
				sqInt value;
				sqInt variableIndex;

				VM_LABEL(extStoreAndPopReceiverVariableBytecode);
				variableIndex = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8)));
				extA = 0;
				value = longAtPointer(localSP);
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
				/* begin storeMaybeContextReceiverVariable:withValue: */
				obj = longAt(localFP + FoxIFReceiver);
				if ((variableIndex <= ReceiverIndex)
				 && ((((longAt(obj)) & (classIndexMask())) == ClassMethodContextCompactIndex)
				 && ((((((longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
				 || ((variableIndex == MethodIndex)
				 && (((((int) ((thePC = longAt((value + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))))) < 0)
				 && ((((thePC) & 7) == 1))))))) {
					/* begin instVar:ofContext:put: */
					assert(isMarriedOrWidowedContext(obj));
					assert(!((isObjImmutable(obj))));
					/* begin writeBackHeadFramePointers */
					assert(GIV(stackPage) == (mostRecentlyUsedPage()));
					/* begin setHeadFP:andSP:inPage: */
					assert(localSP < localFP);
					assert((localSP < ((GIV(stackPage)->baseAddress)))
					 && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
					assert((localFP < ((GIV(stackPage)->baseAddress)))
					 && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
					(GIV(stackPage)->headFP = localFP);
					(GIV(stackPage)->headSP = localSP);
					assert(pageListIsWellFormed());
					if (!((((((longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
						 && (!(isWidowedContext(obj))))) {
						/* begin storePointer:ofObject:withValue: */
						assert(!(isForwarded(obj)));
						if ((assert(isNonImmediate(obj)),
						oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) {

							/* most stores into young objects */
							if (((value & (tagMask())) == 0)
							 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
								/* begin possibleRootStoreInto: */
								if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) {
									remember(obj);
								}
							}
						}
						longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value);
						if (variableIndex == StackPointerIndex) {
							ensureContextIsExecutionSafeAfterAssignToStackPointer(obj);
						}
						goto l661;
					}
					/* begin frameOfMarriedContext: */
					senderOop = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
					assert((((senderOop) & 7) == 1));
					theFP = pointerForOop(senderOop - 1);
					if (variableIndex == SenderIndex) {
						/* begin stackPageFor: */
						thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
						pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
						assert(GIV(stackPage) == (mostRecentlyUsedPage()));
						onCurrentPage = thePage == GIV(stackPage);
						storeSenderOfFramewithValue(theFP, value);
						if (onCurrentPage) {
							localFP = (GIV(stackPage)->headFP);
							localSP = (GIV(stackPage)->headSP);
						}
						else {
							markStackPageMostRecentlyUsed(GIV(stackPage));
						}
						goto l661;
					}
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					externalDivorceFrameandContext(theFP, obj);
					if ((variableIndex == MethodIndex)
					 && (((((int) ((thePC1 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))))) < 0)
					 && ((((thePC1) & 7) == 1)))) {
						ensureContextHasBytecodePC(obj);
					}
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(obj)));
					if ((assert(isNonImmediate(obj)),
					oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((value & (tagMask())) == 0)
						 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(obj);
							}
						}
					}
					longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value);
					if (variableIndex == StackPointerIndex) {
						ensureContextIsExecutionSafeAfterAssignToStackPointer(obj);
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					markStackPageMostRecentlyUsed(GIV(stackPage));
					assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__);
	l661:	/* end instVar:ofContext:put: */;
				}
				else {
					/* begin storePointerImmutabilityCheck:ofObject:withValue: */
					
#          if IMMUTABILITY
					assert(!((isImmediate(obj))));
					if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) {
						/* begin cannotAssign:to:withIndex: */
						longAtPointerput((localSP -= BytesPerOop), obj);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), value);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), (((usqInt)(variableIndex + 1) << 3) | 1));
						/* begin splObj: */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
						GIV(argumentCount) = 2;
						goto normalSend;
						/* return self */
						goto l652;
					}
#          endif /* IMMUTABILITY */
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(obj)));
					if ((assert(isNonImmediate(obj)),
					oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((value & (tagMask())) == 0)
						 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(obj);
							}
						}
					}
					longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), value);
	l652:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
				}
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
			break;
		case 497: /*241*/
			/* extStoreAndPopLiteralVariableBytecode */
			{
				sqInt litVar;
				sqInt value;
				sqInt variableIndex;

				VM_LABEL(extStoreAndPopLiteralVariableBytecode);
				variableIndex = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8)));
				value = longAtPointer(localSP);
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
				extA = 0;
				/* begin storeLiteralVariable:withValue: */

				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord())))));
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, variableIndex);
				}
				/* begin storePointerImmutabilityCheck:ofObject:withValue: */
				
#        if IMMUTABILITY
				assert(!((isImmediate(litVar))));
				if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) {
					/* begin cannotAssign:to:withIndex: */
					longAtPointerput((localSP -= BytesPerOop), litVar);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), value);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), (((usqInt)(ValueIndex + 1) << 3) | 1));
					/* begin splObj: */
					GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
					GIV(argumentCount) = 2;
					goto normalSend;
					/* return self */
					goto l662;
				}
#        endif /* IMMUTABILITY */
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(litVar)));
				if ((assert(isNonImmediate(litVar)),
				oopisGreaterThanOrEqualTo(litVar, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((value & (tagMask())) == 0)
					 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(litVar))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(litVar);
						}
					}
				}
				longAtput((litVar + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))), value);
	l662:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
			break;
		case 498: /*242*/
			/* longStoreAndPopTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt index;

				VM_LABEL(longStoreAndPopTemporaryVariableBytecode);
				/* begin longStoreTemporaryVariableBytecode */
				index = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin itemporary:in:put: */
				if (index < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
					longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP));
				}
				else {
					longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP));
				}
				/* begin internalPop: */
				localSP += 1 * BytesPerOop;
			}
			break;
		case 499: /*243*/
			/* extStoreReceiverVariableBytecode */
			{
				sqInt anObject;
				sqInt obj;
				int onCurrentPage;
				sqInt senderOop;
				char * theFP;
				StackPage * thePage;
				sqInt thePC;
				sqInt thePC1;
				sqInt variableIndex;

				VM_LABEL(extStoreReceiverVariableBytecode);
				variableIndex = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8)));
				extA = 0;
				/* begin storeMaybeContextReceiverVariable:withValue: */
				anObject = longAtPointer(localSP);
				/* begin storeMaybeContext:receiverVariable:withValue: */
				obj = longAt(localFP + FoxIFReceiver);
				if ((variableIndex <= ReceiverIndex)
				 && ((((longAt(obj)) & (classIndexMask())) == ClassMethodContextCompactIndex)
				 && ((((((longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
				 || ((variableIndex == MethodIndex)
				 && (((((int) ((thePC = longAt((anObject + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))))) < 0)
				 && ((((thePC) & 7) == 1))))))) {
					/* begin instVar:ofContext:put: */
					assert(isMarriedOrWidowedContext(obj));
					assert(!((isObjImmutable(obj))));
					/* begin writeBackHeadFramePointers */
					assert(GIV(stackPage) == (mostRecentlyUsedPage()));
					/* begin setHeadFP:andSP:inPage: */
					assert(localSP < localFP);
					assert((localSP < ((GIV(stackPage)->baseAddress)))
					 && (localSP > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
					assert((localFP < ((GIV(stackPage)->baseAddress)))
					 && (localFP > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
					(GIV(stackPage)->headFP = localFP);
					(GIV(stackPage)->headSP = localSP);
					assert(pageListIsWellFormed());
					if (!((((((longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
						 && (!(isWidowedContext(obj))))) {
						/* begin storePointer:ofObject:withValue: */
						assert(!(isForwarded(obj)));
						if ((assert(isNonImmediate(obj)),
						oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) {

							/* most stores into young objects */
							if (((anObject & (tagMask())) == 0)
							 && (oopisLessThan(anObject, GIV(newSpaceLimit)))) {
								/* begin possibleRootStoreInto: */
								if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) {
									remember(obj);
								}
							}
						}
						longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject);
						if (variableIndex == StackPointerIndex) {
							ensureContextIsExecutionSafeAfterAssignToStackPointer(obj);
						}
						goto l680;
					}
					/* begin frameOfMarriedContext: */
					senderOop = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
					assert((((senderOop) & 7) == 1));
					theFP = pointerForOop(senderOop - 1);
					if (variableIndex == SenderIndex) {
						/* begin stackPageFor: */
						thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
						pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
						assert(GIV(stackPage) == (mostRecentlyUsedPage()));
						onCurrentPage = thePage == GIV(stackPage);
						storeSenderOfFramewithValue(theFP, anObject);
						if (onCurrentPage) {
							localFP = (GIV(stackPage)->headFP);
							localSP = (GIV(stackPage)->headSP);
						}
						else {
							markStackPageMostRecentlyUsed(GIV(stackPage));
						}
						goto l680;
					}
					/* begin externalizeIPandSP */
					assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
					GIV(instructionPointer) = oopForPointer(localIP);
					GIV(stackPointer) = localSP;
					GIV(framePointer) = localFP;
					externalDivorceFrameandContext(theFP, obj);
					if ((variableIndex == MethodIndex)
					 && (((((int) ((thePC1 = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))))) < 0)
					 && ((((thePC1) & 7) == 1)))) {
						ensureContextHasBytecodePC(obj);
					}
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(obj)));
					if ((assert(isNonImmediate(obj)),
					oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((anObject & (tagMask())) == 0)
						 && (oopisLessThan(anObject, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(obj);
							}
						}
					}
					longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject);
					if (variableIndex == StackPointerIndex) {
						ensureContextIsExecutionSafeAfterAssignToStackPointer(obj);
					}
					/* begin internalizeIPandSP */
					assert(GIV(instructionPointer) != (ceReturnToInterpreterPC()));
					localIP = pointerForOop(GIV(instructionPointer));
					localSP = pointerForOop(GIV(stackPointer));
					localFP = pointerForOop(GIV(framePointer));
					markStackPageMostRecentlyUsed(GIV(stackPage));
					assertValidExecutionPointersimbarline(((usqInt)localIP), localFP, localSP, 1, __LINE__);
	l680:	/* end instVar:ofContext:put: */;
				}
				else {
					/* begin storePointerImmutabilityCheck:ofObject:withValue: */
					
#          if IMMUTABILITY
					assert(!((isImmediate(obj))));
					if (((((usqInt) (longAt(obj))) >> (immutableBitShift())) & 1) != 0) {
						/* begin cannotAssign:to:withIndex: */
						longAtPointerput((localSP -= BytesPerOop), obj);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), anObject);
						/* begin internalPush: */
						longAtPointerput((localSP -= BytesPerOop), (((usqInt)(variableIndex + 1) << 3) | 1));
						/* begin splObj: */
						GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
						GIV(argumentCount) = 2;
						goto normalSend;
						/* return self */
						goto l671;
					}
#          endif /* IMMUTABILITY */
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(obj)));
					if ((assert(isNonImmediate(obj)),
					oopisGreaterThanOrEqualTo(obj, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((anObject & (tagMask())) == 0)
						 && (oopisLessThan(anObject, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(obj))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(obj);
							}
						}
					}
					longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(variableIndex) << (shiftForWord())))), anObject);
	l671:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
				}
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
			break;
		case 500: /*244*/
			/* extStoreLiteralVariableBytecode */
			{
				sqInt anObject;
				sqInt litVar;
				sqInt variableIndex;

				VM_LABEL(extStoreLiteralVariableBytecode);
				variableIndex = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8)));
				extA = 0;
				/* begin storeLiteralVariable:withValue: */
				anObject = longAtPointer(localSP);

				/* push/store/popLiteralVariable all fetch a literal, and either read or write the literal's value field.
				   The fetch of the literal needs an explicit check (otherwise we would have to scan all literals in
				   all methods in the stack zone, and the entire method on return, and global variables are relatively
				   rare; in my work image 8.7% of literals are globals). */
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin fetchPointer:ofObject: */
				litVar = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((variableIndex + LiteralStart)) << (shiftForWord())))));
				if (((longAt(litVar)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					litVar = unfollowatIndex(litVar, variableIndex);
				}
				/* begin storePointerImmutabilityCheck:ofObject:withValue: */
				
#        if IMMUTABILITY
				assert(!((isImmediate(litVar))));
				if (((((usqInt) (longAt(litVar))) >> (immutableBitShift())) & 1) != 0) {
					/* begin cannotAssign:to:withIndex: */
					longAtPointerput((localSP -= BytesPerOop), litVar);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), anObject);
					/* begin internalPush: */
					longAtPointerput((localSP -= BytesPerOop), (((usqInt)(ValueIndex + 1) << 3) | 1));
					/* begin splObj: */
					GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord())))));
					GIV(argumentCount) = 2;
					goto normalSend;
					/* return self */
					goto l681;
				}
#        endif /* IMMUTABILITY */
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(litVar)));
				if ((assert(isNonImmediate(litVar)),
				oopisGreaterThanOrEqualTo(litVar, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((anObject & (tagMask())) == 0)
					 && (oopisLessThan(anObject, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(litVar))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(litVar);
						}
					}
				}
				longAtput((litVar + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))), anObject);
	l681:	/* end storePointerImmutabilityCheck:ofObject:withValue: */;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
			}
			break;
		case 501: /*245*/
			/* longStoreTemporaryVariableBytecode */
			{
				sqInt frameNumArgs;
				sqInt index;

				VM_LABEL(longStoreTemporaryVariableBytecode);
				index = byteAtPointer(++localIP);
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin itemporary:in:put: */
				if (index < ((frameNumArgs = byteAt((localFP + FoxIFrameFlags) + 1)))) {
					longAtput((localFP + FoxCallerSavedIP) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP));
				}
				else {
					longAtput(((localFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs - index) * BytesPerWord), longAtPointer(localSP));
				}
			}
			break;
		case 504: /*248*/
			/* callPrimitiveBytecode */
			{
				sqInt header;
				sqInt header2;

				VM_LABEL(callPrimitiveBytecode1);
				/* begin methodHeaderOf: */
				assert(isCompiledMethod(GIV(method)));
				header2 = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
				if ((((header2) & 7) == 1)) {
					header = header2;
				}
				else {
					assert((((usqInt)header2)) < GIV(newSpaceStart));
					assert((((((CogMethod *) header2))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
					header = ((((CogMethod *) header2))->methodHeader);
				}
				if (((/* begin alternateHeaderHasPrimitiveFlag: */
				header & AlternateHeaderHasPrimFlag))
				 && ((((sqInt)localIP)) == ((GIV(method) + ((LiteralStart + ((assert((((header) & 7) == 1)),
((header >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize))) {
					localIP = (localIP + (3)) - 1;
					/* begin fetchNextBytecode */
					currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
					goto l689;
				}
				else {
					goto respondToUnknownBytecode;
					goto l689;
				}
			}
	l689:	/* end case */;
			break;
		case 505: /*249*/
			/* extPushFullClosureBytecode */
			{
				sqInt byte;
				sqInt compiledBlock;
				sqInt compiledBlockLiteralIndex;
				sqInt context;
				sqInt header;
				sqInt header1;
				sqInt i;
				int ignoreContext;
				usqInt newClosure;
				usqInt newClosure1;
				usqInt newObj;
				sqInt numArgs;
				usqInt numBytes;
				sqInt numCopied;
				sqInt numCopied1;
				sqInt numSlots;
				sqInt objFormat;
				int receiverIsOnStack;
				sqInt startIndex;
				char *theFP;
				char *theSP;

				VM_LABEL(extPushFullClosureBytecode);
				compiledBlockLiteralIndex = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extA) << 8)));
				extA = 0;
				assert(GIV(method) == (iframeMethod(localFP)));
				/* begin literal:ofMethod: */
				compiledBlock = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((compiledBlockLiteralIndex + LiteralStart)) << (shiftForWord())))));
				assert(isOopCompiledMethod(compiledBlock));
				/* begin argumentCountOf: */
				assert(isCompiledMethod(compiledBlock));
				header1 = longAt((compiledBlock + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
				if ((((header1) & 7) == 1)) {
					header = header1;
				}
				else {
					assert((((usqInt)header1)) < GIV(newSpaceStart));
					assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
					header = ((((CogMethod *) header1))->methodHeader);
				}
				numArgs = (((usqInt) header) >> MethodHeaderArgCountShift) & 15;
				byte = byteAtPointer(++localIP);
				numCopied = byte & ((1U << 6) - 1);
				receiverIsOnStack = byte & (1U << 7);
				ignoreContext = byte & (1U << 6);
				/* begin pushFullClosureNumArgs:copiedValues:compiledBlock:receiverIsOnStack:ignoreContext: */
				if (ignoreContext) {
					context = GIV(nilObj);
				}
				else {
					/* begin ensureFrameIsMarried:SP: */
					theFP = localFP;
					theSP = localSP + (numCopied * BytesPerOop);
					if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
						? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
						: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
						assert(isContext(frameContext(theFP)));
						context = longAt(theFP + FoxThisContext);
						goto l699;
					}
					context = marryFrameSP(theFP, theSP);
	l699:	/* end ensureFrameIsMarried:SP: */;
				}
				/* begin fullClosureIn:numArgs:numCopiedValues:compiledBlock: */
				/* begin eeInstantiateSmallClassIndex:format:numSlots: */
				objFormat = indexablePointersFormat();
				numSlots = FullClosureFirstCopiedValueIndex + numCopied;
				assert((numSlots >= 0)
				 && ((knownClassAtIndex(ClassFullBlockClosureCompactIndex)) != GIV(nilObj)));
				assert(((objFormat < (firstByteFormat())
					? objFormat
					: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassFullBlockClosureCompactIndex))));
				/* begin allocateSmallNewSpaceSlots:format:classIndex: */
				assert(numSlots < (numSlotsMask()));
				newObj = GIV(freeStart);
				numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
				assert((numBytes % (allocationUnit())) == 0);
				assert((newObj % (allocationUnit())) == 0);
				if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
					if (!GIV(needGCFlag)) {
						/* begin scheduleScavenge */
						GIV(needGCFlag) = 1;
						forceInterruptCheck();
					}
					if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
						error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
						newClosure1 = 0;
						goto l708;
					}
				}
				long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassFullBlockClosureCompactIndex);
				GIV(freeStart) += numBytes;
				newClosure1 = newObj;
	l708:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(newClosure1)));
				longAtput((newClosure1 + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))), context);
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(newClosure1)));
				longAtput((newClosure1 + BaseHeaderSize) + (((sqInt)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord())))), compiledBlock);
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(newClosure1)));
				longAtput((newClosure1 + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))), (((usqInt)numArgs << 3) | 1));
				newClosure = newClosure1;
				if (recordSendTrace()) {
					/* begin recordTrace:thing:source: */
					GIV(traceLog)[GIV(traceLogIndex)] = TraceBlockCreation;
					GIV(traceLog)[GIV(traceLogIndex) + 1] = newClosure;
					GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter;
					GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
				}
				if (receiverIsOnStack) {
					startIndex = FullClosureReceiverIndex;
					numCopied1 = numCopied + 1;
				}
				else {
					startIndex = FullClosureFirstCopiedValueIndex;
					/* begin storePointerUnchecked:ofObject:withValue: */
					assert(!(isOopForwarded(newClosure)));
					longAtput((newClosure + BaseHeaderSize) + (((sqInt)((usqInt)(FullClosureReceiverIndex) << (shiftForWord())))), longAt(localFP + FoxIFReceiver));
					numCopied1 = numCopied;
				}
				if (numCopied1 > 0) {
					for (i = 0; i < numCopied1; i += 1) {

						/* Assume: have just allocated a new BlockClosure; it must be young.
						   Thus, can use unchecked stores. */
						/* begin storePointerUnchecked:ofObject:withValue: */
						assert(!(isOopForwarded(newClosure)));
						longAtput((newClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + startIndex)) << (shiftForWord())))), longAtPointer(localSP + (((numCopied1 - i) - 1) * BytesPerOop)));
					}
					/* begin internalPop: */
					localSP += numCopied1 * BytesPerOop;
				}
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), newClosure);
			}
			break;
		case 506: /*250*/
			/* extPushClosureBytecode */
			{
				sqInt blockSize;
				sqInt byte;
				sqInt context;
				sqInt i;
				sqInt initialIP;
				usqInt newClosure;
				usqInt newClosure1;
				usqInt newObj;
				sqInt numArgs;
				usqInt numBytes;
				sqInt numCopied;
				sqInt numSlots;
				sqInt objFormat;
				char *theFP;
				char *theSP;

				VM_LABEL(extPushClosureBytecode);
				byte = byteAtPointer(++localIP);
				numArgs = (byte & 7) + ((extA % 16) * 8);
				numCopied = ((((usqInt) byte) >> 3) & 7) + ((extA / 16) * 8);
				extA = 0;
				blockSize = (byteAtPointer(++localIP)) + (((sqInt)((usqInt)(extB) << 8)));
				numExtB = (extB = 0);
				/* begin pushClosureNumArgs:copiedValues:blockSize: */
				theFP = localFP;
				theSP = localSP + (numCopied * BytesPerOop);
				if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
					: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
					assert(isContext(frameContext(theFP)));
					context = longAt(theFP + FoxThisContext);
					goto l718;
				}
				context = marryFrameSP(theFP, theSP);
	l718:	/* end ensureFrameIsMarried:SP: */;
				/* begin closureIn:numArgs:instructionPointer:numCopiedValues: */
				initialIP = ((oopForPointer(localIP)) + 2) - (GIV(method) + BaseHeaderSize);
				/* begin eeInstantiateSmallClassIndex:format:numSlots: */
				objFormat = indexablePointersFormat();
				numSlots = ClosureFirstCopiedValueIndex + numCopied;
				assert((numSlots >= 0)
				 && ((knownClassAtIndex(ClassBlockClosureCompactIndex)) != GIV(nilObj)));
				assert(((objFormat < (firstByteFormat())
					? objFormat
					: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassBlockClosureCompactIndex))));
				/* begin allocateSmallNewSpaceSlots:format:classIndex: */
				assert(numSlots < (numSlotsMask()));
				newObj = GIV(freeStart);
				numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
				assert((numBytes % (allocationUnit())) == 0);
				assert((newObj % (allocationUnit())) == 0);
				if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
					if (!GIV(needGCFlag)) {
						/* begin scheduleScavenge */
						GIV(needGCFlag) = 1;
						forceInterruptCheck();
					}
					if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
						error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
						newClosure1 = 0;
						goto l714;
					}
				}
				long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassBlockClosureCompactIndex);
				GIV(freeStart) += numBytes;
				newClosure1 = newObj;
	l714:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(newClosure1)));
				longAtput((newClosure1 + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))), context);
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(newClosure1)));
				longAtput((newClosure1 + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))), (((usqInt)initialIP << 3) | 1));
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(newClosure1)));
				longAtput((newClosure1 + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))), (((usqInt)numArgs << 3) | 1));
				newClosure = newClosure1;
				if (recordSendTrace()) {
					/* begin recordTrace:thing:source: */
					GIV(traceLog)[GIV(traceLogIndex)] = TraceBlockCreation;
					GIV(traceLog)[GIV(traceLogIndex) + 1] = newClosure;
					GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromInterpreter;
					GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
				}
				if (numCopied > 0) {
					for (i = 0; i < numCopied; i += 1) {

						/* Assume: have just allocated a new BlockClosure; it must be young.
						   Thus, can use unchecked stores. */
						/* begin storePointerUnchecked:ofObject:withValue: */
						assert(!(isOopForwarded(newClosure)));
						longAtput((newClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + ClosureFirstCopiedValueIndex)) << (shiftForWord())))), longAtPointer(localSP + (((numCopied - i) - 1) * BytesPerOop)));
					}
					/* begin internalPop: */
					localSP += numCopied * BytesPerOop;
				}
				localIP += blockSize;
				/* begin fetchNextBytecode */
				currentBytecode = (byteAtPointer(++localIP)) + GIV(bytecodeSetSelector);
				/* begin internalPush: */
				longAtPointerput((localSP -= BytesPerOop), newClosure);
			}
			break;
		}
	}

	/* undo the pre-increment of IP before returning */
	localIP -= 1;
	/* begin externalizeIPandSP */
	assert((((usqInt)localIP)) != (ceReturnToInterpreterPC()));
	GIV(instructionPointer) = oopForPointer(localIP);
	GIV(stackPointer) = localSP;
	GIV(framePointer) = localFP;
	return null;
}

	/* CogBlockMethod>>#cmHomeMethod */
static CogMethod * NoDbgRegParms
cmHomeMethod(CogBlockMethod * self_in_cmHomeMethod)
{
	return ((self_in_cmHomeMethod->cpicHasMNUCaseOrCMIsFullBlock)
		? ((CogMethod *) self_in_cmHomeMethod)
		: ((CogMethod *) ((((usqInt)self_in_cmHomeMethod)) - ((self_in_cmHomeMethod->homeOffset)))));
}


/*	For assert-checking */

	/* CogStackPage>>#addressIsInPage: */
static sqInt NoDbgRegParms
addressIsInPage(StackPage * self_in_addressIsInPage, char *address)
{
	return (((self_in_addressIsInPage->lastAddress)) < address)
	 && (address < ((self_in_addressIsInPage->baseAddress)));
}

	/* CogStackPage>>#isFree */
static sqInt NoDbgRegParms
isFree(StackPage * self_in_isFree)
{
	return ((self_in_isFree->baseFP)) == 0;
}


/*	<InterpreterStackPage> */
/*	MRUP-->used page<->used page<->used page<->used page<--LRUP
	^ <-next-prev-> ^
	| |
	v <-prev-next-> v
	free page<->free page<->free page<->free page */

	/* CogStackPages>>#freeStackPageNoAssert: */
static void NoDbgRegParms
freeStackPageNoAssert(StackPage *aPage)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    StackPage *prev;

	(aPage->baseFP = 0);
	if (aPage == GIV(mostRecentlyUsedPage)) {
		GIV(mostRecentlyUsedPage) = (GIV(mostRecentlyUsedPage)->prevPage);
		return;
	}
	if ((((prev = (aPage->prevPage))->baseFP)) == 0) {
		return;
	}
	(prev->nextPage = (aPage->nextPage));
	(((aPage->nextPage))->prevPage = prev);
	(aPage->nextPage = (GIV(mostRecentlyUsedPage)->nextPage));
	(((GIV(mostRecentlyUsedPage)->nextPage))->prevPage = aPage);
	(aPage->prevPage = GIV(mostRecentlyUsedPage));
	(GIV(mostRecentlyUsedPage)->nextPage = aPage);
}


/*	<InterpreterStackPage> */
/*	MRUP-->used page<->used page<->used page<->used page<--LRUP
	^ <-next-prev-> ^
	| |
	v <-prev-next-> v
	free page<->free page<->free page<->free page */

	/* CogStackPages>>#freeStackPage: */
static sqInt NoDbgRegParms
freeStackPage(StackPage *aPage)
{
	freeStackPageNoAssert(aPage);
	assert(pageListIsWellFormed());
	return 0;
}


/*	<InterpreterStackPage> */
/*	MRUP-->used page<->used page<->used page<->used page<--LRUP
	^ <-next-prev-> ^
	| |
	v <-prev-next-> v
	free page<->free page<->free page<->free page */

	/* CogStackPages>>#markStackPageMostRecentlyUsed: */
static void NoDbgRegParms
markStackPageMostRecentlyUsed(StackPage *page)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (page == GIV(mostRecentlyUsedPage)) {
		return;
	}
	if (((page->prevPage)) == GIV(mostRecentlyUsedPage)) {
		GIV(mostRecentlyUsedPage) = page;
		assert(pageListIsWellFormed());
		return;
	}
	(((page->prevPage))->nextPage = (page->nextPage));
	(((page->nextPage))->prevPage = (page->prevPage));
	(((GIV(mostRecentlyUsedPage)->nextPage))->prevPage = page);
	(page->prevPage = GIV(mostRecentlyUsedPage));
	(page->nextPage = (GIV(mostRecentlyUsedPage)->nextPage));
	(GIV(mostRecentlyUsedPage)->nextPage = page);
	GIV(mostRecentlyUsedPage) = page;
	assert(pageListIsWellFormed());
}


/*	<InterpreterStackPage> */
/*	This method is used to move a page to a position in the list such that it
	cannot be deallocated when a new page is allocated, without changing the
	most recently
	used page. There must be at least 3 pages in the system. So making the
	page the MRU's prevPage is sufficient to ensure it won't be deallocated. */
/*	MRUP-->used page<->used page<->used page<->used page<--LRUP
	^ <-next-prev-> ^
	| |
	v <-prev-next-> v
	free page<->free page<->free page<->free page */

	/* CogStackPages>>#markStackPageNextMostRecentlyUsed: */
static void NoDbgRegParms
markStackPageNextMostRecentlyUsed(StackPage *page)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(page != GIV(mostRecentlyUsedPage));
	if (((page->nextPage)) == GIV(mostRecentlyUsedPage)) {
		return;
	}
	(((page->prevPage))->nextPage = (page->nextPage));
	(((page->nextPage))->prevPage = (page->prevPage));
	(((GIV(mostRecentlyUsedPage)->prevPage))->nextPage = page);
	(page->prevPage = (GIV(mostRecentlyUsedPage)->prevPage));
	(page->nextPage = GIV(mostRecentlyUsedPage));
	(GIV(mostRecentlyUsedPage)->prevPage = page);
	assert(pageListIsWellFormed());
}


/*	MRUP-->used page<->used page<->used page<->used page<--LRUP
	^ <-next-prev-> ^
	| |
	v <-prev-next-> v
	free page<->free page<->free page<->free page */

	/* CogStackPages>>#newStackPage */
static StackPage *
newStackPage(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    StackPage *lruOrFree;

	lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage);
	if (((lruOrFree->baseFP)) == 0) {
		return lruOrFree;
	}
	divorceFramesIn(lruOrFree);
	return lruOrFree;
}


/*	Answer if the stack page list is well-formed.
	MRUP-->used page<->used page<->used page<->used page<--LRUP
	^ <-next-prev-> ^
	| |
	v <-prev-next-> v
	free page<->free page<->free page<->free page */

	/* CogStackPages>>#pageListIsWellFormed */
static sqInt
pageListIsWellFormed(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt count;
    sqInt limit;
    sqInt ok;
    StackPage *page;

	ok = 1;
	page = (GIV(mostRecentlyUsedPage)->nextPage);
	count = 1;
	limit = GIV(numStackPages) * 2;
	while ((((page->baseFP)) == 0)
	 && ((page != GIV(mostRecentlyUsedPage))
	 && (count <= limit))) {
		if (!(asserta(((((page->nextPage))->prevPage)) == page))) {
			ok = 0;
		}
		page = (page->nextPage);
		count += 1;
	}
	while ((page != GIV(mostRecentlyUsedPage))
	 && (count <= limit)) {
		if (!(asserta(((((page->nextPage))->prevPage)) == page))) {
			ok = 0;
		}
		if (asserta(!(isFree(page)))) {
			if (!(asserta((addressIsInPage(page, (page->baseFP)))
				 && (addressIsInPage(page, (page->headSP)))))) {
				ok = 0;
			}
		}
		else {
			ok = 0;
		}
		page = (page->nextPage);
		count += 1;
	}
	if (!(asserta(count == (numStkPages())))) {
		ok = 0;
	}
	return ok;
}


/*	Answer the page for a page index.
	N.B. This is a zero-relative index. */

	/* CogStackPages>>#stackPageAt: */
static StackPage * NoDbgRegParms
stackPageAt(sqInt index)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return stackPageAtpages(index, GIV(pages));
}


/*	<Integer> */

	/* CogStackPages>>#stackPageFor: */
static StackPage * NoDbgRegParms
stackPageFor(void *pointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin stackPageAt: */
	return stackPageAtpages((assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
}

	/* CogStackPages>>#statAverageLivePagesWhenMapping */
static double
statAverageLivePagesWhenMapping(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (GIV(statNumMaps) == 0
		? 0.0
		: (((double) GIV(statPageCountWhenMappingSum) )) / GIV(statNumMaps));
}

	/* CoInterpreter>>#accessorDepthForPrimitiveIndex: */
signed char
accessorDepthForPrimitiveIndex(sqInt primIndex)
{
	return primitiveAccessorDepthTable[primIndex];
}


/*	Activate newMethod when newMethod has been cogged, i.e. create a
	machine-code frame and (re)enter machine-code.
 */

	/* CoInterpreter>>#activateCoggedNewMethod: */
static void NoDbgRegParms
activateCoggedNewMethod(sqInt inInterpreter)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    CogMethod *cogMethod;
    usqInt i;
    sqInt methodHeader;
    sqInt numTemps;
    sqInt object;
    sqInt object1;
    sqInt rcvr;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;
    sqInt switched;

	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	assert(isCogMethodReference(methodHeader));
	cogMethod = ((CogMethod *) methodHeader);
	methodHeader = (cogMethod->methodHeader);

	/* could new rcvr be set at point of send? */
	rcvr = longAt(GIV(stackPointer) + (((cogMethod->cmNumArgs)) * BytesPerWord));
	/* begin push: */
	longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp5;
	if (((cogMethod->stackCheckOffset)) == 0) {

		/* frameless method; nothing to activate... */
		
		/* dont use and: so as to get Slang to inline cogit numRegArgs > 0 */
		if (((cogMethod->cmNumArgs)) <= (numRegArgs())) {
			callRegisterArgCogMethodatreceiver(cogMethod, noCheckEntryOffset(), rcvr);
		}
		/* begin push: */
		object = (((sqInt)cogMethod)) + (noCheckEntryOffset());
		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
		GIV(stackPointer) = sp;
		/* begin push: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), rcvr);
		GIV(stackPointer) = sp1;
		ceCallCogCodePopReceiverReg();
		error("should not be reached");
	}
	/* begin push: */
	longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
	GIV(stackPointer) = sp6;
	GIV(framePointer) = GIV(stackPointer);
	/* begin push: */
	longAtput((sp7 = GIV(stackPointer) - BytesPerWord), ((sqInt)cogMethod));
	GIV(stackPointer) = sp7;
	/* begin push: */
	longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
	GIV(stackPointer) = sp8;
	/* begin push: */
	longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr);
	GIV(stackPointer) = sp9;
	numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F;
	for (i = (((cogMethod->cmNumArgs)) + 1); i <= numTemps; i += 1) {
		/* begin push: */
		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp2;
	}
	if (((/* begin alternateHeaderHasPrimitiveFlag: */
	methodHeader & AlternateHeaderHasPrimFlag))
	 && (GIV(primFailCode) != 0)) {
		reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader);
	}
	if (GIV(stackPointer) >= GIV(stackLimit)) {
		assert(((cogMethod->stackCheckOffset)) > (noCheckEntryOffset()));
		/* begin push: */
		object1 = (((sqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
		longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object1);
		GIV(stackPointer) = sp3;
		/* begin push: */
		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), rcvr);
		GIV(stackPointer) = sp4;
		ceEnterCogCodePopReceiverReg();
		error("should not be reached");
	}
	GIV(instructionPointer) = (((sqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
	switched = handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader));
	returnToExecutivepostContextSwitch(inInterpreter, switched);
}

	/* CoInterpreter>>#activateNewMethod */
static void
activateNewMethod(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt header;
    sqInt i;
    int inInterpreter;
    sqInt methodHeader;
    sqInt numArgs;
    sqInt numTemps;
    sqInt object;
    sqInt rcvr;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    sqInt switched;

	/* begin methodHeaderOf: */
	assert(isCompiledMethod(GIV(newMethod)));
	header = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F;
	numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15;

	/* could new rcvr be set at point of send? */
	rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord));
	assert(!(isOopForwarded(rcvr)));
	if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) {
		if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
			GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
		}
	}
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp1;
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
	GIV(stackPointer) = sp2;
	GIV(framePointer) = GIV(stackPointer);
	/* begin push: */
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
	GIV(stackPointer) = sp3;
	/* begin setMethod:methodHeader: */
	GIV(method) = GIV(newMethod);
	assert(isOopCompiledMethod(GIV(method)));
	assert((methodHeaderOf(GIV(method))) == methodHeader);
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	/* begin push: */
	longAtput((sp4 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
	GIV(stackPointer) = sp4;
	/* begin push: */
	object = (VMBIGENDIAN
		? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0)
		: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0));
	longAtput((sp5 = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp5;
	/* begin push: */
	longAtput((sp6 = GIV(stackPointer) - BytesPerWord), 0);
	GIV(stackPointer) = sp6;
	/* begin push: */
	longAtput((sp7 = GIV(stackPointer) - BytesPerWord), rcvr);
	GIV(stackPointer) = sp7;
	for (i = (numArgs + 1); i <= numTemps; i += 1) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp;
	}
	GIV(instructionPointer) = ((GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1;
	if ((/* begin alternateHeaderHasPrimitiveFlag: */
	methodHeader & AlternateHeaderHasPrimFlag)) {

		/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
		   with a long store temp.  Strictly no need to skip the store because it's effectively a noop. */
		GIV(instructionPointer) += 3;
		if (GIV(primFailCode) != 0) {
			reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader);
		}
	}
	switched = 1;
	if (GIV(stackPointer) < GIV(stackLimit)) {
		switched = handleStackOverflowOrEventAllowContextSwitch(canContextSwitchIfActivatingheader(GIV(newMethod), methodHeader));
	}
	returnToExecutivepostContextSwitch(inInterpreter, switched);
}


/*	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. */
/*	Override to refuse to cache other than compiled methods.
	This protects open PICs against having to test for compiled methods. */

	/* CoInterpreter>>#addNewMethodToCache: */
static void NoDbgRegParms
addNewMethodToCache(sqInt classObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classTag;
    sqInt err;
    sqInt err1;
    sqInt err2;
    sqInt firstBytecode;
    sqInt hash;
    sqInt hash1;
    sqInt hash2;
    sqInt hash3;
    sqInt header;
    sqInt methodHeader;
    sqInt p;
    sqInt primitiveIndex;
    sqInt probe;

	if (!(((GIV(newMethod) & (tagMask())) == 0)
		 && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		primitiveFunctionPointer = primitiveInvokeObjectAsMethod;
		return;
	}
	/* begin methodCacheHashOf:with: */
	assert(addressCouldBeClassObj(classObj));
	classTag = (((hash1 = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0
		? hash1
		: (objCouldBeClassObj(classObj)
				? (((err = enterIntoClassTable(classObj))) != 0
						? -err
						: (long32At(classObj + 4)) & (identityHashHalfWordMask()))
				: -PrimErrBadReceiver));
	hash = GIV(messageSelector) ^ (((sqInt)((usqInt)(classTag) << 2)));
	if (((GIV(newMethod) & (tagMask())) == 0)
	 && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) {
		/* begin primitiveIndexOfMethod:header: */
		assert(isCompiledMethod(GIV(newMethod)));
		header = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((((header) & 7) == 1)) {
			methodHeader = header;
		}
		else {
			assert((((usqInt)header)) < GIV(newSpaceStart));
			assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
			methodHeader = ((((CogMethod *) header))->methodHeader);
		}
		if (methodHeader & AlternateHeaderHasPrimFlag) {
			firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
			primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)));
		}
		else {
			primitiveIndex = 0;
		}
		/* begin functionPointerFor:inClass: */
		primitiveFunctionPointer = ((void (*)(void)) ((primitiveIndex > MaxPrimitiveIndex
	? 0
	: primitiveTable[primitiveIndex])));
	}
	else {
		assert(!((isNonImmediate(GIV(newMethod)))
		 && (isForwarded(GIV(newMethod)))));
		primitiveFunctionPointer = primitiveInvokeObjectAsMethod;
	}
	for (p = 0; p < CacheProbeMax; p += 1) {
		probe = (((usqInt) hash) >> p) & MethodCacheMask;
		if ((GIV(methodCache)[probe + MethodCacheSelector]) == 0) {

			/* Found an empty entry -- use it */
			GIV(methodCache)[probe + MethodCacheSelector] = GIV(messageSelector);
			GIV(methodCache)[probe + MethodCacheClass] = ((assert(addressCouldBeClassObj(classObj)),
(((hash2 = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0
		? hash2
		: (objCouldBeClassObj(classObj)
				? (((err1 = enterIntoClassTable(classObj))) != 0
						? -err1
						: (long32At(classObj + 4)) & (identityHashHalfWordMask()))
				: -PrimErrBadReceiver))));
			GIV(methodCache)[probe + MethodCacheMethod] = GIV(newMethod);
			GIV(methodCache)[probe + MethodCachePrimFunction] = (((sqIntptr_t) primitiveFunctionPointer));

			/* this for primitiveExternalMethod */
			GIV(lastMethodCacheProbeWrite) = probe;
			return;
		}
	}

	/* first probe */
	probe = hash & MethodCacheMask;
	GIV(methodCache)[probe + MethodCacheSelector] = GIV(messageSelector);
	GIV(methodCache)[probe + MethodCacheClass] = ((assert(addressCouldBeClassObj(classObj)),
(((hash3 = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0
		? hash3
		: (objCouldBeClassObj(classObj)
				? (((err2 = enterIntoClassTable(classObj))) != 0
						? -err2
						: (long32At(classObj + 4)) & (identityHashHalfWordMask()))
				: -PrimErrBadReceiver))));
	GIV(methodCache)[probe + MethodCacheMethod] = GIV(newMethod);
	GIV(methodCache)[probe + MethodCachePrimFunction] = (((sqIntptr_t) primitiveFunctionPointer));

	/* this for primitiveExternalMethod */
	/* ...and zap the following entries */
	GIV(lastMethodCacheProbeWrite) = probe;
	for (p = 1; p < CacheProbeMax; p += 1) {
		probe = (((usqInt) hash) >> p) & MethodCacheMask;
		GIV(methodCache)[probe + MethodCacheSelector] = 0;
	}
}

	/* CoInterpreter>>#argumentCountAddress */
usqInt
argumentCountAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(argumentCount))));
}


/*	Coerce either a CMMethod or a CMBlock to the home CMMethod */

	/* CoInterpreter>>#asCogHomeMethod: */
static CogMethod * NoDbgRegParms
asCogHomeMethod(CogBlockMethod *aCogMethod)
{
	return (((aCogMethod->cmType)) == CMMethod
		? ((CogMethod *) aCogMethod)
		: ((aCogMethod->cpicHasMNUCaseOrCMIsFullBlock)
				? ((CogMethod *) aCogMethod)
				: ((CogMethod *) ((((usqInt)aCogMethod)) - ((aCogMethod->homeOffset))))));
}

	/* CoInterpreter>>#assertValidExecutionPointe:r:s:imbar:line: */
static void NoDbgRegParms
assertValidExecutionPointersimbarline(usqInt lip, char *lifp, char *lisp, sqInt inInterpreter, sqInt ln)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    CogMethod *cogMethod;
    sqInt methodField;
    sqInt methodField1;
    usqInt theIP;

	assertl(GIV(stackPage) == (mostRecentlyUsedPage()), ln);
	assertl(addressIsInPage(GIV(stackPage), lifp), ln);
	assert(deferStackLimitSmashAroundwith(assertValidStackLimits, ln));
	assertl(lisp < lifp, ln);
	assertl(lifp > lisp, ln);
	assertl(lisp >= (((GIV(stackPage)->realStackLimit)) - (stackLimitOffset())), ln);
	assertl(((lifp - lisp) / BytesPerOop) < LargeContextSlots, ln);
	methodField = longAt(lifp + FoxMethod);
	if (inInterpreter) {
		assertl(!(isMachineCodeFrame(lifp)), ln);
		assertl(GIV(method) == methodField, ln);
		
#    if MULTIPLEBYTECODESETS
		assertl((methodUsesAlternateBytecodeSet(GIV(method))) == (GIV(bytecodeSetSelector) == 256), ln);
#    endif /* MULTIPLEBYTECODESETS */
		if (assertal(cheapAddressCouldBeInHeap(methodField), ln)) {
			if (lip == (ceReturnToInterpreterPC())) {
				theIP = longAt(lifp + FoxIFSavedIP);
			}
			else {
				theIP = lip;
			}
			assertl((theIP >= (methodField + (lastPointerOf(methodField))))
			 && (theIP < (((methodField + (numBytesOfBytes(methodField))) + BaseHeaderSize) - 1)), ln);
		}
		assertl((iframeIsBlockActivation(lifp))
		 || ((pushedReceiverOrClosureOfFrame(lifp)) == (iframeReceiver(lifp))), ln);
	}
	else {
		assertl(isMachineCodeFrame(lifp), ln);
		if ((assertal((((usqInt)methodField)) >= (minCogMethodAddress()), ln))
		 && (assertal((((usqInt)methodField)) < (maxCogMethodAddress()), ln))) {
			/* begin mframeHomeMethod: */
			methodField1 = longAt(lifp + FoxMethod);
			if ((methodField1 & MFMethodFlagIsBlockFlag) != 0) {
				cogMethod = (((((CogBlockMethod *) (methodField1 & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock)
					? ((CogMethod *) (((CogBlockMethod *) (methodField1 & MFMethodMask))))
					: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField1 & MFMethodMask))))) - (((((CogBlockMethod *) (methodField1 & MFMethodMask)))->homeOffset)))));
				goto l2;
			}
			cogMethod = ((CogMethod *) (methodField1 & MFMethodMask));
	l2:	/* end mframeHomeMethod: */;
			assertl((lip > (methodField + ((mframeIsBlockActivation(lifp)
	? sizeof(CogBlockMethod)
	: sizeof(CogMethod)))))
			 && (lip < (methodField + ((cogMethod->blockSize)))), ln);
		}
		assertl((mframeIsBlockActivation(lifp))
		 || ((pushedReceiverOrClosureOfFrame(lifp)) == (mframeReceiver(lifp))), ln);
	}
	if ((longAt(lifp + FoxSavedFP)) == 0) {
		assertl(frameHasContext(lifp), ln);
		assertl((frameContext(lifp)) == (longAt(((GIV(stackPage)->baseAddress)) - BytesPerWord)), ln);
	}
}

	/* CoInterpreter>>#assertValidMachineCodeFrame: */
void
assertValidMachineCodeFrame(sqInt instrPtr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    CogBlockMethod *cogMethod;
    CogMethod *homeMethod;

	assert(isMachineCodeFrame(GIV(framePointer)));
	/* begin mframeCogMethod: */
	cogMethod = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask));
	/* begin asCogHomeMethod: */
	homeMethod = (((cogMethod->cmType)) == CMMethod
		? ((CogMethod *) cogMethod)
		: ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)
				? ((CogMethod *) cogMethod)
				: ((CogMethod *) ((((usqInt)cogMethod)) - ((cogMethod->homeOffset))))));
	assert((methodFor(cogMethod)) == homeMethod);
	assert((instrPtr > (((sqInt)cogMethod)))
	 && (instrPtr < ((((sqInt)homeMethod)) + ((homeMethod->blockSize)))));
}


/*	Check that the stacked instruction pointers in the given page are correct.
	Checks the interpreter sender/machine code callee contract. */

	/* CoInterpreter>>#assertValidStackedInstructionPointersIn:line: */
static sqInt NoDbgRegParms
assertValidStackedInstructionPointersInline(StackPage *aStackPage, sqInt ln)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *callerFP;
    sqInt methodField;
    usqInt methodObj;
    sqInt prevFrameWasCogged;
    char *theFP;
    usqInt theIP;
    CogMethod *theMethod;

	if (!(assertal(!(isFree(aStackPage)), ln))) {
		return 0;
	}

	/* The top of stack of an inactive page is always the instructionPointer.
	   The top of stack of the active page may be the instructionPointer if it has been pushed,
	   which is indicated by a 0 instructionPointer. */
	prevFrameWasCogged = 0;
	if ((GIV(stackPage) == aStackPage)
	 && (GIV(instructionPointer) != 0)) {
		theIP = GIV(instructionPointer);
		theFP = GIV(framePointer);
	}
	else {
		theIP = ((usqInt)(longAt((aStackPage->headSP))));
		theFP = (aStackPage->headFP);
		if (GIV(stackPage) == aStackPage) {
			assertl(GIV(framePointer) == theFP, ln);
		}
	}
	while (1) {
		if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
			/* begin mframeHomeMethod: */
			methodField = longAt(theFP + FoxMethod);
			if ((methodField & MFMethodFlagIsBlockFlag) != 0) {
				theMethod = (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock)
					? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask))))
					: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset)))));
				goto l2;
			}
			theMethod = ((CogMethod *) (methodField & MFMethodMask));
	l2:	/* end mframeHomeMethod: */;
			assertl((theIP == (ceCannotResumePC()))
			 || ((theIP >= (((usqInt)theMethod)))
			 && (theIP < ((((usqInt)theMethod)) + ((theMethod->blockSize))))), ln);
			prevFrameWasCogged = 1;
		}
		else {

			/* assert-check the interpreter frame. */
			methodObj = longAt(theFP + FoxMethod);
			if (prevFrameWasCogged) {
				assertl(theIP == (ceReturnToInterpreterPC()), ln);
			}
			if (theIP == (ceReturnToInterpreterPC())) {
				theIP = longAt(theFP + FoxIFSavedIP);
			}
			assertl((theIP >= (methodObj + (lastPointerOf(methodObj))))
			 && (theIP < (((methodObj + (numBytesOfBytes(methodObj))) + BaseHeaderSize) - 1)), ln);
			prevFrameWasCogged = 0;
		}
		theIP = ((usqInt)(longAt(theFP + FoxCallerSavedIP)));
		if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break;
		theFP = callerFP;
	}
	assertl(theIP == (ceBaseFrameReturnPC()), ln);
	return 1;
}


/*	Check that the stacked instruction pointers in all pages are correct.
	Checks the interpreter sender/machine code callee contract.
	Written so it will be optimized away if not in an assert VM. */

	/* CoInterpreter>>#assertValidStackedInstructionPointers: */
static void NoDbgRegParms
assertValidStackedInstructionPointers(sqInt ln)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    StackPage *thePage;

	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		if (!(isFree(thePage))) {
			assertl(assertValidStackedInstructionPointersInline(thePage, ln), ln);
		}
	}
}


/*	Attempt to convert the current interpreted activation into a machine code
	activation, and if this is popssible, jump into machine code. bcpc is the
	0-relative pc of the backward branch bytecode (not any preceding
	extension).  */

	/* CoInterpreter>>#attemptToSwitchToMachineCode: */
static void NoDbgRegParms
attemptToSwitchToMachineCode(sqInt bcpc)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt closure;
    sqInt cls;
    CogMethod *cogMethod;
    CogBlockMethod *cogMethod1;
    CogBlockMethod *cogMethod2;
    CogMethod *homeMethod;
    sqInt methodField;
    sqInt methodHeader;
    char *p;
    usqInt pc;
    usqInt pc1;
    char *sp;
    char *sp1;
    sqInt startBcpc;
    char *theFP;

	if (!((assert(isNonImmediate(GIV(method))),
		isCogMethodReference(longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) {
		if (((byteAt((GIV(framePointer) + FoxIFrameFlags) + 3)) != 0)
		 && (!(isVanillaBlockClosure((cls = frameStackedReceivernumArgs(GIV(framePointer), ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
			? ((mframeCogMethod(GIV(framePointer)))->cmNumArgs)
			: byteAt((GIV(framePointer) + FoxIFrameFlags) + 1)))))))) {

			/* Compiled block / full closure */
			cogFullBlockMethodnumCopied(GIV(method), (numPointerSlotsOf(cls)) - FullClosureFirstCopiedValueIndex);
		}
		else {

			/* Compiled method */
			cogselector(GIV(method), GIV(nilObj));
		}
	}
	if ((assert(isNonImmediate(GIV(method))),
	isCogMethodReference(longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
		/* begin cogMethodOf: */
		methodHeader = longAt((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader))
		 && ((((usqInt)methodHeader)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader);
		/* begin convertToMachineCodeFrame:bcpc: */
		assert(!(isMachineCodeFrame(GIV(framePointer))));
		if ((longAt(GIV(framePointer) + FoxSavedFP)) == 0) {
			longAtput(GIV(framePointer) + FoxCallerSavedIP, ceBaseFrameReturnPC());
		}
		else {
			if (!((((usqInt)(longAt((pointerForOop(longAt(GIV(framePointer) + FoxSavedFP))) + FoxMethod)))) < (startOfMemory()))) {
				/* begin iframeSavedIP:put: */
				theFP = pointerForOop(longAt(GIV(framePointer) + FoxSavedFP));
				assert(!(isMachineCodeFrame(theFP)));
				longAtput(theFP + FoxIFSavedIP, ((sqInt)(pointerForOop(longAt(GIV(framePointer) + FoxCallerSavedIP)))));
				longAtput(GIV(framePointer) + FoxCallerSavedIP, ceReturnToInterpreterPC());
			}
		}
		if ((byteAt((GIV(framePointer) + FoxIFrameFlags) + 3)) != 0) {
			closure = longAt(GIV(framePointer) + (frameStackedReceiverOffset(GIV(framePointer))));
			if (((((longAt((closure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord()))))))) & 7) == 1)) {
				startBcpc = (((longAt((closure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) >> 3)) - 1;
				cogMethod2 = findMethodForStartBcpcinHomeMethod(startBcpc, cogMethod);
			}
			else {
				startBcpc = (((assert((((((cogMethod->methodHeader))) & 7) == 1)),
((((cogMethod->methodHeader)) >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop;
				cogMethod2 = ((CogBlockMethod *) cogMethod);
			}
			methodField = (((sqInt)cogMethod2)) + MFMethodFlagIsBlockFlag;
		}
		else {
			startBcpc = (((assert((((((cogMethod->methodHeader))) & 7) == 1)),
((((cogMethod->methodHeader)) >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop;
			cogMethod2 = ((CogBlockMethod *) cogMethod);
			methodField = ((sqInt)cogMethod);
		}
		pc1 = mcPCForBackwardBranchstartBcpcin(bcpc, startBcpc, cogMethod2);
		assert(pc1 > ((((usqInt)cogMethod2)) + (noCheckEntryOffset())));
		assert(bcpc == (bytecodePCForstartBcpcin(pc1, startBcpc, cogMethod2)));
		longAtput(GIV(framePointer) + FoxMethod, methodField + (((byteAt((GIV(framePointer) + FoxIFrameFlags) + 2)) != 0
	? MFMethodFlagHasContextFlag
	: 0)));
		for (p = (GIV(framePointer) + FoxIFReceiver); p >= GIV(stackPointer); p += (-BytesPerWord)) {
			longAtput((p + FoxMFReceiver) - FoxIFReceiver, longAt(p));
		}
		GIV(stackPointer) = (GIV(stackPointer) + FoxMFReceiver) - FoxIFReceiver;
		pc = pc1;
		/* begin assertValidMachineCodeFrame: */
		assert(isMachineCodeFrame(GIV(framePointer)));
		/* begin mframeCogMethod: */
		cogMethod1 = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask));
		/* begin asCogHomeMethod: */
		homeMethod = (((cogMethod1->cmType)) == CMMethod
			? ((CogMethod *) cogMethod1)
			: ((cogMethod1->cpicHasMNUCaseOrCMIsFullBlock)
					? ((CogMethod *) cogMethod1)
					: ((CogMethod *) ((((usqInt)cogMethod1)) - ((cogMethod1->homeOffset))))));
		assert((methodFor(cogMethod1)) == homeMethod);
		assert((pc > (((sqInt)cogMethod1)))
		 && (pc < ((((sqInt)homeMethod)) + ((homeMethod->blockSize)))));
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), pc);
		GIV(stackPointer) = sp;
		/* begin push: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp1;
		ceEnterCogCodePopReceiverReg();
	}
}


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

	/* CoInterpreter>>#callbackEnter: */
EXPORT(sqInt)
callbackEnter(sqInt *callbackID)
{   DECL_MAYBE_VOLATILE_SQ_GLOBAL_STRUCT
    volatile int calledFromMachineCode;
    volatile void *currentCFramePointer;
    volatile void *currentCStackPointer;
    volatile sqInt header;
    volatile sqInt header1;
    volatile jmp_buf savedReenterInterpreter;
    volatile sqInt wasInMachineCode;


	/* For now, do not allow a callback unless we're in a primitiveResponse */
	if (!(asserta(primitiveFunctionPointer != 0))) {
		return 0;
	}
	assert(GIV(primFailCode) == 0);
	if (!(asserta(GIV(jmpDepth) < MaxJumpBuf))) {
		return 0;
	}
	GIV(jmpDepth) += 1;
	wasInMachineCode = (((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory());

	/* Suspend the currently active process */
	calledFromMachineCode = GIV(instructionPointer) <= (startOfMemory());
	GIV(suspendedCallbacks)[GIV(jmpDepth)] = (fetchPointerofObject(ActiveProcessIndex, schedulerPointer()));
	GIV(suspendedMethods)[GIV(jmpDepth)] = GIV(newMethod);
	flag("need to debug this properly.  Conceptually it is the right thing to do but it crashes in practice");
	transferTofrom(wakeHighestPriority(), CSCallbackLeave);
	forceInterruptCheck();
	currentCStackPointer = getCStackPointer();
	currentCFramePointer = getCFramePointer();
	memcpy(((void *)savedReenterInterpreter), reenterInterpreter, sizeof(jmp_buf));
	assertCStackWellAligned();
	if ((setjmp(GIV(jmpBuf)[GIV(jmpDepth)])) == 0) {

		/* Fill in callbackID */
		callbackID[0] = GIV(jmpDepth);
		enterSmalltalkExecutive();
		assert(0);
	}
	setCStackPointer(currentCStackPointer);
	setCFramePointer(currentCFramePointer);
	memcpy(reenterInterpreter, ((void *) savedReenterInterpreter), sizeof(jmp_buf));
	putToSleepyieldingIf(fetchPointerofObject(ActiveProcessIndex, schedulerPointer()), GIV(preemptionYields));
	transferTofrom(GIV(suspendedCallbacks)[GIV(jmpDepth)], CSCallbackLeave);

	/* see comment above */
	GIV(newMethod) = GIV(suspendedMethods)[GIV(jmpDepth)];
	/* begin argumentCountOfMethodHeader: */
	assert(isCompiledMethod(GIV(newMethod)));
	header1 = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	GIV(argumentCount) = (((usqInt) header) >> MethodHeaderArgCountShift) & 15;
	assert(wasInMachineCode == (isMachineCodeFrame(GIV(framePointer))));
	if (calledFromMachineCode) {
		if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {
			/* begin iframeSavedIP:put: */
			assert(!(isMachineCodeFrame(GIV(framePointer))));
			longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
			GIV(instructionPointer) = ceReturnToInterpreterPC();
		}
	}
	else {

		/* Even if the context was flushed to the heap and rebuilt in transferTo:from:
		   above it will remain an interpreted frame because the context's pc would
		   remain a bytecode pc.  So the instructionPointer must also be a bytecode pc. */
		assert(!(isMachineCodeFrame(GIV(framePointer))));
		assert(GIV(instructionPointer) > (startOfMemory()));
	}
	assert(GIV(primFailCode) == 0);
	GIV(jmpDepth) -= 1;
	return 1;
}

	/* CoInterpreter>>#callForCogCompiledCodeCompaction */
void
callForCogCompiledCodeCompaction(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(cogCompiledCodeCompactionCalledFor) = 1;
	forceInterruptCheck();
}


/*	convert
	rcvr	base
	arg(s)
	retpc	<- sp
	to
	retpc	base
	entrypc
	rcvr
	arg(s)	<- sp
	and then enter at either the checked or the unchecked entry-point. */

	/* CoInterpreter>>#callRegisterArgCogMethod:at:receiver: */
static void NoDbgRegParms
callRegisterArgCogMethodatreceiver(CogMethod *cogMethod, sqInt entryOffset, sqInt rcvr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt object;
    sqInt object1;
    char *sp;
    char *sp1;
    char *sp2;

	assert(((cogMethod->cmNumArgs)) <= (numRegArgs()));
	if (((cogMethod->cmNumArgs)) == 2) {
		/* begin stackValue:put: */
		longAtput(GIV(stackPointer) + (3 * BytesPerWord), longAt(GIV(stackPointer)));
		/* begin push: */
		object = longAt(GIV(stackPointer) + (1 * BytesPerWord));
		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
		GIV(stackPointer) = sp;
		/* begin stackValue:put: */
		longAtput(GIV(stackPointer) + (1 * BytesPerWord), longAt(GIV(stackPointer) + (3 * BytesPerWord)));
		longAtput(GIV(stackPointer) + (2 * BytesPerWord), rcvr);
		longAtput(GIV(stackPointer) + (3 * BytesPerWord), (((sqInt)cogMethod)) + entryOffset);
		ceCallCogCodePopReceiverArg1Arg0Regs();
	}
	if (((cogMethod->cmNumArgs)) == 1) {
		/* begin stackValue:put: */
		longAtput(GIV(stackPointer) + (2 * BytesPerWord), longAt(GIV(stackPointer)));
		/* begin push: */
		object1 = longAt(GIV(stackPointer) + (1 * BytesPerWord));
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1);
		GIV(stackPointer) = sp1;
		longAtput(GIV(stackPointer) + (1 * BytesPerWord), rcvr);
		longAtput(GIV(stackPointer) + (2 * BytesPerWord), (((sqInt)cogMethod)) + entryOffset);
		ceCallCogCodePopReceiverArg0Regs();
	}
	assert(((cogMethod->cmNumArgs)) == 0);
	/* begin stackValue:put: */
	longAtput(GIV(stackPointer) + (1 * BytesPerWord), longAt(GIV(stackPointer)));
	longAtput(GIV(stackPointer) + (0 * BytesPerWord), (((sqInt)cogMethod)) + entryOffset);
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), rcvr);
	GIV(stackPointer) = sp2;
	ceCallCogCodePopReceiverReg();
}


/*	An external call or FFI primitive has failed. Build the frame and
	activate as appropriate. Enter either the interpreter or machine
	code depending on whether aPrimitiveMethod has been or is still
	cogged. Note that we could always interpret but want the efficiency
	of executing machine code if it is available. */

	/* CoInterpreter>>#ceActivateFailingPrimitiveMethod: */
void
ceActivateFailingPrimitiveMethod(sqInt aPrimitiveMethod)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt methodHeader;
    sqInt result;
    char *sp;

	assert(GIV(primFailCode) != 0);
	assert(GIV(newMethod) == aPrimitiveMethod);
	retryPrimitiveOnFailure();
	if (!GIV(primFailCode)) {
		result = longAt(GIV(stackPointer));
		longAtPointerput(GIV(stackPointer), GIV(instructionPointer));
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), result);
		GIV(stackPointer) = sp;
		ceEnterCogCodePopReceiverReg();
	}
	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((aPrimitiveMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)) {
		activateCoggedNewMethod(0);
	}
	else {
		activateNewMethod();
	}
}


/*	Return across a page boundary. The context to return to (which may be
	married) is stored in the first word of the stack. We get here when a
	return instruction jumps
	to the ceBaseFrameReturn: address that is the return pc for base frames. A
	consequence of this is that the current frame is no longer valid since an
	interrupt may have overwritten
	its state as soon as the stack pointer has been cut-back beyond the return
	pc. So to have
	a context to send the cannotReturn: message to we also store the base
	frame's context
	in the second word of the stack page. */

	/* CoInterpreter>>#ceBaseFrameReturn: */
sqInt
ceBaseFrameReturn(sqInt returnValue)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aMethodObj;
    char *callerFP;
    sqInt contextToReturnFrom;
    sqInt contextToReturnTo;
    char *fp;
    char *frameAbove;
    sqInt isAContext;
    StackPage *lruOrFree;
    StackPage *newPage;
    sqInt senderOop;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    StackPage *thePage;

	assert((stackPageFor(GIV(stackPointer))) == GIV(stackPage));
	assert((mostRecentlyUsedPage()) == GIV(stackPage));
	assertCStackWellAligned();
	assert(GIV(framePointer) == 0);
	assert(GIV(stackPointer) <= (((GIV(stackPage)->baseAddress)) - BytesPerWord));
	assert((((GIV(stackPage)->baseFP)) + (2 * BytesPerWord)) < ((GIV(stackPage)->baseAddress)));
	assert((addressCouldBeObj(longAt(((GIV(stackPage)->baseAddress)) - BytesPerWord)))
	 && (isContext(longAt(((GIV(stackPage)->baseAddress)) - BytesPerWord))));
	contextToReturnTo = longAt((GIV(stackPage)->baseAddress));
	assert(addressCouldBeObj(contextToReturnTo));
	freeStackPageNoAssert(GIV(stackPage));
	isAContext = ((contextToReturnTo & (tagMask())) == 0)
	 && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex);
	if (isAContext
	 && ((((((longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(contextToReturnTo))))) {
		/* begin frameOfMarriedContext: */
		senderOop = longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop) & 7) == 1));
		GIV(framePointer) = pointerForOop(senderOop - 1);
		/* begin stackPageFor: */
		thePage = stackPageAtpages((assert((((((char *) GIV(framePointer))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) GIV(framePointer))) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(GIV(framePointer), GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		if (GIV(framePointer) == ((thePage->headFP))) {
			GIV(stackPointer) = (thePage->headSP);
		}
		else {

			/* Returning to some interior frame, presumably because of a sender assignment.
			   Move the frames above to another page (they may be in use, e.g. via coroutining).
			   Make the interior frame the top frame. */
			/* begin findFrameAbove:inPage: */
			fp = (thePage->headFP);
			if (fp == GIV(framePointer)) {
				frameAbove = 0;
				goto l2;
			}
			while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) {
				if (callerFP == GIV(framePointer)) {
					frameAbove = fp;
					goto l2;
				}
				fp = callerFP;
			}
			error("did not find theFP in stack page");
			frameAbove = 0;
	l2:	/* end findFrameAbove:inPage: */;
			/* begin newStackPage */
			lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage);
			if (((lruOrFree->baseFP)) == 0) {
				newPage = lruOrFree;
				goto l1;
			}
			divorceFramesIn(lruOrFree);
			newPage = lruOrFree;
	l1:	/* end newStackPage */;
			assert(newPage == GIV(stackPage));
			moveFramesInthroughtoPage(thePage, frameAbove, newPage);
			markStackPageMostRecentlyUsed(newPage);
			/* begin setStackPointersFromPage: */
			GIV(stackPointer) = (thePage->headSP);
			GIV(framePointer) = (thePage->headFP);
		}
	}
	else {
		if (!(isAContext
			 && (((((longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))) & 7) == 1)))) {
			contextToReturnFrom = longAt(((GIV(stackPage)->baseAddress)) - BytesPerWord);
			tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFromtoreturnValue(contextToReturnFrom, contextToReturnTo, returnValue);
			/* begin externalCannotReturn:from: */
			longAtput((sp3 = GIV(stackPointer) - BytesPerWord), contextToReturnFrom);
			GIV(stackPointer) = sp3;
			/* begin push: */
			longAtput((sp1 = GIV(stackPointer) - BytesPerWord), returnValue);
			GIV(stackPointer) = sp1;
			/* begin push: */
			longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp2;
			return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), contextToReturnFrom, 1);
		}
		GIV(instructionPointer) = 0;
		thePage = makeBaseFrameFor(contextToReturnTo);
		/* begin setStackPointersFromPage: */
		GIV(stackPointer) = (thePage->headSP);
		GIV(framePointer) = (thePage->headFP);
	}
	/* begin setStackPageAndLimit: */
	assert(thePage != 0);
	GIV(stackPage) = thePage;
	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
	}
	markStackPageMostRecentlyUsed(thePage);
	assert((stackPageFor(GIV(framePointer))) == GIV(stackPage));
	if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), returnValue);
		GIV(stackPointer) = sp;
		ceEnterCogCodePopReceiverReg();
	}
	GIV(instructionPointer) = longAt(GIV(stackPointer));
	if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
		GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
	}
	/* begin setMethod: */
	aMethodObj = longAt(GIV(framePointer) + FoxMethod);
	assert((((usqInt)aMethodObj)) >= (startOfMemory()));
	GIV(method) = aMethodObj;
	assert(isOopCompiledMethod(GIV(method)));
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	longAtPointerput(GIV(stackPointer), returnValue);
	assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, GIV(framePointer)));
	siglongjmp(reenterInterpreter, ReturnToInterpreter);
	return null;
}


/*	index is unboxed and 0-based. The call-back expects 1-based value (to
	perform the operation with instVarAt:put:
 */

	/* CoInterpreter>>#ceCannotAssignTo:withIndex:valueToAssign: */
#if IMMUTABILITY
sqInt
ceCannotAssignTowithIndexvalueToAssign(sqInt immutableObject, sqInt index, sqInt valueToAssign)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    sqInt top;

	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), immutableObject);
	GIV(stackPointer) = sp;
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), valueToAssign);
	GIV(stackPointer) = sp1;
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), (((usqInt)(index + 1) << 3) | 1));
	GIV(stackPointer) = sp2;
	/* begin push: */
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp3;
	return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAttemptToAssign) << (shiftForWord()))))), immutableObject, 2);
}
#endif /* IMMUTABILITY */


/*	A context that has been returned from, or otherwise has an invalid pc has
	been reentered.
	Until we have a cannotResume: selector, simply resend cannotReturn:. */

	/* CoInterpreter>>#ceCannotResume */
sqInt
ceCannotResume(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt object;
    sqInt resultOop;
    char *sp;
    char *sp1;
    char *sp2;

	assert(isMachineCodeFrame(GIV(framePointer)));
	assert(frameHasContext(GIV(framePointer)));
	resultOop = longAt(GIV(stackPointer));
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt(GIV(framePointer) + FoxThisContext));
	GIV(stackPointer) = sp;
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), resultOop);
	GIV(stackPointer) = sp1;
	/* begin push: */
	object = ceCannotResumePC();
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp2;
	return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), longAt(GIV(framePointer) + FoxThisContext), 1);
}


/*	Log failure and then retry if there's an accessorDepth or failure due to
	no memory.
 */

	/* CoInterpreter>>#ceCheckAndMaybeRetryPrimitive: */
void
ceCheckAndMaybeRetryPrimitive(sqInt primIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt retried;

	if (recordPrimTrace()) {
		/* begin fastLogPrim: */
		GIV(primTraceLog)[GIV(primTraceLogIndex)] = TracePrimitiveFailure;
		primTraceLogIndex(GIV(primTraceLogIndex) + 1);
	}
	retried = retryPrimitiveOnFailure();
	if (retried
	 && (recordPrimTrace())) {
		/* begin fastLogPrim: */
		GIV(primTraceLog)[GIV(primTraceLogIndex)] = TracePrimitiveRetry;
		primTraceLogIndex(GIV(primTraceLogIndex) + 1);
	}
}

	/* CoInterpreter>>#ceCheckForInterrupts */
void
ceCheckForInterrupts(void)
{
    sqInt switched;

	switched = checkForEventsMayContextSwitch(1);
	returnToExecutivepostContextSwitch(0, switched);
}


/*	Check if the profile timer has expired and if so take a sample.
	If the primitive has failed sample the profileMethod as nil.
	As a courtesy to compileInterpreterPrimitive: map NULL to nilObj. */

	/* CoInterpreter>>#ceCheckProfileTick */
void
ceCheckProfileTick(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!(GIV(newMethod))) {
		GIV(newMethod) = GIV(nilObj);
	}
	checkProfileTick(GIV(newMethod));
}

	/* CoInterpreter>>#ceContext:instVar: */
sqInt
ceContextinstVar(sqInt maybeContext, sqInt slotIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt result;
    char *sp;
    sqInt top;

	if (((longAt(maybeContext)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
		/* begin popStack */
		top = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		GIV(instructionPointer) = top;
		result = externalInstVarofContext(slotIndex, maybeContext);
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp;
	}
	else {
		result = longAt((maybeContext + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))));
	}
	return result;
}


/*	genStorePop:MaybeContextReceiverVariable: filters out unmarried contexts
	but not arbitrary objects in subclasses. It answers maybeMarriedContext so
	that the StackToRegisterMappingCogit can keep ReceiverResultReg live. */

	/* CoInterpreter>>#ceContext:instVar:value: */
sqInt
ceContextinstVarvalue(sqInt maybeMarriedContext, sqInt slotIndex, sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;
    sqInt top;

	if ((((longAt(maybeMarriedContext)) & (classIndexMask())) == ClassMethodContextCompactIndex)
	 && (((((longAt((maybeMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))) {
		/* begin popStack */
		top = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		GIV(instructionPointer) = top;
		externalInstVarofContextput(slotIndex, maybeMarriedContext, anOop);
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp;
	}
	else {
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(maybeMarriedContext)));
		if ((assert(isNonImmediate(maybeMarriedContext)),
		oopisGreaterThanOrEqualTo(maybeMarriedContext, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((anOop & (tagMask())) == 0)
			 && (oopisLessThan(anOop, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(maybeMarriedContext))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(maybeMarriedContext);
				}
			}
		}
		longAtput((maybeMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(slotIndex) << (shiftForWord())))), anOop);
	}
	return maybeMarriedContext;
}

	/* CoInterpreter>>#ceInterpretMethodFromPIC:receiver: */
sqInt
ceInterpretMethodFromPICreceiver(sqInt aMethodObj, sqInt rcvr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstBytecode;
    sqInt header;
    sqInt methodHeader;
    CogMethod *pic;
    sqInt primitiveIndex;
    sqInt top;


	/* pop off inner return and locate open or closed PIC */
	pic = ((CogMethod *) ((popStack()) - (interpretOffset())));
	assert((((pic->cmType)) == CMOpenPIC)
	 || (((pic->cmType)) == CMClosedPIC));
	if (((pic->cmType)) == CMOpenPIC) {
		assert(!(methodHasCogMethod(aMethodObj)));
		if (methodShouldBeCogged(aMethodObj)) {
			cogselector(aMethodObj, (pic->selector));
		}
	}
	if ((assert(isNonImmediate(aMethodObj)),
	isCogMethodReference(longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
		executeCogMethodfromUnlinkedSendWithReceiver(cogMethodOf(aMethodObj), rcvr);
	}
	GIV(messageSelector) = (pic->selector);
	GIV(newMethod) = aMethodObj;
	/* begin primitiveIndexOfMethod:header: */
	assert(isCompiledMethod(aMethodObj));
	header = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	if (methodHeader & AlternateHeaderHasPrimFlag) {
		firstBytecode = (aMethodObj + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
		primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)));
	}
	else {
		primitiveIndex = 0;
	}
	/* begin functionPointerFor:inClass: */
	primitiveFunctionPointer = ((void (*)(void)) ((primitiveIndex > MaxPrimitiveIndex
	? 0
	: primitiveTable[primitiveIndex])));
	GIV(argumentCount) = (pic->cmNumArgs);
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
	return interpretMethodFromMachineCode();
}

	/* CoInterpreter>>#ceMNUFromPICMNUMethod:receiver: */
sqInt
ceMNUFromPICMNUMethodreceiver(sqInt aMethodObj, sqInt rcvr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    CogMethod *cPIC;
    sqInt firstBytecode;
    sqInt header;
    sqInt methodHeader;
    sqInt primitiveIndex;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    sqInt top;

	assert(addressCouldBeOop(rcvr));
	assert((aMethodObj == 0)
	 || ((addressCouldBeObj(aMethodObj))
	 && (isOopCompiledMethod(aMethodObj))));
	cPIC = ((CogMethod *) ((popStack()) - (mnuOffset())));
	assert((((cPIC->cmType)) == CMClosedPIC)
	 || (((cPIC->cmType)) == CMOpenPIC));
	GIV(argumentCount) = (cPIC->cmNumArgs);
	GIV(messageSelector) = (cPIC->selector);
	if (aMethodObj != 0) {
		/* begin popStack */
		top = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		GIV(instructionPointer) = top;
		createActualMessageTo((((tagBits = rcvr & (tagMask()))) != 0
			? (/* begin fetchPointer:ofObject: */
				longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord()))))))
			: fetchClassOfNonImm(rcvr)));
		if (((aMethodObj & (tagMask())) == 0)
		 && ((((((usqInt) (longAt(aMethodObj))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
		 && (isCogMethodReference(longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) {
			/* begin push: */
			longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp;
			executeCogMethodfromUnlinkedSendWithReceiver(cogMethodOf(aMethodObj), rcvr);
			assert(0);
		}
		GIV(newMethod) = aMethodObj;
		/* begin primitiveIndexOfMethod:header: */
		assert(isCompiledMethod(aMethodObj));
		header = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((((header) & 7) == 1)) {
			methodHeader = header;
		}
		else {
			assert((((usqInt)header)) < GIV(newSpaceStart));
			assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
			methodHeader = ((((CogMethod *) header))->methodHeader);
		}
		if (methodHeader & AlternateHeaderHasPrimFlag) {
			firstBytecode = (aMethodObj + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
			primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)));
		}
		else {
			primitiveIndex = 0;
		}
		/* begin functionPointerFor:inClass: */
		primitiveFunctionPointer = ((void (*)(void)) ((primitiveIndex > MaxPrimitiveIndex
	? 0
	: primitiveTable[primitiveIndex])));
		return interpretMethodFromMachineCode();
	}
	handleMNUInMachineCodeToclassForMessage(SelectorDoesNotUnderstand, rcvr, (((tagBits1 = rcvr & (tagMask()))) != 0
		? (/* begin fetchPointer:ofObject: */
			(GIV(lkupClass) = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord())))))))
		: (GIV(lkupClass) = fetchClassOfNonImm(rcvr))));
	assert(0);
	return 0;
}


/*	We know anObject has not a hash yet (or this trampoline would not be
	called. Sets the hash, then answers it as a smallinteger */

	/* CoInterpreter>>#ceNewHashOf: */
sqInt
ceNewHashOf(sqInt anObject)
{
	assert((isNonImmediate(anObject))
	 && ((rawHashBitsOf(anObject)) == 0));
	return (((usqInt)(newHashBitsOf(anObject)) << 3) | 1);
}

	/* CoInterpreter>>#ceNonLocalReturn: */
sqInt
ceNonLocalReturn(sqInt returnValue)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    sqInt callerContextOrNil1;
    sqInt callerContextOrNil2;
    char *callerFP;
    sqInt closure;
    sqInt contextToReturnTo;
    sqInt currentCtx;
    char *frameToReturnTo;
    sqInt home;
    StackPage *newPage;
    sqInt nextCntx;
    sqInt objOop;
    sqInt objOop1;
    sqInt ourContext;
    sqInt ourContext1;
    sqInt senderOop;
    sqInt senderOop1;
    char *sp;
    char *sp1;
    char *sp11;
    char *sp12;
    char *sp13;
    char *sp2;
    char *sp21;
    char *sp22;
    char *sp23;
    char *sp3;
    char *sp31;
    char *sp4;
    char *sp5;
    char *theFP;
    char *theFP1;
    char *theFP2;
    char *theFP3;
    char *theFP4;
    char *theFP5;
    char *theFP6;
    StackPage *thePage;
    StackPage *thePage1;
    StackPage *thePage2;
    StackPage *thePage3;
    char *theSP;
    char *theSP1;
    char *theSP2;
    char *theSP3;
    sqInt top;
    sqInt unwindContextOrNilOrZero;
    sqInt valuePointer;
    sqInt valuePointer1;


	/* self shortPrintFrameAndCallers: framePointer.
	   self printOop: returnValue.
	   self halt. */
	frameToReturnTo = ((char *) 0);
	assert(isMachineCodeFrame(GIV(framePointer)));
	assert(frameIsBlockActivation(GIV(framePointer)));
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	closure = longAt(GIV(framePointer) + (frameStackedReceiverOffset(GIV(framePointer))));

	/* avoid compiler warning */
	/* Walk the closure's lexical chain to find the context or frame to return from (home). */
	home = null;
	while (closure != GIV(nilObj)) {
		/* begin followField:ofObject: */
		objOop = longAt((closure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))));
		if (((objOop & (tagMask())) == 0)
		 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop = fixFollowedFieldofObjectwithInitialValue(ClosureOuterContextIndex, closure, objOop);
		}
		home = objOop;
		if (!(((home & (tagMask())) == 0)
			 && (((longAt(home)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {

			/* error: can't find home on chain; cannot return */
			/* begin ensureFrameIsMarried:SP: */
			theFP1 = GIV(framePointer);
			theSP = GIV(stackPointer);
			if (((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
				? ((longAt(theFP1 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
				: (byteAt((theFP1 + FoxIFrameFlags) + 2)) != 0)) {
				assert(isContext(frameContext(theFP1)));
				ourContext = longAt(theFP1 + FoxThisContext);
				goto l10;
			}
			ourContext = marryFrameSP(theFP1, theSP);
	l10:	/* end ensureFrameIsMarried:SP: */;
			/* begin externalCannotReturn:from: */
			longAtput((sp = GIV(stackPointer) - BytesPerWord), ourContext);
			GIV(stackPointer) = sp;
			/* begin push: */
			longAtput((sp1 = GIV(stackPointer) - BytesPerWord), returnValue);
			GIV(stackPointer) = sp1;
			/* begin push: */
			longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp2;
			return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), ourContext, 1);
		}
		/* begin followField:ofObject: */
		objOop1 = longAt((home + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureIndex) << (shiftForWord())))));
		if (((objOop1 & (tagMask())) == 0)
		 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop1 = fixFollowedFieldofObjectwithInitialValue(ClosureIndex, home, objOop1);
		}
		closure = objOop1;
	}
	unwindContextOrNilOrZero = findUnwindThroughContext(home);
	if (unwindContextOrNilOrZero == GIV(nilObj)) {

		/* error: can't find home on chain; cannot return */
		/* begin ensureFrameIsMarried:SP: */
		theFP2 = GIV(framePointer);
		theSP1 = GIV(stackPointer);
		if (((((usqInt)(longAt(theFP2 + FoxMethod)))) < (startOfMemory())
			? ((longAt(theFP2 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((theFP2 + FoxIFrameFlags) + 2)) != 0)) {
			assert(isContext(frameContext(theFP2)));
			ourContext = longAt(theFP2 + FoxThisContext);
			goto l15;
		}
		ourContext = marryFrameSP(theFP2, theSP1);
	l15:	/* end ensureFrameIsMarried:SP: */;
		/* begin externalCannotReturn:from: */
		longAtput((sp3 = GIV(stackPointer) - BytesPerWord), ourContext);
		GIV(stackPointer) = sp3;
		/* begin push: */
		longAtput((sp11 = GIV(stackPointer) - BytesPerWord), returnValue);
		GIV(stackPointer) = sp11;
		/* begin push: */
		longAtput((sp21 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp21;
		return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), ourContext, 1);
	}
	if (unwindContextOrNilOrZero != 0) {
		/* begin externalAboutToReturn:through: */
		theFP6 = GIV(framePointer);
		theSP3 = GIV(stackPointer);
		if (((((usqInt)(longAt(theFP6 + FoxMethod)))) < (startOfMemory())
			? ((longAt(theFP6 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((theFP6 + FoxIFrameFlags) + 2)) != 0)) {
			assert(isContext(frameContext(theFP6)));
			ourContext1 = longAt(theFP6 + FoxThisContext);
			goto l23;
		}
		ourContext1 = marryFrameSP(theFP6, theSP3);
	l23:	/* end ensureFrameIsMarried:SP: */;
		/* begin push: */
		longAtput((sp5 = GIV(stackPointer) - BytesPerWord), ourContext1);
		GIV(stackPointer) = sp5;
		/* begin push: */
		longAtput((sp13 = GIV(stackPointer) - BytesPerWord), returnValue);
		GIV(stackPointer) = sp13;
		/* begin push: */
		longAtput((sp23 = GIV(stackPointer) - BytesPerWord), unwindContextOrNilOrZero);
		GIV(stackPointer) = sp23;
		/* begin push: */
		longAtput((sp31 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp31;
		return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorAboutToReturn) << (shiftForWord()))))), ourContext1, 2);
	}
	contextToReturnTo = null;
	if (((((longAt((home + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
		assert(checkIsStillMarriedContextcurrentFP(home, GIV(framePointer)));
		/* begin frameOfMarriedContext: */
		senderOop = longAt((home + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop) & 7) == 1));
		theFP = pointerForOop(senderOop - 1);
		if ((longAt(theFP + FoxSavedFP)) == 0) {
			/* begin frameCallerContext: */
			assert(isBaseFrame(theFP));
			/* begin stackPageFor: */
			thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
			pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
			callerContextOrNil = longAt((thePage1->baseAddress));
			assert(addressCouldBeObj(callerContextOrNil));
			assert((callerContextOrNil == (nilObject()))
			 || (isContext(callerContextOrNil)));
			contextToReturnTo = callerContextOrNil;
		}
		else {
			frameToReturnTo = pointerForOop(longAt(theFP + FoxSavedFP));
		}
	}
	else {
		contextToReturnTo = longAt((home + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		if ((((contextToReturnTo & (tagMask())) == 0)
		 && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex))
		 && (((((longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))) {
			assert(checkIsStillMarriedContextcurrentFP(contextToReturnTo, GIV(framePointer)));
			/* begin frameOfMarriedContext: */
			senderOop1 = longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
			assert((((senderOop1) & 7) == 1));
			frameToReturnTo = pointerForOop(senderOop1 - 1);
			contextToReturnTo = null;
		}
	}
	if (contextToReturnTo != null) {
		frameToReturnTo = establishFrameForContextToReturnTo(contextToReturnTo);
		if (frameToReturnTo == 0) {

			/* error: home's sender is dead; cannot return */
			/* begin ensureFrameIsMarried:SP: */
			theFP3 = GIV(framePointer);
			theSP2 = GIV(stackPointer);
			if (((((usqInt)(longAt(theFP3 + FoxMethod)))) < (startOfMemory())
				? ((longAt(theFP3 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
				: (byteAt((theFP3 + FoxIFrameFlags) + 2)) != 0)) {
				assert(isContext(frameContext(theFP3)));
				ourContext = longAt(theFP3 + FoxThisContext);
				goto l18;
			}
			ourContext = marryFrameSP(theFP3, theSP2);
	l18:	/* end ensureFrameIsMarried:SP: */;
			/* begin externalCannotReturn:from: */
			longAtput((sp4 = GIV(stackPointer) - BytesPerWord), ourContext);
			GIV(stackPointer) = sp4;
			/* begin push: */
			longAtput((sp12 = GIV(stackPointer) - BytesPerWord), returnValue);
			GIV(stackPointer) = sp12;
			/* begin push: */
			longAtput((sp22 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp22;
			return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorCannotReturn) << (shiftForWord()))))), ourContext, 1);
		}
	}
	assert(pageListIsWellFormed());
	/* begin stackPageFor: */
	newPage = stackPageAtpages((assert((((((char *) frameToReturnTo)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) frameToReturnTo)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(frameToReturnTo, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	if (newPage != GIV(stackPage)) {
		/* begin frameCallerContext: */
		theFP5 = (GIV(stackPage)->baseFP);
		assert(isBaseFrame(theFP5));
		/* begin stackPageFor: */
		thePage3 = stackPageAtpages((assert((((((char *) theFP5)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP5)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP5, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		callerContextOrNil2 = longAt((thePage3->baseAddress));
		assert(addressCouldBeObj(callerContextOrNil2));
		assert((callerContextOrNil2 == (nilObject()))
		 || (isContext(callerContextOrNil2)));
		currentCtx = callerContextOrNil2;
		assert(isContext(currentCtx));
		freeStackPage(GIV(stackPage));
		while (1) {
			assert(isContext(currentCtx));
			if ((((((longAt((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
			 && ((stackPageFor((theFP = frameOfMarriedContext(currentCtx)))) == newPage)) break;
			if (((((longAt((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
				/* begin stackPageFor: */
				thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
				pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
				/* begin frameCallerContext: */
				theFP4 = (thePage->baseFP);
				assert(isBaseFrame(theFP4));
				/* begin stackPageFor: */
				thePage2 = stackPageAtpages((assert((((((char *) theFP4)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP4)) <= (((char *) GIV(pages)))))),
				pageIndexForstackBasePlus1bytesPerPage(theFP4, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
				callerContextOrNil1 = longAt((thePage2->baseAddress));
				assert(addressCouldBeObj(callerContextOrNil1));
				assert((callerContextOrNil1 == (nilObject()))
				 || (isContext(callerContextOrNil1)));
				currentCtx = callerContextOrNil1;
				freeStackPage(thePage);
			}
			else {
				nextCntx = longAt((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
				/* begin markContextAsDead: */
				assert(isContext(currentCtx));
				/* begin storePointerUnchecked:ofObject:withValue: */
				valuePointer = GIV(nilObj);
				assert(!(isOopForwarded(currentCtx)));
				longAtput((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer);
				/* begin storePointerUnchecked:ofObject:withValue: */
				valuePointer1 = GIV(nilObj);
				assert(!(isOopForwarded(currentCtx)));
				longAtput((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1);
				currentCtx = nextCntx;
			}
		}
		/* begin setStackPageAndLimit: */
		assert(newPage != 0);
		GIV(stackPage) = newPage;
		if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
			GIV(stackLimit) = (GIV(stackPage)->stackLimit);
		}
		markStackPageMostRecentlyUsed(newPage);
		/* begin setStackPointersFromPage: */
		GIV(stackPointer) = (newPage->headSP);
		GIV(framePointer) = (newPage->headFP);
	}
	if (GIV(framePointer) == frameToReturnTo) {
		/* begin popStack */
		top = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		GIV(instructionPointer) = top;
	}
	else {
		do {
			callerFP = GIV(framePointer);
			GIV(framePointer) = pointerForOop(longAt(GIV(framePointer) + FoxSavedFP));
		} while(GIV(framePointer) != frameToReturnTo);
		GIV(instructionPointer) = ((usqInt)(pointerForOop(longAt(callerFP + FoxCallerSavedIP))));
		assert(!(isBaseFrame(callerFP)));
		GIV(stackPointer) = (callerFP + (frameStackedReceiverOffset(callerFP))) + BytesPerWord;
	}
	return returntoExecutive(returnValue, 0);
}

	/* CoInterpreter>>#ceReapAndResetErrorCodeFor: */
void
ceReapAndResetErrorCodeFor(CogMethod *cogMethod)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(GIV(primFailCode) != 0);
	GIV(newMethod) = (cogMethod->methodObject);
	reapAndResetErrorCodeToheader(GIV(stackPointer) + BytesPerWord, (cogMethod->methodHeader));
}


/*	Perform a return from a machine code frame to an interpreted frame.
	The machine code has executed a return instruction when the return address
	is set to ceReturnToInterpreterPC. Return the result and switch to the
	interpreter.  */

	/* CoInterpreter>>#ceReturnToInterpreter: */
sqInt
ceReturnToInterpreter(sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aMethodObj;
    char *sp;
    StackPage *thePage;

	assert(addressCouldBeOop(anOop));
	flag("are you really sure setStackPageAndLimit: is needed?");
	/* begin setStackPageAndLimit: */
	thePage = GIV(stackPage);
	assert(thePage != 0);
	GIV(stackPage) = thePage;
	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
	}
	markStackPageMostRecentlyUsed(thePage);
	assert(!(isMachineCodeFrame(GIV(framePointer))));
	/* begin setMethod: */
	aMethodObj = longAt(GIV(framePointer) + FoxMethod);
	assert((((usqInt)aMethodObj)) >= (startOfMemory()));
	GIV(method) = aMethodObj;
	assert(isOopCompiledMethod(GIV(method)));
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	assertValidExecutionPointersimbarline(longAt(GIV(framePointer) + FoxIFSavedIP), GIV(framePointer), GIV(stackPointer), 1, __LINE__);
	GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), anOop);
	GIV(stackPointer) = sp;
	siglongjmp(reenterInterpreter, ReturnToInterpreter);
	return null;
}


/*	Entry-point for an abort send in a CogMethod (aboutToReturn:through:,
	cannotReturn: et al).
	Try and dispatch the send, but the send may turn into an MNU in which case
	defer to
	handleMNUInMachineCodeTo:... which will dispatch the MNU.
	
	Continue execution via either executeMethod or
	interpretMethodFromMachineCode: depending on whether the target method is
	cogged or not. */

	/* CoInterpreter>>#ceSendAbort:to:numArgs: */
sqInt
ceSendAborttonumArgs(sqInt selector, sqInt rcvr, sqInt numArgs)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt aMethodObj;
    sqInt classObj;
    sqInt classTablePage;
    sqInt classTag;
    CogMethod *cogMethod;
    sqInt errSelIdx;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt methodHeader;
    sqInt tagBits;
    sqInt top;


	/* self printExternalHeadFrame */
	/* self printStringOf: selector */
	assertCStackWellAligned();
	assert(addressCouldBeOop(rcvr));
	/* begin sendBreakpoint:receiver: */
	sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr);
	GIV(argumentCount) = numArgs;
	if (((tagBits = rcvr & (tagMask()))) != 0) {
		classTag = tagBits;
	}
	else {
		/* begin classIndexOf: */
		classTag = (longAt(rcvr)) & (classIndexMask());
	}
	if (lookupInMethodCacheSelclassTag(selector, classTag)) {

		/* check for coggability because method is in the cache */
		/* begin ifAppropriateCompileToNativeCode:selector: */
		aMethodObj = GIV(newMethod);
		/* begin fetchPointer:ofObject: */
		methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((assert(((((methodHeader) & 7) == 1))
			 || (((((usqInt)methodHeader)) < (startOfMemory()))
			 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
		(methodHeader & (smallIntegerTag())) == 0)) {

			/* makeBaseFrame: can create cog methods with nil selectors. */
			cogMethod = ((CogMethod *) methodHeader);
			if (((cogMethod->selector)) == GIV(nilObj)) {
				setSelectorOfto(cogMethod, selector);
			}
		}
		else {
			if (((assert((((methodHeader) & 7) == 1)),
			((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
				cogselector(aMethodObj, selector);
			}
			else {
				maybeFlagMethodAsInterpreted(aMethodObj);
			}
		}
	}
	else {
		GIV(messageSelector) = selector;
		/* begin classAtIndex: */
		assert((classTag >= 0)
		 && ((classTag <= (tagMask()))
		 || ((classTag >= (arrayClassIndexPun()))
		 && (classTag <= (classIndexMask())))));
		/* begin fetchPointer:ofObject: */
		fieldIndex = ((usqInt) classTag) >> (classTableMajorIndexShift());
		classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
		if (classTablePage == GIV(nilObj)) {
			classObj = null;
			goto l4;
		}
		/* begin fetchPointer:ofObject: */
		fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1);
		classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	l4:	/* end classAtIndex: */;
		if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) {
			handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj);
			assert(0);
		}
	}
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
	if (((GIV(newMethod) & (tagMask())) == 0)
	 && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
	 && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) {
		executeNewMethod();
		assert(0);
	}
	return interpretMethodFromMachineCode();
}


/*	Send from an Open PIC when the first-level method lookup probe has failed,
	or to continue when PIC creation has failed (e.g. because we're out of
	code space),
	or when a send has failed due to a forwarded receiver. */
/*	self printFrame: stackPage headFP WithSP: stackPage headSP */
/*	self printStringOf: selector */

	/* CoInterpreter>>#ceSendFromInLineCacheMiss: */
sqInt
ceSendFromInLineCacheMiss(CogMethod *cogMethodOrPIC)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt aMethodObj;
    sqInt classObj;
    sqInt classTablePage;
    sqInt classTag;
    CogMethod *cogMethod;
    sqInt errSelIdx;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt methodHeader;
    usqInt numArgs;
    sqInt rcvr;
    sqInt selector;
    sqInt tagBits;
    sqInt top;

	numArgs = (cogMethodOrPIC->cmNumArgs);

	/* skip return pc */
	rcvr = longAt(GIV(stackPointer) + ((numArgs + 1) * BytesPerWord));
	assert(addressCouldBeOop(rcvr));
	if (((tagBits = rcvr & (tagMask()))) != 0) {
		classTag = tagBits;
	}
	else {
		/* begin classIndexOf: */
		classTag = (longAt(rcvr)) & (classIndexMask());
	}
	GIV(argumentCount) = numArgs;
	if (lookupInMethodCacheSelclassTag((cogMethodOrPIC->selector), classTag)) {

		/* check for coggability because method is in the cache */
		/* begin ifAppropriateCompileToNativeCode:selector: */
		aMethodObj = GIV(newMethod);
		selector = (cogMethodOrPIC->selector);
		/* begin fetchPointer:ofObject: */
		methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((assert(((((methodHeader) & 7) == 1))
			 || (((((usqInt)methodHeader)) < (startOfMemory()))
			 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
		(methodHeader & (smallIntegerTag())) == 0)) {

			/* makeBaseFrame: can create cog methods with nil selectors. */
			cogMethod = ((CogMethod *) methodHeader);
			if (((cogMethod->selector)) == GIV(nilObj)) {
				setSelectorOfto(cogMethod, selector);
			}
		}
		else {
			if (((assert((((methodHeader) & 7) == 1)),
			((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
				cogselector(aMethodObj, selector);
			}
			else {
				maybeFlagMethodAsInterpreted(aMethodObj);
			}
		}
	}
	else {
		if (((((cogMethodOrPIC->selector)) & (tagMask())) == 0)
		 && (((longAt((cogMethodOrPIC->selector))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			handleForwardedSelectorFaultFor((cogMethodOrPIC->selector));
			return ceSendFromInLineCacheMiss(cogMethodOrPIC);
		}
		if (classTag == (isForwardedObjectClassIndexPun())) {
			handleForwardedSendFaultForReceiverstackDelta(rcvr, 1);
			return ceSendFromInLineCacheMiss(cogMethodOrPIC);
		}
		GIV(messageSelector) = (cogMethodOrPIC->selector);
		/* begin classAtIndex: */
		assert((classTag >= 0)
		 && ((classTag <= (tagMask()))
		 || ((classTag >= (arrayClassIndexPun()))
		 && (classTag <= (classIndexMask())))));
		/* begin fetchPointer:ofObject: */
		fieldIndex = ((usqInt) classTag) >> (classTableMajorIndexShift());
		classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
		if (classTablePage == GIV(nilObj)) {
			classObj = null;
			goto l4;
		}
		/* begin fetchPointer:ofObject: */
		fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1);
		classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	l4:	/* end classAtIndex: */;
		if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) {
			handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj);
			assert(0);
		}
	}
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
	if (((GIV(newMethod) & (tagMask())) == 0)
	 && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
	 && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) {
		executeNewMethod();
		assert(0);
	}
	return interpretMethodFromMachineCode();
}


/*	For RegisterAllocatingCogit we want the pc following a conditional branch
	not to be reachable, so
	we don't have to generate code to reload registers. But notionally the pc
	following a conditional
	branch is reached when continuing from a mustBeBoolean error. Instead of
	supporting this in the
	JIT, simply convert to an interpreter frame, backup the pc to the branch,
	reenter the interpreter
	and hence retry the mustBeBoolean send therein. N.B. We could do this for
	immutability violations
	too, but immutability is used in actual applications and so should be
	performant, whereas
	mustBeBoolean errors are extremely rare and so we choose brevity over
	performance in this case. */

	/* CoInterpreter>>#ceSendMustBeBooleanTo:interpretingAtDelta: */
void
ceSendMustBeBooleanTointerpretingAtDelta(sqInt aNonBooleanObject, sqInt jumpSize)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    CogBlockMethod *cogMethod;
    sqInt methodHeader;
    sqInt methodObj;
    sqInt oop;
    char *p;
    char *sp;
    sqInt startBcpc;
    sqInt top;

	assert(addressCouldBeOop(aNonBooleanObject));
	/* begin mframeCogMethod: */
	cogMethod = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask));
	if ((((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0)
	 && (!((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)))) {
		methodHeader = ((((CogMethod *) (((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)
	? ((CogMethod *) cogMethod)
	: ((CogMethod *) ((((usqInt)cogMethod)) - ((cogMethod->homeOffset))))))))->methodHeader);
		methodObj = ((((CogMethod *) (((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)
	? ((CogMethod *) cogMethod)
	: ((CogMethod *) ((((usqInt)cogMethod)) - ((cogMethod->homeOffset))))))))->methodObject);
		startBcpc = (cogMethod->startpc);
	}
	else {
		methodHeader = ((((CogMethod *) cogMethod))->methodHeader);
		methodObj = ((((CogMethod *) cogMethod))->methodObject);
		startBcpc = ((literalCountOfMethodHeader(methodHeaderOf(methodObj))) + LiteralStart) * BytesPerOop;
	}
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
	GIV(instructionPointer) = bytecodePCForstartBcpcin(GIV(instructionPointer), startBcpc, cogMethod);

	/* pre-decrement */
	/* Make space for the two extra fields in an interpreter frame */
	GIV(instructionPointer) = (((methodObj + BaseHeaderSize) + GIV(instructionPointer)) - jumpSize) - 1;
	for (p = GIV(stackPointer); p <= (GIV(framePointer) + FoxMFReceiver); p += BytesPerWord) {
		oop = longAt(p);
		longAtput((p - BytesPerWord) - BytesPerWord, longAt(p));
	}
	GIV(stackPointer) = (GIV(stackPointer) - BytesPerWord) - BytesPerWord;
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), aNonBooleanObject);
	GIV(stackPointer) = sp;
	longAtput(GIV(framePointer) + FoxIFrameFlags, (VMBIGENDIAN
		? ((1 + (((cogMethod->cmNumArgs)) << ((BytesPerWord * 8) - 8))) + ((((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
	? 1ULL << ((BytesPerWord * 8) - 16)
	: 0))) + ((((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
	? 1ULL << ((BytesPerWord * 8) - 24)
	: 0))
		: ((1 + (((cogMethod->cmNumArgs)) << 8)) + ((((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
	? 1U << 16
	: 0))) + ((((longAt(GIV(framePointer) + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
	? 1U << 24
	: 0))));
	longAtput(GIV(framePointer) + FoxIFSavedIP, 0);
	longAtput(GIV(framePointer) + FoxMethod, methodObj);
	/* begin setMethod:methodHeader: */
	GIV(method) = methodObj;
	assert(isOopCompiledMethod(GIV(method)));
	assert((methodHeaderOf(GIV(method))) == methodHeader);
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	siglongjmp(reenterInterpreter, ReturnToInterpreter);
}

	/* CoInterpreter>>#ceSendMustBeBoolean: */
sqInt
ceSendMustBeBoolean(sqInt anObject)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;
    char *sp1;
    sqInt top;

	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), anObject);
	GIV(stackPointer) = sp;
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp1;
	return ceSendAborttonumArgs(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorMustBeBoolean) << (shiftForWord()))))), anObject, 0);
}


/*	Entry-point for an unlinked directed super send in a CogMethod. Smalltalk
	stack looks like
	receiver
	args
	head sp ->	sender return pc
	methodClassBinding is an association whose value is the class above which
	to start the lookup. */

	/* CoInterpreter>>#ceSend:aboveClassBinding:to:numArgs: */
void
ceSendaboveClassBindingtonumArgs(sqInt selector, sqInt methodClassBinding, sqInt rcvr, sqInt numArgs)
{
	ceSendabovetonumArgs(selector, fetchPointerofObject(ValueIndex, (((methodClassBinding & (tagMask())) == 0)
	 && (((longAt(methodClassBinding)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)
		? noInlineFollowForwarded(methodClassBinding)
		: methodClassBinding)), rcvr, numArgs);
}


/*	Entry-point for an unlinked directed super send in a CogMethod. Smalltalk
	stack looks like
	receiver
	args
	head sp ->	sender return pc
	methodClass is the class above which to start the lookup.
	
	If an MNU then defer to handleMNUInMachineCodeTo:... which will dispatch
	the MNU and
	may choose to allocate a closed PIC with a fast MNU dispatch for this
	send. Otherwise
	attempt to link the send site as efficiently as possible. All link
	attempts may fail; e.g.
	because we're out of code memory.
	
	Continue execution via either executeMethod or
	interpretMethodFromMachineCode: depending on whether the target method is
	cogged or not. */

	/* CoInterpreter>>#ceSend:above:to:numArgs: */
sqInt
ceSendabovetonumArgs(sqInt selector, sqInt methodClass, sqInt rcvr, sqInt numArgs)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt aMethodObj;
    sqInt classObj;
    sqInt classObj1;
    sqInt classPointer;
    sqInt classTablePage;
    sqInt classTag;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt err;
    sqInt errSelIdx;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt hash;
    sqInt methodHeader;
    sqInt methodHeader1;
    CogMethod *newCogMethod;
    sqInt objOop;
    sqInt top;
    sqInt top1;


	/* self printExternalHeadFrame */
	/* self printStringOf: selector */
	assertCStackWellAligned();
	assert(addressCouldBeOop(rcvr));
	/* begin sendBreakpoint:receiver: */
	sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr);
	/* begin classTagForClass: */
	classPointer = (((methodClass & (tagMask())) == 0)
	 && (((longAt(methodClass)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)
		? noInlineFollowForwarded(methodClass)
		: methodClass);
	/* begin followField:ofObject: */
	objOop = longAt((classPointer + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classPointer, objOop);
	}
	classObj1 = objOop;
	assert(addressCouldBeClassObj(classObj1));
	classTag = (((hash = (long32At(classObj1 + 4)) & (identityHashHalfWordMask()))) != 0
		? hash
		: (objCouldBeClassObj(classObj1)
				? (((err = enterIntoClassTable(classObj1))) != 0
						? -err
						: (/* begin rawHashBitsOf: */
							(long32At(classObj1 + 4)) & (identityHashHalfWordMask())))
				: -PrimErrBadReceiver));
	GIV(argumentCount) = numArgs;
	if (lookupInMethodCacheSelclassTag(selector, classTag)) {

		/* check for coggability because method is in the cache */
		/* begin ifAppropriateCompileToNativeCode:selector: */
		aMethodObj = GIV(newMethod);
		/* begin fetchPointer:ofObject: */
		methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((assert(((((methodHeader1) & 7) == 1))
			 || (((((usqInt)methodHeader1)) < (startOfMemory()))
			 && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))),
		(methodHeader1 & (smallIntegerTag())) == 0)) {

			/* makeBaseFrame: can create cog methods with nil selectors. */
			cogMethod1 = ((CogMethod *) methodHeader1);
			if (((cogMethod1->selector)) == GIV(nilObj)) {
				setSelectorOfto(cogMethod1, selector);
			}
		}
		else {
			if (((assert((((methodHeader1) & 7) == 1)),
			((methodHeader1 >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
				cogselector(aMethodObj, selector);
			}
			else {
				maybeFlagMethodAsInterpreted(aMethodObj);
			}
		}
	}
	else {
		assert(!((isForwardedClassTag(classTag))));
		if (((selector & (tagMask())) == 0)
		 && (((longAt(selector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			return ceSendabovetonumArgs(handleForwardedSelectorFaultFor(selector), methodClass, rcvr, numArgs);
		}
		GIV(messageSelector) = selector;
		/* begin classAtIndex: */
		assert((classTag >= 0)
		 && ((classTag <= (tagMask()))
		 || ((classTag >= (arrayClassIndexPun()))
		 && (classTag <= (classIndexMask())))));
		/* begin fetchPointer:ofObject: */
		fieldIndex = ((usqInt) classTag) >> (classTableMajorIndexShift());
		classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
		if (classTablePage == GIV(nilObj)) {
			classObj = null;
			goto l4;
		}
		/* begin fetchPointer:ofObject: */
		fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1);
		classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	l4:	/* end classAtIndex: */;
		if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) {
			if ((errSelIdx == SelectorDoesNotUnderstand)
			 && ((((usqInt)((cogMethod = cogMNUPICSelectorreceivermethodOperandnumArgs(GIV(messageSelector), rcvr, mnuMethodOrNilFor(rcvr), GIV(argumentCount)))))) > (minCogMethodAddress()))) {
				linkSendAtintooffsetreceiver(longAt(GIV(stackPointer)), mframeHomeMethod(GIV(framePointer)), cogMethod, noCheckEntryOffset(), rcvr);
			}
			handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj);
			assert(0);
		}
	}
	if (((GIV(newMethod) & (tagMask())) == 0)
	 && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
	 && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) {
		/* begin cogMethodOf: */
		methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader))
		 && ((((usqInt)methodHeader)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader);
		if (((cogMethod->selector)) == GIV(nilObj)) {
			setSelectorOfto(cogMethod, selector);
		}
		else {

			/* Deal with anonymous accessors, e.g. in Newspeak.  The cogMethod may not have the
			   correct selector.  If not, try and compile a new method with the correct selector. */
			if (((cogMethod->selector)) != selector) {
				newCogMethod = cogselector(GIV(newMethod), selector);
				if (!(newCogMethod == null)) {
					cogMethod = newCogMethod;
				}
			}
		}
		if (((cogMethod->selector)) == selector) {
			linkSendAtintooffsetreceiver(longAt(GIV(stackPointer)), mframeHomeMethod(GIV(framePointer)), cogMethod, noCheckEntryOffset(), rcvr);
		}
		/* begin popStack */
		top = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		GIV(instructionPointer) = top;
		executeNewMethod();
		assert(0);
	}
	/* begin popStack */
	top1 = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top1;
	return interpretMethodFromMachineCode();
}


/*	Entry-point for an unlinked send in a CogMethod. Smalltalk stack looks
	like receiver
	args
	head sp ->	sender return pc
	
	If an MNU then defer to handleMNUInMachineCodeTo:... which will dispatch
	the MNU and
	may choose to allocate a closed PIC with a fast MNU dispatch for this
	send. Otherwise
	attempt to link the send site as efficiently as possible. All link
	attempts may fail; e.g.
	because we're out of code memory.
	
	Continue execution via either executeMethod or
	interpretMethodFromMachineCode: depending on whether the target method is
	cogged or not. */

	/* CoInterpreter>>#ceSend:super:to:numArgs: */
sqInt
ceSendsupertonumArgs(sqInt selector, sqInt superNormalBar, sqInt rcvr, sqInt numArgs)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt aMethodObj;
    sqInt classObj;
    sqInt classObj1;
    sqInt classPointer;
    sqInt classTablePage;
    sqInt classTag;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt err;
    sqInt errSelIdx;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt hash;
    sqInt literal;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt methodPointer;
    CogMethod *newCogMethod;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop2;
    sqInt offset;
    sqInt tagBits;
    sqInt top;
    sqInt top1;


	/* self printExternalHeadFrame */
	/* self printStringOf: selector */
	assertCStackWellAligned();
	assert(addressCouldBeOop(rcvr));
	/* begin sendBreakpoint:receiver: */
	sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), rcvr);
	if (superNormalBar == 0) {
		if (((tagBits = rcvr & (tagMask()))) != 0) {
			classTag = tagBits;
		}
		else {
			/* begin classIndexOf: */
			classTag = (longAt(rcvr)) & (classIndexMask());
		}
	}
	else {
		/* begin classTagForClass: */
		if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) {
			methodPointer = ((mframeHomeMethod(GIV(framePointer)))->methodObject);
		}
		else {
			/* begin iframeMethod: */
			methodPointer = longAt(GIV(framePointer) + FoxMethod);
		}
		/* begin followLiteral:ofMethod: */
		offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1;
		/* begin followField:ofObject: */
		objOop1 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
		if (((objOop1 & (tagMask())) == 0)
		 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop1 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop1);
		}
		literal = objOop1;
		if ((literal != GIV(nilObj))
		 && (((literal & (tagMask())) == 0)
		 && (((((usqInt) (longAt(literal))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))) {
			assert((numSlotsOf(literal)) > ValueIndex);
			/* begin followField:ofObject: */
			objOop2 = longAt((literal + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
			if (((objOop2 & (tagMask())) == 0)
			 && (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop2 = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop2);
			}
			classPointer = objOop2;
		}
		else {
			/* begin nilObject */
			classPointer = GIV(nilObj);
		}
		/* begin followField:ofObject: */
		objOop = longAt((classPointer + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop & (tagMask())) == 0)
		 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classPointer, objOop);
		}
		classObj1 = objOop;
		assert(addressCouldBeClassObj(classObj1));
		classTag = (((hash = (long32At(classObj1 + 4)) & (identityHashHalfWordMask()))) != 0
			? hash
			: (objCouldBeClassObj(classObj1)
					? (((err = enterIntoClassTable(classObj1))) != 0
							? -err
							: (/* begin rawHashBitsOf: */
								(long32At(classObj1 + 4)) & (identityHashHalfWordMask())))
					: -PrimErrBadReceiver));
	}
	GIV(argumentCount) = numArgs;
	if (lookupInMethodCacheSelclassTag(selector, classTag)) {

		/* check for coggability because method is in the cache */
		/* begin ifAppropriateCompileToNativeCode:selector: */
		aMethodObj = GIV(newMethod);
		/* begin fetchPointer:ofObject: */
		methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((assert(((((methodHeader1) & 7) == 1))
			 || (((((usqInt)methodHeader1)) < (startOfMemory()))
			 && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))),
		(methodHeader1 & (smallIntegerTag())) == 0)) {

			/* makeBaseFrame: can create cog methods with nil selectors. */
			cogMethod1 = ((CogMethod *) methodHeader1);
			if (((cogMethod1->selector)) == GIV(nilObj)) {
				setSelectorOfto(cogMethod1, selector);
			}
		}
		else {
			if (((assert((((methodHeader1) & 7) == 1)),
			((methodHeader1 >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
				cogselector(aMethodObj, selector);
			}
			else {
				maybeFlagMethodAsInterpreted(aMethodObj);
			}
		}
	}
	else {
		if (((selector & (tagMask())) == 0)
		 && (((longAt(selector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			return ceSendsupertonumArgs(handleForwardedSelectorFaultFor(selector), superNormalBar, rcvr, numArgs);
		}
		if (classTag == (isForwardedObjectClassIndexPun())) {
			assert(superNormalBar == 0);
			return ceSendsupertonumArgs(selector, superNormalBar, handleForwardedSendFaultForReceiverstackDelta(rcvr, 1), numArgs);
		}
		GIV(messageSelector) = selector;
		/* begin classAtIndex: */
		assert((classTag >= 0)
		 && ((classTag <= (tagMask()))
		 || ((classTag >= (arrayClassIndexPun()))
		 && (classTag <= (classIndexMask())))));
		/* begin fetchPointer:ofObject: */
		fieldIndex = ((usqInt) classTag) >> (classTableMajorIndexShift());
		classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
		if (classTablePage == GIV(nilObj)) {
			classObj = null;
			goto l8;
		}
		/* begin fetchPointer:ofObject: */
		fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1);
		classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	l8:	/* end classAtIndex: */;
		if (((errSelIdx = lookupOrdinaryNoMNUEtcInClass(classObj))) != 0) {
			if ((errSelIdx == SelectorDoesNotUnderstand)
			 && ((((usqInt)((cogMethod = cogMNUPICSelectorreceivermethodOperandnumArgs(GIV(messageSelector), rcvr, mnuMethodOrNilFor(rcvr), GIV(argumentCount)))))) > (minCogMethodAddress()))) {
				linkSendAtintooffsetreceiver(longAt(GIV(stackPointer)), mframeHomeMethod(GIV(framePointer)), cogMethod, (superNormalBar == 0
					? entryOffset()
					: noCheckEntryOffset()), rcvr);
			}
			handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classObj);
			assert(0);
		}
	}
	if (((GIV(newMethod) & (tagMask())) == 0)
	 && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
	 && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) {
		/* begin cogMethodOf: */
		methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader))
		 && ((((usqInt)methodHeader)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader);
		if (((cogMethod->selector)) == GIV(nilObj)) {
			setSelectorOfto(cogMethod, selector);
		}
		else {

			/* Deal with anonymous accessors, e.g. in Newspeak.  The cogMethod may not have the
			   correct selector.  If not, try and compile a new method with the correct selector. */
			if (((cogMethod->selector)) != selector) {
				newCogMethod = cogselector(GIV(newMethod), selector);
				if (!(newCogMethod == null)) {
					cogMethod = newCogMethod;
				}
			}
		}
		if (((cogMethod->selector)) == selector) {
			linkSendAtintooffsetreceiver(longAt(GIV(stackPointer)), mframeHomeMethod(GIV(framePointer)), cogMethod, (superNormalBar == 0
				? entryOffset()
				: noCheckEntryOffset()), rcvr);
		}
		else {

			/* If patchToOpenPICFor:.. returns we're out of code memory */
			if (superNormalBar == 0) {

				/* Open PICs perform normal sends. Can't patch if this is a super send. */
				patchToOpenPICFornumArgsreceiver(selector, numArgs, rcvr);
			}
		}
		/* begin popStack */
		top = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		GIV(instructionPointer) = top;
		executeNewMethod();
		assert(0);
	}
	/* begin popStack */
	top1 = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top1;
	return interpretMethodFromMachineCode();
}


/*	If contextSwitchIfNotNil is nil we can't context switch.
	contextSwitchIfNotNil is set to nil by
	- the special primitiveClosureValueNoContextSwitch entry-point in block
	dispatch - the stack check in methods with primitive 198.
	In a normal method contextSwitchIfNotNil will be the method (see e.g.
	SimpleStackBasedCogit>>compileFrameBuild). In a block it will be the
	closure (see e.g. SimpleStackBasedCogit>>compileMethodBody). */

	/* CoInterpreter>>#ceStackOverflow: */
void
ceStackOverflow(sqInt contextSwitchIfNotNil)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt cesoRetAddr;
    CogBlockMethod *cogMethod;
    sqInt switched;
    sqInt top;

	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	cesoRetAddr = top;
	/* begin mframeCogMethod: */
	cogMethod = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask));
	assert((cesoRetAddr - (abortOffset())) == (((sqInt)(asCogHomeMethod(cogMethod)))));
	GIV(instructionPointer) = (((sqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
	assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 0, __LINE__);
	GIV(method) = (GIV(newMethod) = (GIV(messageSelector) = GIV(nilObj)));
	switched = handleStackOverflowOrEventAllowContextSwitch(contextSwitchIfNotNil != 0);
	returnToExecutivepostContextSwitch(0, switched);
	error("should not be reached");
}

	/* CoInterpreter>>#ceTraceBlockActivation */
void
ceTraceBlockActivation(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt selector;

	if (recordBlockTrace()) {
		/* begin recordTrace:thing:source: */
		selector = ((mframeHomeMethod(GIV(framePointer)))->methodObject);
		GIV(traceLog)[GIV(traceLogIndex)] = TraceBlockActivation;
		GIV(traceLog)[GIV(traceLogIndex) + 1] = selector;
		GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromMachineCode;
		GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
		if (printOnTrace()) {
			printActivationNameForreceiverisBlockfirstTemporary(((mframeHomeMethod(GIV(framePointer)))->methodObject), ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
				? (/* begin mframeReceiver: */
					longAt(GIV(framePointer) + FoxMFReceiver))
				: (/* begin iframeReceiver: */
					longAt(GIV(framePointer) + FoxIFReceiver))), 1, null);
			/* begin cr */
			printf("\n");
		}
	}
}

	/* CoInterpreter>>#ceTraceLinkedSend: */
void
ceTraceLinkedSend(sqInt theReceiver)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classOrInteger;
    CogMethod *cogMethod;
    sqInt selector;
    sqInt selector1;
    sqInt tagBits;

	cogMethod = ((CogMethod *) ((longAt(GIV(stackPointer))) - (traceLinkedSendOffset())));
	/* begin recordTrace:thing:source: */
	if (((tagBits = theReceiver & (tagMask()))) != 0) {
		/* begin fetchPointer:ofObject: */
		classOrInteger = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))));
	}
	else {
		classOrInteger = fetchClassOfNonImm(theReceiver);
	}
	selector = (cogMethod->selector);
	GIV(traceLog)[GIV(traceLogIndex)] = classOrInteger;
	GIV(traceLog)[GIV(traceLogIndex) + 1] = selector;
	GIV(traceLog)[GIV(traceLogIndex) + 2] = TraceIsFromMachineCode;
	GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
	if (printOnTrace()) {
		printActivationNameForreceiverisBlockfirstTemporary((cogMethod->methodObject), theReceiver, 0, null);
		/* begin cr */
		printf("\n");
	}
	/* begin sendBreakpoint:receiver: */
	selector1 = (cogMethod->selector);
	sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector1), lengthOfMaybeImmediate(selector1), theReceiver);
}


/*	For assertion checking. */

	/* CoInterpreter>>#ceTraceStoreOf:into: */
void
ceTraceStoreOfinto(sqInt aValue, sqInt anObject)
{
	assert((isImmediate(aValue))
	 || (addressCouldBeObj(aValue)));
	assert(addressCouldBeObj(anObject));
}

	/* CoInterpreter>>#checkAssertsEnabledInCoInterpreter */
void
checkAssertsEnabledInCoInterpreter(void)
{
    sqInt assertsAreEnabledInCoInterpreter;

	assertsAreEnabledInCoInterpreter = 0;
	assert(assertsAreEnabledInCoInterpreter);
}


/*	Perform an integrity/leak check using the heapMap. Assume
	clearLeakMapAndMapAccessibleObjects has set a bit at each
	object's header. Check that all object references in machine
	code are valid. Answer if all checks pass. */

	/* CoInterpreter>>#checkCodeIntegrity: */
static sqInt NoDbgRegParms
checkCodeIntegrity(sqInt gcModes)
{
	return checkIntegrityOfObjectReferencesInCode(gcModes);
}


/*	Check the log for leaks. The trace log is a circular buffer of pairs of
	entries. If there is an entry at traceLogIndex - 3 \\ TraceBufferSize it
	has entries. If
	there is something at traceLogIndex it has wrapped. */

	/* CoInterpreter>>#checkLogIntegrity */
static sqInt
checkLogIntegrity(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt limit;
    sqInt ok;
    sqInt oop;
    sqInt remainder;

	limit = (((remainder = (GIV(traceLogIndex) - 3) % TraceBufferSize)) < 0
		? remainder + TraceBufferSize
		: remainder);
	if ((GIV(traceLog)[limit]) == 0) {
		return 1;
	}
	if ((GIV(traceLog)[GIV(traceLogIndex)]) != 0) {
		limit = TraceBufferSize - 3;
	}
	ok = 1;
	for (i = 0; i <= limit; i += 3) {
		oop = GIV(traceLog)[i];
		if (!(oop & (tagMask()))) {
			if (!(checkOopIntegritynamedindex(oop, "traceLog", i))) {
				ok = 0;
			}
		}
		oop = GIV(traceLog)[i + 1];
		if (!(oop & (tagMask()))) {
			if (!(checkOopIntegritynamedindex(oop, "traceLog", i + 1))) {
				ok = 0;
			}
		}
	}
	return ok;
}


/*	Check if the argument is an ok object.
	If this is a pointers object, check that its fields are all okay oops. */

	/* CoInterpreter>>#checkOkayFields: */
static sqInt NoDbgRegParms
checkOkayFields(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fieldOop;
    sqInt hasYoung;
    sqInt i;

	if ((oop == null)
	 || (oop == 0)) {
		return 1;
	}
	if ((((oop) & 7) == 1)) {
		return 1;
	}
	if (!(checkOkayOop(oop))) {
		return 0;
	}
	if (!(checkOopHasOkayClass(oop))) {
		return 0;
	}
	if (!((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
		 || (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		return 1;
	}
	hasYoung = 0;
	if (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
		i = ((literalCountOfMethodHeader(methodHeaderOf(oop))) + LiteralStart) - 1;
	}
	else {
		if (((oop & (tagMask())) == 0)
		 && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
			i = (CtxtTempFrameStart + (fetchStackPointerOf(oop))) - 1;
		}
		else {
			i = (lengthOfformat(oop, (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))) - 1;
		}
	}
	while (i >= 0) {
		fieldOop = longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if ((fieldOop & (smallIntegerTag())) == 0) {
			if ((i == 0)
			 && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) {
				if ((methodFor(pointerForOop(fieldOop))) == 0) {
					print("method ");
					printHex(oop);
					print(" has an invalid cog method reference");
					return 0;
				}
			}
			else {
				hasYoung = hasYoung
				 || (((fieldOop & (tagMask())) == 0)
				 && (oopisLessThan(fieldOop, GIV(newSpaceLimit))));
				if (!(checkOkayOop(fieldOop))) {
					return 0;
				}
				if (!(checkOopHasOkayClass(fieldOop))) {
					return 0;
				}
			}
		}
		i -= 1;
	}
	if (hasYoung) {
		/* begin checkOkayYoungReferrer: */
		if (oopisLessThan(oop, GIV(newSpaceLimit))) {
			return 1;
		}
		if (!(((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0)) {
			print("remembered bit is not set in ");
			printHex(oop);
			/* begin cr */
			printf("\n");
			return 0;
		}
		if (isInRememberedSet(oop)) {
			return 1;
		}
		printHex(oop);
		print(" has remembered bit set but is not in remembered set");
		/* begin cr */
		printf("\n");
		return 0;
	}
	return 1;
}


/*	Perform an integrity/leak check using the heapMap. Assume
	clearLeakMapAndMapAccesibleObjects has set a bit at each
	object's header. Scan all objects accessible from the stack
	checking that every pointer points to a header. Answer if no
	dangling pointers were detected. */

	/* CoInterpreter>>#checkStackIntegrity */
static sqInt
checkStackIntegrity(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *callerFP;
    CogMethod *cogMethod;
    char *frameRcvrOffset;
    sqInt i;
    sqInt methodField;
    sqInt ok;
    usqInt oop;
    char *theFP;
    StackPage *thePage;
    char *theSP;

	ok = 1;
	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		if (!(isFree(thePage))) {
			if (thePage == GIV(stackPage)) {
				theSP = GIV(stackPointer);
				theFP = GIV(framePointer);
			}
			else {
				theSP = (thePage->headSP);
				theFP = (thePage->headFP);
			}
			if (!(thePage == GIV(stackPage))) {
				theSP += BytesPerWord;
			}
			while (1) {
				frameRcvrOffset = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? theFP + FoxMFReceiver
					: theFP + FoxIFReceiver);
				while (theSP <= frameRcvrOffset) {
					oop = longAt(theSP);
					if (((oop & (tagMask())) == 0)
					 && ((heapMapAtWord(pointerForOop(oop))) == 0)) {
						printFrameThingandFrameat("object leak in frame temp", theFP, theSP);
						ok = 0;
					}
					theSP += BytesPerWord;
				}
				if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? (/* begin mframeHasContext: */
						((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0)
					: (/* begin iframeHasContext: */
						(byteAt((theFP + FoxIFrameFlags) + 2)) != 0))) {
					oop = longAt(theFP + FoxThisContext);
					if ((oop & (tagMask()))
					 || ((heapMapAtWord(pointerForOop(oop))) == 0)) {
						printFrameThingandFrameat("object leak in frame ctxt", theFP, theFP + FoxThisContext);
						ok = 0;
					}
					if (!(((oop & (tagMask())) == 0)
						 && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
						printFrameThingandFrameat("frame ctxt should be context", theFP, theFP + FoxThisContext);
						ok = 0;
					}
					if (!((((oop & (tagMask())) == 0)
						 && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex))
						 && (((((longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)))) {
						printFrameThingandFrameat("frame ctxt should be married", theFP, theFP + FoxThisContext);
						ok = 0;
					}
					if (!((((oop & (tagMask())) == 0)
						 && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex))
						 && ((frameOfMarriedContext(oop)) == theFP))) {
						printFrameThingandFrameat("frame ctxt should be married to this frame ", theFP, theFP + FoxThisContext);
						ok = 0;
					}
				}
				if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
					/* begin mframeHomeMethod: */
					methodField = longAt(theFP + FoxMethod);
					if ((methodField & MFMethodFlagIsBlockFlag) != 0) {
						cogMethod = (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock)
							? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask))))
							: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset)))));
						goto l4;
					}
					cogMethod = ((CogMethod *) (methodField & MFMethodMask));
	l4:	/* end mframeHomeMethod: */;
					if ((heapMapAtWord(pointerForOop(cogMethod))) == 0) {
						printFrameThingandFrameat("object leak in mframe mthd", theFP, theFP + FoxMethod);
						ok = 0;
					}
				}
				else {
					oop = longAt(theFP + FoxMethod);
					if ((oop & (tagMask()))
					 || ((heapMapAtWord(pointerForOop(oop))) == 0)) {
						printFrameThingandFrameat("object leak in iframe mthd", theFP, theFP + FoxMethod);
						ok = 0;
					}
				}
				if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break;
				theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
				theFP = callerFP;
			}
			theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
			while (theSP <= ((thePage->baseAddress))) {
				oop = longAt(theSP);
				if (((oop & (tagMask())) == 0)
				 && ((heapMapAtWord(pointerForOop(oop))) == 0)) {
					printFrameThingandFrameat("object leak in frame arg", theFP, theSP);
					ok = 0;
				}
				theSP += BytesPerWord;
			}
		}
	}
	return ok;
}

	/* CoInterpreter>>#clearTraceLog */
void
clearTraceLog(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	GIV(traceLogIndex) = 0;
	for (i = 0; i < TraceBufferSize; i += 1) {
		GIV(traceLog)[i] = 0;
	}
}

	/* CoInterpreter>>#cogMethodOf: */
CogMethod *
cogMethodOf(sqInt aMethodOop)
{
    sqInt methodHeader;

	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	assert((isNonImmediate(methodHeader))
	 && ((((usqInt)methodHeader)) < (startOfMemory())));
	return ((CogMethod *) methodHeader);
}

	/* CoInterpreter>>#commenceCogCompiledCodeCompaction */
static void
commenceCogCompiledCodeCompaction(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;
    usqLong startTime;
    sqInt top;

	GIV(cogCompiledCodeCompactionCalledFor) = 0;
	if (recordEventTrace()) {
		/* begin recordTrace:thing:source: */
		GIV(traceLog)[GIV(traceLogIndex)] = TraceCodeCompaction;
		GIV(traceLog)[GIV(traceLogIndex) + 1] = TraceCodeCompaction;
		GIV(traceLog)[GIV(traceLogIndex) + 2] = 0;
		GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
	}
	if (recordPrimTrace()) {
		/* begin fastLogPrim: */
		GIV(primTraceLog)[GIV(primTraceLogIndex)] = TraceCodeCompaction;
		primTraceLogIndex(GIV(primTraceLogIndex) + 1);
	}

	/* This can be called in a number of circumstances.  The instructionPointer
	   may contain a native pc that must be relocated.  There may already be a
	   pushed instructionPointer on stack.  Clients ensure that instructionPointer
	   is 0 if it should not be pushed and/or relocated.  Pushing twice is a mistake
	   because only the top one will be relocated. */
	startTime = ioUTCMicrosecondsNow();
	if (GIV(instructionPointer) != 0) {

		/* better not have already been pushed */
		assert((((usqInt)(stackTop()))) != GIV(instructionPointer));
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp;
		/* begin externalWriteBackHeadStackPointer */
		assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
		(GIV(stackPage)->headSP = GIV(stackPointer));
	}
	assertValidStackedInstructionPointers(__LINE__);
	compactCogCompiledCode();
	/* begin nilUncoggableMethods */
	GIV(lastCoggableInterpretedBlockMethod) = (GIV(lastUncoggableInterpretedBlockMethod) = null);
	if (GIV(instructionPointer) != 0) {
		/* begin popStack */
		top = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		GIV(instructionPointer) = top;
		/* begin externalWriteBackHeadStackPointer */
		assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
		(GIV(stackPage)->headSP = GIV(stackPointer));
	}
	assertValidStackedInstructionPointers(__LINE__);
	GIV(statCodeCompactionCount) += 1;
	GIV(statCodeCompactionUsecs) += (ioUTCMicrosecondsNow()) - startTime;
	if (checkForLeaks != 0) {
		clearLeakMapAndMapAccessibleObjects();
		asserta(checkCodeIntegrity(0));
	}
}

	/* CoInterpreter>>#compilationBreakpointFor: */
void
compilationBreakpointFor(sqInt selectorOop)
{
	suppressHeartbeatFlag = 1;
	warning("compilation send break (heartbeat suppressed)");
}


/*	Answer a value to store in the InstructionPointer index of a context
	object for theIP and theFP.
	Mapping native pcs to bytecode pcs is quite expensive, requiring a search
	through the method
	map. We mitigate this cost by deferring mapping until we really have to,
	which is when a context's
	instruction pointer is accessed by Smalltalk code (either direct inst var
	access or through the
	instVarAt: primitive). But to defer mapping we have to be able to
	distinguish machine code from
	bytecode pcs, which we do by using negative values for machine code pcs.
	So if the frame is a
	machine code one answer the negation of the offset in the cog method.
	
	As a whorish performance hack we also include the block method offset in
	the pc of a block.
	The least significant 16 bits are the native pc and the most significant
	14 bits are the block
	start, in block alignment units. So when mapping back we can find the
	start of the block.
	
	See mustMapMachineCodePC:context: for the code that does the actual
	mapping.  */

	/* CoInterpreter>>#contextInstructionPointer:frame: */
static sqInt NoDbgRegParms
contextInstructionPointerframe(sqInt theIP, char *theFP)
{
    sqInt blockOffset;
    CogBlockMethod *cogMethod;
    CogMethod *homeMethod;

	assert(validInstructionPointerinFrame(theIP, theFP));
	if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
		/* begin encodedNativePCOf:cogMethod: */
		cogMethod = ((CogBlockMethod *) ((longAt(theFP + FoxMethod)) & MFMethodMask));
		if (theIP == (ceCannotResumePC())) {
			return HasBeenReturnedFromMCPCOop;
		}
		if (((cogMethod->cmType)) == CMMethod) {
			return (((usqInt)((((sqInt)cogMethod)) - theIP) << 3) | 1);
		}
		homeMethod = ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)
			? ((CogMethod *) cogMethod)
			: ((CogMethod *) ((((usqInt)cogMethod)) - ((cogMethod->homeOffset)))));
		blockOffset = ((((sqInt)homeMethod)) - (((sqInt)cogMethod))) / (blockAlignment());
		return (((usqInt)((((usqInt) blockOffset << 16)) | (((((sqInt)cogMethod)) - theIP) & 0xFFFF)) << 3) | 1);
	}
	return (((usqInt)(((((theIP == (ceReturnToInterpreterPC())
	? longAt(theFP + FoxIFSavedIP)
	: theIP)) - (longAt(theFP + FoxMethod))) - BaseHeaderSize) + 2) << 3) | 1);
}


/*	default native stack frame size */

	/* CoInterpreter>>#defaultNativeStackFrameSize */
sqInt
defaultNativeStackFrameSize(void)
{
	return 256;
}


/*	Defer smashes of the stackLimit around the call of functionSymbol (for
	assert checks)
 */

	/* CoInterpreter>>#deferStackLimitSmashAround:with: */
static sqInt NoDbgRegParms
deferStackLimitSmashAroundwith(void (*functionSymbol)(sqInt), sqInt arg)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(deferSmash) = 1;
	sqLowLevelMFence();
	functionSymbol(arg);
	GIV(deferSmash) = 0;
	sqLowLevelMFence();
	if (GIV(deferredSmash)) {
		GIV(deferredSmash) = 0;
		sqLowLevelMFence();
		forceInterruptCheck();
	}
	return 1;
}


/*	Divorce at most one frame in the current page (since the divorce may cause
	the page to be split)
	and answer whether a frame was divorced. */

	/* CoInterpreter>>#divorceAMachineCodeFrameWithCogMethod:in: */
static sqInt NoDbgRegParms
divorceAMachineCodeFrameWithCogMethodin(CogMethod *cogMethod, StackPage *aStackPage)
{
    char *calleeFP;
    sqInt theContext;
    char *theFP;
    char *theSP;

	theFP = (aStackPage->headFP);
	theSP = (aStackPage->headSP);

	/* theSP points at hottest item on frame's stack */
	theSP += BytesPerWord;
	while (1) {
		if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()))
		 && (cogMethod == (mframeHomeMethod(theFP)))) {
			/* begin ensureFrameIsMarried:SP: */
			if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
				? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
				: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
				assert(isContext(frameContext(theFP)));
				theContext = longAt(theFP + FoxThisContext);
				goto l1;
			}
			theContext = marryFrameSP(theFP, theSP);
	l1:	/* end ensureFrameIsMarried:SP: */;
			externalDivorceFrameandContext(theFP, theContext);
			return 1;
		}
		calleeFP = theFP;
		theFP = pointerForOop(longAt(theFP + FoxSavedFP));
		if (!(theFP != 0)) break;

		/* theSP points at stacked hottest item on frame's stack */
		assert(!(isBaseFrame(calleeFP)));
		theSP = (calleeFP + (frameStackedReceiverOffset(calleeFP))) + BytesPerWord;
	}
	return 0;
}


/*	The prim trace log is a circular buffer of entries. If there is
	an entry at primTraceLogIndex \\ PrimTraceLogSize it has entries.
	If there is something at primTraceLogIndex it has wrapped. */

	/* CoInterpreter>>#dumpPrimTraceLog */
void
dumpPrimTraceLog(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt remainder;

	if ((GIV(primTraceLog)[(((remainder = (GIV(primTraceLogIndex) - 1) % PrimTraceLogSize)) < 0
			? remainder + PrimTraceLogSize
			: remainder)]) == 0) {
		return;
	}
	if ((GIV(primTraceLog)[GIV(primTraceLogIndex)]) != 0) {
		for (i = GIV(primTraceLogIndex); i < PrimTraceLogSize; i += 1) {
			printPrimLogEntryAt(i);
			/* begin cr */
			printf("\n");
		}
	}
	for (i = 0; i < GIV(primTraceLogIndex); i += 1) {
		printPrimLogEntryAt(i);
		/* begin cr */
		printf("\n");
	}
}


/*	The trace log is a circular buffer of pairs of entries. If there is
	an entry at traceLogIndex - 3 \\ TraceBufferSize it has entries.
	If there is something at traceLogIndex it has wrapped. */

	/* CoInterpreter>>#dumpTraceLog */
void
dumpTraceLog(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt remainder;

	if ((GIV(traceLog)[(((remainder = (GIV(traceLogIndex) - 3) % TraceBufferSize)) < 0
			? remainder + TraceBufferSize
			: remainder)]) == 0) {
		return;
	}
	if ((GIV(traceLog)[GIV(traceLogIndex)]) != 0) {
		for (i = GIV(traceLogIndex); i <= (TraceBufferSize - 3); i += 3) {
			printLogEntryAt(i);
		}
	}
	for (i = 0; i <= (GIV(traceLogIndex) - 3); i += 3) {
		printLogEntryAt(i);
	}
}


/*	Make sure the context has a byetcode pc. Can only be used on single
	contexts. 
 */

	/* CoInterpreter>>#ensureContextHasBytecodePC: */
static void NoDbgRegParms
ensureContextHasBytecodePC(sqInt aContext)
{
    sqInt pc;

	assert(!(isMarriedOrWidowedContext(aContext)));
	pc = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))));
	if (((((pc) & 7) == 1))
	 && (((pc = (pc >> 3))) < 0)) {
		pc = mustMapMachineCodePCcontext(pc, aContext);
		assert(validBCPCinMethod((pc >> 3), fetchPointerofObject(MethodIndex, aContext)));
		assert(!(isOopForwarded(aContext)));
		longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), pc);
	}
}


/*	Safety to give the JIT lattitude in calling convention. Conceptually,
	returning a value to a context involves pushing that value onto the stack.
	This is used
	in Squeak methods such as ContextPart>>jump
	jump
	| top |
	thisContext sender push: nil.
	stackp = 0 ifTrue: [self stepToSendOrReturn].
	stackp = 0 ifTrue: [self push: nil].
	top := self pop.
	thisContext privSender: self.
	^top
	Here jump may pop the value of a temporary variable off the stack which
	will, conceptually and, in the interpreter, actually, get pushed back on
	return. But
	if the JIT is mapping the stack to registers disaster may ensue since the
	value may not get pushed to the stack and code may access an invalid value
	(e.g. a pc).
	
	The solution is to fall back on the interpreter. If the stack pointer is
	changed we
	also ensure the pc is a bytecode pc (+ive) which will cause
	makeBaseFrameFor: to create an interpreter frame if the context is
	executed again. */

	/* CoInterpreter>>#ensureContextIsExecutionSafeAfterAssignToStackPointer: */
static void NoDbgRegParms
ensureContextIsExecutionSafeAfterAssignToStackPointer(sqInt aContext)
{
	ensureContextHasBytecodePC(aContext);
}


/*	Main entry-point into the interpreter at each execution level, where an
	execution level is either the start of execution or reentry for a
	callback. Capture the C stack
	pointers so that calls from machine-code into the C run-time occur at this
	level. This is the actual implementation, separated from
	enterSmalltalkExecutive so the
	simulator can wrap it in an exception handler and hence simulate the
	setjmp/longjmp.  */

	/* CoInterpreter>>#enterSmalltalkExecutiveImplementation */
static sqInt
enterSmalltalkExecutiveImplementation(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aMethodObj;

	assertCStackWellAligned();
	ceCaptureCStackPointers();
	sigsetjmp(reenterInterpreter, 0);
	if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) {
		returnToExecutivepostContextSwitch(0, 1);
	}
	/* begin setMethod: */
	aMethodObj = longAt(GIV(framePointer) + FoxMethod);
	assert((((usqInt)aMethodObj)) >= (startOfMemory()));
	GIV(method) = aMethodObj;
	assert(isOopCompiledMethod(GIV(method)));
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
		GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
	}
	assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 1, __LINE__);
	interpret();
	return 0;
}


/*	Execute a CogMethod from a linked send. The receiver,
	arguments and return address are on the Smalltalk stack. First
	push the entry-point and finally the register argument(s). Then write
	back the frame pointers and call the routine that will pop off the
	register argument(s) and jump to the entry by executing a return
	instruction. 
	In the simple jit only the receiver gets passed in registers, so only the
	receiver gets pushed. */

	/* CoInterpreter>>#executeCogMethod:fromLinkedSendWithReceiver: */
void
executeCogMethodfromLinkedSendWithReceiver(CogMethod *cogMethod, sqInt rcvr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt object;
    char *sp;
    char *sp1;

	assertCStackWellAligned();
	assert(isMachineCodeFrame(GIV(framePointer)));
	assertValidExecutionPointersimbarline(longAt(GIV(stackPointer)), GIV(framePointer), GIV(stackPointer), 0, __LINE__);
	
	/* dont use and: so as to get Slang to inline cogit numRegArgs > 0 */
	if (((cogMethod->cmNumArgs)) <= (numRegArgs())) {
		callRegisterArgCogMethodatreceiver(cogMethod, entryOffset(), rcvr);
	}
	/* begin push: */
	object = (((sqInt)cogMethod)) + (entryOffset());
	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), rcvr);
	GIV(stackPointer) = sp1;
	ceCallCogCodePopReceiverReg();
}


/*	Execute a CogMethod from an unlinked send. The receiver,
	arguments and return address are on the Smalltalk stack. First
	push the entry-point and finally the register argument(s). Then write
	back the frame pointers and call the routine that will pop off the
	register argument(s) and jump to the entry by executing a return
	instruction. 
	In the simple jit only the receiver gets passed in registers, so only the
	receiver gets pushed. */

	/* CoInterpreter>>#executeCogMethod:fromUnlinkedSendWithReceiver: */
static void NoDbgRegParms
executeCogMethodfromUnlinkedSendWithReceiver(CogMethod *cogMethod, sqInt rcvr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt object;
    char *sp;
    char *sp1;

	assertCStackWellAligned();
	assert(isMachineCodeFrame(GIV(framePointer)));
	assertValidExecutionPointersimbarline(longAt(GIV(stackPointer)), GIV(framePointer), GIV(stackPointer), 0, __LINE__);
	
	/* dont use and: so as to get Slang to inline cogit numRegArgs > 0 */
	if (((cogMethod->cmNumArgs)) <= (numRegArgs())) {
		callRegisterArgCogMethodatreceiver(cogMethod, noCheckEntryOffset(), rcvr);
	}
	/* begin push: */
	object = (((sqInt)cogMethod)) + (noCheckEntryOffset());
	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), rcvr);
	GIV(stackPointer) = sp1;
	ceCallCogCodePopReceiverReg();
}


/*	Execute a closed PIC from a linked send, to redispatch based on the rcvr.
	The receiver, arguments and return address are on the Smalltalk stack.
	First push the entry-point and finally the register argument(s). Then
	write back the frame pointers and call the routine that will pop off the
	register argument(s) and jump to the entry by executing a return
	instruction. 
	In the simple jit only the receiver gets passed in registers, so only the
	receiver gets pushed. */

	/* CoInterpreter>>#executeCogPIC:fromLinkedSendWithReceiver:andCacheTag: */
void
executeCogPICfromLinkedSendWithReceiverandCacheTag(CogMethod *cogPIC, sqInt rcvr, sqInt cacheTag)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt object;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;

	assertCStackWellAligned();
	assert(isMachineCodeFrame(GIV(framePointer)));
	assertValidExecutionPointersimbarline(longAt(GIV(stackPointer)), GIV(framePointer), GIV(stackPointer), 0, __LINE__);
	/* begin push: */
	object = (((sqInt)cogPIC)) + (entryOffset());
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp1;
	
	/* dont use and: so as to get Slang to inline cogit numRegArgs > 0 */
	if (((cogPIC->cmNumArgs)) <= (numRegArgs())) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), cacheTag);
		GIV(stackPointer) = sp;
		
		switch ((cogPIC->cmNumArgs)) {
		case 0:
			ceCall0ArgsPIC();
			break;
		case 1:
			ceCall1ArgsPIC();
			break;
		case 2:
			ceCall2ArgsPIC();
			break;
		default:
			;
		}
		error("not reached");
	}
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), rcvr);
	GIV(stackPointer) = sp2;
	/* begin push: */
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), cacheTag);
	GIV(stackPointer) = sp3;
	ceCallCogCodePopReceiverAndClassRegs();
}


/*	Execute newMethod - either primitiveFunctionPointer must be set directly
	(i.e. from primitiveExecuteMethod et al), or it would have been set
	probing the method cache (i.e. primitivePerform et al).
	Eagerly compile it if appropriate so that doits are fast. */

	/* CoInterpreter>>#executeNewMethod */
static sqInt
executeNewMethod(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    int inInterpreter;
    sqInt methodHeader;

	inInterpreter = GIV(instructionPointer) >= (startOfMemory());
	if (primitiveFunctionPointer != 0) {
		if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) {
			externalQuickPrimitiveResponse();
			returntoExecutive(popStack(), inInterpreter);
			return null;
		}
		if (slowPrimitiveResponse()) {
			returntoExecutive(popStack(), inInterpreter);
			return null;
		}
	}
	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if (!((assert(((((methodHeader) & 7) == 1))
			 || (((((usqInt)methodHeader)) < (startOfMemory()))
			 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
		(methodHeader & (smallIntegerTag())) == 0))) {
		if (((assert((((methodHeader) & 7) == 1)),
		((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
			cogselector(GIV(newMethod), GIV(nilObj));
			/* begin fetchPointer:ofObject: */
			methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		}
		else {
			maybeFlagMethodAsInterpreted(GIV(newMethod));
		}
	}
	if ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)) {
		if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {
			/* begin iframeSavedIP:put: */
			assert(!(isMachineCodeFrame(GIV(framePointer))));
			longAtput(GIV(framePointer) + FoxIFSavedIP, ((sqInt)GIV(instructionPointer)));
			GIV(instructionPointer) = ceReturnToInterpreterPC();
		}
		activateCoggedNewMethod(inInterpreter);
	}
	else {
		activateNewMethod();
	}
	return 0;
}


/*	Fetch an instance variable from a maybe married context.
	If the context is still married compute the value of the
	relevant inst var from the spouse frame's state.
	
	If the context is single but has a negative instruction pointer
	recognise that the instruction pointer is actually into machine
	code and convert it to the corresponding bytecode pc. */

	/* CoInterpreter>>#externalInstVar:ofContext: */
static sqInt NoDbgRegParms
externalInstVarofContext(sqInt offset, sqInt aContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt value;

	assert(isContext(aContext));
	assert(offset <= (ReceiverIndex + (checkStackPointerForMaybeMarriedContext(aContext))));
	if (!(offset <= StackPointerIndex)) {
		return longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(offset) << (shiftForWord())))));
	}
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if ((((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(aContext)))) {
		return fetchPointerofMarriedContext(offset, aContext);
	}
	value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(offset) << (shiftForWord())))));
	if ((offset == InstructionPointerIndex)
	 && (((((value) & 7) == 1))
	 && ((((int) value)) < 0))) {
		return mustMapMachineCodePCcontext((value >> 3), aContext);
	}
	return value;
}


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

	/* CoInterpreter>>#findNewMethodInClassTag: */
static void NoDbgRegParms
findNewMethodInClassTag(sqInt classTagArg)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt aMethodObj;
    usqInt aMethodObj1;
    sqInt classTablePage;
    sqInt classTag;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt ok;
    sqInt selector;
    sqInt selector1;

	ok = lookupInMethodCacheSelclassTag(GIV(messageSelector), classTagArg);
	if (ok) {
		/* begin ifAppropriateCompileToNativeCode:selector: */
		aMethodObj = GIV(newMethod);
		selector = GIV(messageSelector);
		/* begin fetchPointer:ofObject: */
		methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((assert(((((methodHeader) & 7) == 1))
			 || (((((usqInt)methodHeader)) < (startOfMemory()))
			 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
		(methodHeader & (smallIntegerTag())) == 0)) {

			/* makeBaseFrame: can create cog methods with nil selectors. */
			cogMethod = ((CogMethod *) methodHeader);
			if (((cogMethod->selector)) == GIV(nilObj)) {
				setSelectorOfto(cogMethod, selector);
			}
		}
		else {
			if (((assert((((methodHeader) & 7) == 1)),
			((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
				cogselector(aMethodObj, selector);
			}
			else {
				maybeFlagMethodAsInterpreted(aMethodObj);
			}
		}
	}
	else {

		/* entry was not found in the cache; perhaps soemthing was forwarded. */
		classTag = classTagArg;
		if ((((GIV(messageSelector) & (tagMask())) == 0)
		 && (((longAt(GIV(messageSelector))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))
		 || (classTag == (isForwardedObjectClassIndexPun()))) {
			if (((GIV(messageSelector) & (tagMask())) == 0)
			 && (((longAt(GIV(messageSelector))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				GIV(messageSelector) = handleForwardedSelectorFaultFor(GIV(messageSelector));
			}
			if (classTag == (isForwardedObjectClassIndexPun())) {
				classTag = handleForwardedSendFaultForTag(classTag);
			}
			ok = lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag);
			if (ok) {
				/* begin ifAppropriateCompileToNativeCode:selector: */
				aMethodObj1 = GIV(newMethod);
				selector1 = GIV(messageSelector);
				/* begin fetchPointer:ofObject: */
				methodHeader1 = longAt((aMethodObj1 + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
				if ((assert(((((methodHeader1) & 7) == 1))
					 || (((((usqInt)methodHeader1)) < (startOfMemory()))
					 && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))),
				(methodHeader1 & (smallIntegerTag())) == 0)) {

					/* makeBaseFrame: can create cog methods with nil selectors. */
					cogMethod1 = ((CogMethod *) methodHeader1);
					if (((cogMethod1->selector)) == GIV(nilObj)) {
						setSelectorOfto(cogMethod1, selector1);
					}
				}
				else {
					if (((assert((((methodHeader1) & 7) == 1)),
					((methodHeader1 >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
						cogselector(aMethodObj1, selector1);
					}
					else {
						maybeFlagMethodAsInterpreted(aMethodObj1);
					}
				}
				return;
			}
		}
		/* begin classAtIndex: */
		assert((classTag >= 0)
		 && ((classTag <= (tagMask()))
		 || ((classTag >= (arrayClassIndexPun()))
		 && (classTag <= (classIndexMask())))));
		/* begin fetchPointer:ofObject: */
		fieldIndex = ((usqInt) classTag) >> (classTableMajorIndexShift());
		classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
		if (classTablePage == GIV(nilObj)) {
			GIV(lkupClass) = null;
			goto l2;
		}
		/* begin fetchPointer:ofObject: */
		fieldIndex1 = classTag & ((1U << (classTableMajorIndexShift())) - 1);
		GIV(lkupClass) = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	l2:	/* end classAtIndex: */;
		lookupMethodInClass(GIV(lkupClass));
		addNewMethodToCache(GIV(lkupClass));
	}
}


/*	methodObj is a CompiledMethod. If it contains an external primitive,
	flush the function address and session ID of the CM. Answer the prim
	index for the benefit of subclass overrides. */
/*	methodObj is a CompiledMethod containing an external primitive.
	Flush the function address and session ID of the CM. Override
	to also flush the machine code call if one exists. */

	/* CoInterpreter>>#flushExternalPrimitiveOf: */
void
flushExternalPrimitiveOf(sqInt methodObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstBytecode;
    sqInt header;
    sqInt header1;
    sqInt lit;
    sqInt methodHeader;
    sqInt primIdx;
    sqInt primIdx1;

	/* begin methodHeaderOf: */
	assert(isCompiledMethod(methodObj));
	header1 = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	if (header & AlternateHeaderHasPrimFlag) {
		firstBytecode = (methodObj + ((LiteralStart + (((header >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
		primIdx1 = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)));
	}
	else {
		primIdx1 = 0;
	}
	if ((primIdx1 == PrimNumberExternalCall)
	 && (((assert((((header) & 7) == 1)),
	((header >> 3)) & AlternateHeaderNumLiteralsMask)) > 0)) {

		/* If not, something's broken */
		/* begin fetchPointer:ofObject: */
		lit = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)((0 + LiteralStart)) << (shiftForWord())))));
		if ((((lit & (tagMask())) == 0)
		 && (((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && ((numSlotsOf(lit)) == 4)) {

			/* If not, something's broken */
			assert(!(isOopForwarded(lit)));
			longAtput((lit + BaseHeaderSize) + (2U << (shiftForWord())), ConstZero);
			assert(!(isOopForwarded(lit)));
			longAtput((lit + BaseHeaderSize) + (3U << (shiftForWord())), ConstZero);
		}
	}
	primIdx = primIdx1;
	if ((primIdx == PrimNumberExternalCall)
	 && ((assert(isNonImmediate(methodObj)),
	/* begin isCogMethodReference: */
	(methodHeader = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))),
	assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0))) {
		rewritePrimInvocationInto(cogMethodOf(methodObj), primitiveExternalCall);
	}
}


/*	Flush the method cache. The method cache is flushed on every programming
	change and garbage collect.
 */
/*	Flush the method cache. The method cache is flushed on every programming
	change and garbage collect.
 */

	/* CoInterpreter>>#flushMethodCache */
static void
flushMethodCache(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	for (i = 1; i <= MethodCacheSize; i += 1) {
		GIV(methodCache)[i] = 0;
	}
	
	/* this for primitiveExternalMethod */
	GIV(lastMethodCacheProbeWrite) = 0;
	unlinkAllSends();
}

	/* CoInterpreter>>#followForwardedFieldsInCurrentMethod */
static void
followForwardedFieldsInCurrentMethod(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    CogMethod *cogMethod;
    sqInt methodField;

	if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) {
		/* begin mframeHomeMethod: */
		methodField = longAt(GIV(framePointer) + FoxMethod);
		if ((methodField & MFMethodFlagIsBlockFlag) != 0) {
			cogMethod = (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock)
				? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask))))
				: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset)))));
			goto l2;
		}
		cogMethod = ((CogMethod *) (methodField & MFMethodMask));
	l2:	/* end mframeHomeMethod: */;
		followForwardedObjectFieldstoDepth((cogMethod->methodObject), 0);
		followForwardedLiteralsIn(cogMethod);
	}
	else {
		followForwardedObjectFieldstoDepth(GIV(method), 0);
	}
}


/*	Spur's become: is lazy, turning the becommed object into a forwarding
	object to the other.
	The read-barrier is minimised by arranging that forwarding pointers will
	fail a method cache
	probe, since notionally objects' internals are accessed only via sending
	messages to them,
	the exception is primitives that access the internals of the non-receiver
	argument(s). 
	To avoid a read barrier on bytecode, literal and inst var fetch and
	non-local return, we scan
	the receivers (including the stacked receiver for non-local return) and
	method references
	in the stack zone and follow any forwarded ones. This is of course way
	cheaper than
	scanning all of memory as in the old become.
	
	Override to handle machine code frames */

	/* CoInterpreter>>#followForwardingPointersInStackZone: */
static void NoDbgRegParms
followForwardingPointersInStackZone(sqInt theBecomeEffectsFlags)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *callerFP;
    sqInt i;
    sqInt newOop;
    sqInt numArgs;
    sqInt offset;
    usqInt oop;
    sqInt referent;
    sqInt referent1;
    sqInt referent2;
    char *theFP;
    usqInt theIPPtr;
    StackPage *thePage;
    char *theSP;

	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if (theBecomeEffectsFlags & BecameCompiledMethodFlag) {
		if (((longAt(GIV(method))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			theIPPtr = GIV(instructionPointer) - GIV(method);
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(GIV(method)));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((GIV(method) + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent & (tagMask())) == 0)
			 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			GIV(method) = referent;
			GIV(instructionPointer) = GIV(method) + theIPPtr;
		}
		if (((GIV(newMethod) & (tagMask())) == 0)
		 && (((longAt(GIV(newMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(GIV(newMethod)));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent1 = longAt((GIV(newMethod) + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent1 & (tagMask())) == 0)
			 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			GIV(newMethod) = referent1;
		}
	}
	assert(GIV(stackPage) != 0);
	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		if (!(((thePage->baseFP)) == 0)) {
			assert(ifCurrentStackPageHasValidHeadPointers(thePage));

			/* Skip the instruction pointer on top of stack of inactive pages. */
			theFP = (thePage->headFP);
			theIPPtr = (thePage == GIV(stackPage)
				? 0
				: ((usqInt)((thePage->headSP))));
			while (1) {
				assert(addressIsInPage(thePage, theFP));
				assert((theIPPtr == 0)
				 || (addressIsInPage(thePage, ((void *)theIPPtr))));
				if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
					oop = longAt(theFP + FoxMFReceiver);
					if (((oop & (tagMask())) == 0)
					 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						longAtput(theFP + FoxMFReceiver, followForwarded(oop));
					}
					assert(!(isForwarded(((mframeHomeMethod(theFP))->methodObject))));
				}
				else {
					oop = longAt(theFP + FoxIFReceiver);
					if (((oop & (tagMask())) == 0)
					 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						longAtput(theFP + FoxIFReceiver, followForwarded(oop));
					}
					oop = longAt(theFP + FoxMethod);
					if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
						/* begin followForwarded: */
						assert(isUnambiguouslyForwarder(oop));
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent2 = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
						while (((referent2 & (tagMask())) == 0)
						 && (((longAt(referent2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
							/* begin fetchPointer:ofMaybeForwardedObject: */
							referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord())));
						}
						newOop = referent2;
						offset = newOop - oop;
						if ((theIPPtr != 0)
						 && ((longAt(theIPPtr)) > oop)) {
							longAtput(theIPPtr, (longAt(theIPPtr)) + offset);
						}
						longAtput(theFP + FoxIFSavedIP, (longAt(theFP + FoxIFSavedIP)) + offset);
						longAtput(theFP + FoxMethod, (oop = newOop));
					}
				}
				if ((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? (/* begin mframeHasContext: */
						((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0)
					: (/* begin iframeHasContext: */
						(byteAt((theFP + FoxIFrameFlags) + 2)) != 0)))
				 && (((longAt(longAt(theFP + FoxThisContext))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					longAtput(theFP + FoxThisContext, followForwarded(longAt(theFP + FoxThisContext)));
				}
				/* begin frameStackedReceiverOffsetNumArgs: */
				numArgs = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((mframeCogMethod(theFP))->cmNumArgs)
					: byteAt((theFP + FoxIFrameFlags) + 1));
				offset = (FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord()))));
				oop = longAt(theFP + offset);
				if (((oop & (tagMask())) == 0)
				 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					longAtput(theFP + offset, followForwarded(oop));
				}
				if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break;
				theIPPtr = ((usqInt)(theFP + FoxCallerSavedIP));
				theFP = callerFP;
			}
			theSP = ((thePage->baseAddress)) - BytesPerWord;
			while (theSP <= ((thePage->baseAddress))) {
				oop = longAt(theSP);
				if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					longAtput(theSP, followForwarded(oop));
				}
				theSP += BytesPerWord;
			}
		}
	}
}


/*	Force an interrupt check ASAP. This version is the
	entry-point to forceInterruptCheck for the heartbeat
	timer to allow for repeatable debugging. */

	/* CoInterpreter>>#forceInterruptCheckFromHeartbeat */
void
forceInterruptCheckFromHeartbeat(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!suppressHeartbeatFlag) {
		/* begin checkForLongRunningPrimitive */
		if (GIV(longRunningPrimitiveCheckSemaphore) == null) {
			goto l1;
		}
		if ((GIV(longRunningPrimitiveStartUsecs) > 0)
		 && ((GIV(longRunningPrimitiveCheckMethod) == GIV(newMethod))
		 && (GIV(longRunningPrimitiveCheckSequenceNumber) == GIV(statCheckForEvents)))) {
			GIV(longRunningPrimitiveStopUsecs) = ioUTCMicroseconds();
			assert(GIV(longRunningPrimitiveStopUsecs) > GIV(longRunningPrimitiveStartUsecs));
			goto l1;
		}
		if (GIV(longRunningPrimitiveStopUsecs) == 0) {
			GIV(longRunningPrimitiveCheckSequenceNumber) = GIV(statCheckForEvents);
			GIV(longRunningPrimitiveCheckMethod) = GIV(newMethod);
			GIV(longRunningPrimitiveStartUsecs) = ioUTCMicroseconds();
			sqLowLevelMFence();
		}
	l1:	/* end checkForLongRunningPrimitive */;
		sqLowLevelMFence();
		if (GIV(deferSmash)) {
			GIV(deferredSmash) = 1;
			sqLowLevelMFence();
		}
		else {
			forceInterruptCheck();
		}
	}
}


/*	In the StackInterpreter the saved ip field of a base frame holds the
	base frame's caller context. But in the Cog VM the first word on the
	stack holds the base frame's caller context, which is immediately
	above the stacked receiver. */

	/* CoInterpreter>>#frameCallerContext: */
static sqInt NoDbgRegParms
frameCallerContext(char *theFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    StackPage *thePage;

	assert(isBaseFrame(theFP));
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	callerContextOrNil = longAt((thePage->baseAddress));
	assert(addressCouldBeObj(callerContextOrNil));
	assert((callerContextOrNil == (nilObject()))
	 || (isContext(callerContextOrNil)));
	return callerContextOrNil;
}

	/* CoInterpreter>>#frameHasContext: */
static sqInt NoDbgRegParms
frameHasContext(char *theFP)
{
	return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0);
}


/*	<Integer> */

	/* CoInterpreter>>#frameIsBlockActivation: */
static sqInt NoDbgRegParms
frameIsBlockActivation(char *theFP)
{
	return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 3)) != 0);
}

	/* CoInterpreter>>#frameMethodObject: */
static sqInt NoDbgRegParms
frameMethodObject(char *theFP)
{
	return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((mframeHomeMethod(theFP))->methodObject)
		: longAt(theFP + FoxMethod));
}


/*	See encodeFrameFieldHasContext:numArgs: */

	/* CoInterpreter>>#frameNumArgs: */
static sqInt NoDbgRegParms
frameNumArgs(char *theFP)
{
	return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((mframeCogMethod(theFP))->cmNumArgs)
		: byteAt((theFP + FoxIFrameFlags) + 1));
}

	/* CoInterpreter>>#framePointerAddress */
usqInt
framePointerAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(framePointer))));
}

	/* CoInterpreter>>#frameReceiver: */
static sqInt NoDbgRegParms
frameReceiver(char *theFP)
{
	return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? longAt(theFP + FoxMFReceiver)
		: longAt(theFP + FoxIFReceiver));
}

	/* CoInterpreter>>#functionPointerForCompiledMethod:primitiveIndex: */
void (*functionPointerForCompiledMethodprimitiveIndex(sqInt methodObj, sqInt primIndex))(void)

{
    static void *function = (void *)-1;
    void (*functionPointer)(void);
    void (*functionPointer1)(void);
    sqInt index;
    sqInt lit;

	/* begin functionPointerFor:inClass: */
	functionPointer = ((void (*)(void)) ((primIndex > MaxPrimitiveIndex
	? 0
	: primitiveTable[primIndex])));
	if (functionPointer == primitiveCalloutToFFI) {
		/* begin functionForPrimitiveCallout */
		if ((((sqInt)function)) == -1) {
			function = ioLoadFunctionFrom("primitiveCallout", "SqueakFFIPrims");
		}
		return ((void (*)(void)) function);
	}
	if (functionPointer == primitiveExternalCall) {
		/* begin functionForPrimitiveExternalCall: */
		setPostCompileHook(recordCallOffsetIn);
		if (!((literalCountOfMethodHeader(methodHeaderOf(methodObj))) > 0)) {
			return ((void (*)(void)) primitiveExternalCall);
		}
		/* begin fetchPointer:ofObject: */
		lit = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)((0 + LiteralStart)) << (shiftForWord())))));
		if (!((((lit & (tagMask())) == 0)
			 && (((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
			 && ((lengthOfformat(lit, (((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask()))) == 4))) {
			return ((void (*)(void)) primitiveExternalCall);
		}
		index = longAt((lit + BaseHeaderSize) + (3U << (shiftForWord())));
		if (!(((((index) & 7) == 1))
			 && ((((index = (index >> 3))) > 0)
			 && (index <= MaxExternalPrimitiveTableSize)))) {
			return ((void (*)(void)) primitiveExternalCall);
		}
		functionPointer1 = externalPrimitiveTable[index - 1];
		if (functionPointer1 == 0) {
			return ((void (*)(void)) primitiveExternalCall);
		}
		return functionPointer1;
	}
	return functionPointer;
}

	/* CoInterpreter>>#getCheckAllocFiller */
sqInt
getCheckAllocFiller(void)
{
	return checkAllocFiller;
}


/*	Answer an array of flags indicating various properties of the Cog VM.
	These are the same as the image header flags shifted right two bits
	(excluding float order and full screen flags).
	Bit 0: specific to CoInterpreterMT
	Bit 1: if set, methods that are interpreted will have the flag bit set in
	their header
	Bit 2: if set, implies preempting a process does not put it to the back of
	its run queue
	Bit 3: specific to CoInterpreterMT
	Bit 4: if set, implies the new finalization scheme where WeakArrays are
	queued Bit 5: if set, implies wheel events will be delivered as such and
	not mapped to arrow key events */

	/* CoInterpreter>>#getCogVMFlags */
static sqInt
getCogVMFlags(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (((usqInt)((((((GIV(flagInterpretedMethods)
	? 2
	: 0)) + ((GIV(preemptionYields)
	? 0
	: 4))) + ((GIV(newFinalization)
	? 16
	: 0))) + ((sendWheelEvents
	? 32
	: 0))) + ((((((usqInt) GIV(imageHeaderFlags)) >> 2) | (((2 + 4) + 16) + 32)) - (((2 + 4) + 16) + 32)))) << 3) | 1);
}


/*	currentBytecode will be private to the main dispatch loop in the generated
	code. This method allows the currentBytecode to be retrieved from global
	variables. Override to answer -1 if we're not in an interpreter frame. */

	/* CoInterpreter>>#getCurrentBytecode */
sqInt
getCurrentBytecode(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (((((((usqInt)GIV(framePointer))) & (BytesPerWord - 1)) == 0)
	 && ((((((usqInt)GIV(framePointer))) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)GIV(framePointer))) <= (((usqInt)GIV(pages)))))))
	 && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())))
		? byteAt(GIV(instructionPointer))
		: -1);
}


/*	Handle a send fault that may be due to a send to a forwarded object.
	Unforward the receiver on the stack and answer it. */

	/* CoInterpreter>>#handleForwardedSendFaultForReceiver:stackDelta: */
static sqInt NoDbgRegParms
handleForwardedSendFaultForReceiverstackDelta(sqInt forwardedReceiver, sqInt stackDelta)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt rcvr;
    sqInt rcvrStackIndex;
    sqInt referent;


	/* should *not* be a super send, so the receiver should be forwarded. */
	assert(isOopForwarded(forwardedReceiver));
	rcvrStackIndex = GIV(argumentCount) + stackDelta;
	assert((stackValue(rcvrStackIndex)) == forwardedReceiver);
	/* begin followForwarded: */
	assert(isUnambiguouslyForwarder(forwardedReceiver));
	/* begin fetchPointer:ofMaybeForwardedObject: */
	referent = longAt((forwardedReceiver + BaseHeaderSize) + (0U << (shiftForWord())));
	while (((referent & (tagMask())) == 0)
	 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	rcvr = referent;
	longAtput(GIV(stackPointer) + (rcvrStackIndex * BytesPerWord), rcvr);
	followForwardedFrameContentsstackPointer(GIV(framePointer), GIV(stackPointer) + ((rcvrStackIndex + 1) * BytesPerWord));
	if (isPointers(((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
		? longAt(GIV(framePointer) + FoxMFReceiver)
		: longAt(GIV(framePointer) + FoxIFReceiver)))) {
		followForwardedObjectFieldstoDepth(((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
			? longAt(GIV(framePointer) + FoxMFReceiver)
			: longAt(GIV(framePointer) + FoxIFReceiver)), 0);
	}
	followForwardedFieldsInCurrentMethod();
	return rcvr;
}


/*	A message send from either an open PIC or an unlinked send has not been
	understood. Create a message and execute the relevant resulting MNU
	method. messageSelector is an implicit argument (yuck). */

	/* CoInterpreter>>#handleMNU:InMachineCodeTo:classForMessage: */
static sqInt NoDbgRegParms
handleMNUInMachineCodeToclassForMessage(sqInt selectorIndex, sqInt rcvr, sqInt classForMessage)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt aMethodObj;
    sqInt classForThisMessage;
    CogMethod *cogMethod;
    sqInt err;
    sqInt errSelIdx;
    sqInt hash;
    sqInt methodHeader;
    sqInt selector;
    char *sp;
    char *sp1;
    sqInt top;

	assert(addressCouldBeOop(rcvr));
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
	createActualMessageTo(classForMessage);
	/* begin fetchPointer:ofObject: */
	GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(selectorIndex) << (shiftForWord())))));
	if (lookupInMethodCacheSelclassTag(GIV(messageSelector), (assert(addressCouldBeClassObj(GIV(lkupClass))),
	(((hash = (long32At(GIV(lkupClass) + 4)) & (identityHashHalfWordMask()))) != 0
			? hash
			: (objCouldBeClassObj(GIV(lkupClass))
					? (((err = enterIntoClassTable(GIV(lkupClass)))) != 0
							? -err
							: (long32At(GIV(lkupClass) + 4)) & (identityHashHalfWordMask()))
					: -PrimErrBadReceiver))))) {

		/* check for coggability because method is in the cache */
		/* begin ifAppropriateCompileToNativeCode:selector: */
		aMethodObj = GIV(newMethod);
		selector = GIV(messageSelector);
		/* begin fetchPointer:ofObject: */
		methodHeader = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((assert(((((methodHeader) & 7) == 1))
			 || (((((usqInt)methodHeader)) < (startOfMemory()))
			 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
		(methodHeader & (smallIntegerTag())) == 0)) {

			/* makeBaseFrame: can create cog methods with nil selectors. */
			cogMethod = ((CogMethod *) methodHeader);
			if (((cogMethod->selector)) == GIV(nilObj)) {
				setSelectorOfto(cogMethod, selector);
			}
		}
		else {
			if (((assert((((methodHeader) & 7) == 1)),
			((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
				cogselector(aMethodObj, selector);
			}
			else {
				maybeFlagMethodAsInterpreted(aMethodObj);
			}
		}
	}
	else {
		errSelIdx = lookupMNUInClass((classForThisMessage = GIV(lkupClass)));
		if (errSelIdx != 0) {
			if (selectorIndex == SelectorDoesNotUnderstand) {
				error("Recursive not understood error encountered");
			}
			/* begin push: */
			longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp;
			return handleMNUInMachineCodeToclassForMessage(errSelIdx, rcvr, classForThisMessage);
		}
	}
	if (((GIV(newMethod) & (tagMask())) == 0)
	 && ((((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
	 && (isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) {
		/* begin push: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp1;
		executeCogMethodfromUnlinkedSendWithReceiver(cogMethodOf(GIV(newMethod)), rcvr);
		assert(0);
	}
	return interpretMethodFromMachineCode();
}


/*	<Integer> */

	/* CoInterpreter>>#iframeIsBlockActivation: */
static sqInt NoDbgRegParms
iframeIsBlockActivation(char *theFP)
{
	return (byteAt((theFP + FoxIFrameFlags) + 3)) != 0;
}

	/* CoInterpreter>>#iframeReceiver: */
static sqInt NoDbgRegParms
iframeReceiver(char *theFP)
{
	return longAt(theFP + FoxIFReceiver);
}

	/* CoInterpreter>>#iframeSavedIP: */
static sqInt NoDbgRegParms
iframeSavedIP(char *theFP)
{
	return longAt(theFP + FoxIFSavedIP);
}


/*	This is for low-level error reporting. If either of the C stack pointers
	are pointing into the stack zone then write them back to framePointer
	and/or stackPointer so that the stack backtrace will be up to date. Write
	their original values through savedFPP & savedSPP if non-null. */

	/* CoInterpreter>>#ifValidWriteBackStack:Pointers:Save:To: */
void
ifValidWriteBackStackPointersSaveTo(void *theCFP, void *theCSP, char **savedFPP, char **savedSPP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (savedFPP != 0) {
		savedFPP[0] = GIV(framePointer);
	}
	if (savedSPP != 0) {
		savedSPP[0] = GIV(stackPointer);
	}
	if ((((((usqInt)theCFP)) & (BytesPerWord - 1)) == 0)
	 && ((((((usqInt)theCFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theCFP)) <= (((usqInt)GIV(pages))))))) {
		GIV(framePointer) = theCFP;
	}
	if ((((((usqInt)theCSP)) & (BytesPerWord - 1)) == 0)
	 && ((((((usqInt)theCSP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theCSP)) <= (((usqInt)GIV(pages))))))) {
		GIV(stackPointer) = theCSP;
	}
}

	/* CoInterpreter>>#instructionPointerAddress */
usqInt
instructionPointerAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(instructionPointer))));
}


/*	Answer the bytecode pc object (i.e. SmallInteger) for an active frame. The
	bytecode pc is derived from the frame's pc. If the frame is the top frame
	on the current stack
	the frame pc is whatever the current instruction pointer is. If the frame
	is the top
	frame on some other stack the frame pc is the value on top of stack.
	Otherwise the
	frame pc is the saved pc of the frame above. Once the frame pc is found it
	must be
	mapped to a bytecode pc. */

	/* CoInterpreter>>#instructionPointerForFrame:currentFP:currentIP: */
static sqInt NoDbgRegParms
instructionPointerForFramecurrentFPcurrentIP(char *spouseFP, char *currentFP, sqInt instrPtr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *callerFP;
    char *fp;
    char *theFPAbove;
    sqInt theIP;
    StackPage *thePage;
    sqInt value;

	if (spouseFP == currentFP) {
		theIP = oopForPointer(instrPtr);
	}
	else {
		/* begin stackPageFor: */
		thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		/* begin findFrameAbove:inPage: */
		fp = (thePage->headFP);
		if (fp == spouseFP) {
			theFPAbove = 0;
			goto l2;
		}
		while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) {
			if (callerFP == spouseFP) {
				theFPAbove = fp;
				goto l2;
			}
			fp = callerFP;
		}
		error("did not find theFP in stack page");
		theFPAbove = 0;
	l2:	/* end findFrameAbove:inPage: */;
		theIP = (theFPAbove == 0
			? longAt((thePage->headSP))
			: oopForPointer(pointerForOop(longAt(theFPAbove + FoxCallerSavedIP))));
	}
	value = contextInstructionPointerframe(theIP, spouseFP);
	return ((((int) value)) < 0
		? mustMapMachineCodePCcontext((value >> 3), longAt(spouseFP + FoxThisContext))
		: value);
}


/*	This is used for asserts that check that inline cache editing results in
	valid addresses.
	In the C VM interpret is presumed to come before any primitives and so it
	constitutes the lowest address in C code that machine code should be
	linked. In the simulator
	we just answer something not low. */

	/* CoInterpreter>>#interpretAddress */
usqInt
interpretAddress(void)
{
	return ((usqInt)((&interpret)));
}


/*	At a rough approximation we may need to allocate up to a couple
	of page's worth of contexts when switching stack pages, assigning
	to senders, etc. But the snapshot primitive voids all stack pages.
	So a safe margin is the size of a large context times the maximum
	number of frames per page times the number of pages. */

	/* CoInterpreter>>#interpreterAllocationReserveBytes */
static sqInt NeverInline
interpreterAllocationReserveBytes(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt maxFramesPerPage;
    sqInt maxUsedBytesPerPage;

	maxUsedBytesPerPage = (stackPageFrameBytes()) + ((IFrameSlots + 64) * BytesPerWord);
	maxFramesPerPage = (maxUsedBytesPerPage / BytesPerWord) / MFrameSlots;
	return ((maxFramesPerPage * LargeContextSlots) * BytesPerOop) * GIV(numStackPages);
}


/*	Execute a method interpretively from machine code. We assume (require)
	that newMethod
	messageSelector, primitiveFunctionPointer and argumentCount have been set
	in the caller.
	Once evaluated either continue in the interpreter via a jongjmp or in
	machine code via an
	enilopmart (a form of longjmp - a stinking rose by any other name). */

	/* CoInterpreter>>#interpretMethodFromMachineCode */
static sqInt
interpretMethodFromMachineCode(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt nArgs;
    char *savedFramePointer;
    char *savedStackPointer;

	nArgs = 0;
	savedFramePointer = ((char *) 0);
	savedStackPointer = ((char *) 0);
	assertCStackWellAligned();
	assert(validInstructionPointerinFrame(GIV(instructionPointer), GIV(framePointer)));
	if (primitiveFunctionPointer != 0) {
		if (primitiveFunctionPointer == primitiveInvokeObjectAsMethod) {
			assert(!(isOopCompiledMethod(GIV(newMethod))));
		}
		else {
			assert((isOopCompiledMethod(GIV(newMethod)))
			 && ((primitiveIndexOf(GIV(newMethod))) != 0));
		}
		assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
		(GIV(stackPage)->headFP = GIV(framePointer));
		if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) {
			externalQuickPrimitiveResponse();
			GIV(primFailCode) = 0;
		}
		else {
			/* begin slowPrimitiveResponse */
			if (recordPrimTrace()) {
				/* begin fastLogPrim: */
				GIV(primTraceLog)[GIV(primTraceLogIndex)] = GIV(messageSelector);
				primTraceLogIndex(GIV(primTraceLogIndex) + 1);
			}
			assert(!(isOopForwarded(stackValue(GIV(argumentCount)))));
			assert((remapBufferCount()) == 0);
			nArgs = GIV(argumentCount);
			savedStackPointer = GIV(stackPointer);
			savedFramePointer = GIV(framePointer);
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
			dispatchFunctionPointer(primitiveFunctionPointer);
			assert(maybeLeakCheckExternalPrimCall(GIV(newMethod)));
			/* begin maybeRetryPrimitiveOnFailure */
			if (GIV(primFailCode)) {
				retryPrimitiveOnFailure();
			}
			/* begin maybeFailForLastObjectOverwrite */
			if (checkAllocFiller) {
				if (((freeStart()) < GIV(scavengeThreshold))
				 && ((longAt(freeStart())) != (freeStart()))) {
					/* begin primitiveFailFor: */
					GIV(primFailCode) = PrimErrWritePastObject;
				}
			}
			if ((!GIV(primFailCode))
			 && ((GIV(framePointer) == savedFramePointer)
			 && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {

				/* Don't fail if primitive has done something radical, e.g. perform: */
				if (GIV(stackPointer) != (savedStackPointer + (nArgs * BytesPerWord))) {
					flag("Would be nice to make this a message send of e.g. unbalancedPrimitive to the current process or context");
					failUnbalancedPrimitive();
					GIV(stackPointer) = savedStackPointer;
				}
			}
			if (GIV(nextProfileTick) > 0) {
				checkProfileTick(GIV(newMethod));
			}
			!GIV(primFailCode);
		}
		if (!GIV(primFailCode)) {
			returntoExecutive(popStack(), 0);
		}
	}
	else {
		assert((isOopCompiledMethod(GIV(newMethod)))
		 && (((primitiveIndexOf(GIV(newMethod))) == 0)
		 || (((functionPointerForinClass(primitiveIndexOf(GIV(newMethod)), nilObject())) == 0)
		 || (isNullExternalPrimitiveCall(GIV(newMethod))))));
	}
	activateNewMethod();
	siglongjmp(reenterInterpreter, ReturnToInterpreter);
	return null;
}

	/* CoInterpreter>>#isCogMethodReference: */
sqInt
isCogMethodReference(sqInt methodHeader)
{
	assert(((((methodHeader) & 7) == 1))
	 || (((((usqInt)methodHeader)) < (startOfMemory()))
	 && ((((usqInt)methodHeader)) >= (minCogMethodAddress()))));
	return (methodHeader & (smallIntegerTag())) == 0;
}

	/* CoInterpreter>>#isMachineCodeFrame: */
static sqInt NoDbgRegParms
isMachineCodeFrame(char *theFP)
{
	return (((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory());
}


/*	Lookup selector in rcvr, without doing MNU processing, and answer either a
	method or an error code if the message was not understood. Used to
	populate closed PICs. */
/*	self printFrame: stackPage headFP WithSP: stackPage headSP */
/*	self printStringOf: selector */

	/* CoInterpreter>>#lookupMNU:receiver: */
sqInt
lookupMNUreceiver(sqInt selector, sqInt rcvr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classTag;
    sqInt erridx;
    sqInt inCache;
    sqInt tagBits;

	if (((tagBits = rcvr & (tagMask()))) != 0) {
		classTag = tagBits;
	}
	else {
		/* begin classIndexOf: */
		classTag = (longAt(rcvr)) & (classIndexMask());
	}
	inCache = lookupInMethodCacheSelclassTag(selector, classTag);
	if (!inCache) {
		GIV(messageSelector) = selector;
		erridx = lookupMNUInClass(classAtIndex(classTag));
		if (erridx != 0) {
			assert(erridx <= (maxLookupNoMNUErrorCode()));
			return erridx;
		}
	}
	return GIV(newMethod);
}


/*	Lookup selector in rcvr, without doing MNU processing, and answer either a
	method or an error code if the message was not understood. Used to
	populate closed PICs. */
/*	self printFrame: stackPage headFP WithSP: stackPage headSP */
/*	self printStringOf: selector */

	/* CoInterpreter>>#lookupOrdinary:receiver: */
sqInt
lookupOrdinaryreceiver(sqInt selector, sqInt rcvr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classTag;
    sqInt erridx;
    sqInt tagBits;

	if (((tagBits = rcvr & (tagMask()))) != 0) {
		classTag = tagBits;
	}
	else {
		/* begin classIndexOf: */
		classTag = (longAt(rcvr)) & (classIndexMask());
	}
	if (!(lookupInMethodCacheSelclassTag(selector, classTag))) {
		GIV(messageSelector) = selector;
		if (((erridx = lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag)))) != 0) {
			assert(erridx <= (maxLookupNoMNUErrorCode()));
			return erridx;
		}
	}
	return GIV(newMethod);
}


/*	<Integer> */
/*	Marry aContext with the base frame of a new stack page. Build the base
	frame to reflect the context's state. Answer the new page. Override to
	hold the caller context in a different place, In the StackInterpreter we
	use the caller saved ip, but in the Cog VM caller saved ip is the
	ceBaseReturn: trampoline. Simply hold the caller context in the first word
	of the stack. */

	/* CoInterpreter>>#makeBaseFrameFor: */
static StackPage * NoDbgRegParms
makeBaseFrameFor(sqInt aContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt header;
    sqInt header1;
    sqInt i;
    StackPage *lruOrFree;
    sqInt maybeClosure;
    sqInt numArgs;
    sqInt objOop;
    sqInt objOop1;
    sqInt oop;
    sqInt oop1;
    StackPage *page;
    char *pointer;
    sqInt rawHeader;
    sqInt rcvr;
    sqInt stackPtrIndex;
    sqInt theIP;
    sqInt theMethod;
    sqInt yetToCompact;


	/* theIP must be typed as signed because it is assigned ceCannotResumePC and so maybe implicitly typed as unsigned. */
	assert(isContext(aContext));
	assert(isSingleContext(aContext));
	assert(goodContextSize(aContext));
	theIP = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))));
	assert(HasBeenReturnedFromMCPC < 0);
	theIP = ((((theIP) & 7) == 1)
		? (theIP >> 3)
		: HasBeenReturnedFromMCPC);
	/* begin followObjField:ofObject: */
	objOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
	assert(isNonImmediate(objOop));
	if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		objOop = fixFollowedFieldofObjectwithInitialValue(MethodIndex, aContext, objOop);
	}
	theMethod = objOop;
	/* begin newStackPage */
	lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage);
	if (((lruOrFree->baseFP)) == 0) {
		page = lruOrFree;
		goto l1;
	}
	divorceFramesIn(lruOrFree);
	page = lruOrFree;
	l1:	/* end newStackPage */;
	longAtput((pointer = (page->baseAddress)), followObjFieldofObject(SenderIndex, aContext));
	longAtput((pointer -= BytesPerWord), aContext);
	/* begin followField:ofObject: */
	objOop1 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(ReceiverIndex) << (shiftForWord())))));
	if (((objOop1 & (tagMask())) == 0)
	 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop1 = fixFollowedFieldofObjectwithInitialValue(ReceiverIndex, aContext, objOop1);
	}
	rcvr = objOop1;
	maybeClosure = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureIndex) << (shiftForWord())))));
	if (maybeClosure != GIV(nilObj)) {
		if (((longAt(maybeClosure)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			maybeClosure = fixFollowedFieldofObjectwithInitialValue(ClosureIndex, aContext, maybeClosure);
		}
		/* begin quickFetchInteger:ofObject: */
		oop = longAt((maybeClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))));
		assert((((oop) & 7) == 1));
		numArgs = (oop >> 3);
		longAtput((pointer -= BytesPerWord), maybeClosure);
	}
	else {
		/* begin methodHeaderOf: */
		assert(isCompiledMethod(theMethod));
		header1 = longAt((theMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((((header1) & 7) == 1)) {
			header = header1;
		}
		else {
			assert((((usqInt)header1)) < GIV(newSpaceStart));
			assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
			header = ((((CogMethod *) header1))->methodHeader);
		}

		/* If this is a synthetic context its IP could be pointing at the CallPrimitive opcode.  If so, skip it. */
		numArgs = (((usqInt) header) >> MethodHeaderArgCountShift) & 15;
		if (((/* begin alternateHeaderHasPrimitiveFlag: */
		header & AlternateHeaderHasPrimFlag))
		 && (theIP == (1 + ((((assert((((header) & 7) == 1)),
((header >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop)))) {
			theIP += 3;
		}
		longAtput((pointer -= BytesPerWord), rcvr);
	}
	for (i = 1; i <= numArgs; i += 1) {
		longAtput((pointer -= BytesPerWord), longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)((ReceiverIndex + i)) << (shiftForWord()))))));
	}
	longAtput((pointer -= BytesPerWord), ceBaseFrameReturnPC());
	longAtput((pointer -= BytesPerWord), 0);
	(page->headFP = pointer);
	if (theIP < 0) {

		/* Since we would have to generate a machine-code method to be able to map
		   the native pc anyway we should create a native method and native frame. */
		/* begin ensureMethodIsCogged:maybeClosure: */
		rawHeader = longAt((theMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((assert(((((rawHeader) & 7) == 1))
			 || (((((usqInt)rawHeader)) < (startOfMemory()))
			 && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))),
		(rawHeader & (smallIntegerTag())) == 0)) {
			cogMethod = ((CogMethod *) rawHeader);
			goto l10;
		}
		yetToCompact = 1;
		while (1) {
			if ((maybeClosure != GIV(nilObj))
			 && (!(((((longAt((maybeClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord()))))))) & 7) == 1)))) {
				cogMethod1 = cogFullBlockMethodnumCopied(theMethod, (numSlotsOf(maybeClosure)) - FullClosureFirstCopiedValueIndex);
			}
			else {
				cogMethod1 = cogselector(theMethod, GIV(nilObj));
			}
			if (!((cogMethod1 == null)
			 && (GIV(cogCompiledCodeCompactionCalledFor)
			 && (yetToCompact)))) break;
			yetToCompact = 0;
			commenceCogCompiledCodeCompaction();
		}
		if (!(asserta(cogMethod1 != null))) {
			error("could not compile method that should have been compiled");
		}
		cogMethod = cogMethod1;
	l10:	/* end ensureMethodIsCogged:maybeClosure: */;
		theMethod = ((sqInt)cogMethod);
		if (maybeClosure != GIV(nilObj)) {
			if (((((longAt((maybeClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord()))))))) & 7) == 1)) {

				/* If the pc is the special HasBeenReturnedFromMCPC pc set the pc
				   appropriately so that the frame stays in the cannotReturn: state. */
				if (theIP == HasBeenReturnedFromMCPC) {
					theMethod = ((sqInt)(findMethodForStartBcpcinHomeMethod((((longAt((maybeClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) >> 3)) - 1, ((CogMethod *) theMethod))));
					if (theMethod == 0) {
						error("cannot find machine code block matching closure's startpc");
					}
					theIP = ceCannotResumePC();
				}
				else {
					assert((((signed)theIP >> 16)) < -1);
					theMethod -= (((signed)theIP >> 16)) * (blockAlignment());
					theIP = theMethod - (((short)theIP));
				}
			}
			else {
				assert((((signed)theIP >> 16)) >= -1);
				theIP = (theIP == HasBeenReturnedFromMCPC
					? ceCannotResumePC()
					: (((sqInt)theMethod)) - theIP);
			}
			longAtput((pointer -= BytesPerWord), (theMethod + MFMethodFlagHasContextFlag) + MFMethodFlagIsBlockFlag);
		}
		else {
			assert((((signed)theIP >> 16)) >= -1);
			theIP = (theIP == HasBeenReturnedFromMCPC
				? ceCannotResumePC()
				: (((sqInt)theMethod)) - theIP);
			longAtput((pointer -= BytesPerWord), theMethod + MFMethodFlagHasContextFlag);
		}
		longAtput((pointer -= BytesPerWord), aContext);
	}
	else {
		longAtput((pointer -= BytesPerWord), theMethod);
		longAtput((pointer -= BytesPerWord), aContext);
		longAtput((pointer -= BytesPerWord), (VMBIGENDIAN
			? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (1ULL << ((BytesPerWord * 8) - 16))) + ((maybeClosure != GIV(nilObj)
	? 1ULL << ((BytesPerWord * 8) - 24)
	: 0))
			: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (1U << 16)) + ((maybeClosure != GIV(nilObj)
	? 1U << 24
	: 0))));
		longAtput((pointer -= BytesPerWord), 0);
		assert(((theIP >= (((LiteralStart + (literalCountOf(theMethod))) * BytesPerOop) + 1)) && (theIP <= (lengthOf(theMethod)))));
		theIP = ((theMethod + theIP) + BaseHeaderSize) - 2;
	}
	(page->baseFP = (page->headFP));
	assert(frameHasContext((page->baseFP)));
	assert((frameNumArgs((page->baseFP))) == numArgs);
	longAtput((pointer -= BytesPerWord), rcvr);
	/* begin quickFetchInteger:ofObject: */
	oop1 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
	assert((((oop1) & 7) == 1));
	stackPtrIndex = (oop1 >> 3);
	assert((ReceiverIndex + stackPtrIndex) < (lengthOf(aContext)));
	for (i = (numArgs + 1); i <= stackPtrIndex; i += 1) {
		longAtput((pointer -= BytesPerWord), longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)((ReceiverIndex + i)) << (shiftForWord()))))));
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(aContext)));
		longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)((ReceiverIndex + i)) << (shiftForWord())))), GIV(nilObj));
	}
	longAtput((pointer -= BytesPerWord), theIP);
	(page->headSP = pointer);
	assert(contexthasValidInversePCMappingOfin(aContext, theIP, (page->baseFP)));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(aContext)));
	longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), (assert(((oopForPointer((page->baseFP))) & (BytesPerWord - 1)) == 0),
	(oopForPointer((page->baseFP))) + (smallIntegerTag())));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(aContext)));
	longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), (assert(((oopForPointer(0)) & (BytesPerWord - 1)) == 0),
	(oopForPointer(0)) + (smallIntegerTag())));
	assert(((((fetchPointerofObject(SenderIndex, aContext))) & 7) == 1));
	assert((frameOfMarriedContext(aContext)) == ((page->baseFP)));
	assert(validStackPageBaseFrame(page));
	return page;
}


/*	The prim trace log is a circular buffer of selectors. If there is
	an entry at primTraceLogIndex - 1 \\ PrimTraceBufferSize it has entries.
	If there is something at primTraceLogIndex it has wrapped. */

	/* CoInterpreter>>#mapPrimTraceLog */
static void
mapPrimTraceLog(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt remainder;
    sqInt selector;

	if ((GIV(primTraceLog)[(((remainder = (GIV(primTraceLogIndex) - 1) % PrimTraceLogSize)) < 0
			? remainder + PrimTraceLogSize
			: remainder)]) == 0) {
		return;
	}
	if ((GIV(primTraceLog)[GIV(primTraceLogIndex)]) != 0) {
		for (i = GIV(primTraceLogIndex); i < PrimTraceLogSize; i += 1) {
			selector = GIV(primTraceLog)[i];
			if ((selector != 0)
			 && (((selector & (tagMask())) == 0)
			 && (shouldRemapObj(selector)))) {
				GIV(primTraceLog)[i] = (remapObj(selector));
			}
		}
	}
	for (i = 0; i < GIV(primTraceLogIndex); i += 1) {
		selector = GIV(primTraceLog)[i];
		if ((selector != 0)
		 && (((selector & (tagMask())) == 0)
		 && (shouldRemapObj(selector)))) {
			GIV(primTraceLog)[i] = (remapObj(selector));
		}
	}
}

	/* CoInterpreter>>#mapStackPages */
static void NeverInline
mapStackPages(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *callerFP;
    char *frameRcvrOffset;
    sqInt i;
    sqInt numLivePages;
    sqInt oop;
    char *theFP;
    sqInt theIP;
    char *theIPPtr;
    StackPage *thePage;
    char *theSP;

	theIP = 0;
	numLivePages = 0;
	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		if (!(((thePage->baseFP)) == 0)) {
			assert(ifCurrentStackPageHasValidHeadPointers(thePage));
			numLivePages += 1;
			theSP = (thePage->headSP);

			/* Skip the instruction pointer on top of stack of inactive pages. */
			theFP = (thePage->headFP);
			if (thePage == GIV(stackPage)) {
				theIPPtr = (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()))
				 || ((longAt(theFP + FoxIFSavedIP)) == 0)
					? 0
					: theFP + FoxIFSavedIP);
			}
			else {
				theIPPtr = theSP;
				theSP += BytesPerWord;
			}
			while (1) {
				assert(addressIsInPage(thePage, theFP));
				assert(addressIsInPage(thePage, theSP));
				assert((theIPPtr == 0)
				 || (addressIsInPage(thePage, theIPPtr)));
				frameRcvrOffset = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? theFP + FoxMFReceiver
					: theFP + FoxIFReceiver);
				while (theSP <= frameRcvrOffset) {
					oop = longAt(theSP);
					if (((oop & (tagMask())) == 0)
					 && (shouldRemapObj(oop))) {
						longAtput(theSP, remapObj(oop));
					}
					theSP += BytesPerWord;
				}
				if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
					: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
					if (shouldRemapObj(longAt(theFP + FoxThisContext))) {
						longAtput(theFP + FoxThisContext, remapObj(longAt(theFP + FoxThisContext)));
					}
					if (!(GIV(gcPhaseInProgress) == SlidingCompactionInProgress)) {
						assert((isMarriedOrWidowedContext(frameContext(theFP)))
						 && ((frameOfMarriedContext(frameContext(theFP))) == theFP));
					}
				}
				if (!((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()))) {
					if (shouldRemapObj(longAt(theFP + FoxMethod))) {
						if (theIPPtr != 0) {
							theIP = longAt(theIPPtr);
							if (theIP == (ceReturnToInterpreterPC())) {
								assert((iframeSavedIP(theFP)) > (iframeMethod(theFP)));
								theIPPtr = theFP + FoxIFSavedIP;
								theIP = longAt(theIPPtr);
							}
							else {
								assert(theIP > (iframeMethod(theFP)));
							}
							theIP -= longAt(theFP + FoxMethod);
						}
						longAtput(theFP + FoxMethod, remapObj(longAt(theFP + FoxMethod)));
						if (theIPPtr != 0) {
							longAtput(theIPPtr, theIP + (longAt(theFP + FoxMethod)));
						}
					}
				}
				if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break;
				theSP = ((theIPPtr = theFP + FoxCallerSavedIP)) + BytesPerWord;
				theFP = callerFP;
			}
			theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
			while (theSP <= ((thePage->baseAddress))) {
				oop = longAt(theSP);
				if (((oop & (tagMask())) == 0)
				 && (shouldRemapObj(oop))) {
					longAtput(theSP, remapObj(oop));
				}
				theSP += BytesPerWord;
			}
		}
	}
	/* begin recordLivePagesOnMapping: */
	GIV(statNumMaps) += 1;
	GIV(statPageCountWhenMappingSum) += numLivePages;
	GIV(statMaxPageCountWhenMapping) = ((GIV(statMaxPageCountWhenMapping) < numLivePages) ? numLivePages : GIV(statMaxPageCountWhenMapping));
}


/*	The trace log is a circular buffer of pairs of entries. If there is
	an entry at traceLogIndex - 3 \\ TraceBufferSize it has entries.
	If there is something at traceLogIndex it has wrapped. */

	/* CoInterpreter>>#mapTraceLog */
static void
mapTraceLog(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt intOrClass;
    sqInt limit;
    sqInt remainder;
    sqInt selectorOrMethod;

	limit = (((remainder = (GIV(traceLogIndex) - 3) % TraceBufferSize)) < 0
		? remainder + TraceBufferSize
		: remainder);
	if ((GIV(traceLog)[limit]) == 0) {
		return;
	}
	if ((GIV(traceLog)[GIV(traceLogIndex)]) != 0) {
		limit = TraceBufferSize - 3;
	}
	for (i = 0; i <= limit; i += 3) {
		intOrClass = GIV(traceLog)[i];
		if (((intOrClass & (tagMask())) == 0)
		 && (shouldRemapObj(intOrClass))) {
			GIV(traceLog)[i] = (remapObj(intOrClass));
		}
		selectorOrMethod = GIV(traceLog)[i + 1];
		if (((selectorOrMethod & (tagMask())) == 0)
		 && (shouldRemapObj(selectorOrMethod))) {
			GIV(traceLog)[i + 1] = (remapObj(selectorOrMethod));
		}
	}
}

	/* CoInterpreter>>#markActiveMethodsAndReferents */
void
markActiveMethodsAndReferents(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    StackPage *thePage;

	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		if (!(isFree(thePage))) {
			markCogMethodsAndReferentsOnPage(thePage);
		}
	}
}


/*	The prim trace log is a circular buffer of selectors. If there is
	an entry at primTraceLogIndex - 1 \\ PrimTraceBufferSize it has entries.
	If there is something at primTraceLogIndex it has wrapped. */

	/* CoInterpreter>>#markAndTracePrimTraceLog */
static void
markAndTracePrimTraceLog(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt remainder;
    sqInt selector;

	if ((GIV(primTraceLog)[(((remainder = (GIV(primTraceLogIndex) - 1) % PrimTraceLogSize)) < 0
			? remainder + PrimTraceLogSize
			: remainder)]) == 0) {
		return;
	}
	if ((GIV(primTraceLog)[GIV(primTraceLogIndex)]) != 0) {
		for (i = GIV(primTraceLogIndex); i < PrimTraceLogSize; i += 1) {
			selector = GIV(primTraceLog)[i];
			if ((selector != 0)
			 && ((selector & (tagMask())) == 0)) {
				markAndTrace(selector);
			}
		}
	}
	for (i = 0; i < GIV(primTraceLogIndex); i += 1) {
		selector = GIV(primTraceLog)[i];
		if ((selector != 0)
		 && ((selector & (tagMask())) == 0)) {
			markAndTrace(selector);
		}
	}
}

	/* CoInterpreter>>#markAndTraceStackPage: */
static void NoDbgRegParms
markAndTraceStackPage(StackPage *thePage)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    CogBlockMethod *aCogMethod;
    char *callerFP;
    char *frameRcvrOffset;
    CogMethod *homeMethod;
    sqInt oop;
    sqInt referent;
    sqInt referent1;
    char *theFP;
    char *theSP;

	assert(!(isFree(thePage)));
	assert(ifCurrentStackPageHasValidHeadPointers(thePage));
	assert(((thePage->trace)) != StackPageTraced);
	(thePage->trace = StackPageTraced);
	theSP = (thePage->headSP);

	/* Skip the instruction pointer on top of stack of inactive pages. */
	theFP = (thePage->headFP);
	if (!(thePage == GIV(stackPage))) {
		theSP += BytesPerWord;
	}
	while (1) {
		frameRcvrOffset = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? theFP + FoxMFReceiver
			: theFP + FoxIFReceiver);
		while (theSP <= frameRcvrOffset) {
			oop = longAt(theSP);
			if (((oop & (tagMask())) == 0)
			 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(oop));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent & (tagMask())) == 0)
				 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				oop = referent;
				longAtput(theSP, oop);
			}
			if (!(oop & (tagMask()))) {
				markAndTrace(oop);
			}
			theSP += BytesPerWord;
		}
		if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
			assert(isContext(frameContext(theFP)));
			markAndTrace(longAt(theFP + FoxThisContext));
		}
		if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
			/* begin markAndTraceMachineCodeMethod: */
			aCogMethod = ((CogBlockMethod *) ((longAt(theFP + FoxMethod)) & MFMethodMask));
			/* begin asCogHomeMethod: */
			homeMethod = (((aCogMethod->cmType)) == CMMethod
				? ((CogMethod *) aCogMethod)
				: ((aCogMethod->cpicHasMNUCaseOrCMIsFullBlock)
						? ((CogMethod *) aCogMethod)
						: ((CogMethod *) ((((usqInt)aCogMethod)) - ((aCogMethod->homeOffset))))));
			markAndTrace((homeMethod->methodObject));
		}
		else {
			markAndTrace(longAt(theFP + FoxMethod));
		}
		if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break;
		theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
		theFP = callerFP;
	}

	/* caller ip is ceBaseReturnPC */
	theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
	while (theSP <= ((thePage->baseAddress))) {
		oop = longAt(theSP);
		if (((oop & (tagMask())) == 0)
		 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(oop));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent1 = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent1 & (tagMask())) == 0)
			 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			oop = referent1;
			longAtput(theSP, oop);
		}
		if (!(oop & (tagMask()))) {
			markAndTrace(oop);
		}
		theSP += BytesPerWord;
	}
}


/*	The trace log is a circular buffer of pairs of entries. If there is an
	entry at
	traceLogIndex - 3 \\ TraceBufferSize it has entries. If there is something
	at traceLogIndex it has wrapped. */

	/* CoInterpreter>>#markAndTraceTraceLog */
static void
markAndTraceTraceLog(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt limit;
    sqInt oop;
    sqInt remainder;

	limit = (((remainder = (GIV(traceLogIndex) - 3) % TraceBufferSize)) < 0
		? remainder + TraceBufferSize
		: remainder);
	if ((GIV(traceLog)[limit]) == 0) {
		return;
	}
	if ((GIV(traceLog)[GIV(traceLogIndex)]) != 0) {
		limit = TraceBufferSize - 3;
	}
	for (i = 0; i <= limit; i += 3) {
		oop = GIV(traceLog)[i];
		if (!(oop & (tagMask()))) {
			markAndTrace(oop);
		}
		oop = GIV(traceLog)[i + 1];
		if (!(oop & (tagMask()))) {
			markAndTrace(oop);
		}
	}
}

	/* CoInterpreter>>#markCogMethodsAndReferentsOnPage: */
static void NoDbgRegParms
markCogMethodsAndReferentsOnPage(StackPage *thePage)
{
    char *callerFP;
    char *theFP;

	assert(!(isFree(thePage)));
	assert(ifCurrentStackPageHasValidHeadPointers(thePage));

	/* Skip the instruction pointer on top of stack of inactive pages. */
	theFP = (thePage->headFP);
	while (1) {
		if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
			markMethodAndReferents(mframeCogMethod(theFP));
		}
		if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break;
		theFP = callerFP;
	}
}


/*	Answer whether marryFrame:SP: copies non-argument temporaries. */

	/* CoInterpreter>>#marryFrameCopiesTemps */
sqInt
marryFrameCopiesTemps(void)
{
	return 0;
}

	/* CoInterpreter>>#maxLookupNoMNUErrorCode */
sqInt
maxLookupNoMNUErrorCode(void)
{
	return ((SelectorCannotInterpret < SelectorDoesNotUnderstand) ? SelectorDoesNotUnderstand : SelectorCannotInterpret);
}


/*	The flag bit can be used to flag methods that are interpreted, if it has
	been requested
	from the image header flags. */

	/* CoInterpreter>>#maybeFlagMethodAsInterpreted: */
static void NoDbgRegParms
maybeFlagMethodAsInterpreted(sqInt aMethod)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt rawHeader;
    sqInt realHeader;

	if (GIV(flagInterpretedMethods)) {
		/* begin fetchPointer:ofObject: */
		rawHeader = longAt((aMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		realHeader = ((assert(((((rawHeader) & 7) == 1))
			 || (((((usqInt)rawHeader)) < (startOfMemory()))
			 && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))),
		(rawHeader & (smallIntegerTag())) == 0)
			? ((((CogMethod *) rawHeader))->methodHeader)
			: rawHeader);
		realHeader = realHeader | ((((usqInt)(1U << MethodHeaderFlagBitPosition) << 3) | 1));
		if ((assert(((((rawHeader) & 7) == 1))
			 || (((((usqInt)rawHeader)) < (startOfMemory()))
			 && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))),
		(rawHeader & (smallIntegerTag())) == 0)) {
			((((CogMethod *) rawHeader))->methodHeader = realHeader);
		}
		else {
			assert(!(isOopForwarded(aMethod)));
			longAtput((aMethod + BaseHeaderSize) + (0U << (shiftForWord())), realHeader);
		}
	}
}

	/* CoInterpreter>>#mcprimFunctionForPrimitiveIndex: */
sqInt
mcprimFunctionForPrimitiveIndex(sqInt primIndex)
{
	if (primIndex == PrimNumberHashMultiply) {
		return mcprimHashMultiply;
	}
	error("unknown mcprim");
	return null;
}

	/* CoInterpreter>>#methodCacheAddress */
void *
methodCacheAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(methodCache);
}

	/* CoInterpreter>>#methodHasCogMethod: */
sqInt
methodHasCogMethod(sqInt aMethodOop)
{
    sqInt methodHeader;

	assert(isNonImmediate(aMethodOop));
	/* begin isCogMethodReference: */
	methodHeader = longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	assert(((((methodHeader) & 7) == 1))
	 || (((((usqInt)methodHeader)) < (startOfMemory()))
	 && ((((usqInt)methodHeader)) >= (minCogMethodAddress()))));
	return (methodHeader & (smallIntegerTag())) == 0;
}

	/* CoInterpreter>>#methodNeedsLargeContext: */
sqInt
methodNeedsLargeContext(sqInt methodObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt header;
    sqInt methodHeader;

	/* begin methodHeaderIndicatesLargeFrame: */
	assert(isCompiledMethod(methodObj));
	header = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	return (methodHeader & LargeContextBit) != 0;
}

	/* CoInterpreter>>#methodShouldBeCogged: */
sqInt
methodShouldBeCogged(sqInt aMethodObj)
{
	if (methodWithHeaderShouldBeCogged(methodHeaderOf(aMethodObj))) {
		return 1;
	}
	maybeFlagMethodAsInterpreted(aMethodObj);
	return 0;
}


/*	At the moment jit any method with less than N literals, where N defaults
	to 60.
	See e.g. SimpleStackBasedCogit class>>initialize.
	In my dev image eem 2/22/2009 13:39
	(30 to: 100 by: 5) collect:
	[:n| n -> (SystemNavigation default allSelect: [:m| m numLiterals > n])
	size] #(30->1681 35->1150 40->765 45->523 50->389 55->289 60->206
	65->151 70->124 75->99 80->73 85->63 90->54 95->42 100->38).
	And running the CogVMSimulator with flagging of interpreted methods turned
	on reveals
	the following sizes of interpreted methods.
	| sizes |
	sizes := Bag new.
	SystemNavigation default allSelect: [:m| m flag ifTrue: [sizes add: m
	numLiterals]. false].
	sizes sortedElements asArray
	#(	40->4 41->1 42->2 44->1 45->3 46->1 47->2 48->1
	50->2 51->1 53->1 55->1 56->1
	87->1 108->1 171->1)
	literalCountOfHeader: does not include the header word. */

	/* CoInterpreter>>#methodWithHeaderShouldBeCogged: */
static sqInt NoDbgRegParms
methodWithHeaderShouldBeCogged(sqInt methodHeader)
{
	return ((assert((((methodHeader) & 7) == 1)),
	((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile;
}


/*	Answer the Cog method for a machine code frame. This may be
	either a full CogMethod or merely a CogBlockMethod rump header. */

	/* CoInterpreter>>#mframeCogMethod: */
static CogBlockMethod * NoDbgRegParms
mframeCogMethod(char *theFP)
{
	return ((CogBlockMethod *) ((longAt(theFP + FoxMethod)) & MFMethodMask));
}

	/* CoInterpreter>>#mframeHomeMethodExport */
CogMethod *
mframeHomeMethodExport(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt methodField;

	/* begin mframeHomeMethod: */
	methodField = longAt(GIV(framePointer) + FoxMethod);
	if ((methodField & MFMethodFlagIsBlockFlag) != 0) {
		return (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock)
			? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask))))
			: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset)))));
	}
	return ((CogMethod *) (methodField & MFMethodMask));
}


/*	Answer the home method for a machine code frame. From a block frame we
	find the home method through the block's homeOffset field which is the
	delta to it.
	In both cases we need to strip the isBlock and isContext flags from the
	method field. */

	/* CoInterpreter>>#mframeHomeMethod: */
CogMethod *
mframeHomeMethod(char *theFP)
{
    sqInt methodField;

	/* begin frameMethodField: */
	methodField = longAt(theFP + FoxMethod);
	if ((methodField & MFMethodFlagIsBlockFlag) != 0) {
		return (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock)
			? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask))))
			: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset)))));
	}
	return ((CogMethod *) (methodField & MFMethodMask));
}


/*	<Integer> */

	/* CoInterpreter>>#mframeIsBlockActivation: */
static sqInt NoDbgRegParms
mframeIsBlockActivation(char *theFP)
{
	return ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0;
}

	/* CoInterpreter>>#mframeReceiver: */
static sqInt NoDbgRegParms
mframeReceiver(char *theFP)
{
	return longAt(theFP + FoxMFReceiver);
}


/*	Traverse all stack pages looking for non-zero bytes in the headroom part
	of each page.
	Answer the minimum size of unused headroom (zero bytes) in the pages. This
	is for
	checking that there is enough headroom allocated in stack pages. */

	/* CoInterpreter>>#minimumUnusedHeadroom */
static sqInt
minimumUnusedHeadroom(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    int minUnused;
    char *p;
    StackPage *page;
    int unused;

	minUnused = (((stackPageAt(0))->baseAddress)) - (((stackPageAt(0))->lastAddress));
	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		page = stackPageAtpages(i, GIV(pages));
		p = (page->lastAddress);
		do {
			p += BytesPerWord;
		} while(((longAtPointer(p)) == 0)
			 && (p <= ((page->baseAddress))));
		unused = (p - BytesPerWord) - ((page->lastAddress));
		if (unused < minUnused) {
			minUnused = unused;
		}
	}
	return minUnused;
}

	/* CoInterpreter>>#mMethodClass */
sqInt
mMethodClass(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt literal;
    sqInt methodPointer;
    sqInt objOop;
    sqInt objOop1;
    sqInt offset;

	/* begin methodClassOf: */
	methodPointer = ((mframeHomeMethod(GIV(framePointer)))->methodObject);
	/* begin followLiteral:ofMethod: */
	offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1;
	/* begin followField:ofObject: */
	objOop1 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
	if (((objOop1 & (tagMask())) == 0)
	 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop1 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop1);
	}
	literal = objOop1;
	return ((literal != GIV(nilObj))
	 && (((literal & (tagMask())) == 0)
	 && (((((usqInt) (longAt(literal))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
		? (assert((numSlotsOf(literal)) > ValueIndex),
			/* begin followField:ofObject: */
			(objOop = longAt((literal + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))))),
			(((objOop & (tagMask())) == 0)
				 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)
					? (objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop))
					: 0),
			objOop)
		: /* begin nilObject */ GIV(nilObj));
}

	/* CoInterpreter>>#mnuCompilationBreakpointFor: */
void
mnuCompilationBreakpointFor(sqInt selectorOop)
{
	suppressHeartbeatFlag = 1;
	warning("compilation MNU break (heartbeat suppressed)");
}


/*	Lookup the doesNotUnderstand: selector in the class of the argument rcvr.
	Answer either the matching method (cogged if appropriate), or nil, if not
	found. 
 */

	/* CoInterpreter>>#mnuMethodOrNilFor: */
static sqInt NoDbgRegParms
mnuMethodOrNilFor(sqInt rcvr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt currentClass;
    sqInt dictionary;
    sqInt index;
    usqInt length;
    sqInt mask;
    sqInt methodArray;
    sqInt methodHeader;
    sqInt mnuMethod;
    sqInt mnuSelector;
    sqInt nextSelector;
    usqInt numSlots;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop2;
    sqInt tagBits;
    sqInt wrapAround;

	assert(!((isOopForwarded(rcvr))));
	if (((tagBits = rcvr & (tagMask()))) != 0) {
		/* begin fetchPointer:ofObject: */
		currentClass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))));
	}
	else {
		currentClass = fetchClassOfNonImm(rcvr);
	}
	/* begin fetchPointer:ofObject: */
	mnuSelector = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorDoesNotUnderstand) << (shiftForWord())))));
	while (currentClass != GIV(nilObj)) {
		dictionary = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(MethodDictionaryIndex) << (shiftForWord())))));
		if (dictionary == GIV(nilObj)) {
			return null;
		}
		/* begin lookupMethodFor:InDictionary: */
		assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(dictionary + 7);
		length = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(dictionary - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
		mask = (length - SelectorStart) - 1;

		/* It is assumed that there are some nils in this dictionary, and search will
		   stop when one is encountered. However, if there are no nils, then wrapAround
		   will be detected the second time the loop gets to the end of the table. */
		index = SelectorStart + (mask & ((mnuSelector & (tagMask())
	? (mnuSelector >> 3)
	: (long32At(mnuSelector + 4)) & (identityHashHalfWordMask()))));
		wrapAround = 0;
		while (1) {
			/* begin fetchPointer:ofObject: */
			nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
			if (nextSelector == GIV(nilObj)) {
				mnuMethod = null;
				goto l9;
			}
			if (((nextSelector & (tagMask())) == 0)
			 && (((longAt(nextSelector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				nextSelector = fixFollowedFieldofObjectwithInitialValue(index + SelectorStart, dictionary, nextSelector);
			}
			if (nextSelector == mnuSelector) {
				/* begin followObjField:ofObject: */
				objOop = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
				assert(isNonImmediate(objOop));
				if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					objOop = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop);
				}
				methodArray = objOop;
				/* begin followField:ofObject: */
				objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
				if (((objOop1 & (tagMask())) == 0)
				 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1);
				}
				mnuMethod = objOop1;
				goto l9;
			}
			index += 1;
			if (index == length) {
				if (wrapAround) {
					mnuMethod = null;
					goto l9;
				}
				wrapAround = 1;
				index = SelectorStart;
			}
		}
		mnuMethod = null;
	l9:	/* end lookupMethodFor:InDictionary: */;
		if (!(mnuMethod == null)) {
			/* begin fetchPointer:ofObject: */
			methodHeader = longAt((mnuMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
			if ((!((assert(((((methodHeader) & 7) == 1))
				 || (((((usqInt)methodHeader)) < (startOfMemory()))
				 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
			(methodHeader & (smallIntegerTag())) == 0)))
			 && (((assert((((methodHeader) & 7) == 1)),
			((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile)) {
				cogselector(mnuMethod, mnuSelector);
			}
			return mnuMethod;
		}
		/* begin followField:ofObject: */
		objOop2 = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop2 & (tagMask())) == 0)
		 && (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop2 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop2);
		}
		currentClass = objOop2;
	}
	return null;
}


/*	Move frames from the hot end of oldPage through to theFP to newPage.
	This has the effect of making theFP a base frame which can be stored into.
	Answer theFP's new location. */

	/* CoInterpreter>>#moveFramesIn:through:toPage: */
static char * NoDbgRegParms
moveFramesInthroughtoPage(StackPage *oldPage, char *theFP, StackPage *newPage)
{
    char *callerFP;
    usqInt callerIP;
    int delta;
    char *fpInNewPage;
    char *newFP;
    char *newSP;
    sqInt numArgs;
    char *offsetCallerFP;
    char *source;
    sqInt stackedReceiverOffset;
    sqInt theContext;
    char *theFP1;
    char *theSP;


	/* A base frame must have a context for cannotReturn: processing. */
	assert(!(isBaseFrame(theFP)));
	assert(validStackPageBaseFrames());
	callerFP = pointerForOop(longAt(theFP + FoxSavedFP));
	assert(frameHasContext(callerFP));
	assert(isContext(frameContext(callerFP)));
	/* begin ensureFrameIsMarried:SP: */
	theSP = theFP + (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
	? FoxMFReceiver
	: FoxIFReceiver));
	if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
		assert(isContext(frameContext(theFP)));
		theContext = longAt(theFP + FoxThisContext);
		goto l4;
	}
	theContext = marryFrameSP(theFP, theSP);
	l4:	/* end ensureFrameIsMarried:SP: */;
	longAtput((newSP = (newPage->baseAddress)), longAt(callerFP + FoxThisContext));
	longAtput((newSP -= BytesPerWord), theContext);
	/* begin frameStackedReceiverOffsetNumArgs: */
	numArgs = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((mframeCogMethod(theFP))->cmNumArgs)
		: byteAt((theFP + FoxIFrameFlags) + 1));
	stackedReceiverOffset = (FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord()))));
	for (source = (theFP + stackedReceiverOffset); source >= ((oldPage->headSP)); source += (-BytesPerWord)) {
		newSP -= BytesPerWord;
		longAtput(newSP, longAt(source));
	}
	delta = newSP - ((oldPage->headSP));
	newFP = (((newPage->baseAddress)) - stackedReceiverOffset) - (2 * BytesPerWord);
	/* begin setHeadFP:andSP:inPage: */
	theFP1 = ((oldPage->headFP)) + delta;
	assert(newSP < theFP1);
	assert((newSP < ((newPage->baseAddress)))
	 && (newSP > (((newPage->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((theFP1 < ((newPage->baseAddress)))
	 && (theFP1 > (((newPage->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(newPage->headFP = theFP1);
	(newPage->headSP = newSP);
	(newPage->baseFP = newFP);
	callerIP = oopForPointer(pointerForOop(longAt(theFP + FoxCallerSavedIP)));
	if ((((usqInt)callerIP)) >= (startOfMemory())) {
		/* begin iframeSavedIP:put: */
		assert(!(isMachineCodeFrame(callerFP)));
		longAtput(callerFP + FoxIFSavedIP, callerIP);
		callerIP = ceReturnToInterpreterPC();
	}
	longAtput(theFP + stackedReceiverOffset, callerIP);
	assert((callerFP < ((oldPage->baseAddress)))
	 && (callerFP > (((oldPage->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(oldPage->headFP = callerFP);
	(oldPage->headSP = theFP + stackedReceiverOffset);
	longAtput(newFP + FoxCallerSavedIP, ceBaseFrameReturnPC());
	longAtput(newFP + FoxSavedFP, 0);
	fpInNewPage = (newPage->headFP);
	do {
		offsetCallerFP = pointerForOop(longAt(fpInNewPage + FoxSavedFP));
		if (offsetCallerFP != 0) {
			offsetCallerFP += delta;
		}
		longAtput(fpInNewPage + FoxSavedFP, oopForPointer(offsetCallerFP));
		if (((((usqInt)(longAt(fpInNewPage + FoxMethod)))) < (startOfMemory())
			? ((longAt(fpInNewPage + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((fpInNewPage + FoxIFrameFlags) + 2)) != 0)) {
			theContext = longAt(fpInNewPage + FoxThisContext);
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(theContext)));
			longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), (assert(((oopForPointer(fpInNewPage)) & (BytesPerWord - 1)) == 0),
			(oopForPointer(fpInNewPage)) + (smallIntegerTag())));
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(theContext)));
			longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), (assert(((oopForPointer(offsetCallerFP)) & (BytesPerWord - 1)) == 0),
			(oopForPointer(offsetCallerFP)) + (smallIntegerTag())));
		}
		fpInNewPage = offsetCallerFP;
	} while(fpInNewPage != 0);
	assert(validStackPageBaseFrames());
	return newFP;
}


/*	Map the native pc theIP into a bytecode pc integer object and answer it.
	See contextInstructionPointer:frame: for the explanation. */

	/* CoInterpreter>>#mustMapMachineCodePC:context: */
static sqInt NoDbgRegParms
mustMapMachineCodePCcontext(sqInt theIP, sqInt aOnceMarriedContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bcpc;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    CogBlockMethod *cogMethodForIP;
    sqInt maybeClosure;
    sqInt mcpc;
    sqInt methodHeader;
    sqInt methodObj;
    sqInt rawHeader;
    sqInt startBcpc;
    sqInt yetToCompact;

	if (theIP == HasBeenReturnedFromMCPC) {
		return GIV(nilObj);
	}
	maybeClosure = longAt((aOnceMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureIndex) << (shiftForWord())))));
	methodObj = longAt((aOnceMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
	if ((maybeClosure != GIV(nilObj))
	 && (((((longAt((maybeClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord()))))))) & 7) == 1))) {
		assert((((signed)theIP >> 16)) < -1);
		startBcpc = (((longAt((maybeClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))))) >> 3)) - 1;
	}
	else {
		assert((((signed)theIP >> 16)) == -1);
		startBcpc = ((literalCountOfMethodHeader(methodHeaderOf(methodObj))) + LiteralStart) * BytesPerOop;
	}
	/* begin ensureMethodIsCogged:maybeClosure: */
	rawHeader = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((rawHeader) & 7) == 1))
		 || (((((usqInt)rawHeader)) < (startOfMemory()))
		 && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))),
	(rawHeader & (smallIntegerTag())) == 0)) {
		cogMethod = ((CogMethod *) rawHeader);
		goto l5;
	}
	yetToCompact = 1;
	while (1) {
		if ((maybeClosure != GIV(nilObj))
		 && (!(((((longAt((maybeClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord()))))))) & 7) == 1)))) {
			cogMethod1 = cogFullBlockMethodnumCopied(methodObj, (numSlotsOf(maybeClosure)) - FullClosureFirstCopiedValueIndex);
		}
		else {
			cogMethod1 = cogselector(methodObj, GIV(nilObj));
		}
		if (!((cogMethod1 == null)
		 && (GIV(cogCompiledCodeCompactionCalledFor)
		 && (yetToCompact)))) break;
		yetToCompact = 0;
		commenceCogCompiledCodeCompaction();
	}
	if (!(asserta(cogMethod1 != null))) {
		error("could not compile method that should have been compiled");
	}
	cogMethod = cogMethod1;
	l5:	/* end ensureMethodIsCogged:maybeClosure: */;
	/* begin bytecodePCFor:cogMethod:startBcpc: */
	assert(theIP < 0);
	if ((((signed)theIP >> 16)) < -1) {

		/* See contextInstructionPointer:frame: */
		cogMethodForIP = ((CogBlockMethod *) ((((sqInt)cogMethod)) - ((((signed)theIP >> 16)) * (blockAlignment()))));
		assert(((cogMethodForIP->cmType)) == CMBlock);
		assert((cmHomeMethod(cogMethodForIP)) == cogMethod);
		mcpc = (((sqInt)cogMethodForIP)) - (((short)theIP));
	}
	else {
		cogMethodForIP = ((CogBlockMethod *) cogMethod);
		assert(((cogMethodForIP->cmType)) == CMMethod);

		/* map any pcs in primitive code (i.e. return addresses for interpreter primitive calls) to the initial pc */
		mcpc = (((sqInt)cogMethod)) - theIP;
		if ((((usqInt)mcpc)) < ((cogMethod->stackCheckOffset))) {
			bcpc = startBcpc;
			goto l1;
		}
	}
	assert(((mcpc >= (((sqInt)cogMethod))) && (mcpc <= ((((sqInt)cogMethod)) + ((cogMethod->blockSize))))));
	bcpc = bytecodePCForstartBcpcin(mcpc, startBcpc, cogMethodForIP);
	l1:	/* end bytecodePCFor:cogMethod:startBcpc: */;
	assert(bcpc >= (startPCOfMethod(methodObj)));
	if ((bcpc == startBcpc)
	 && ((maybeClosure == GIV(nilObj))
	 && ((/* begin alternateHeaderHasPrimitiveFlag: */
	(methodHeader = (cogMethod->methodHeader)),
	methodHeader & AlternateHeaderHasPrimFlag)))) {
		bcpc += 3;
	}
	return (((usqInt)(bcpc + 1) << 3) | 1);
}

	/* CoInterpreter>>#newMethodAddress */
usqInt
newMethodAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(newMethod))));
}


/*	Answer if classTag x messageSelector => newMethod is in the lookup cache.
	This is for assert checking to check that open PICs find entries. */

	/* CoInterpreter>>#newMethodInLookupCacheAt:and: */
static sqInt NoDbgRegParms
newMethodInLookupCacheAtand(sqInt selector, sqInt classTag)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt hash;
    sqInt p;
    sqInt probe;

	hash = selector ^ (((sqInt)((usqInt)(classTag) << 2)));
	for (p = 0; p < CacheProbeMax; p += 1) {
		probe = (((usqInt) hash) >> p) & MethodCacheMask;
		if (((GIV(methodCache)[probe + MethodCacheSelector]) == selector)
		 && (((GIV(methodCache)[probe + MethodCacheClass]) == classTag)
		 && ((GIV(methodCache)[probe + MethodCacheMethod]) == GIV(newMethod)))) {
			return 1;
		}
	}
	return 0;
}


/*	N.B. nextProfileTick is 64-bits */

	/* CoInterpreter>>#nextProfileTickAddress */
usqInt
nextProfileTickAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(nextProfileTick))));
}

	/* CoInterpreter>>#noAssertHeaderOf: */
sqInt
noAssertHeaderOf(sqInt methodPointer)
{
    sqInt methodHeader;

	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	return ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)
		? ((((CogMethod *) methodHeader))->methodHeader)
		: methodHeader);
}


/*	integerValue is interpreted as POSITIVE, e.g. as the result of Bitmap>at:.
	N.B. Returning in each arm separately enables Slang inlining.
	/Don't/ return the ifTrue:ifFalse: unless Slang inlining of conditionals
	is fixed. */

	/* CoInterpreter>>#positive32BitIntegerFor: */
sqInt
positive32BitIntegerFor(unsigned int integerValue)
{
	return ((((((usqInt)integerValue)) & 0xFFFFFFFFU) << 3) | 1);
}


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

	/* CoInterpreter>>#positive32BitValueOf: */
unsigned int
positive32BitValueOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt value64;

	if ((((oop) & 7) == 1)) {
		value64 = (oop >> 3);
		if ((value64 < 0)
		 || ((((unsigned int) value64)) != value64)) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			value64 = 0;
		}
		return value64;
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	return 0;
}


/*	Answer a Large Positive Integer object for the given integer value. N.B.
	will *not* cause a GC. */

	/* CoInterpreter>>#positive64BitIntegerFor: */
sqInt
positive64BitIntegerFor(usqLong integerValue)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt newLargeInteger;
    usqInt newObj;
    usqInt numBytes;
    sqInt numSlots;
    sqInt objFormat;
    sqInt sz;

	if (integerValue <= (MaxSmallInteger)) {
		return ((integerValue << 3) | 1);
	}
	sz = 8;
	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
	objFormat = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1));
	numSlots = 8 / BytesPerOop;
	assert((numSlots >= 0)
	 && ((knownClassAtIndex(ClassLargePositiveIntegerCompactIndex)) != GIV(nilObj)));
	assert(((objFormat < (firstByteFormat())
		? objFormat
		: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassLargePositiveIntegerCompactIndex))));
	/* begin allocateSmallNewSpaceSlots:format:classIndex: */
	assert(numSlots < (numSlotsMask()));
	newObj = GIV(freeStart);
	numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
			error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
			newLargeInteger = 0;
			goto l1;
		}
	}
	long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassLargePositiveIntegerCompactIndex);
	GIV(freeStart) += numBytes;
	newLargeInteger = newObj;
	l1:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
	long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), SQ_SWAP_8_BYTES_IF_BIGENDIAN(integerValue));
	return newLargeInteger;
}


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

	/* CoInterpreter>>#positive64BitValueOf: */
usqLong
positive64BitValueOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ccIndex;
    sqInt fmt;
    sqInt ok;
    sqInt sz;
    usqLong value;

	if ((((oop) & 7) == 1)) {
		if (((oop >> 3)) < 0) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return null;
		}
		return (oop >> 3);
	}
	if (oop & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop)));
	/* begin classIndexOf: */
	ccIndex = (longAt(oop)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
	goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (!ok) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	/* begin numBytesOfBytes: */
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	assert(fmt >= (firstByteFormat()));
	sz = ((numSlotsOf(oop)) << (shiftForWord())) - (fmt & 7);
	if (sz > (sizeof(sqLong))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	if (sz > 4) {
		value = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize) + (0U << 3))));
	}
	else {

		/* ] */
		value = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2))))));
	}
	return value;
}


/*	Signal the gc semaphore, and inform the display subsystem if the display
	bitmap has moved.
 */
/*	Attempt to shrink free memory, signal the gc semaphore and let the Cogit
	do its post GC thang
 */

	/* CoInterpreter>>#postGCAction: */
static void NoDbgRegParms
postGCAction(sqInt gcModeArg)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(gcModeArg == GIV(gcMode));
	signalSemaphoreWithIndex(GIV(gcSemaphoreIndex));
	postGCUpdateDisplayBits();
	cogitPostGCAction(gcModeArg);
	/* begin nilUncoggableMethods */
	GIV(lastCoggableInterpretedBlockMethod) = (GIV(lastUncoggableInterpretedBlockMethod) = null);
	GIV(gcMode) = 0;
}


/*	Need to write back the frame pointers unless all pages are free (as in
	snapshot) 
 */
/*	Need to write back the frame pointers unless all pages are free (as in
	snapshot). Need to set gcMode var (to avoid passing the flag through a lot
	of the updating code) */

	/* CoInterpreter>>#preGCAction: */
static void NoDbgRegParms
preGCAction(sqInt gcModeArg)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt traceType;

	if (GIV(stackPage) != 0) {
		/* begin externalWriteBackHeadFramePointers */
		assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
		assert(GIV(stackPage) == (mostRecentlyUsedPage()));
		assert(!((isFree(GIV(stackPage)))));
		/* begin setHeadFP:andSP:inPage: */
		assert(GIV(stackPointer) < GIV(framePointer));
		assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
		assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
		(GIV(stackPage)->headFP = GIV(framePointer));
		(GIV(stackPage)->headSP = GIV(stackPointer));
		assert(pageListIsWellFormed());
	}
	if ((gcModeArg == GCModeFull)
	 && (1)) {
		flushMethodCache();
	}
	GIV(gcMode) = gcModeArg;
	if (recordEventTrace()) {
		traceType = (gcModeArg == GCModeFull
			? TraceFullGC
			: TraceIncrementalGC);
		/* begin recordTrace:thing:source: */
		GIV(traceLog)[GIV(traceLogIndex)] = traceType;
		GIV(traceLog)[GIV(traceLogIndex) + 1] = traceType;
		GIV(traceLog)[GIV(traceLogIndex) + 2] = 0;
		GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
	}
	if (recordPrimTrace()) {
		traceType = (gcModeArg == GCModeFull
			? TraceFullGC
			: TraceIncrementalGC);
		/* begin fastLogPrim: */
		GIV(primTraceLog)[GIV(primTraceLogIndex)] = traceType;
		primTraceLogIndex(GIV(primTraceLogIndex) + 1);
	}
}

	/* CoInterpreter>>#primErrTable */
sqInt
primErrTable(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(PrimErrTableIndex) << (shiftForWord())))));
}

	/* CoInterpreter>>#primFailCodeAddress */
usqInt
primFailCodeAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(primFailCode))));
}


/*	This is used for asserts that check that inline cache editing results in
	valid addresses.
	In the C VM interpret is presumed to come before any primitives and so it
	constitutes the lowest address in C code that machine code should be
	linked, but optimizing
	compilers change things around. In the simulator we just answer something
	not low. */

	/* CoInterpreter>>#primitiveFailAddress */
usqInt
primitiveFailAddress(void)
{
	return ((usqInt)((&primitiveFail)));
}


/*	Answer any special requirements of the given primitive */

	/* CoInterpreter>>#primitivePropertyFlags: */
sqInt
primitivePropertyFlags(sqInt primIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt baseFlags;

	/* begin primitivePropertyFlagsForSpur: */
	if (primIndex == PrimNumberHashMultiply) {
		return PrimCallOnSmalltalkStack;
	}
	baseFlags = PrimCallNeedsPrimitiveFunction + PrimCallNeedsNewMethod;
	if (GIV(profileSemaphore) != GIV(nilObj)) {
		baseFlags = baseFlags | PrimCallCollectsProfileSamples;
	}
	if ((primIndex == PrimNumberExternalCall)
	 || (primIndex == PrimNumberFFICall)) {

		/* For callbacks */
		baseFlags = baseFlags | PrimCallMayCallBack;
		if (checkAllocFiller) {
			baseFlags = baseFlags | CheckAllocationFillerAfterPrimCall;
		}
	}
	return baseFlags;
}

	/* CoInterpreter>>#primTraceLogAddress */
void *
primTraceLogAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(primTraceLog);
}


/*	N.B. primTraceLogIndex is 8-bits */

	/* CoInterpreter>>#primTraceLogIndexAddress */
usqInt
primTraceLogIndexAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(primTraceLogIndex))));
}

	/* CoInterpreter>>#printCogMethod: */
void
printCogMethod(CogMethod *cogMethod)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt firstBytecode;
    sqInt primitive;
    sqInt s;

	address = ((sqInt)cogMethod);
	printHex(address);
	print(" <-> ");
	printHex(address + ((cogMethod->blockSize)));
	if (((cogMethod->cmType)) == CMMethod) {
		print(": method: ");
		printHex((cogMethod->methodObject));
		if (((cogMethod->methodHeader)) & AlternateHeaderHasPrimFlag) {
			firstBytecode = (((cogMethod->methodObject)) + ((LiteralStart + (((((cogMethod->methodHeader)) >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
			primitive = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)));
		}
		else {
			primitive = 0;
		}
		if (primitive != 0) {
			print(" prim ");
			printNum(primitive);
		}
	}
	if (((cogMethod->cmType)) == CMBlock) {
		print(": block home: ");
		printHex(((usqInt)((((((CogBlockMethod *) cogMethod))->cpicHasMNUCaseOrCMIsFullBlock)
	? ((CogMethod *) (((CogBlockMethod *) cogMethod)))
	: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) cogMethod)))) - (((((CogBlockMethod *) cogMethod))->homeOffset))))))));
	}
	if (((cogMethod->cmType)) == CMClosedPIC) {
		print(": Closed PIC N: ");
		printHex((cogMethod->cPICNumCases));
	}
	if (((cogMethod->cmType)) == CMOpenPIC) {
		print(": Open PIC ");
	}
	print(" selector: ");
	printHex((cogMethod->selector));
	if (((cogMethod->selector)) == GIV(nilObj)) {
		if ((((cogMethod->cmType)) == CMMethod)
		 && (((s = maybeSelectorOfMethod((cogMethod->methodObject)))) != null)) {
			print(" (nil: ");
			printStringOf(s);
			print(")");
		}
		else {
			print(" (nil)");
		}
	}
	else {
		/* begin space */
		putchar(' ');
		printStringOf((cogMethod->selector));
	}
	/* begin cr */
	printf("\n");
}

	/* CoInterpreter>>#printFrameFlagsForFP: */
static void NoDbgRegParms
printFrameFlagsForFP(char *theFP)
{
    char *address;
    sqInt it;

	if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
		address = theFP + FoxMethod;
		it = (longAt(address)) & 7;
	}
	else {
		address = theFP + FoxIFrameFlags;
		it = longAt(address);
	}
	/* begin printHexPtr: */
	printHex(oopForPointer(address));
	print(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ": mcfrm flags: "
		: ":intfrm flags: "));
	printHex(it);
	if (it != 0) {
		/* begin printChar: */
		putchar('=');
		printNum(it);
	}
	print("  numArgs: ");
	printNum(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((mframeCogMethod(theFP))->cmNumArgs)
		: byteAt((theFP + FoxIFrameFlags) + 1)));
	print((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)
		? " hasContext"
		: " noContext"));
	print((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 3)) != 0)
		? " isBlock"
		: " notBlock"));
	/* begin cr */
	printf("\n");
}

	/* CoInterpreter>>#printFrameMethodFor: */
static void NoDbgRegParms
printFrameMethodFor(char *theFP)
{
    char *address;
    CogMethod *homeMethod;
    sqInt it;
    sqInt methodField;
    sqInt obj;

	address = theFP + FoxMethod;
	it = longAt(address);
	printHex(((sqInt)address));
	/* begin printChar: */
	putchar(':');
	print("      method: ");
	printHex(it);
	/* begin tab */
	putchar('	');
	if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()))
	 && (((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0)) {
		/* begin mframeHomeMethod: */
		methodField = longAt(theFP + FoxMethod);
		if ((methodField & MFMethodFlagIsBlockFlag) != 0) {
			homeMethod = (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock)
				? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask))))
				: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset)))));
			goto l2;
		}
		homeMethod = ((CogMethod *) (methodField & MFMethodMask));
	l2:	/* end mframeHomeMethod: */;
		print("hm: ");
		printHex(((sqInt)homeMethod));
		/* begin tab */
		putchar('	');
	}
	obj = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((mframeHomeMethod(theFP))->methodObject)
		: longAt(theFP + FoxMethod));
	shortPrintOop(obj);
}

	/* CoInterpreter>>#printFrameThing:at:extraString: */
static void NoDbgRegParms
printFrameThingatextraString(char *name, char *address, char *extraStringOrNil)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt it;
    sqInt len;

	it = longAt(address);
	/* begin printHexPtr: */
	printHex(oopForPointer(address));
	/* begin printChar: */
	putchar(':');
	len = strlen(name);
	for (i = 1; i <= (12 - len); i += 1) {
		/* begin space */
		putchar(' ');
	}
	print(name);
	print(": ");
	printHex(it);
	if (it != 0) {
		/* begin printChar: */
		putchar('=');
		if (it == GIV(nilObj)) {
			print("nil");
		}
		else {
			printNum(it);
		}
	}
	if (!(extraStringOrNil == null)) {
		/* begin space */
		putchar(' ');
		print(extraStringOrNil);
	}
	/* begin cr */
	printf("\n");
}

	/* CoInterpreter>>#printFrameThing:at:extra: */
static void NoDbgRegParms
printFrameThingatextra(char *name, char *address, sqInt extraValue)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt it;
    sqInt len;

	it = longAt(address);
	/* begin printHexPtr: */
	printHex(oopForPointer(address));
	/* begin printChar: */
	putchar(':');
	len = strlen(name);
	for (i = 1; i <= (12 - len); i += 1) {
		/* begin space */
		putchar(' ');
	}
	print(name);
	print(": ");
	printHex(it);
	if (it != 0) {
		/* begin printChar: */
		putchar('=');
		if (it == GIV(nilObj)) {
			print("nil");
		}
		else {
			printNum(it);
		}
	}
	/* begin space */
	putchar(' ');
	printNum(extraValue);
	/* begin cr */
	printf("\n");
}

	/* CoInterpreter>>#printFrame:WithSP: */
sqInt
printFrameWithSP(char *theFP, char *theSP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *addr;
    CogBlockMethod *cogMethod;
    sqInt header;
    sqInt header1;
    CogMethod *homeMethod;
    usqInt i;
    usqInt index;
    sqInt methodField;
    usqInt numArgs;
    sqInt numTemps;
    char *rcvrAddress;
    sqInt rcvrOrClosure;
    sqInt theMethod;
    sqInt theMethodEnd;
    sqInt topThing;

	if (!((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
		 && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
		/* begin printHexPtr: */
		printHex(oopForPointer(theFP));
		print(" is not in the stack zone?!");
		/* begin cr */
		printf("\n");
		return null;
	}
	if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
		/* begin mframeCogMethod: */
		cogMethod = ((CogBlockMethod *) ((longAt(theFP + FoxMethod)) & MFMethodMask));
		/* begin mframeHomeMethod: */
		methodField = longAt(theFP + FoxMethod);
		if ((methodField & MFMethodFlagIsBlockFlag) != 0) {
			homeMethod = (((((CogBlockMethod *) (methodField & MFMethodMask)))->cpicHasMNUCaseOrCMIsFullBlock)
				? ((CogMethod *) (((CogBlockMethod *) (methodField & MFMethodMask))))
				: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (methodField & MFMethodMask))))) - (((((CogBlockMethod *) (methodField & MFMethodMask)))->homeOffset)))));
			goto l2;
		}
		homeMethod = ((CogMethod *) (methodField & MFMethodMask));
	l2:	/* end mframeHomeMethod: */;
		theMethod = ((sqInt)homeMethod);
		theMethodEnd = (((sqInt)homeMethod)) + ((homeMethod->blockSize));
		numArgs = (cogMethod->cmNumArgs);
		numTemps = (((usqInt) ((homeMethod->methodHeader))) >> MethodHeaderTempCountShift) & 0x3F;
	}
	else {
		theMethod = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((mframeHomeMethod(theFP))->methodObject)
			: longAt(theFP + FoxMethod));
		theMethodEnd = theMethod + (((numSlotsOf(theMethod)) << (shiftForWord())) + BaseHeaderSize);
		/* begin iframeNumArgs: */
		numArgs = byteAt((theFP + FoxIFrameFlags) + 1);
		/* begin temporaryCountOfMethodHeader: */
		assert(isCompiledMethod(theMethod));
		header1 = longAt((theMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((((header1) & 7) == 1)) {
			header = header1;
		}
		else {
			assert((((usqInt)header1)) < GIV(newSpaceStart));
			assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
			header = ((((CogMethod *) header1))->methodHeader);
		}
		numTemps = (((usqInt) header) >> MethodHeaderTempCountShift) & 0x3F;
	}
	if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 3)) != 0)) {

		/* No BlockLocalTempCounter in the Cogit's C code, so quick hack is to use numCopied + numArgs */
		rcvrOrClosure = longAt(theFP + (frameStackedReceiverOffset(theFP)));
		if (((rcvrOrClosure & (tagMask())) == 0)
		 && ((addressCouldBeObj(rcvrOrClosure))
		 && ((fetchClassOfNonImm(rcvrOrClosure)) == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassBlockClosure) << (shiftForWord()))))))))) {
			numTemps = numArgs + (stSizeOf(rcvrOrClosure));
		}
		else {
			numTemps = numArgs;
		}
	}
	shortPrintFrame(theFP);
	if ((longAt(theFP + FoxSavedFP)) == 0) {
		printFrameOopat("(caller ctxt", (theFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
	? ((mframeCogMethod(theFP))->cmNumArgs)
	: byteAt((theFP + FoxIFrameFlags) + 1))))) + (2 * BytesPerWord));
		printFrameOopat("(saved ctxt", (theFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
	? ((mframeCogMethod(theFP))->cmNumArgs)
	: byteAt((theFP + FoxIFrameFlags) + 1))))) + (1 * BytesPerWord));
	}
	printFrameOopat("rcvr/clsr", (theFP + FoxCallerSavedIP) + ((numArgs + 1) * BytesPerWord));
	for (i = numArgs; i >= 1; i += -1) {
		printFrameOopindexat("arg", numArgs - i, (theFP + FoxCallerSavedIP) + (i * BytesPerWord));
	}
	printFrameThingatextraString("caller ip", theFP + FoxCallerSavedIP, ((longAt(theFP + FoxCallerSavedIP)) == (ceReturnToInterpreterPC())
		? "ceReturnToInterpreter"
		: 0));
	printFrameThingat("saved fp", theFP + FoxSavedFP);
	printFrameMethodFor(theFP);
	if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
		printFrameFlagsForFP(theFP);
	}
	printFrameOopat("context", theFP + FoxThisContext);
	if (!((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory()))) {
		printFrameFlagsForFP(theFP);
	}
	if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
		rcvrAddress = theFP + FoxMFReceiver;
	}
	else {
		printFrameThingatextra("saved ip", theFP + FoxIFSavedIP, ((longAt(theFP + FoxIFSavedIP)) == 0
			? 0
			: (((longAt(theFP + FoxIFSavedIP)) - theMethod) + 2) - BaseHeaderSize));
		rcvrAddress = theFP + FoxIFReceiver;
	}
	printFrameOopat("receiver", rcvrAddress);
	topThing = longAt(theSP);
	if (oopisGreaterThanOrEqualToandLessThan(topThing, theMethod, theMethodEnd)) {
		for (addr = (rcvrAddress - BytesPerWord); addr >= (theSP + BytesPerWord); addr += (-BytesPerWord)) {
			index = ((rcvrAddress - addr) / BytesPerWord) + numArgs;
			if (index <= numTemps) {
				printFrameOopindexat("temp", index - 1, addr);
			}
			else {
				printFrameOopat((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
					: (byteAt((theFP + FoxIFrameFlags) + 3)) != 0)
					? "temp/stck"
					: "stck"), addr);
			}
		}
		printFrameThingatextra("frame ip", theSP, ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? topThing - theMethod
			: ((topThing - theMethod) + 2) - BaseHeaderSize));
	}
	else {
		for (addr = (rcvrAddress - BytesPerWord); addr >= theSP; addr += (-BytesPerWord)) {
			index = ((rcvrAddress - addr) / BytesPerWord) + numArgs;
			if (index <= numTemps) {
				printFrameOopindexat("temp", index - 1, addr);
			}
			else {
				printFrameOopat((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
					: (byteAt((theFP + FoxIFrameFlags) + 3)) != 0)
					? "temp/stck"
					: "stck"), addr);
			}
		}
	}
	return 0;
}

	/* CoInterpreter>>#printLogEntryAt: */
static void NoDbgRegParms
printLogEntryAt(sqInt i)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt intOrClass;
    sqInt selectorMethodOrProcess;
    sqInt source;
    char * traceSources[] = {
		"?", "m", "i", "callbackEnter", "callbackLeave", "enterCritical", "exitCritical",
		"resume", "signal", "suspend", "wait", "yield", "eventcheck", "threadsched",
		"ownVM", "bindToThread", "switchIfNecessary"
	};

	intOrClass = GIV(traceLog)[i];
	selectorMethodOrProcess = GIV(traceLog)[i + 1];
	source = GIV(traceLog)[i + 2];
	if (source <= TraceIsFromInterpreter) {
		print(traceSources[source]);
		/* begin space */
		putchar(' ');
	}
	if ((((intOrClass) & 7) == 1)) {
		if (intOrClass == TraceStackOverflow) {
			print("stack overflow");
		}
		if (intOrClass == TraceContextSwitch) {
			print("context switch from ");
			printHex(selectorMethodOrProcess);
		}
		if (intOrClass == TraceBlockActivation) {
			print(" [] in ");
			printHex(selectorMethodOrProcess);
		}
		if (intOrClass == TraceBlockCreation) {
			print("create [] ");
			printHex(selectorMethodOrProcess);
		}
		if (intOrClass == TraceIncrementalGC) {
			print("incrementalGC");
		}
		if (intOrClass == TraceFullGC) {
			print("fullGC");
		}
		if (intOrClass == TraceCodeCompaction) {
			print("compactCode");
		}
		if (intOrClass == TraceVMCallback) {
			print("callback");
		}
		if (intOrClass == TraceVMCallbackReturn) {
			print("return from callback");
		}
	}
	else {
		/* begin space */
		putchar(' ');
		printNameOfClasscount(intOrClass, 5);
		print(">>");
		printStringOf(selectorMethodOrProcess);
	}
	if (source > TraceIsFromInterpreter) {
		/* begin space */
		putchar(' ');
		print(traceSources[source]);
	}
	/* begin cr */
	printf("\n");
}

	/* CoInterpreter>>#printMethodCacheFor: */
void
printMethodCacheFor(sqInt thing)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqIntptr_t c;
    sqInt i;
    sqIntptr_t m;
    sqInt n;
    sqIntptr_t p;
    sqIntptr_t s;

	n = 0;
	for (i = 0; i < MethodCacheSize; i += MethodCacheEntrySize) {
		s = GIV(methodCache)[i + MethodCacheSelector];
		c = GIV(methodCache)[i + MethodCacheClass];
		m = GIV(methodCache)[i + MethodCacheMethod];
		p = GIV(methodCache)[i + MethodCachePrimFunction];
		if (((thing == -1)
		 || ((s == thing)
		 || ((c == thing)
		 || ((p == thing)
		 || ((m == thing)
		 || ((addressCouldBeObj(m))
		 && ((((m & (tagMask())) == 0)
		 && ((((((usqInt) (longAt(m))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
		 && (isCogMethodReference(longAt((m + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))))
		 && ((((sqInt)(cogMethodOf(m)))) == thing))))))))
		 && (((s & (tagMask()))
		 || (addressCouldBeObj(s)))
		 && ((c != 0)
		 && ((addressCouldBeClassObj(c))
		 || (addressCouldBeClassObj(classAtIndex(c))))))) {
			n += 1;
			printNum(i);
			/* begin space */
			putchar(' ');
			printf("0x%" PRIxSQINT "", i);
			/* begin cr */
			printf("\n");
			/* begin tab */
			putchar('	');
			if (((((usqInt) (longAt(s))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())) {
				printf("%" PRIxSQPTR " %.*s\n", s, (int)(numBytesOf(s)), (char *)firstIndexableField(s));
			}
			else {
				shortPrintOop(s);
			}
			/* begin tab */
			putchar('	');
			if (addressCouldBeClassObj(c)) {
				shortPrintOop(c);
			}
			else {
				printNum(c);
				/* begin space */
				putchar(' ');
				printf("0x%" PRIxSQINT "", c);
				/* begin space */
				putchar(' ');
				shortPrintOop(classAtIndex(c));
			}
			/* begin tab */
			putchar('	');
			shortPrintOop(m);
			/* begin tab */
			putchar('	');
			if (p > 1024) {
				printf("0x%" PRIxSQINT "", p);
			}
			else {
				printNum(p);
			}
			/* begin cr */
			printf("\n");
		}
	}
	if (n > 1) {
		printNum(n);
		/* begin cr */
		printf("\n");
	}
}

	/* CoInterpreter>>#printPrimLogEntryAt: */
static sqInt NoDbgRegParms
printPrimLogEntryAt(sqInt i)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt intOrSelector;
    sqInt referent;
    sqInt target;

	intOrSelector = GIV(primTraceLog)[i];
	if (intOrSelector & (tagMask())) {
		if (intOrSelector == TraceIncrementalGC) {
			print("**IncrementalGC**");
			return null;
		}
		if (intOrSelector == TraceFullGC) {
			print("**FullGC**");
			return null;
		}
		if (intOrSelector == TraceCodeCompaction) {
			print("**CompactCode**");
			return null;
		}
		if (intOrSelector == TraceStackOverflow) {
			print("**StackOverflow**");
			return null;
		}
		if (intOrSelector == TracePrimitiveFailure) {
			print("**PrimitiveFailure**");
			return null;
		}
		if (intOrSelector == TracePrimitiveRetry) {
			print("**PrimitiveRetry**");
			return null;
		}
		print("???");
	}
	else {
		if (intOrSelector == 0) {
			printNum(i);
			print("!!!");
		}
		else {
			/* begin safePrintStringOf: */
			if (((intOrSelector & (tagMask())) == 0)
			 && (((longAt(intOrSelector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(intOrSelector));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((intOrSelector + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent & (tagMask())) == 0)
				 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				target = referent;
			}
			else {
				target = intOrSelector;
			}
			printStringOf(target);
			/* return self */
		}
	}
	return 0;
}

	/* CoInterpreter>>#quickPrimitiveConstantFor: */
sqInt
quickPrimitiveConstantFor(sqInt aQuickPrimitiveIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	
	switch (aQuickPrimitiveIndex) {
	case 257:
		return GIV(trueObj);

	case 258:
		return GIV(falseObj);

	case 259:
		return GIV(nilObj);

	case 260:
		return ConstMinusOne;

	case 261:
		return ConstZero;

	case 262:
		return ConstOne;

	case 263:
		return ConstTwo;

	default:
		error("Case not found and no otherwise clause");
		return -1;
	}
}

	/* CoInterpreter>>#quickPrimitiveGeneratorFor: */
sqInt (*quickPrimitiveGeneratorFor(sqInt aQuickPrimitiveIndex))(void)

{
	
	switch (aQuickPrimitiveIndex) {
	case 256:
		return genQuickReturnSelf;

	case 257:
	case 258:
	case 259:
	case 260:
	case 261:
	case 262:
	case 263:
		return genQuickReturnConst;

	default:
		return genQuickReturnInstVar;

	}
}

	/* CoInterpreter>>#quickPrimitiveInstVarIndexFor: */
sqInt
quickPrimitiveInstVarIndexFor(sqInt primIndex)
{
	return primIndex - 264;
}

	/* CoInterpreter>>#rawHeaderOf: */
sqInt
rawHeaderOf(sqInt methodPointer)
{
	return longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
}


/*	Since methods may be updated while forwarding during become, make the
	assert accomodate this.
 */

	/* CoInterpreter>>#rawHeaderOf:put: */
void
rawHeaderOfput(sqInt methodOop, sqInt cogMethodOrMethodHeader)
{
	assert(isCompiledMethodHeader(headerWhileForwardingOf(methodOop)));
	assert(!(isOopForwarded(methodOop)));
	longAtput((methodOop + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))), cogMethodOrMethodHeader);
}


/*	Read an image from the given file stream, allocating an amount of memory
	to its object heap.
	
	V3: desiredHeapSize is the total size of the heap. Fail if the image has
	an unknown format or
	requires more than the specified amount of memory.
	
	Spur: desiredHeapSize is ignored; this routine will attempt to provide at
	least extraVMMemory's
	ammount of free space after the image is loaded, taking any free space in
	teh image into account.
	extraVMMemory is stored in the image header and is accessible as
	vmParameterAt: 23. If
	extraVMMemory is 0, the value defaults to the default grow headroom. Fail
	if the image has an
	unknown format or if sufficient memory cannot be allocated.
	
	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. */

	/* CoInterpreter>>#readImageFromFile:HeapSize:StartingAt: */
size_t
readImageFromFileHeapSizeStartingAt(sqImageFile f, usqInt desiredHeapSize, squeakFileOffsetType imageOffset)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt allocationReserve;
    sqInt anObject;
    sqInt aValue;
    sqInt bit;
    sqInt bytes;
    sqInt bytesRead;
    sqInt bytesToShift;
    sqInt classArrayClass;
    sqInt classArrayObj;
    size_t dataSize;
    sqInt firstSegSize;
    sqInt freeOldSpaceInImage;
    sqInt hdrCogCodeSize;
    sqInt hdrEdenBytes;
    sqInt hdrMaxExtSemTabSize;
    sqInt hdrNumStackPages;
    sqInt headerFlags;
    sqInt headerSize;
    squeakFileOffsetType headerStart;
    sqInt headroom;
    sqInt headroom1;
    usqInt heapSize;
    usqInt heapSize1;
    sqInt i;
    sqInt i1;
    sqInt iLimiT;
    usqInt minimumMemory;
    usqInt numSlots;
    sqInt objOop;
    sqInt oldBaseAddr;
    sqInt oop;
    sqInt seed;
    sqInt swapBytes;
    sqInt w;
    int w1;
    unsigned short w10;
    sqInt w11;
    sqInt w12;
    sqInt w13;
    sqInt w2;
    sqInt w3;
    sqInt w4;
    sqInt w5;
    int w6;
    unsigned short w7;
    int w8;
    unsigned short w9;


	/* guess Metaclass instSize */
	GIV(metaclassNumSlots) = 6;

	/* guess (Class instVarIndexFor: 'name' ifAbsent: []) - 1 */
	GIV(classNameIndex) = 6;
	swapBytes = checkImageVersionFromstartingAt(f, imageOffset);

	/* record header start position */
	headerStart = (sqImageFilePosition(f)) - 4;
	/* begin getWord32FromFile:swap: */
	w1 = 0;
	sqImageFileRead((&w1), sizeof(int), 1, f);
	headerSize = (swapBytes
		? SQ_SWAP_4_BYTES(w1)
		: w1);
	/* begin getLongFromFile:swap: */
	w2 = 0;
	sqImageFileRead((&w2), sizeof(w2), 1, f);
	dataSize = ((sqInt) ((swapBytes
	? (/* begin byteSwapped: */
		SQ_SWAP_8_BYTES(w2))
	: w2)));
	/* begin getLongFromFile:swap: */
	w3 = 0;
	sqImageFileRead((&w3), sizeof(w3), 1, f);
	if (swapBytes) {
		/* begin byteSwapped: */
		oldBaseAddr = SQ_SWAP_8_BYTES(w3);
	}
	else {
		oldBaseAddr = w3;
	}
	/* begin specialObjectsOop: */
	w12 = 0;
	sqImageFileRead((&w12), sizeof(w12), 1, f);
	if (swapBytes) {
		/* begin byteSwapped: */
		anObject = SQ_SWAP_8_BYTES(w12);
	}
	else {
		anObject = w12;
	}
	GIV(specialObjectsOop) = anObject;
	/* begin lastHash: */
	w13 = 0;
	sqImageFileRead((&w13), sizeof(w13), 1, f);
	if (swapBytes) {
		/* begin byteSwapped: */
		seed = SQ_SWAP_8_BYTES(w13);
	}
	else {
		seed = w13;
	}
	GIV(lastHash) = seed;
	/* begin getLongFromFile:swap: */
	w4 = 0;
	sqImageFileRead((&w4), sizeof(w4), 1, f);
	if (swapBytes) {
		/* begin byteSwapped: */
		GIV(savedWindowSize) = SQ_SWAP_8_BYTES(w4);
	}
	else {
		GIV(savedWindowSize) = w4;
	}
	/* begin getLongFromFile:swap: */
	w5 = 0;
	sqImageFileRead((&w5), sizeof(w5), 1, f);
	if (swapBytes) {
		/* begin byteSwapped: */
		headerFlags = SQ_SWAP_8_BYTES(w5);
	}
	else {
		headerFlags = w5;
	}
	/* begin setImageHeaderFlagsFrom: */

	/* so as to preserve unrecognised flags. */
	GIV(imageHeaderFlags) = headerFlags;
	GIV(fullScreenFlag) = headerFlags & 1;

	/* processHasThreadId := headerFlags anyMask: 4. specific to CoInterpreterMT */
	GIV(imageFloatsBigEndian) = ((headerFlags & 2) == 0
		? 1
		: 0);
	GIV(flagInterpretedMethods) = headerFlags & 8;

	/* noThreadingOfGUIThread := headerFlags anyMask: 32. specific to CoInterpreterMT */
	GIV(preemptionYields) = (headerFlags & 16) == 0;
	GIV(newFinalization) = headerFlags & 64;
	sendWheelEvents = headerFlags & 128;
	/* begin getWord32FromFile:swap: */
	w6 = 0;
	sqImageFileRead((&w6), sizeof(int), 1, f);
	extraVMMemory = (swapBytes
		? SQ_SWAP_4_BYTES(w6)
		: w6);
	/* begin getShortFromFile:swap: */
	w7 = 0;
	sqImageFileRead((&w7), sizeof(unsigned short), 1, f);
	hdrNumStackPages = (swapBytes
		? ((((usqInt) w7) >> 8) & 0xFF) | (((sqInt)((usqInt)((w7 & 0xFF)) << 8)))
		: w7);
	GIV(numStackPages) = (desiredNumStackPages != 0
		? desiredNumStackPages
		: (hdrNumStackPages == 0
				? defaultNumStackPages()
				: hdrNumStackPages));

	/* This slot holds the size of the native method zone in 1k units. (pad to word boundary). */
	desiredNumStackPages = hdrNumStackPages;
	hdrCogCodeSize = (getShortFromFileswap(f, swapBytes)) * 1024;
	GIV(cogCodeSize) = (desiredCogCodeSize != 0
		? desiredCogCodeSize
		: (hdrCogCodeSize == 0
				? defaultCogCodeSize()
				: hdrCogCodeSize));
	if (GIV(cogCodeSize) > (maxCogCodeSize())) {
		GIV(cogCodeSize) = maxCogCodeSize();
	}
	/* begin getWord32FromFile:swap: */
	w8 = 0;
	sqImageFileRead((&w8), sizeof(int), 1, f);
	hdrEdenBytes = (swapBytes
		? SQ_SWAP_4_BYTES(w8)
		: w8);
	/* begin edenBytes: */
	bytes = (desiredEdenBytes != 0
		? desiredEdenBytes
		: (hdrEdenBytes == 0
				? defaultEdenBytes()
				: hdrEdenBytes));
	GIV(edenBytes) = bytes;
	desiredEdenBytes = hdrEdenBytes;
	/* begin getShortFromFile:swap: */
	w9 = 0;
	sqImageFileRead((&w9), sizeof(unsigned short), 1, f);
	hdrMaxExtSemTabSize = (swapBytes
		? ((((usqInt) w9) >> 8) & 0xFF) | (((sqInt)((usqInt)((w9 & 0xFF)) << 8)))
		: w9);
	if (hdrMaxExtSemTabSize != 0) {
		/* begin setMaxExtSemSizeTo: */
		GIV(maxExtSemTabSizeSet) = 1;
		ioSetMaxExtSemTableSize(hdrMaxExtSemTabSize);
	}
	/* begin getShortFromFile:swap: */
	w10 = 0;
	sqImageFileRead((&w10), sizeof(unsigned short), 1, f);
	GIV(the2ndUnknownShort) = (swapBytes
		? ((((usqInt) w10) >> 8) & 0xFF) | (((sqInt)((usqInt)((w10 & 0xFF)) << 8)))
		: w10);
	/* begin getLongFromFile:swap: */
	w11 = 0;
	sqImageFileRead((&w11), sizeof(w11), 1, f);
	if (swapBytes) {
		/* begin byteSwapped: */
		firstSegSize = SQ_SWAP_8_BYTES(w11);
	}
	else {
		firstSegSize = w11;
	}
	/* begin firstSegmentSize: */
	GIV(firstSegmentSize) = firstSegSize;
	allocationReserve = interpreterAllocationReserveBytes();

	/* no need to include the stackZone; this is alloca'ed */
	minimumMemory = ((GIV(cogCodeSize) + dataSize) + GIV(edenBytes)) + allocationReserve;
	/* begin getLongFromFile:swap: */
	w = 0;
	sqImageFileRead((&w), sizeof(w), 1, f);
	if (swapBytes) {
		/* begin byteSwapped: */
		freeOldSpaceInImage = SQ_SWAP_8_BYTES(w);
	}
	else {
		freeOldSpaceInImage = w;
	}
	/* begin initialHeadroom:givenFreeOldSpaceInImage: */
	headroom1 = (extraVMMemory == 0
		? (!(GIV(growHeadroom))
				? (16 * 1024) * 1024
				: GIV(growHeadroom))
		: extraVMMemory);
	if (freeOldSpaceInImage >= headroom1) {
		headroom = 0;
		goto l2;
	}
	if (freeOldSpaceInImage >= ((headroom1 * 7) / 8)) {
		headroom = headroom1 / 8;
		goto l2;
	}
	if (freeOldSpaceInImage >= ((headroom1 * 3) / 4)) {
		headroom = headroom1 / 4;
		goto l2;
	}
	if (freeOldSpaceInImage >= ((headroom1 * 5) / 8)) {
		headroom = (headroom1 * 3) / 8;
		goto l2;
	}
	if (freeOldSpaceInImage >= (headroom1 / 2)) {
		headroom = headroom1 / 2;
		goto l2;
	}
	headroom = headroom1;
	l2:	/* end initialHeadroom:givenFreeOldSpaceInImage: */;
	/* begin roundUpHeapSize: */
	heapSize1 = (((GIV(cogCodeSize) + dataSize) + headroom) + GIV(edenBytes)) + ((headroom > allocationReserve
	? 0
	: allocationReserve));
	bit = (((highBit(heapSize1)) - 1) * 3) / 4;
	heapSize = (heapSize1 & ((1ULL << bit) - 1)
		? (((heapSize1 | ((1ULL << bit) - 1)) - ((1ULL << bit) - 1))) + (1ULL << bit)
		: heapSize1);
	/* begin memory: */
	aValue = ((usqInt)(pointerForOop(allocateMemoryMinimumImageFileHeaderSize(heapSize, minimumMemory, f, headerSize))));
	GIV(memory) = aValue;
	if (!(memory())) {
		insufficientMemoryAvailableError();
	}

	/* position file after the header */
	heapBase = setHeapBasememoryLimitendOfMemory((memory()) + GIV(cogCodeSize), (memory()) + heapSize, ((memory()) + GIV(cogCodeSize)) + dataSize);
	sqImageFileSeek(f, headerStart + headerSize);
	bytesRead = readHeapFromImageFiledataBytes(f, dataSize);
	if (bytesRead != dataSize) {
		unableToReadImageError();
	}
	ensureImageFormatIsUpToDate(swapBytes);
	bytesToShift = GIV(oldSpaceStart) - oldBaseAddr;
	/* begin initializeInterpreter: */
	interpreterProxy = sqGetInterpreterProxy();
	dummyReferToProxy();
	initializeObjectMemory(bytesToShift);
	/* begin checkAssumedCompactClasses */
	if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassArray) << (shiftForWord())))))) != ((assert(((ClassArrayCompactIndex >= 1) && (ClassArrayCompactIndex <= (classTablePageSize())))),
	/* begin fetchPointer:ofObject: */
	longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassArrayCompactIndex) << (shiftForWord())))))))) {
		invalidCompactClassError("Array");
	}
	/* begin checkCompactIndex:isClass:named: */
	if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassLargeNegativeInteger) << (shiftForWord())))))) != ((assert(((ClassLargeNegativeIntegerCompactIndex >= 1) && (ClassLargeNegativeIntegerCompactIndex <= (classTablePageSize())))),
	/* begin fetchPointer:ofObject: */
	longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassLargeNegativeIntegerCompactIndex) << (shiftForWord())))))))) {
		invalidCompactClassError("LargeNegativeInteger");
	}
	/* begin checkCompactIndex:isClass:named: */
	if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassLargePositiveInteger) << (shiftForWord())))))) != ((assert(((ClassLargePositiveIntegerCompactIndex >= 1) && (ClassLargePositiveIntegerCompactIndex <= (classTablePageSize())))),
	/* begin fetchPointer:ofObject: */
	longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassLargePositiveIntegerCompactIndex) << (shiftForWord())))))))) {
		invalidCompactClassError("LargePositiveInteger");
	}
	/* begin checkCompactIndex:isClass:named: */
	if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassFloat) << (shiftForWord())))))) != ((assert(((ClassFloatCompactIndex >= 1) && (ClassFloatCompactIndex <= (classTablePageSize())))),
	/* begin fetchPointer:ofObject: */
	longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassFloatCompactIndex) << (shiftForWord())))))))) {
		invalidCompactClassError("Float");
	}
	/* begin checkCompactIndex:isClass:named: */
	if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassBlockClosure) << (shiftForWord())))))) != ((assert(((ClassBlockClosureCompactIndex >= 1) && (ClassBlockClosureCompactIndex <= (classTablePageSize())))),
	/* begin fetchPointer:ofObject: */
	longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassBlockClosureCompactIndex) << (shiftForWord())))))))) {
		invalidCompactClassError("BlockClosure");
	}
	/* begin checkCompactIndex:isClass:named: */
	if ((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassMethodContext) << (shiftForWord())))))) != ((assert(((ClassMethodContextCompactIndex >= 1) && (ClassMethodContextCompactIndex <= (classTablePageSize())))),
	/* begin fetchPointer:ofObject: */
	longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassMethodContextCompactIndex) << (shiftForWord())))))))) {
		invalidCompactClassError("MethodContext");
	}
	/* begin compactIndexOfClass: */
	objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassByteArray) << (shiftForWord())))));
	assert((rawHashBitsOf(objOop)) != 0);
	GIV(classByteArrayCompactIndex) = (long32At(objOop + 4)) & (identityHashHalfWordMask());
	/* begin initializeExtraClassInstVarIndices */
	classArrayObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassArray) << (shiftForWord())))));
	classArrayClass = fetchClassOfNonImm(classArrayObj);
	/* begin numSlotsOf: */
	assert((classIndexOf(classArrayClass)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(classArrayClass + 7);
	GIV(metaclassNumSlots) = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(classArrayClass - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);

	/* default */
	GIV(thisClassIndex) = 5;
	for (i1 = (InstanceSpecificationIndex + 1), iLimiT = (lengthOfformat(classArrayClass, (((usqInt) (longAt(classArrayClass))) >> (formatShift())) & (formatMask()))); i1 <= iLimiT; i1 += 1) {
		if ((longAt((classArrayClass + BaseHeaderSize) + (((sqInt)((usqInt)((i1 - 1)) << (shiftForWord())))))) == classArrayObj) {
			GIV(thisClassIndex) = i1 - 1;
		}
	}

	/* default */
	GIV(classNameIndex) = 6;
	for (i1 = (InstanceSpecificationIndex + 1), iLimiT = (lengthOfformat(classArrayObj, (((usqInt) (longAt(classArrayObj))) >> (formatShift())) & (formatMask()))); i1 <= iLimiT; i1 += 1) {
		/* begin fetchPointer:ofObject: */
		oop = longAt((classArrayObj + BaseHeaderSize) + (((sqInt)((usqInt)((i1 - 1)) << (shiftForWord())))));
		if ((((oop & (tagMask())) == 0)
		 && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))
		 && (((lengthOfformat(oop, (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))) == 5)
		 && ((strncmp("Array", firstFixedField(oop), 5)) == 0))) {
			GIV(classNameIndex) = i1 - 1;
		}
	}
	GIV(method) = (GIV(newMethod) = GIV(nilObj));
	GIV(methodDictLinearSearchLimit) = 8;
	/* begin initialCleanup */
	flushMethodCache();
	/* begin flushExternalPrimitiveTable */
	for (i = 0; i < MaxExternalPrimitiveTableSize; i += 1) {
		externalPrimitiveTable[i] = 0;
	}
	GIV(externalPrimitiveTableFirstFreeIndex) = 0;
	GIV(profileSemaphore) = (GIV(profileProcess) = (GIV(profileMethod) = GIV(nilObj)));

	/* cmd-. as used for Mac but no other OS */
	GIV(interruptKeycode) = 2094;
	while (GIV(globalSessionID) == 0) {
		GIV(globalSessionID) = (time(NULL)) + (ioMSecs());
	}
	GIV(metaAccessorDepth) = -2;
	sHEAFn = ioLoadFunctionFrom("secHasEnvironmentAccess", "SecurityPlugin");
	/* begin initializeCodeGenerator */
	initializeCodeZoneFromupTo(memory(), (memory()) + GIV(cogCodeSize));
	return dataSize;
}


/*	Report the stack page size and minimum unused headroom to stdout. */

	/* CoInterpreter>>#reportMinimumUnusedHeadroom */
void
reportMinimumUnusedHeadroom(void)
{
	printf("stack page bytes %lld available headroom %lld minimum unused headroom %lld\n", ((unsigned long long)(stackPageByteSize())), ((unsigned long long)(((stackPageByteSize()) - ((((stackPageFrameBytes()) < (((stackPageByteSize()) - ((IFrameSlots + 64) * BytesPerWord)) - (osCogStackPageHeadroom()))) ? (stackPageFrameBytes()) : (((stackPageByteSize()) - ((IFrameSlots + 64) * BytesPerWord)) - (osCogStackPageHeadroom()))))) - ((IFrameSlots + 64) * BytesPerWord))), ((unsigned long long)(minimumUnusedHeadroom())));
}


/*	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 yeild 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.
	Override to add tracing info. */

	/* CoInterpreter>>#resume:preemptedYieldingIf:from: */
static sqInt NoDbgRegParms
resumepreemptedYieldingIffrom(sqInt aProcess, sqInt yieldImplicitly, sqInt sourceCode)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activePriority;
    sqInt activeProc;
    sqInt newPriority;
    sqInt objOop;
    sqInt objOop1;
    sqInt oop;
    sqInt oop1;

	/* begin fetchPointer:ofObject: */
	objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	activeProc = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
	/* begin quickFetchInteger:ofObject: */
	oop = longAt((activeProc + BaseHeaderSize) + (((sqInt)((usqInt)(PriorityIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	activePriority = (oop >> 3);
	/* begin quickFetchInteger:ofObject: */
	oop1 = longAt((aProcess + BaseHeaderSize) + (((sqInt)((usqInt)(PriorityIndex) << (shiftForWord())))));
	assert((((oop1) & 7) == 1));
	newPriority = (oop1 >> 3);
	if (newPriority <= activePriority) {
		putToSleepyieldingIf(aProcess, 1);
		return 0;
	}
	putToSleepyieldingIf(activeProc, yieldImplicitly);
	transferTofrom(aProcess, sourceCode);
	return 1;
}


/*	Return to the current frame, either by entering machine code, or
	longjmp-ing back to the
	interpreter or simply returning, depending on where we are. To know
	whether to return or
	enter machine code we have to know from whence we came. We could have come
	from the interpreter, either directly or via a machine code primitive. We
	could have come from
	machine code. The instructionPointer tells us where from. If it is above
	startOfMemory we're
	in the interpreter. If it is below, then we are in machine-code unless it
	is ceReturnToInterpreterPC,
	in which case we're in a machine-code primitive called from the
	interpreter.  */

	/* CoInterpreter>>#returnToExecutive:postContextSwitch: */
static sqInt NoDbgRegParms
returnToExecutivepostContextSwitch(sqInt inInterpreter, sqInt switchedContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aMethodObj;
    CogBlockMethod *cogMethod;
    sqInt fullyInInterpreter;
    sqInt retValue;
    char *sp;
    char *sp1;
    sqInt top;

	assertCStackWellAligned();
	if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) {
		assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 0, __LINE__);
		if (switchedContext) {
			/* begin mframeCogMethod: */
			cogMethod = ((CogBlockMethod *) ((longAt(GIV(framePointer) + FoxMethod)) & MFMethodMask));
			assert((GIV(instructionPointer) > (minCogMethodAddress()))
			 && (GIV(instructionPointer) < (maxCogMethodAddress())));
			if ((GIV(instructionPointer) != ((((sqInt)cogMethod)) + ((cogMethod->stackCheckOffset))))
			 && (isSendReturnPC(GIV(instructionPointer)))) {
				assert(addressCouldBeOop(stackTop()));
				/* begin popStack */
				top = longAt(GIV(stackPointer));
				GIV(stackPointer) += BytesPerWord;
				retValue = top;
			}
			else {
				/* begin mframeReceiver: */
				retValue = longAt(GIV(framePointer) + FoxMFReceiver);
			}
		}
		else {
			/* begin mframeReceiver: */
			retValue = longAt(GIV(framePointer) + FoxMFReceiver);
		}
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp;
		/* begin push: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), retValue);
		GIV(stackPointer) = sp1;
		ceEnterCogCodePopReceiverReg();
	}
	/* begin setMethod: */
	aMethodObj = longAt(GIV(framePointer) + FoxMethod);
	assert((((usqInt)aMethodObj)) >= (startOfMemory()));
	GIV(method) = aMethodObj;
	assert(isOopCompiledMethod(GIV(method)));
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	fullyInInterpreter = inInterpreter;
	if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
		GIV(instructionPointer) = ((usqInt)(longAt(GIV(framePointer) + FoxIFSavedIP)));
		fullyInInterpreter = 0;
	}
	assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 1, __LINE__);
	if (!fullyInInterpreter) {
		siglongjmp(reenterInterpreter, ReturnToInterpreter);
	}
	return null;
}


/*	We have made a context switch, either when interpreting or from machine
	code. Effectively return to the current frame, either by entering machine
	code, or
	longjmp-ing back to the interpreter or simply returning, depending on
	where we are. */

	/* CoInterpreter>>#return:toExecutive: */
static sqInt NoDbgRegParms
returntoExecutive(sqInt returnValue, sqInt inInterpreter)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aMethodObj;
    char *sp;
    char *sp1;
    char *sp2;

	assertCStackWellAligned();
	if ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())) {
		assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 0, __LINE__);
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp;
		/* begin push: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), returnValue);
		GIV(stackPointer) = sp1;
		ceEnterCogCodePopReceiverReg();
	}
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), returnValue);
	GIV(stackPointer) = sp2;
	/* begin setMethod: */
	aMethodObj = longAt(GIV(framePointer) + FoxMethod);
	assert((((usqInt)aMethodObj)) >= (startOfMemory()));
	GIV(method) = aMethodObj;
	assert(isOopCompiledMethod(GIV(method)));
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), 1, __LINE__);
	if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
		/* begin iframeSavedIP: */
		GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
	}
	if (inInterpreter) {
		return null;
	}
	siglongjmp(reenterInterpreter, ReturnToInterpreter);
	return null;
}


/*	Rewrite an existing entry in the method cache with a new primitive
	function address.
	Used by primitiveExternalCall to make direct calls to found external
	prims, or quickly
	fail not found external prims.
	Override to do the same to the machine code call. If methodObj has a
	cogged dual
	rewrite the primitive call in it to call localPrimAddress. Used to update
	calls through
	primitiveExternalCall to directly call the target function or to revert to
	calling primitiveExternalCall after a flush. */

	/* CoInterpreter>>#rewriteMethodCacheEntryForExternalPrimitiveToFunction: */
static void NoDbgRegParms
rewriteMethodCacheEntryForExternalPrimitiveToFunction(void (*localPrimAddress)(void))
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if ((assert(isNonImmediate(GIV(newMethod))),
	isCogMethodReference(longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
		rewritePrimInvocationInto(cogMethodOf(GIV(newMethod)), (localPrimAddress == 0
			? ((void (*)(void)) primitiveFail)
			: localPrimAddress));
	}
	if ((GIV(methodCache)[GIV(lastMethodCacheProbeWrite) + MethodCacheMethod]) == GIV(newMethod)) {
		GIV(methodCache)[GIV(lastMethodCacheProbeWrite) + MethodCachePrimFunction] = (((sqIntptr_t) localPrimAddress));
	}
}


/*	Answer if there is room to push n arguments onto the current stack. We
	assume this is called by primitives that check there is enough room in any
	new context, and
	won't actually push the arguments in the current context if the primitive
	fails. With
	this assumption it is safe to answer based on the maximum argument count,
	/not/ the ammount of space in the current frame were it converted to a
	context..  */

	/* CoInterpreter>>#roomToPushNArgs: */
static sqInt NoDbgRegParms
roomToPushNArgs(sqInt n)
{
	
	/* simpler code that simply insists args are <= max arg count */
	return n <= (LargeContextSlots - CtxtTempFrameStart);
}


/*	Send the calllback message to Alien class with the supplied arg(s). Use
	either the 1 arg
	invokeCallbackContext: or the 4 arg invokeCallback:stack:registers:jmpbuf:
	message, depending on what selector is installed in the
	specialObjectsArray. Note that if invoking the
	legacy invokeCallback:stack:registers:jmpbuf: we pass the
	vmCallbackContext as the jmpbuf
	argument (see reestablishContextPriorToCallback:). The arguments are raw C
	addresses and
	are converted to integer objects on the way. sendInvokeCallbackContext: &
	returnAs:ThroughCallback:Context: along with ownVM: and disownVM: conspire
	to save and
	restore newMethod, argumentCount and primitiveFunctionPointer around a
	callback. The VM depends on argumentCount being correct to cut-back the
	correct number of
	arguments on primitive return. If a primitive that invokes a callback
	fails after invoking a
	callback (a bad idea, but s**t happens during development) then newMethod
	is required to
	activate the right faling method, and Spur expects
	primitiveFunctionPointer to be valid, so
	asserts will fail misleadingly if not. */
/*	Override to log and check stack alignment. Since this is an implicit send
	we need to
	log it explicitly. The return side is done via a primitive so that gets
	logged normally. */

	/* CoInterpreter>>#sendInvokeCallbackContext: */
EXPORT(sqInt)
sendInvokeCallbackContext(VMCallbackContext *vmCallbackContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt aMethodObj;
    sqInt aSelectorOrImmediate;
    sqInt classTag;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt i;
    usqInt initialIP;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt numArgs;
    sqInt numTemps;
    sqInt obj;
    sqInt object;
    sqInt object1;
    sqInt object11;
    sqInt object2;
    sqInt object3;
    sqInt object4;
    sqInt object5;
    sqInt rcvr;
    sqInt selector;
    char *sp;
    char *sp1;
    char *sp10;
    char *sp11;
    char *sp2;
    char *sp21;
    char *sp3;
    char *sp31;
    char *sp4;
    char *sp41;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;

	cogMethod = ((CogMethod *) 0);
	assertCStackWellAligned();
	if (recordPrimTrace()) {
		/* begin fastLogPrim: */
		aSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorInvokeCallback) << (shiftForWord())))));
		GIV(primTraceLog)[GIV(primTraceLogIndex)] = aSelectorOrImmediate;
		primTraceLogIndex(GIV(primTraceLogIndex) + 1);
	}
	(vmCallbackContext->savedPrimFunctionPointer = primitiveFunctionPointer);
	/* begin fetchClassTagOfNonImm: */
	obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord())))));
	/* begin classIndexOf: */
	classTag = (longAt(obj)) & (classIndexMask());
	/* begin fetchPointer:ofObject: */
	GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorInvokeCallback) << (shiftForWord())))));
	if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) {
		if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) {
			return 0;
		}
	}
	if (primitiveFunctionPointer != 0) {
		primitiveFunctionPointer = (vmCallbackContext->savedPrimFunctionPointer);
		return 0;
	}
	assert(((debugCallbackInvokes += 1)) > 0);
	/* begin saveCStackStateForCallbackContext: */
	(vmCallbackContext->savedCStackPointer = getCStackPointer());
	(vmCallbackContext->savedCFramePointer = getCFramePointer());
	memcpy(((void *)((vmCallbackContext->savedReenterInterpreter))), reenterInterpreter, sizeof(jmp_buf));
	/* begin push: */
	object3 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord())))));
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3);
	GIV(stackPointer) = sp3;
	if ((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4) {
		/* begin push: */
		object = positiveMachineIntegerFor(((usqInt)((vmCallbackContext->thunkp))));
		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
		GIV(stackPointer) = sp;
		/* begin push: */
		object1 = positiveMachineIntegerFor(((usqInt)((vmCallbackContext->stackp))));
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1);
		GIV(stackPointer) = sp1;
		/* begin push: */
		object2 = positiveMachineIntegerFor(((usqInt)((vmCallbackContext->intregargsp))));
		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2);
		GIV(stackPointer) = sp2;
	}
	/* begin push: */
	object4 = positiveMachineIntegerFor(((usqInt)vmCallbackContext));
	longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4);
	GIV(stackPointer) = sp4;
	/* begin ifAppropriateCompileToNativeCode:selector: */
	aMethodObj = GIV(newMethod);
	selector = GIV(messageSelector);
	/* begin fetchPointer:ofObject: */
	methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader1) & 7) == 1))
		 || (((((usqInt)methodHeader1)) < (startOfMemory()))
		 && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))),
	(methodHeader1 & (smallIntegerTag())) == 0)) {

		/* makeBaseFrame: can create cog methods with nil selectors. */
		cogMethod1 = ((CogMethod *) methodHeader1);
		if (((cogMethod1->selector)) == GIV(nilObj)) {
			setSelectorOfto(cogMethod1, selector);
		}
	}
	else {
		if (((assert((((methodHeader1) & 7) == 1)),
		((methodHeader1 >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
			cogselector(aMethodObj, selector);
		}
		else {
			maybeFlagMethodAsInterpreted(aMethodObj);
		}
	}
	/* begin justActivateNewMethod: */
	methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)) {
		cogMethod = ((CogMethod *) methodHeader);
		methodHeader = (cogMethod->methodHeader);
	}
	numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F;
	numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15;

	/* could new rcvr be set at point of send? */
	rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord));
	assert(!(isOopForwarded(rcvr)));
	if ((cogMethod != null)
	 && ((((usqInt)GIV(instructionPointer))) >= (startOfMemory()))) {
		/* begin iframeSavedIP:put: */
		assert(!(isMachineCodeFrame(GIV(framePointer))));
		longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
		GIV(instructionPointer) = ceReturnToInterpreterPC();
	}
	/* begin push: */
	longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp7;
	/* begin push: */
	longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
	GIV(stackPointer) = sp8;
	GIV(framePointer) = GIV(stackPointer);
	initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize;
	if (cogMethod == null) {
		/* begin push: */
		longAtput((sp10 = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
		GIV(stackPointer) = sp10;
		/* begin setMethod:methodHeader: */
		GIV(method) = GIV(newMethod);
		assert(isOopCompiledMethod(GIV(method)));
		assert((methodHeaderOf(GIV(method))) == methodHeader);
		
#    if MULTIPLEBYTECODESETS
		GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0
			? 256
			: 0);
#    endif /* MULTIPLEBYTECODESETS */
		/* begin push: */
		longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp11;
		/* begin push: */
		object5 = (VMBIGENDIAN
			? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0)
			: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0));
		longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object5);
		GIV(stackPointer) = sp21;
		/* begin push: */
		longAtput((sp31 = GIV(stackPointer) - BytesPerWord), 0);
		GIV(stackPointer) = sp31;
		GIV(instructionPointer) = initialIP - 1;
	}
	else {
		/* begin push: */
		object11 = ((usqInt)cogMethod);
		longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object11);
		GIV(stackPointer) = sp41;
		/* begin push: */
		longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp5;
		GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
	}
	/* begin push: */
	longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr);
	GIV(stackPointer) = sp9;
	for (i = (numArgs + 1); i <= numTemps; i += 1) {
		/* begin push: */
		longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp6;
	}
	if ((/* begin alternateHeaderHasPrimitiveFlag: */
	methodHeader & AlternateHeaderHasPrimFlag)) {

		/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
		   with a long store temp.  Strictly no need to skip the store because it's effectively a noop. */
		if (!(cogMethod)) {
			GIV(instructionPointer) += 3;
		}
		if (GIV(primFailCode) != 0) {
			reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader);
		}
	}
	if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) {
		maybeFlagMethodAsInterpreted(GIV(newMethod));
	}
	/* begin checkForStackOverflow */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) {
		handleStackOverflow();
	}
	assert((frameReceiver(GIV(framePointer))) == (splObj(ClassAlien)));
	/* begin enterSmalltalkExecutiveFromCallback */
	enterSmalltalkExecutive();
	return 1;
}


/*	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. */
/*	Override to log and check stack alignment. Since this is an implicit send
	we need to
	log it explicitly. The return side is done via a primitive so that gets
	logged normally. */

	/* CoInterpreter>>#sendInvokeCallback:Stack:Registers:Jmpbuf: */
EXPORT(sqInt)
sendInvokeCallbackStackRegistersJmpbuf(sqInt thunkPtr, sqInt stackPtr, sqInt regsPtr, sqInt jmpBufPtr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt aMethodObj;
    sqInt aSelectorOrImmediate;
    sqInt classTag;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt i;
    usqInt initialIP;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt numArgs;
    sqInt numTemps;
    sqInt obj;
    sqInt object;
    sqInt object1;
    sqInt object11;
    sqInt object2;
    sqInt object3;
    sqInt object4;
    sqInt object5;
    sqInt rcvr;
    sqInt selector;
    char *sp;
    char *sp1;
    char *sp10;
    char *sp11;
    char *sp2;
    char *sp21;
    char *sp3;
    char *sp31;
    char *sp4;
    char *sp41;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;

	cogMethod = ((CogMethod *) 0);
	assertCStackWellAligned();
	if (recordPrimTrace()) {
		/* begin fastLogPrim: */
		aSelectorOrImmediate = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorInvokeCallback) << (shiftForWord())))));
		GIV(primTraceLog)[GIV(primTraceLogIndex)] = aSelectorOrImmediate;
		primTraceLogIndex(GIV(primTraceLogIndex) + 1);
	}
	/* begin fetchClassTagOfNonImm: */
	obj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord())))));
	/* begin classIndexOf: */
	classTag = (longAt(obj)) & (classIndexMask());
	/* begin fetchPointer:ofObject: */
	GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorInvokeCallback) << (shiftForWord())))));
	GIV(argumentCount) = 4;
	if (!(lookupInMethodCacheSelclassTag(GIV(messageSelector), classTag))) {
		if ((lookupOrdinaryNoMNUEtcInClass(classAtIndex(classTag))) != 0) {
			return 0;
		}
	}
	if (!(((argumentCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) == 4)
		 && (primitiveFunctionPointer == 0))) {
		return 0;
	}
	/* begin push: */
	object = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord())))));
	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
	/* begin push: */
	object1 = positiveMachineIntegerFor(thunkPtr);
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1);
	GIV(stackPointer) = sp1;
	/* begin push: */
	object2 = positiveMachineIntegerFor(stackPtr);
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2);
	GIV(stackPointer) = sp2;
	/* begin push: */
	object3 = positiveMachineIntegerFor(regsPtr);
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3);
	GIV(stackPointer) = sp3;
	/* begin push: */
	object4 = positiveMachineIntegerFor(jmpBufPtr);
	longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4);
	GIV(stackPointer) = sp4;
	/* begin ifAppropriateCompileToNativeCode:selector: */
	aMethodObj = GIV(newMethod);
	selector = GIV(messageSelector);
	/* begin fetchPointer:ofObject: */
	methodHeader1 = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader1) & 7) == 1))
		 || (((((usqInt)methodHeader1)) < (startOfMemory()))
		 && ((((usqInt)methodHeader1)) >= (minCogMethodAddress())))),
	(methodHeader1 & (smallIntegerTag())) == 0)) {

		/* makeBaseFrame: can create cog methods with nil selectors. */
		cogMethod1 = ((CogMethod *) methodHeader1);
		if (((cogMethod1->selector)) == GIV(nilObj)) {
			setSelectorOfto(cogMethod1, selector);
		}
	}
	else {
		if (((assert((((methodHeader1) & 7) == 1)),
		((methodHeader1 >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
			cogselector(aMethodObj, selector);
		}
		else {
			maybeFlagMethodAsInterpreted(aMethodObj);
		}
	}
	/* begin justActivateNewMethod: */
	methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)) {
		cogMethod = ((CogMethod *) methodHeader);
		methodHeader = (cogMethod->methodHeader);
	}
	numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F;
	numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15;

	/* could new rcvr be set at point of send? */
	rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord));
	assert(!(isOopForwarded(rcvr)));
	if ((cogMethod != null)
	 && ((((usqInt)GIV(instructionPointer))) >= (startOfMemory()))) {
		/* begin iframeSavedIP:put: */
		assert(!(isMachineCodeFrame(GIV(framePointer))));
		longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
		GIV(instructionPointer) = ceReturnToInterpreterPC();
	}
	/* begin push: */
	longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp7;
	/* begin push: */
	longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
	GIV(stackPointer) = sp8;
	GIV(framePointer) = GIV(stackPointer);
	initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize;
	if (cogMethod == null) {
		/* begin push: */
		longAtput((sp10 = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
		GIV(stackPointer) = sp10;
		/* begin setMethod:methodHeader: */
		GIV(method) = GIV(newMethod);
		assert(isOopCompiledMethod(GIV(method)));
		assert((methodHeaderOf(GIV(method))) == methodHeader);
		
#    if MULTIPLEBYTECODESETS
		GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0
			? 256
			: 0);
#    endif /* MULTIPLEBYTECODESETS */
		/* begin push: */
		longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp11;
		/* begin push: */
		object5 = (VMBIGENDIAN
			? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0)
			: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0));
		longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object5);
		GIV(stackPointer) = sp21;
		/* begin push: */
		longAtput((sp31 = GIV(stackPointer) - BytesPerWord), 0);
		GIV(stackPointer) = sp31;
		GIV(instructionPointer) = initialIP - 1;
	}
	else {
		/* begin push: */
		object11 = ((usqInt)cogMethod);
		longAtput((sp41 = GIV(stackPointer) - BytesPerWord), object11);
		GIV(stackPointer) = sp41;
		/* begin push: */
		longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp5;
		GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
	}
	/* begin push: */
	longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr);
	GIV(stackPointer) = sp9;
	for (i = (numArgs + 1); i <= numTemps; i += 1) {
		/* begin push: */
		longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp6;
	}
	if ((/* begin alternateHeaderHasPrimitiveFlag: */
	methodHeader & AlternateHeaderHasPrimFlag)) {

		/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
		   with a long store temp.  Strictly no need to skip the store because it's effectively a noop. */
		if (!(cogMethod)) {
			GIV(instructionPointer) += 3;
		}
		if (GIV(primFailCode) != 0) {
			reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader);
		}
	}
	if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) {
		maybeFlagMethodAsInterpreted(GIV(newMethod));
	}
	/* begin checkForStackOverflow */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) {
		handleStackOverflow();
	}
	/* begin enterSmalltalkExecutiveFromCallback */
	enterSmalltalkExecutive();
	return 1;
}

	/* CoInterpreter>>#shortPrintFrame: */
static sqInt NoDbgRegParms
shortPrintFrame(char *theFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aByte;
    sqInt frameNumArgs;
    sqInt frameNumArgs1;
    sqInt mthd;
    sqInt rcvr;

	if (!((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
		 && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
		print("invalid frame pointer");
		/* begin cr */
		printf("\n");
		return null;
	}
	rcvr = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? longAt(theFP + FoxMFReceiver)
		: longAt(theFP + FoxIFReceiver));
	mthd = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((mframeHomeMethod(theFP))->methodObject)
		: longAt(theFP + FoxMethod));
	/* begin printHexPtr: */
	printHex(oopForPointer(theFP));
	/* begin space */
	putchar(' ');
	/* begin printChar: */
	aByte = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? 'M'
		: 'I');
	putchar(aByte);
	/* begin space */
	putchar(' ');
	printActivationNameForreceiverisBlockfirstTemporary(mthd, rcvr, ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 3)) != 0), ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? (0 < ((frameNumArgs = ((mframeCogMethod(theFP))->cmNumArgs)))
				? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs) * BytesPerWord))
				: longAt(((theFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs) * BytesPerWord)))
		: (/* begin itemporary:in: */
			(0 < ((frameNumArgs1 = byteAt((theFP + FoxIFrameFlags) + 1)))
					? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs1) * BytesPerWord))
					: longAt(((theFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1) * BytesPerWord))))));
	/* begin space */
	putchar(' ');
	shortPrintOop(rcvr);
	return 0;
}


/*	Answer a full 32 bit integer object for the given integer value.
	N.B. Returning in each arm separately enables Slang inlining.
	/Don't/ return the ifTrue:ifFalse: unless Slang inlining of conditionals
	is fixed. */

	/* CoInterpreter>>#signed32BitIntegerFor: */
sqInt
signed32BitIntegerFor(sqInt integerValue)
{
	return (((usqInt)(((int) integerValue)) << 3) | 1);
}


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

	/* CoInterpreter>>#signed32BitValueOf: */
int
signed32BitValueOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt value64;

	if ((((oop) & 7) == 1)) {
		value64 = (oop >> 3);
		if ((((int) value64)) != value64) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			value64 = 0;
		}
		return value64;
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	return 0;
}


/*	Answer a Large Integer object for the given integer value. N.B. will *not*
	cause a GC. */

	/* CoInterpreter>>#signed64BitIntegerFor: */
sqInt
signed64BitIntegerFor(sqLong integerValue)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt largeClass;
    usqLong magnitude;
    usqInt newLargeInteger;
    usqInt newObj;
    usqInt numBytes;
    sqInt numSlots;
    sqInt objFormat;
    sqInt sz;

	if (integerValue < 0) {
		if (integerValue >= (MinSmallInteger)) {
			return (((usqInt)(((sqInt)integerValue)) << 3) | 1);
		}
		largeClass = ClassLargeNegativeIntegerCompactIndex;
		magnitude = 0 - (((usqLong) integerValue));
	}
	else {
		if (integerValue <= (MaxSmallInteger)) {
			return (((usqInt)(((sqInt)integerValue)) << 3) | 1);
		}
		largeClass = ClassLargePositiveIntegerCompactIndex;
		magnitude = integerValue;
	}
	sz = 8;
	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
	objFormat = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1));
	numSlots = (sz + 3) / BytesPerOop;
	assert((numSlots >= 0)
	 && ((largeClass != 0)
	 && ((knownClassAtIndex(largeClass)) != GIV(nilObj))));
	assert(((objFormat < (firstByteFormat())
		? objFormat
		: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(largeClass))));
	/* begin allocateSmallNewSpaceSlots:format:classIndex: */
	assert(numSlots < (numSlotsMask()));
	newObj = GIV(freeStart);
	numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
			error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
			newLargeInteger = 0;
			goto l1;
		}
	}
	long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + largeClass);
	GIV(freeStart) += numBytes;
	newLargeInteger = newObj;
	l1:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
	
	/* Memory is eight byte aligned in SPUR, so we are sure to have room for 64bits word whatever allocated sz */
	long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), SQ_SWAP_8_BYTES_IF_BIGENDIAN(magnitude));
	return newLargeInteger;
}


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

	/* CoInterpreter>>#signed64BitValueOf: */
sqLong
signed64BitValueOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ccIndex;
    sqInt ccIndex1;
    sqInt fmt;
    usqLong magnitude;
    sqInt negative;
    sqInt ok;
    sqInt sz;
    sqLong value;

	if ((((oop) & 7) == 1)) {
		return ((sqLong) ((oop >> 3)));
	}
	if (oop & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop)));
	/* begin classIndexOf: */
	ccIndex1 = (longAt(oop)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex1;
	goto l4;
	l4:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (ok) {
		negative = 0;
	}
	else {
		negative = 1;
		/* begin isClassOfNonImm:equalTo:compactClassIndex: */
		assert(!(isImmediate(oop)));
		/* begin classIndexOf: */
		ccIndex = (longAt(oop)) & (classIndexMask());
		ok = ClassLargeNegativeIntegerCompactIndex == ccIndex;
		goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
		if (!ok) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return 0;
		}
	}
	/* begin numBytesOfBytes: */
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	assert(fmt >= (firstByteFormat()));
	sz = ((numSlotsOf(oop)) << (shiftForWord())) - (fmt & 7);
	if (sz > (sizeof(sqLong))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	if (sz > 4) {
		magnitude = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize) + (0U << 3))));
	}
	else {

		/* ] */
		magnitude = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2))))));
	}
	if ((negative
		? magnitude > 0x8000000000000000ULL
		: magnitude >= 0x8000000000000000ULL)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	if (negative) {
		value = 0 - magnitude;
	}
	else {
		value = magnitude;
	}
	return value;
}


/*	Invoke a normal (non-quick) primitive.
	Called under the assumption that primFunctionPointer has been preloaded. */
/*	Invoke a normal (non-quick) primitive.
	Called under the assumption that primFunctionPointer has been preloaded.
	Override to log primitive. */

	/* CoInterpreter>>#slowPrimitiveResponse */
static sqInt
slowPrimitiveResponse(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt nArgs;
    char *savedFramePointer;
    char *savedStackPointer;

	nArgs = 0;
	savedFramePointer = ((char *) 0);
	savedStackPointer = ((char *) 0);
	if (recordPrimTrace()) {
		/* begin fastLogPrim: */
		GIV(primTraceLog)[GIV(primTraceLogIndex)] = GIV(messageSelector);
		primTraceLogIndex(GIV(primTraceLogIndex) + 1);
	}
	assert(!(isOopForwarded(stackValue(GIV(argumentCount)))));
	assert((remapBufferCount()) == 0);
	nArgs = GIV(argumentCount);
	savedStackPointer = GIV(stackPointer);
	savedFramePointer = GIV(framePointer);
	/* begin initPrimCall */
	GIV(primFailCode) = 0;
	dispatchFunctionPointer(primitiveFunctionPointer);
	assert(maybeLeakCheckExternalPrimCall(GIV(newMethod)));
	/* begin maybeRetryPrimitiveOnFailure */
	if (GIV(primFailCode)) {
		retryPrimitiveOnFailure();
	}
	/* begin maybeFailForLastObjectOverwrite */
	if (checkAllocFiller) {
		if (((freeStart()) < GIV(scavengeThreshold))
		 && ((longAt(freeStart())) != (freeStart()))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrWritePastObject;
		}
	}
	if ((!GIV(primFailCode))
	 && ((GIV(framePointer) == savedFramePointer)
	 && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {

		/* Don't fail if primitive has done something radical, e.g. perform: */
		if (GIV(stackPointer) != (savedStackPointer + (nArgs * BytesPerWord))) {
			flag("Would be nice to make this a message send of e.g. unbalancedPrimitive to the current process or context");
			failUnbalancedPrimitive();
			GIV(stackPointer) = savedStackPointer;
		}
	}
	if (GIV(nextProfileTick) > 0) {
		checkProfileTick(GIV(newMethod));
	}
	return !GIV(primFailCode);
}


/*	<SmallInteger> */

	/* CoInterpreter>>#specialSelectorNumArgs: */
sqInt
specialSelectorNumArgs(sqInt index)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((fetchPointerofObject((index * 2) + 1, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord()))))))) >> 3);
}

	/* CoInterpreter>>#stackLimitAddress */
usqInt
stackLimitAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (usqInt)&GIV(stackLimit);
}


/*	Answer the amount of slots needed to fit a new frame at the point the
	stack limit is checked. A frame looks like this at the point the stack
	limit is checked:
	stacked receiver/closure
	arg0
	...
	argN
	caller's method ip/base frame's sender context
	fp->	saved fp
	method
	context (uninitialized?)
	method header fields (interpreter only)
	saved method ip (uninitialized?; interpreter only)
	receiver
	first temp
	...
	sp->	Nth temp
	So the amount of headroom is
	the maximum number of arguments + 1 (for stacked receiver and arguments)
	+ the frame size
	+ the max number of temps.
	Since a method's number of temps includes its arguments the actual offset
	is:  */

	/* CoInterpreter>>#stackLimitOffset */
static sqInt
stackLimitOffset(void)
{
	return (IFrameSlots + 64) * BytesPerWord;
}


/*	Return a minimum amount of headroom for each stack page (in bytes).
	In the interpreter we don't actually need any headroom. In a JIT the stack
	has to have room for interrupt handlers which will run on the stack.
	Defer to the platform for this one. */

	/* CoInterpreter>>#stackPageHeadroom */
static sqInt
stackPageHeadroom(void)
{
	return osCogStackPageHeadroom();
}

	/* CoInterpreter>>#stackPointerAddress */
usqInt
stackPointerAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(stackPointer))));
}


/*	Zero-relative version of CompiledMethod>>startpc. */

	/* CoInterpreter>>#startPCOfMethodHeader: */
sqInt
startPCOfMethodHeader(sqInt aCompiledMethodHeader)
{
	return (((assert((((aCompiledMethodHeader) & 7) == 1)),
((aCompiledMethodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop;
}


/*	Answer the startPC of lit if it is a (clean) block in aMethodObj,
	otherwise answer nil.
 */

	/* CoInterpreter>>#startPCOrNilOfLiteral:in: */
sqInt
startPCOrNilOfLiteralin(sqInt lit, sqInt aMethodObj)
{
    sqInt oop;
    sqInt outerContext;

	if (!(((lit & (tagMask())) == 0)
		 && ((((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == (indexablePointersFormat()))
		 && ((numSlotsOf(lit)) >= ClosureFirstCopiedValueIndex)))) {
		return null;
	}
	outerContext = longAt((lit + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))));
	if (!(((outerContext & (tagMask())) == 0)
		 && (((longAt(outerContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
		return null;
	}
	if (aMethodObj != (longAt((outerContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord()))))))) {
		return null;
	}
	/* begin quickFetchInteger:ofObject: */
	oop = longAt((lit + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	return (oop >> 3);
}


/*	Signal the given semaphore from within the interpreter.
	Answer if the current process was preempted.
	Override to add tracing info. */

	/* CoInterpreter>>#synchronousSignal: */
static sqInt NoDbgRegParms
synchronousSignal(sqInt aSemaphore)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ctxt;
    sqInt excessSignals;
    sqInt proc;
    sqInt referent;

	if ((assert(!(isForwarded(aSemaphore))),
	(longAt((aSemaphore + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))))) == GIV(nilObj))) {

		/* no process is waiting on this semaphore */
		excessSignals = fetchIntegerofObject(ExcessSignalsIndex, aSemaphore);
		/* begin storeInteger:ofObject:withValue: */
		if ((((((usqInt) (excessSignals + 1)) >> 60) + 1) & 15) <= 1) {
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(aSemaphore)));
			longAtput((aSemaphore + BaseHeaderSize) + (((sqInt)((usqInt)(ExcessSignalsIndex) << (shiftForWord())))), (((usqInt)(excessSignals + 1) << 3) | 1));
		}
		else {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
		return 0;
	}
	/* begin ensureSemaphoreUnforwardedThroughContext: */
	proc = longAt((aSemaphore + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))));
	if (((longAt(proc)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		followForwardedObjectFieldstoDepth(aSemaphore, 1);
		proc = longAt((aSemaphore + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))));
	}
	assert(!((isForwarded(proc))));
	ctxt = longAt((proc + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord())))));
	if (((longAt(ctxt)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(ctxt));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((ctxt + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		ctxt = referent;
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(proc)));
		if ((assert(isNonImmediate(proc)),
		oopisGreaterThanOrEqualTo(proc, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((ctxt & (tagMask())) == 0)
			 && (oopisLessThan(ctxt, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(proc))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(proc);
				}
			}
		}
		longAtput((proc + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord())))), ctxt);
	}
	return resumepreemptedYieldingIffrom(removeFirstLinkOfList(aSemaphore), GIV(preemptionYields), CSSignal);
}


/*	Handle the cannot return response for a base frame return to an invalid
	context. Build a new base frame for the context in the cannot resume state
	ready for the
	send of cannotReturn:.
	
	Since we have returned from the base frame of the page the context is
	effectively widowed.
	But its sender needs to be contextToReturnTo, and its pc needs to be the
	HasBeenReturnedFromMCPC marker. So bereave it (as a side-effect of
	isWidowedContext:), assign contextToReturnTo to
	sender, and rebuild its frame, which will have the ceCannotResumePC as its
	pc. Finally push
	returnValue and set instructionPointer to ceCannotResumePC in preparation
	for the send. */

	/* CoInterpreter>>#tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFrom:to:returnValue: */
static void NoDbgRegParms
tearDownAndRebuildFrameForCannotReturnBaseFrameReturnFromtoreturnValue(sqInt contextToReturnFrom, sqInt contextToReturnTo, sqInt returnValue)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    StackPage *newPage;

	assert((GIV(stackPage) != 0)
	 && (isFree(GIV(stackPage))));
	isWidowedContext(contextToReturnFrom);
	assert(!(isMarriedOrWidowedContext(contextToReturnFrom)));
	/* begin storePointer:ofObject:withValue: */
	assert(!(isForwarded(contextToReturnFrom)));
	if ((assert(isNonImmediate(contextToReturnFrom)),
	oopisGreaterThanOrEqualTo(contextToReturnFrom, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((contextToReturnTo & (tagMask())) == 0)
		 && (oopisLessThan(contextToReturnTo, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(contextToReturnFrom))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(contextToReturnFrom);
			}
		}
	}
	longAtput((contextToReturnFrom + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), contextToReturnTo);
	/* begin storePointer:ofObject:withValue: */
	assert(!(isForwarded(contextToReturnFrom)));
	if ((assert(isNonImmediate(contextToReturnFrom)),
	oopisGreaterThanOrEqualTo(contextToReturnFrom, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((HasBeenReturnedFromMCPCOop & (tagMask())) == 0)
		 && (oopisLessThan(HasBeenReturnedFromMCPCOop, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(contextToReturnFrom))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(contextToReturnFrom);
			}
		}
	}
	longAtput((contextToReturnFrom + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), HasBeenReturnedFromMCPCOop);
	GIV(instructionPointer) = 0;
	newPage = makeBaseFrameFor(contextToReturnFrom);
	assert(GIV(stackPage) == newPage);
	/* begin setStackPageAndLimit: */
	assert(newPage != 0);
	GIV(stackPage) = newPage;
	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
	}
	markStackPageMostRecentlyUsed(newPage);
	/* begin setStackPointersFromPage: */
	GIV(stackPointer) = (newPage->headSP);
	GIV(framePointer) = (newPage->headFP);
	assert((stackTop()) == (ceCannotResumePC()));
	longAtPointerput(GIV(stackPointer), returnValue);
	GIV(instructionPointer) = ceCannotResumePC();
}


/*	Record a process to be awoken on the next interpreter cycle.
	Reimplement to record the source of the switch for debugging,
	and to cope with possible code compaction in makeBaseFrameFor:. */

	/* CoInterpreter>>#transferTo:from: */
static void NoDbgRegParms
transferTofrom(sqInt newProc, sqInt sourceCode)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeContext;
    sqInt aMethodObj;
    StackPage *lastUsedPage;
    StackPage *lruOrFree;
    sqInt newContext;
    StackPage *newPage;
    sqInt objOop;
    sqInt oldProc;
    sqInt sched;
    sqInt senderOop;
    char *sp;
    char *theFP;
    char *theFrame;
    StackPage *thePage;
    char *theSP;
    sqInt top;
    sqInt valuePointer;

	GIV(statProcessSwitch) += 1;
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp;
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	/* begin assertValidExecutionPointe:r:s: */
	assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
	GIV(instructionPointer) = 0;
	/* begin fetchPointer:ofObject: */
	objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	sched = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	oldProc = longAt((sched + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
	/* begin recordContextSwitchFrom:in: */
	if (recordEventTrace()) {
		/* begin recordTrace:thing:source: */
		GIV(traceLog)[GIV(traceLogIndex)] = TraceContextSwitch;
		GIV(traceLog)[GIV(traceLogIndex) + 1] = oldProc;
		GIV(traceLog)[GIV(traceLogIndex) + 2] = sourceCode;
		GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
	}
	/* begin ensureFrameIsMarried:SP: */
	theFP = GIV(framePointer);
	theSP = GIV(stackPointer) + BytesPerWord;
	if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
		assert(isContext(frameContext(theFP)));
		activeContext = longAt(theFP + FoxThisContext);
		goto l4;
	}
	activeContext = marryFrameSP(theFP, theSP);
	l4:	/* end ensureFrameIsMarried:SP: */;
	/* begin storePointer:ofObject:withValue: */
	assert(!(isForwarded(oldProc)));
	if ((assert(isNonImmediate(oldProc)),
	oopisGreaterThanOrEqualTo(oldProc, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((activeContext & (tagMask())) == 0)
		 && (oopisLessThan(activeContext, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(oldProc))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(oldProc);
			}
		}
	}
	longAtput((oldProc + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord())))), activeContext);
	/* begin storePointer:ofObject:withValue: */
	assert(!(isForwarded(sched)));
	if ((assert(isNonImmediate(sched)),
	oopisGreaterThanOrEqualTo(sched, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((newProc & (tagMask())) == 0)
		 && (oopisLessThan(newProc, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(sched))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(sched);
			}
		}
	}
	longAtput((sched + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))), newProc);
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(newProc)));
	longAtput((newProc + BaseHeaderSize) + (((sqInt)((usqInt)(MyListIndex) << (shiftForWord())))), GIV(nilObj));
	/* begin externalSetStackPageAndPointersForSuspendedContextOfProcess: */
	newContext = longAt((newProc + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord())))));
	assert(isContext(newContext));
	if (((((longAt((newContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
		assert(checkIsStillMarriedContextcurrentFP(newContext, GIV(framePointer)));
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = GIV(nilObj);
	assert(!(isOopForwarded(newProc)));
	longAtput((newProc + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord())))), valuePointer);
	if ((((((longAt((newContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(newContext)))) {
		/* begin frameOfMarriedContext: */
		senderOop = longAt((newContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop) & 7) == 1));
		theFrame = pointerForOop(senderOop - 1);
		/* begin stackPageFor: */
		thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		if (theFrame != ((thePage->headFP))) {

			/* explicit assignment of suspendedContext can cause switch to interior frame. */
			/* begin newStackPage */
			lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage);
			if (((lruOrFree->baseFP)) == 0) {
				newPage = lruOrFree;
				goto l11;
			}
			divorceFramesIn(lruOrFree);
			newPage = lruOrFree;
	l11:	/* end newStackPage */;
			moveFramesInthroughtoPage(thePage, findFrameAboveinPage(theFrame, thePage), newPage);
			/* begin markStackPageLeastMostRecentlyUsed: */
			assert(newPage == ((GIV(mostRecentlyUsedPage)->nextPage)));
			lastUsedPage = (newPage->nextPage);
			while (((lastUsedPage->baseFP)) == 0) {
				lastUsedPage = (lastUsedPage->nextPage);
			}
			if (((lastUsedPage->nextPage)) == newPage) {
				goto l14;
			}
			(((newPage->prevPage))->nextPage = (newPage->nextPage));
			(((newPage->nextPage))->prevPage = (newPage->prevPage));
			(((lastUsedPage->prevPage))->nextPage = newPage);
			(newPage->prevPage = (lastUsedPage->prevPage));
			(newPage->nextPage = lastUsedPage);
			(lastUsedPage->prevPage = newPage);
			assert(pageListIsWellFormed());
	l14:	/* end markStackPageLeastMostRecentlyUsed: */;
		}
		assert(((thePage->headFP)) == theFrame);
	}
	else {
		thePage = makeBaseFrameFor(newContext);
		theFrame = (thePage->baseFP);
	}
	/* begin setStackPageAndLimit: */
	assert(thePage != 0);
	GIV(stackPage) = thePage;
	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
	}
	markStackPageMostRecentlyUsed(thePage);
	/* begin setStackPointersFromPage: */
	GIV(stackPointer) = (thePage->headSP);
	GIV(framePointer) = (thePage->headFP);
	if (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))) {
		/* begin setMethod: */
		aMethodObj = longAt(GIV(framePointer) + FoxMethod);
		assert((((usqInt)aMethodObj)) >= (startOfMemory()));
		GIV(method) = aMethodObj;
		assert(isOopCompiledMethod(GIV(method)));
		
#    if MULTIPLEBYTECODESETS
		GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
			? 256
			: 0);
#    endif /* MULTIPLEBYTECODESETS */
	}
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
	/* begin assertValidExecutionPointe:r:s: */
	assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
}

	/* CoInterpreter>>#updateStackZoneReferencesToCompiledCodePreCompaction */
void
updateStackZoneReferencesToCompiledCodePreCompaction(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *callerFP;
    sqInt i;
    sqInt theFlags;
    char *theFP;
    usqInt theIP;
    char *theIPPtr;
    CogMethod *theMethod;
    sqInt theMethodField;
    StackPage *thePage;

	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		if (!(isFree(thePage))) {
			theIPPtr = (thePage->headSP);
			theFP = (thePage->headFP);
			while (1) {
				if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
					/* begin frameMethodField: */
					theMethodField = longAt(theFP + FoxMethod);
					theFlags = theMethodField & MFMethodFlagsMask;
					theMethod = ((CogMethod *) (theMethodField - theFlags));
					if (((theMethod->cmType)) == CMBlock) {
						theMethod = (((((CogBlockMethod *) (theMethodField - theFlags)))->cpicHasMNUCaseOrCMIsFullBlock)
							? ((CogMethod *) (((CogBlockMethod *) (theMethodField - theFlags))))
							: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) (theMethodField - theFlags))))) - (((((CogBlockMethod *) (theMethodField - theFlags)))->homeOffset)))));
					}
					theIP = ((usqInt)(longAt(theIPPtr)));
					if ((theIP != (ceCannotResumePC()))
					 && (asserta((theIP >= (((usqInt)theMethod)))
					 && (theIP < ((((usqInt)theMethod)) + ((theMethod->blockSize))))))) {
						longAtput(theIPPtr, theIP + ((theMethod->objectHeader)));
					}
					longAtput(theFP + FoxMethod, theMethodField + ((theMethod->objectHeader)));
				}
				if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break;
				theIPPtr = theFP + FoxCallerSavedIP;
				theFP = callerFP;
			}
		}
	}
}


/*	Update the frame's spouse context with the frame's current state except
	for the
	sender and instruction pointer, which are used to mark the context as
	married. 
 */

	/* CoInterpreter>>#updateStateOfSpouseContextForFrame:WithSP: */
static void NoDbgRegParms
updateStateOfSpouseContextForFrameWithSP(char *theFP, char *theSP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *argsPointer;
    sqInt i;
    char *pointer;
    sqInt tempIndex;
    sqInt theContext;

	assert(frameHasContext(theFP));
	theContext = longAt(theFP + FoxThisContext);
	assert(isContext(theContext));
	assert((frameReceiver(theFP)) == (noFixupFollowFieldofObject(ReceiverIndex, theContext)));
	if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
		tempIndex = ((mframeCogMethod(theFP))->cmNumArgs);
		pointer = (theFP + FoxMFReceiver) - BytesPerWord;
	}
	else {
		/* begin iframeNumArgs: */
		tempIndex = byteAt((theFP + FoxIFrameFlags) + 1);
		pointer = (theFP + FoxIFReceiver) - BytesPerWord;
	}
	argsPointer = theFP + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(tempIndex) << (shiftForWord())))));
	for (i = 1; i <= tempIndex; i += 1) {
		argsPointer -= BytesPerWord;
		assert(addressCouldBeOop(longAt(argsPointer)));
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(theContext)));
		if ((assert(isNonImmediate(theContext)),
		oopisGreaterThanOrEqualTo(theContext, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if ((((longAt(argsPointer)) & (tagMask())) == 0)
			 && (oopisLessThan(longAt(argsPointer), GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(theContext))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(theContext);
				}
			}
		}
		longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)((ReceiverIndex + i)) << (shiftForWord())))), longAt(argsPointer));
	}
	while (pointer >= theSP) {
		assert(addressCouldBeOop(longAt(pointer)));
		tempIndex += 1;
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(theContext)));
		if ((assert(isNonImmediate(theContext)),
		oopisGreaterThanOrEqualTo(theContext, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if ((((longAt(pointer)) & (tagMask())) == 0)
			 && (oopisLessThan(longAt(pointer), GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(theContext))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(theContext);
				}
			}
		}
		longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)((ReceiverIndex + tempIndex)) << (shiftForWord())))), longAt(pointer));
		pointer -= BytesPerWord;
	}
	assert((ReceiverIndex + tempIndex) < (lengthOf(theContext)));
	assert(!(isOopForwarded(theContext)));
	longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))), (((usqInt)tempIndex << 3) | 1));
}


/*	Note that we accept anInstrPointer pointing to a callPrimitiveBytecode
	at the start of a method that contains a primitive. This because methods
	like Context(Part)>>reset have to be updated to skip the callPrimtiive
	bytecode otherwise. */
/*	-1 for pre-increment in fetchNextBytecode */

	/* CoInterpreter>>#validInstructionPointer:inMethod:framePointer: */
sqInt
validInstructionPointerinMethodframePointer(usqInt instrPointer, usqInt aMethod, char *fp)
{
    CogMethod *cogMethod;
    sqInt header;
    usqInt theInstrPointer;

	if (instrPointer == (ceCannotResumePC())) {
		return (((usqInt)(longAt(fp + FoxMethod)))) < (startOfMemory());
	}
	if (instrPointer == (ceReturnToInterpreterPC())) {
		if ((((usqInt)(longAt(fp + FoxMethod)))) < (startOfMemory())) {
			return 0;
		}
		/* begin iframeSavedIP: */
		theInstrPointer = longAt(fp + FoxIFSavedIP);
	}
	else {
		theInstrPointer = instrPointer;
		header = longAt((aMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if (((assert(((((header) & 7) == 1))
			 || (((((usqInt)header)) < (startOfMemory()))
			 && ((((usqInt)header)) >= (minCogMethodAddress())))),
		(header & (smallIntegerTag())) == 0))
		 && (theInstrPointer < (startOfMemory()))) {
			cogMethod = ((CogMethod *) header);
			return (theInstrPointer >= (header + (sizeof(CogMethod))))
			 && (theInstrPointer < (header + ((cogMethod->blockSize))));
		}
	}
	return (theInstrPointer >= (((aMethod + (lastPointerOf(aMethod))) + BytesPerOop) - 1))
	 && (theInstrPointer < (((aMethod + (numBytesOfBytes(aMethod))) + BaseHeaderSize) - 1));
}


/*	Check that the base frame in the stack page has a valid sender and saved
	context. 
 */

	/* CoInterpreter>>#validStackPageBaseFrame: */
static sqInt NoDbgRegParms
validStackPageBaseFrame(StackPage *aPage)
{
    sqInt savedThisContext;
    sqInt senderContextOrNil;

	senderContextOrNil = longAt((aPage->baseAddress));
	savedThisContext = longAt(((aPage->baseAddress)) - BytesPerWord);
	if (!(asserta(((((aPage->baseFP)) + (frameStackedReceiverOffset((aPage->baseFP)))) + (2 * BytesPerWord)) == ((aPage->baseAddress))))) {
		return 0;
	}
	if (!(asserta(addressCouldBeObj(senderContextOrNil)))) {
		return 0;
	}
	if (!(asserta(addressCouldBeObj(savedThisContext)))) {
		return 0;
	}
	if (!(asserta((senderContextOrNil == (nilObject()))
		 || (isContext(senderContextOrNil))))) {
		return 0;
	}
	if (!(asserta(isContext(savedThisContext)))) {
		return 0;
	}
	if (!(asserta((frameCallerContext((aPage->baseFP))) == senderContextOrNil))) {
		return 0;
	}
	if (!(asserta((frameContext((aPage->baseFP))) == savedThisContext))) {
		return 0;
	}
	return 1;
}

	/* CoInterpreter>>#varBaseAddress */
usqInt
varBaseAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (((usqInt)((&GIV(stackPointer))))) - 64;
}


/*	Make sure that all VM state that affects the heap contents is voided so
	that the heap is
	ready to be snapshotted. If flushExtPrims is true, flush references to
	external primitives in methods. Answer the activeContext that should be
	stored in the snapshot. */
/*	Make sure that all VM state that affects the heap contents is voided so
	that the heap is
	ready to be snapshotted. If flushExtPrims is true, flush references to
	external primitives in methods. Answer the activeContext that should be
	stored in the snapshot. */

	/* CoInterpreter>>#voidVMStateForSnapshotFlushingExternalPrimitivesIf: */
static sqInt NoDbgRegParms
voidVMStateForSnapshotFlushingExternalPrimitivesIf(sqInt flushExtPrims)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeContext;
    sqInt activeContext1;
    sqInt address;
    sqInt address1;
    sqInt fmt;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;


	/* in case of code compactions. */
	GIV(instructionPointer) = 0;
	activeContext1 = divorceAllFrames();
	/* begin bereaveAllMarriedContextsForSnapshotFlushingExternalPrimitivesIf: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask());
		if ((fmt == (indexablePointersFormat()))
		 && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
			makeContextSnapshotSafe(objOop1);
		}
		if (flushExtPrims
		 && (fmt >= (firstCompiledMethodFormat()))) {
			flushExternalPrimitiveOf(objOop1);
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask());
		if ((fmt == (indexablePointersFormat()))
		 && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
			makeContextSnapshotSafe(objOop1);
		}
		if (flushExtPrims
		 && (fmt >= (firstCompiledMethodFormat()))) {
			flushExternalPrimitiveOf(objOop1);
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask());
			if ((fmt == (indexablePointersFormat()))
			 && (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
				makeContextSnapshotSafe(objOop11);
			}
			if (flushExtPrims
			 && (fmt >= (firstCompiledMethodFormat()))) {
				flushExternalPrimitiveOf(objOop11);
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	activeContext = activeContext1;
	voidCogCompiledCode();
	return activeContext;
}

	/* CoInterpreter>>#whereIs: */
char *
whereIs(sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *somewhere;
    char *where;

	somewhere = whereIsMaybeCodeThing(anOop);
	if (!(somewhere == null)) {
		return somewhere;
	}
	/* begin whereIsMaybeHeapThing: */
	if ((oopisLessThan(anOop, GIV(newSpaceLimit)))
	 && (oopisGreaterThanOrEqualTo(anOop, GIV(newSpaceStart)))) {
		if (oopisGreaterThanOrEqualToandLessThan(anOop, ((eden()).start), GIV(freeStart))) {
			where = " is in eden";
			goto l1;
		}
		if (oopisGreaterThanOrEqualToandLessThan(anOop, ((futureSpace()).start), futureSurvivorStart())) {
			where = " is in future space";
			goto l1;
		}
		if (oopisGreaterThanOrEqualToandLessThan(anOop, ((pastSpace()).start), GIV(pastSpaceStart))) {
			where = " is in past space";
			goto l1;
		}
		where = " is in new space";
		goto l1;
	}
	if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(oldSpaceStart), GIV(endOfMemory))) {
		if (!((segmentContainingObj(anOop)) == null)) {
			where = " is in old space";
			goto l1;
		}
		where = " is between old space segments";
		goto l1;
	}
	where = null;
	l1:	/* end whereIsMaybeHeapThing: */;
	if (!(where == null)) {
		return where;
	}
	/* begin whereIsMaybeStackThing: */
	if (oopisGreaterThanOrEqualToandLessThan(anOop, GIV(stackBasePlus1) - 1, GIV(pages))) {
		where = " is in the stack zone";
		goto l2;
	}
	where = null;
	l2:	/* end whereIsMaybeStackThing: */;
	if (!(where == null)) {
		return where;
	}
	return " is no where obvious";
}


/*	Either widow the context or map its pc to a bytecode one.
	Used to implement primitiveVoidVMStateForMethod. */
/*	for debugging & saving space */

	/* CoInterpreter>>#widowOrForceToBytecodePC: */
static void NoDbgRegParms NeverInline
widowOrForceToBytecodePC(sqInt ctxt)
{
	if (((((longAt((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {

		/* Since any machine-code frame activations of the method have been divorced
		   there should only be interpreted activations of marriecd contexts. */
		if (!(isWidowedContext(ctxt))) {
			assert(!((isMachineCodeFrame(frameOfMarriedContext(ctxt)))));
		}
	}
	else {
		ensureContextHasBytecodePC(ctxt);
	}
}

	/* CoInterpreterPrimitives>>#frameIsMarked: */
static sqInt NoDbgRegParms
frameIsMarked(sqInt theFPInt)
{
    sqInt methodField;

	methodField = longAt(theFPInt + FoxMethod);
	return ((((usqInt)methodField)) < (startOfMemory())
		? (methodField & 4) != 0
		: ((longAt(theFPInt + FoxIFrameFlags)) & 2) != 0);
}


/*	Machine code primitive for hash multiply. c.f. primitiveHashMultiply.
	mcprims consume receiver and arguments as parameters and answer the
	result on success, or set the primitive error code and answer 0 on
	failure.  */
/*	Implement 28-bit hashMultiply for SmallInteger and LargePositiveInteger
	receivers. 
 */

	/* CoInterpreterPrimitives>>#mcprimHashMultiply: */
sqInt
mcprimHashMultiply(sqInt receiverArg)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ccIndex;
    sqInt ok;
    sqInt value;

	if ((((receiverArg) & 7) == 1)) {
		value = (receiverArg >> 3);
	}
	else {
		/* begin is:instanceOf:compactClassIndex: */
		if (receiverArg & (tagMask())) {
			ok = 0;
			goto l2;
		}
		/* begin isClassOfNonImm:equalTo:compactClassIndex: */
		assert(!(isImmediate(receiverArg)));
		/* begin classIndexOf: */
		ccIndex = (longAt(receiverArg)) & (classIndexMask());
		ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
		goto l2;
	l2:	/* end is:instanceOf:compactClassIndex: */;
		if (!ok) {
			GIV(primFailCode) = PrimErrBadReceiver;
			return 0;
		}
		value = SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((receiverArg + BaseHeaderSize) + (0U << 2))));
	}
	return (((usqInt)((value * HashMultiplyConstant) & 0xFFFFFFF) << 3) | 1);
}


/*	This is optional old obsolete stuff tedious to implement in Cog because of
	the need to map from machine code pc to bytecode pc. So for now just fail. */

	/* CoInterpreterPrimitives>>#primitiveClosureCopyWithCopiedValues */
static void
primitiveClosureCopyWithCopiedValues(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
}


/*	Answer the contents of the code zone as an array of pair-wise element,
	address in ascending
	address order. Answer a string for a runtime routine or abstract label
	(beginning, end, etc),
	a CompiledMethod for a CMMethod, or a selector (presumably a Symbol) for a
	PIC. If there is an argument and it is true, then collect inner
	information about the CogMethod. */

	/* CoInterpreterPrimitives>>#primitiveCollectCogCodeConstituents */
static void
primitiveCollectCogCodeConstituents(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt constituents;
    char *sp;
    sqInt withDetails;

	if (GIV(argumentCount) == 0) {
		withDetails = 0;
	}
	else {
		withDetails = longAt(GIV(stackPointer));
		if (!((withDetails == GIV(trueObj))
			 || (withDetails == GIV(falseObj)))) {
			(GIV(primFailCode) = PrimErrBadArgument);
			return;
		}
		withDetails = withDetails == GIV(trueObj);
	}
	constituents = cogCodeConstituents(withDetails);
	if (!(constituents)) {
		(GIV(primFailCode) = PrimErrNoMemory);
		return;
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), constituents);
	GIV(stackPointer) = sp;
}


/*	Lift the veil from a context and answer an integer describing its interior
	state. Used for e.g. VM tests so they can verify they're testing what they
	think they're testing.
	0 implies a vanilla heap context.
	Bit 0 = is or was married to a frame
	Bit 1 = is still married to a frame
	Bit 2 = frame is executing machine code
	Bit 3 = has machine code pc (as opposed to nil or a bytecode pc)
	Bit 4 = method is currently compiled to machine code */

	/* CoInterpreterPrimitives>>#primitiveContextXray */
static void
primitiveContextXray(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt context;
    sqInt flags;
    sqInt pc;
    sqInt senderOop;
    char *sp;
    char *theFP;
    sqInt theMethod;

	context = longAt(GIV(stackPointer));
	pc = longAt((context + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))));
	if (((((longAt((context + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
		if (checkIsStillMarriedContextcurrentFP(context, GIV(framePointer))) {
			/* begin frameOfMarriedContext: */
			senderOop = longAt((context + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
			assert((((senderOop) & 7) == 1));
			theFP = pointerForOop(senderOop - 1);
			if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
				flags = 7;
			}
			else {
				flags = 3;
			}
		}
		else {
			flags = 1;
		}
	}
	else {
		flags = 0;
	}
	if (((((pc) & 7) == 1))
	 && (((pc >> 3)) < 0)) {
		flags = flags | 8;
	}
	theMethod = longAt((context + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
	if (((theMethod & (tagMask())) == 0)
	 && ((((((usqInt) (longAt(theMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
	 && (isCogMethodReference(longAt((theMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))))))) {
		flags = flags | 16;
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)flags << 3) | 1));
	GIV(stackPointer) = sp;
}


/*	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. */

	/* CoInterpreterPrimitives>>#primitiveEnterCriticalSection */
static void
primitiveEnterCriticalSection(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeProc;
    sqInt criticalSection;
    int inInterpreter;
    sqInt objOop;
    sqInt objOop1;
    sqInt owningProcess;
    sqInt owningProcessIndex;
    char *sp;
    char *sp1;
    char *sp2;

	if (GIV(argumentCount) > 0) {

		/* rcvr */
		criticalSection = longAt(GIV(stackPointer) + (1 * BytesPerWord));
		activeProc = longAt(GIV(stackPointer));
	}
	else {

		/* rcvr */
		criticalSection = longAt(GIV(stackPointer));
		/* begin fetchPointer:ofObject: */
		objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
		objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
		activeProc = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
	}

	/* CriticalSections are laid out like Semaphores */
	owningProcessIndex = ExcessSignalsIndex;
	owningProcess = longAt((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(owningProcessIndex) << (shiftForWord())))));
	if (owningProcess == GIV(nilObj)) {
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(criticalSection)));
		if ((assert(isNonImmediate(criticalSection)),
		oopisGreaterThanOrEqualTo(criticalSection, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((activeProc & (tagMask())) == 0)
			 && (oopisLessThan(activeProc, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(criticalSection))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(criticalSection);
				}
			}
		}
		longAtput((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(owningProcessIndex) << (shiftForWord())))), activeProc);
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), GIV(falseObj));
		GIV(stackPointer) = sp;
		return;
	}
	if (owningProcess == activeProc) {
		/* begin pop:thenPush: */
		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), GIV(trueObj));
		GIV(stackPointer) = sp1;
		return;
	}
	/* begin pop:thenPush: */
	longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), GIV(falseObj));
	GIV(stackPointer) = sp2;
	inInterpreter = GIV(instructionPointer) >= (startOfMemory());
	addLastLinktoList(activeProc, criticalSection);
	transferTofrom(wakeHighestPriority(), CSEnterCriticalSection);
	/* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */
	if (GIV(nextProfileTick) > 0) {
		checkProfileTick(GIV(newMethod));
	}
	returnToExecutivepostContextSwitch(inInterpreter, 1);
}


/*	Exit the critical section.
	This may change the active process as a result. */

	/* CoInterpreterPrimitives>>#primitiveExitCriticalSection */
static void
primitiveExitCriticalSection(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt criticalSection;
    int inInterpreter;
    sqInt owningProcess;
    sqInt owningProcessIndex;


	/* rcvr */
	criticalSection = longAt(GIV(stackPointer));

	/* CriticalSections are laid out like Semaphores */
	owningProcessIndex = ExcessSignalsIndex;
	if ((assert(!(isForwarded(criticalSection))),
	(longAt((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))))) == GIV(nilObj))) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(criticalSection)));
		longAtput((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(owningProcessIndex) << (shiftForWord())))), GIV(nilObj));
	}
	else {

		/* We're going to switch process, either to an interpreted frame or a machine
		   code frame. To know whether to return or enter machine code we have to
		   know from whence we came.  We could have come from the interpreter,
		   either directly or via a machine code primitive.  We could have come from
		   machine code.  The instructionPointer tells us where from: */
		inInterpreter = GIV(instructionPointer) >= (startOfMemory());

		/* store check unnecessary because aSemaphore referred to owningProcess
		   via its FirstLinkIndex slot before owningProcess was removed. */
		owningProcess = removeFirstLinkOfList(criticalSection);
		assert(!(isOopForwarded(criticalSection)));
		longAtput((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(owningProcessIndex) << (shiftForWord())))), owningProcess);
		if (resumepreemptedYieldingIffrom(owningProcess, GIV(preemptionYields), CSExitCriticalSection)) {
			/* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */
			if (GIV(nextProfileTick) > 0) {
				checkProfileTick(GIV(newMethod));
			}
			returnToExecutivepostContextSwitch(inInterpreter, 1);
		}
	}
}


/*	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.
 */
/*	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.
	Override to flush appropriate machine code caches also. */

	/* CoInterpreterPrimitives>>#primitiveFlushCacheByMethod */
static void
primitiveFlushCacheByMethod(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	flushMethodCacheForMethod(longAt(GIV(stackPointer)));
	unlinkSendsToandFreeIf(longAt(GIV(stackPointer)), 0);
}


/*	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. Override to also flush machine code caches. */

	/* CoInterpreterPrimitives>>#primitiveFlushCacheBySelector */
static void
primitiveFlushCacheBySelector(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt probe;
    sqInt selector;

	selector = longAt(GIV(stackPointer));
	probe = 0;
	for (i = 1; i <= MethodCacheEntries; i += 1) {
		if ((GIV(methodCache)[probe + MethodCacheSelector]) == selector) {
			GIV(methodCache)[probe + MethodCacheSelector] = 0;
		}
		probe += MethodCacheEntrySize;
	}
	if ((selector == (fetchPointerofObject(16 * 2, splObj(SpecialSelectors))))
	 || (selector == (fetchPointerofObject(17 * 2, splObj(SpecialSelectors))))) {
	}
	unlinkSendsOfisMNUSelector(selector, selector == (longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorDoesNotUnderstand) << (shiftForWord())))))));
}

	/* CoInterpreterPrimitives>>#primitiveFunctionPointerAddress */
usqInt
primitiveFunctionPointerAddress(void)
{
	return ((usqInt)((&primitiveFunctionPointer)));
}


/*	Primitive. Install the semaphore to be used for collecting long-running
	primitives, 
	or nil if no semaphore should be used. */

	/* CoInterpreterPrimitives>>#primitiveLongRunningPrimitiveSemaphore */
EXPORT(sqInt)
primitiveLongRunningPrimitiveSemaphore(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeContext;
    int flushState;
    sqInt sema;
    char *sp;

	if (GIV(argumentCount) != 1) {
		return (GIV(primFailCode) = PrimErrBadNumArgs);
	}
	sema = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	if (sema == GIV(nilObj)) {
		flushState = GIV(longRunningPrimitiveCheckSemaphore) != null;
		GIV(longRunningPrimitiveCheckSemaphore) = null;
	}
	else {
		flushState = GIV(longRunningPrimitiveCheckSemaphore) == null;
		if (!(((sema & (tagMask())) == 0)
			 && (((longAt(sema)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord())))))))))) {
			return (GIV(primFailCode) = PrimErrBadArgument);
		}
		GIV(longRunningPrimitiveCheckSemaphore) = sema;
	}
	if (flushState) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp;
		activeContext = voidVMStateForSnapshotFlushingExternalPrimitivesIf(0);
		marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
		assert((((stackValue(0)) == (nilObject()))
		 && (GIV(longRunningPrimitiveCheckSemaphore) == null))
		 || (((stackValue(0)) == GIV(longRunningPrimitiveCheckSemaphore))
		 && (isSemaphoreOop(sema))));
	}
	voidLongRunningPrimitive("install");
	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	if (flushState) {
		siglongjmp(reenterInterpreter, ReturnToInterpreter);
	}
	return 0;
}

	/* CoInterpreterPrimitives>>#primitiveMethodPCData */
EXPORT(sqInt)
primitiveMethodPCData(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt cm;
    CogMethod *cogMethod;
    sqInt data;
    sqInt data1;
    sqInt methodHeader;
    sqInt methodReceiver;
    sqInt nEntries;
    sqInt nSlots;
    char *sp;

	if (GIV(argumentCount) != 0) {
		return (GIV(primFailCode) = PrimErrBadNumArgs);
	}
	methodReceiver = longAt(GIV(stackPointer));
	data = 0;
	if ((assert(isNonImmediate(methodReceiver)),
	isCogMethodReference(longAt((methodReceiver + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
		/* begin pcDataFor: */
		methodHeader = longAt((methodReceiver + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader))
		 && ((((usqInt)methodHeader)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader);
		cm = (cogMethod->methodObject);
		nSlots = (((byteSizeOf(cm)) - (((literalCountOfMethodHeader(methodHeaderOf(cm))) + LiteralStart) * BytesPerOop)) * 2) + ((8 /* allocationUnit */ * 2) / BytesPerOop);
		data1 = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassArray) << (shiftForWord()))))), nSlots);
		if (!(data1)) {
			data = -1;
			goto l1;
		}
		nEntries = mapPCDataForinto(cogMethod, data1);
		if (nEntries == 0) {
			data = 0;
			goto l1;
		}
		if (nEntries < nSlots) {
			shortentoIndexableSize(data1, nEntries);
		}
		data = data1;
	l1:	/* end pcDataFor: */;
		if (data == -1) {
			return (GIV(primFailCode) = PrimErrNoMemory);
		}
	}
	if (data == 0) {
		data = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassArray) << (shiftForWord()))))), 0);
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), data);
	GIV(stackPointer) = sp;
	return 0;
}


/*	Lift the veil from a method and answer an integer describing the interior
	state of its machine code.
	Used for e.g. VM tests so they can verify they're testing what they think
	they're testing.
	0 implies a vanilla method.
	Bit 0 = method might be compiled to machine code
	Bit 1 = method is currently compiled to machine code
	Bit 2 = is compiled frameless.
	Bit 3 = method refers to young object.
	Bit 4 = method too big to be jitted (more than 64k of code, or needs more
	than 1.5Mb of stack space to compile)
	Bit 5 = method contains unknown/unjittable bytecode
	Bit 6 = method should not be jitted because it contains a primitive not to
	be called from machine code (unused) */

	/* CoInterpreterPrimitives>>#primitiveMethodXray */
static void
primitiveMethodXray(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt alreadyCogged;
    CogMethod *cogMethod;
    sqInt flags;
    sqInt methodHeader;
    char *sp;

	if (methodWithHeaderShouldBeCogged(methodHeaderOf(longAt(GIV(stackPointer))))) {
		/* begin maybeMethodHasCogMethod: */
		alreadyCogged = (((longAt(GIV(stackPointer))) & (tagMask())) == 0)
		 && ((((((usqInt) (longAt(longAt(GIV(stackPointer))))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
		 && (isCogMethodReference(longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord()))))))));
		flags = 1;
		if (!alreadyCogged) {
			cogMethod = cogselector(longAt(GIV(stackPointer)), GIV(nilObj));
			if ((cogMethod == null)
			 && (GIV(cogCompiledCodeCompactionCalledFor))) {
				commenceCogCompiledCodeCompaction();
				cogMethod = cogselector(longAt(GIV(stackPointer)), GIV(nilObj));
			}
			
			switch (((sqInt)cogMethod)) {
			case MethodTooBig:
				flags = 1 + 16;
				break;
			case EncounteredUnknownBytecode:
				flags = 1 + 32;
				break;
			case ShouldNotJIT:
				flags = 1 + 64;
				break;
			default:
				assert(!(((((((sqInt)cogMethod)) >= MaxNegativeErrorCode) && ((((sqInt)cogMethod)) <= NotFullyInitialized)))));

			}
		}
		if ((flags == 1)
		 && ((((longAt(GIV(stackPointer))) & (tagMask())) == 0)
		 && ((((((usqInt) (longAt(longAt(GIV(stackPointer))))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
		 && (isCogMethodReference(longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))))) {
			/* begin cogMethodOf: */
			methodHeader = longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
			assert((isNonImmediate(methodHeader))
			 && ((((usqInt)methodHeader)) < (startOfMemory())));
			cogMethod = ((CogMethod *) methodHeader);
			flags = (((cogMethod->stackCheckOffset)) == 0
				? 7
				: 3);
			if ((cogMethod->cmRefersToYoung)) {
				flags += 8;
			}
			if (!alreadyCogged) {
				freeMethod(cogMethod);
			}
		}
	}
	else {
		flags = 0;
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)flags << 3) | 1));
	GIV(stackPointer) = sp;
}

	/* CoInterpreterPrimitives>>#primitiveMinimumUnusedHeadroom */
EXPORT(void)
primitiveMinimumUnusedHeadroom(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;
    char *sp;

	/* begin methodReturnValue: */
	oop = (((usqInt)(minimumUnusedHeadroom()) << 3) | 1);
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}


/*	Defined for CompiledMethods only */

	/* CoInterpreterPrimitives>>#primitiveObjectAt */
static void
primitiveObjectAt(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt index;
    sqInt integerPointer;
    sqInt oop;
    sqInt rawHeader;
    sqInt realHeader;
    char *sp;
    sqInt thisReceiver;

	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		index = (integerPointer >> 3);
		goto l1;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		index = 0;
		goto l1;
	}
	l1:	/* end stackIntegerValue: */;
	if (GIV(primFailCode)) {
		(GIV(primFailCode) = PrimErrBadArgument);
		return;
	}
	thisReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	rawHeader = longAt((thisReceiver + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	realHeader = ((assert(((((rawHeader) & 7) == 1))
		 || (((((usqInt)rawHeader)) < (startOfMemory()))
		 && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))),
	(rawHeader & (smallIntegerTag())) == 0)
		? ((((CogMethod *) rawHeader))->methodHeader)
		: rawHeader);
	if (!((index > 0)
		 && (index <= (((assert((((realHeader) & 7) == 1)),
((realHeader >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart)))) {
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	/* begin pop:thenPush: */
	oop = (index == 1
		? realHeader
		: longAt((thisReceiver + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord()))))));
	longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}


/*	Store a literal into a CompiledMethod at the given index. Defined for
	CompiledMethods only.
 */

	/* CoInterpreterPrimitives>>#primitiveObjectAtPut */
static void
primitiveObjectAtPut(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt index;
    sqInt newValue;
    sqInt rawHeader;
    sqInt realHeader;
    char *sp;
    sqInt thisReceiver;

	newValue = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((index & (smallIntegerTag())) == 0) {
		(GIV(primFailCode) = PrimErrBadArgument);
		return;
	}
	index = (index >> 3);
	thisReceiver = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(thisReceiver))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		(GIV(primFailCode) = PrimErrNoModification);
		return;
	}
	rawHeader = longAt((thisReceiver + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	realHeader = ((assert(((((rawHeader) & 7) == 1))
		 || (((((usqInt)rawHeader)) < (startOfMemory()))
		 && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))),
	(rawHeader & (smallIntegerTag())) == 0)
		? ((((CogMethod *) rawHeader))->methodHeader)
		: rawHeader);
	if (!((index > 0)
		 && (index <= (((assert((((realHeader) & 7) == 1)),
((realHeader >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart)))) {
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if (index == 1) {
		if (((newValue & (smallIntegerTag())) == 0)
		 || (((assert((((newValue) & 7) == 1)),
		((newValue >> 3)) & AlternateHeaderNumLiteralsMask)) != ((assert((((realHeader) & 7) == 1)),
		((realHeader >> 3)) & AlternateHeaderNumLiteralsMask)))) {
			(GIV(primFailCode) = PrimErrBadArgument);
			return;
		}
		if ((assert(((((rawHeader) & 7) == 1))
			 || (((((usqInt)rawHeader)) < (startOfMemory()))
			 && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))),
		(rawHeader & (smallIntegerTag())) == 0)) {
			((((CogMethod *) rawHeader))->methodHeader = newValue);
		}
		else {
			assert(!(isOopForwarded(thisReceiver)));
			longAtput((thisReceiver + BaseHeaderSize) + (0U << (shiftForWord())), newValue);
		}
	}
	else {
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(thisReceiver)));
		if ((assert(isNonImmediate(thisReceiver)),
		oopisGreaterThanOrEqualTo(thisReceiver, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((newValue & (tagMask())) == 0)
			 && (oopisLessThan(newValue, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(thisReceiver))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(thisReceiver);
				}
			}
		}
		longAtput((thisReceiver + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))), newValue);
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), newValue);
	GIV(stackPointer) = sp;
}


/*	Primitive. Install the semaphore to be used for profiling, 
	or nil if no semaphore should be used.
	See also primitiveProfileStart. */

	/* CoInterpreterPrimitives>>#primitiveProfileSemaphore */
EXPORT(sqInt)
primitiveProfileSemaphore(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeContext;
    int flushState;
    sqInt sema;
    char *sp;

	if (GIV(argumentCount) != 1) {
		return (GIV(primFailCode) = PrimErrBadNumArgs);
	}
	sema = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	if (sema == GIV(nilObj)) {
		flushState = GIV(profileSemaphore) != GIV(nilObj);
	}
	else {
		flushState = GIV(profileSemaphore) == GIV(nilObj);
		if (!(((sema & (tagMask())) == 0)
			 && (((longAt(sema)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord())))))))))) {
			return (GIV(primFailCode) = PrimErrBadArgument);
		}
	}

	/* If we've switched profiling on or off we must void machine code
	   (and machine code pcs in contexts) since we will start or stop
	   testing the profile clock in machine code primitive invocations,
	   and so generate slightly different code from here on in. */
	GIV(profileSemaphore) = sema;
	if (flushState) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp;
		activeContext = voidVMStateForSnapshotFlushingExternalPrimitivesIf(0);
		marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
		assert((((stackValue(0)) == (nilObject()))
		 && (GIV(profileSemaphore) == (nilObject())))
		 || (((stackValue(0)) == GIV(profileSemaphore))
		 && (isSemaphoreOop(sema))));
	}
	GIV(profileProcess) = (GIV(profileMethod) = GIV(nilObj));
	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	if (flushState) {
		siglongjmp(reenterInterpreter, ReturnToInterpreter);
	}
	return 0;
}


/*	Put this process on the scheduler's lists thus allowing it to proceed next
	time there is
	a chance for processes of it's priority level. It must go to the back of
	its run queue so
	as not to preempt any already running processes at this level. If the
	process's priority
	is higher than the current process, preempt the current process. */

	/* CoInterpreterPrimitives>>#primitiveResume */
static void
primitiveResume(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    int inInterpreter;
    sqInt proc;


	/* rcvr */
	proc = longAt(GIV(stackPointer));
	if (!(isContext(followFieldofObject(SuspendedContextIndex, proc)))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	inInterpreter = GIV(instructionPointer) >= (startOfMemory());
	if (resumepreemptedYieldingIffrom(proc, GIV(preemptionYields), CSResume)) {
		/* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */
		if (GIV(nextProfileTick) > 0) {
			checkProfileTick(GIV(newMethod));
		}
		returnToExecutivepostContextSwitch(inInterpreter, 1);
	}
}


/*	Synchronously signal the semaphore.
	This may change the active process as a result. */
/*	We may be about to switch process, either to an interpreted frame or a
	machine code frame. To know whether to return or enter machine code
	we have to know from whence we came. We could have come from the
	interpreter, either directly or via a machine code primitive. We could
	have come from machine code. The instructionPointer tells us where from: */

	/* CoInterpreterPrimitives>>#primitiveSignal */
static void
primitiveSignal(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    int inInterpreter;

	inInterpreter = GIV(instructionPointer) >= (startOfMemory());
	if (synchronousSignal(longAt(GIV(stackPointer)))) {
		/* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */
		if (GIV(nextProfileTick) > 0) {
			checkProfileTick(GIV(newMethod));
		}
		returnToExecutivepostContextSwitch(inInterpreter, 1);
	}
}


/*	Save a normal snapshot under the same name as it was loaded
	unless it has been renamed by the last primitiveImageName.
	
	Override to jump to the interpreter because the machine code zone is now
	void. 
 */

	/* CoInterpreterPrimitives>>#primitiveSnapshot */
static void
primitiveSnapshot(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	snapshot(0);
	if ((longAt(GIV(framePointer) + FoxMethod)) == GIV(newMethod)) {

		/* snapshot: has reached the end and built a frame.
		   In the JIT we need to back-up the pc before reentering the interpreter. */
		GIV(instructionPointer) -= 1;
	}
	siglongjmp(reenterInterpreter, ReturnToInterpreter);
}


/*	Save an embedded snapshot.
	
	Override to jump to the interpreter because the machine code zone is now
	void. 
 */

	/* CoInterpreterPrimitives>>#primitiveSnapshotEmbedded */
static void
primitiveSnapshotEmbedded(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	snapshot(1);
	if ((longAt(GIV(framePointer) + FoxMethod)) == GIV(newMethod)) {

		/* snapshot: has reached the end and built a frame.
		   In the JIT we need to back-up the pc before reentering the interpreter. */
		GIV(instructionPointer) -= 1;
	}
	siglongjmp(reenterInterpreter, ReturnToInterpreter);
}


/*	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.
 */

	/* CoInterpreterPrimitives>>#primitiveSuspend */
static void
primitiveSuspend(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstLink;
    int inInterpreter;
    sqInt lastLink;
    sqInt myList;
    sqInt nextLink;
    sqInt process;
    sqInt referent;
    char *sp;
    char *sp1;
    sqInt tempLink;
    sqInt valuePointer;

	process = longAt(GIV(stackPointer));
	if (process == (fetchPointerofObject(ActiveProcessIndex, schedulerPointer()))) {

		/* We're going to switch process, either to an interpreted frame or a machine
		   code frame. To know whether to return or enter machine code we have to
		   know from whence we came.  We could have come from the interpreter,
		   either directly or via a machine code primitive.  We could have come from
		   machine code.  The instructionPointer tells us where from: */
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), GIV(nilObj));
		GIV(stackPointer) = sp;
		inInterpreter = GIV(instructionPointer) >= (startOfMemory());
		transferTofrom(wakeHighestPriority(), CSSuspend);
		/* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */
		if (GIV(nextProfileTick) > 0) {
			checkProfileTick(GIV(newMethod));
		}
		returnToExecutivepostContextSwitch(inInterpreter, 1);
		return;
	}

	/* 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 + BaseHeaderSize) + (((sqInt)((usqInt)(MyListIndex) << (shiftForWord())))));
	if (myList == GIV(nilObj)) {
		(GIV(primFailCode) = PrimErrBadReceiver);
		return;
	}
	if (((longAt(myList)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(myList));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((myList + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		myList = referent;
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(process)));
		if ((assert(isNonImmediate(process)),
		oopisGreaterThanOrEqualTo(process, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((myList & (tagMask())) == 0)
			 && (oopisLessThan(myList, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(process))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(process);
				}
			}
		}
		longAtput((process + BaseHeaderSize) + (((sqInt)((usqInt)(MyListIndex) << (shiftForWord())))), myList);
	}
	/* begin removeProcess:fromList: */
	assert(!((isForwarded(process))));
	assert(!((isForwarded(myList))));
	/* begin fetchPointer:ofObject: */
	firstLink = longAt((myList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))));
	/* begin fetchPointer:ofObject: */
	lastLink = longAt((myList + BaseHeaderSize) + (((sqInt)((usqInt)(LastLinkIndex) << (shiftForWord())))));
	assert(!((isForwarded(firstLink))));
	assert(!((isForwarded(lastLink))));
	if (process == firstLink) {
		/* begin fetchPointer:ofObject: */
		nextLink = longAt((process + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))));
		assert(!((isForwarded(nextLink))));
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(myList)));
		if ((assert(isNonImmediate(myList)),
		oopisGreaterThanOrEqualTo(myList, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((nextLink & (tagMask())) == 0)
			 && (oopisLessThan(nextLink, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(myList))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(myList);
				}
			}
		}
		longAtput((myList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))), nextLink);
		if (process == lastLink) {
			/* begin storePointerUnchecked:ofObject:withValue: */
			valuePointer = GIV(nilObj);
			assert(!(isOopForwarded(myList)));
			longAtput((myList + BaseHeaderSize) + (((sqInt)((usqInt)(LastLinkIndex) << (shiftForWord())))), valuePointer);
		}
	}
	else {
		tempLink = firstLink;
		while (1) {
			assert(!((isForwarded(tempLink))));
			if (tempLink == GIV(nilObj)) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				goto l17;
			}
			/* begin fetchPointer:ofObject: */
			nextLink = longAt((tempLink + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))));
			if (nextLink == process) break;
			/* begin fetchPointer:ofObject: */
			tempLink = longAt((tempLink + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))));
		}
		/* begin fetchPointer:ofObject: */
		nextLink = longAt((process + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))));
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(tempLink)));
		if ((assert(isNonImmediate(tempLink)),
		oopisGreaterThanOrEqualTo(tempLink, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((nextLink & (tagMask())) == 0)
			 && (oopisLessThan(nextLink, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(tempLink))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(tempLink);
				}
			}
		}
		longAtput((tempLink + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))), nextLink);
		if (process == lastLink) {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(myList)));
			if ((assert(isNonImmediate(myList)),
			oopisGreaterThanOrEqualTo(myList, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((tempLink & (tagMask())) == 0)
				 && (oopisLessThan(tempLink, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(myList))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(myList);
					}
				}
			}
			longAtput((myList + BaseHeaderSize) + (((sqInt)((usqInt)(LastLinkIndex) << (shiftForWord())))), tempLink);
		}
	}
	/* begin storePointer:ofObject:withValue: */
	assert(!(isForwarded(process)));
	if ((assert(isNonImmediate(process)),
	oopisGreaterThanOrEqualTo(process, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((GIV(nilObj) & (tagMask())) == 0)
		 && (oopisLessThan(GIV(nilObj), GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(process))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(process);
			}
		}
	}
	longAtput((process + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))), GIV(nilObj));
	l17:	/* end removeProcess:fromList: */;
	if (!GIV(primFailCode)) {
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(process)));
		if ((assert(isNonImmediate(process)),
		oopisGreaterThanOrEqualTo(process, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((GIV(nilObj) & (tagMask())) == 0)
			 && (oopisLessThan(GIV(nilObj), GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(process))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(process);
				}
			}
		}
		longAtput((process + BaseHeaderSize) + (((sqInt)((usqInt)(MyListIndex) << (shiftForWord())))), GIV(nilObj));
		/* begin pop:thenPush: */
		longAtput((sp1 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), myList);
		GIV(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. 
	Override to ensure the caller's saved ip is correct, i.e. if an
	interpreter frame it may
	have to move to iframeSavedIP. */

	/* CoInterpreterPrimitives>>#primitiveTerminateTo */
static void
primitiveTerminateTo(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aContextOrNil;
    sqInt callerContextOrNil;
    sqInt callerContextOrNil1;
    char *callerFP;
    char *callerFP1;
    char *callerFP2;
    char *contextsFP;
    usqInt contextsIP;
    char *contextsSP;
    sqInt currentCtx;
    char *fp;
    char *fp1;
    char *fp2;
    char *frameAbove;
    char *newFP;
    char *newSP;
    sqInt nextCntx;
    sqInt numArgs;
    StackPage *pageToStopOn;
    sqInt senderOop;
    sqInt senderOop1;
    sqInt senderOop2;
    sqInt senderOop3;
    sqInt senderOop4;
    sqInt senderOop5;
    char *source;
    sqInt stackedReceiverOffset;
    char *theFP;
    char *theFP1;
    StackPage *thePage;
    StackPage *thePage1;
    StackPage *thePage2;
    sqInt thisCtx;
    sqInt valuePointer;
    sqInt valuePointer1;

	contextsFP = ((char *) 0);
	aContextOrNil = longAt(GIV(stackPointer));
	if (!((aContextOrNil == GIV(nilObj))
		 || (((aContextOrNil & (tagMask())) == 0)
		 && (((longAt(aContextOrNil)) & (classIndexMask())) == ClassMethodContextCompactIndex)))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	thisCtx = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (thisCtx == aContextOrNil) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if ((aContextOrNil != GIV(nilObj))
	 && ((((((longAt((aContextOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(aContextOrNil))))) {
		/* begin frameOfMarriedContext: */
		senderOop = longAt((aContextOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop) & 7) == 1));
		contextsFP = pointerForOop(senderOop - 1);
		/* begin stackPageFor: */
		pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	}
	else {
		pageToStopOn = 0;
	}
	if ((((((longAt((thisCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(thisCtx)))) {
		/* begin frameOfMarriedContext: */
		senderOop2 = longAt((thisCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop2) & 7) == 1));
		theFP = pointerForOop(senderOop2 - 1);
		if ((theFP == GIV(framePointer))
		 && (pageToStopOn == GIV(stackPage))) {
			assertValidStackedInstructionPointersInline(GIV(stackPage), __LINE__);
			if ((pointerForOop(longAt(theFP + FoxSavedFP))) != contextsFP) {
				/* begin frameStackedReceiverOffsetNumArgs: */
				numArgs = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((mframeCogMethod(theFP))->cmNumArgs)
					: byteAt((theFP + FoxIFrameFlags) + 1));
				stackedReceiverOffset = (FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord()))));
				/* begin findFrameAbove:inPage: */
				fp = (pageToStopOn->headFP);
				if (fp == contextsFP) {
					frameAbove = 0;
					goto l5;
				}
				while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) {
					if (callerFP == contextsFP) {
						frameAbove = fp;
						goto l5;
					}
					fp = callerFP;
				}
				error("did not find theFP in stack page");
				frameAbove = 0;
	l5:	/* end findFrameAbove:inPage: */;
				contextsIP = ((usqInt)(pointerForOop(longAt(frameAbove + FoxCallerSavedIP))));
				assert((((((usqInt)contextsIP)) >= (startOfMemory()))
				 || (contextsIP == (ceReturnToInterpreterPC()))) == (!(isMachineCodeFrame(contextsFP))));
				assert(!(isBaseFrame(frameAbove)));
				newSP = (frameAbove + (frameStackedReceiverOffset(frameAbove))) + BytesPerWord;
				newFP = (newSP - stackedReceiverOffset) - BytesPerWord;
				for (source = (theFP + stackedReceiverOffset); source >= GIV(stackPointer); source += (-BytesPerWord)) {
					newSP -= BytesPerWord;
					longAtput(newSP, longAt(source));
				}
				longAtput(newFP + FoxSavedFP, contextsFP);
				if (((((usqInt)(longAt(newFP + FoxMethod)))) < (startOfMemory()))
				 && (contextsIP >= (startOfMemory()))) {
					/* begin iframeSavedIP:put: */
					assert(!(isMachineCodeFrame(contextsFP)));
					longAtput(contextsFP + FoxIFSavedIP, contextsIP);
					contextsIP = ceReturnToInterpreterPC();
				}
				longAtput(newFP + FoxCallerSavedIP, contextsIP);
				assert(isContext(thisCtx));
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(thisCtx)));
				longAtput((thisCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), (assert(((oopForPointer(newFP)) & (BytesPerWord - 1)) == 0),
				(oopForPointer(newFP)) + (smallIntegerTag())));
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(thisCtx)));
				longAtput((thisCtx + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), (assert(((oopForPointer(contextsFP)) & (BytesPerWord - 1)) == 0),
				(oopForPointer(contextsFP)) + (smallIntegerTag())));
				GIV(framePointer) = newFP;
				GIV(stackPointer) = newSP;
			}
			/* begin pop: */
			GIV(stackPointer) += 1 * BytesPerWord;
			assertValidStackedInstructionPointersInline(GIV(stackPage), __LINE__);
			assert(GIV(stackPage) == (mostRecentlyUsedPage()));
			return;
		}
		assertValidStackedInstructionPointers(__LINE__);

		/* May cause a GC!! */
		theFP = externalEnsureIsBaseFrame(theFP);
		/* begin frameCallerContext: */
		assert(isBaseFrame(theFP));
		/* begin stackPageFor: */
		thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		callerContextOrNil = longAt((thePage1->baseAddress));
		assert(addressCouldBeObj(callerContextOrNil));
		assert((callerContextOrNil == (nilObject()))
		 || (isContext(callerContextOrNil)));
		currentCtx = callerContextOrNil;
		if ((aContextOrNil != GIV(nilObj))
		 && ((((((longAt((aContextOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(aContextOrNil))))) {
			/* begin frameOfMarriedContext: */
			senderOop1 = longAt((aContextOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
			assert((((senderOop1) & 7) == 1));
			contextsFP = pointerForOop(senderOop1 - 1);
			/* begin stackPageFor: */
			pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))),
			pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		}
		else {
			pageToStopOn = 0;
		}
	}
	else {
		currentCtx = longAt((thisCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	}
	assertValidStackedInstructionPointers(__LINE__);
	if (contexthasSender(thisCtx, aContextOrNil)) {

		/* Need to walk the stack freeing stack pages and nilling contexts. */
		while (!((currentCtx == aContextOrNil)
		 || (currentCtx == GIV(nilObj)))) {
			assert(isContext(currentCtx));
			if (((((longAt((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
				/* begin frameOfMarriedContext: */
				senderOop4 = longAt((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
				assert((((senderOop4) & 7) == 1));
				theFP = pointerForOop(senderOop4 - 1);
				/* begin stackPageFor: */
				thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
				pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
				if (thePage == GIV(stackPage)) {
					/* begin findFrameAbove:inPage: */
					fp1 = (thePage->headFP);
					if (fp1 == theFP) {
						frameAbove = 0;
						goto l19;
					}
					while (((callerFP1 = pointerForOop(longAt(fp1 + FoxSavedFP)))) != 0) {
						if (callerFP1 == theFP) {
							frameAbove = fp1;
							goto l19;
						}
						fp1 = callerFP1;
					}
					error("did not find theFP in stack page");
					frameAbove = 0;
	l19:	/* end findFrameAbove:inPage: */;
					assert(frameAbove != 0);

					/* May cause a GC!! May also reclaim aContextOrNil's page, hence... */
					frameAbove = externalEnsureIsBaseFrame(frameAbove);
					if ((aContextOrNil != GIV(nilObj))
					 && ((((((longAt((aContextOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
					 && (!(isWidowedContext(aContextOrNil))))) {
						/* begin frameOfMarriedContext: */
						senderOop3 = longAt((aContextOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
						assert((((senderOop3) & 7) == 1));
						contextsFP = pointerForOop(senderOop3 - 1);
						/* begin stackPageFor: */
						pageToStopOn = stackPageAtpages((assert((((((char *) contextsFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) contextsFP)) <= (((char *) GIV(pages)))))),
						pageIndexForstackBasePlus1bytesPerPage(contextsFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
					}
					else {
						pageToStopOn = 0;
					}
				}
				else {
					if (thePage == pageToStopOn) {

						/* We're here.  Cut back the stack to aContextOrNil's frame,
						   push its instructionPointer if it's not already a head frame,
						   and we're done. */
						/* begin findFrameAbove:inPage: */
						fp2 = (thePage->headFP);
						if (fp2 == contextsFP) {
							frameAbove = 0;
							goto l20;
						}
						while (((callerFP2 = pointerForOop(longAt(fp2 + FoxSavedFP)))) != 0) {
							if (callerFP2 == contextsFP) {
								frameAbove = fp2;
								goto l20;
							}
							fp2 = callerFP2;
						}
						error("did not find theFP in stack page");
						frameAbove = 0;
	l20:	/* end findFrameAbove:inPage: */;
						if (frameAbove != 0) {
							contextsSP = ((assert(!(isBaseFrame(frameAbove))),
(frameAbove + (frameStackedReceiverOffset(frameAbove))) + BytesPerWord)) - BytesPerWord;
							longAtput(contextsSP, pointerForOop(longAt(frameAbove + FoxCallerSavedIP)));
							/* begin setHeadFP:andSP:inPage: */
							assert(contextsSP < contextsFP);
							assert((contextsSP < ((thePage->baseAddress)))
							 && (contextsSP > (((thePage->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
							assert((contextsFP < ((thePage->baseAddress)))
							 && (contextsFP > (((thePage->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
							(thePage->headFP = contextsFP);
							(thePage->headSP = contextsSP);
						}
						currentCtx = aContextOrNil;
					}
					else {

						/* We can free the entire page without further ado. */
						/* begin frameCallerContext: */
						theFP1 = (thePage->baseFP);
						assert(isBaseFrame(theFP1));
						/* begin stackPageFor: */
						thePage2 = stackPageAtpages((assert((((((char *) theFP1)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP1)) <= (((char *) GIV(pages)))))),
						pageIndexForstackBasePlus1bytesPerPage(theFP1, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
						callerContextOrNil1 = longAt((thePage2->baseAddress));
						assert(addressCouldBeObj(callerContextOrNil1));
						assert((callerContextOrNil1 == (nilObject()))
						 || (isContext(callerContextOrNil1)));
						currentCtx = callerContextOrNil1;
						freeStackPageNoAssert(thePage);
					}
				}
			}
			else {
				nextCntx = longAt((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
				/* begin markContextAsDead: */
				assert(isContext(currentCtx));
				/* begin storePointerUnchecked:ofObject:withValue: */
				valuePointer = GIV(nilObj);
				assert(!(isOopForwarded(currentCtx)));
				longAtput((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer);
				/* begin storePointerUnchecked:ofObject:withValue: */
				valuePointer1 = GIV(nilObj);
				assert(!(isOopForwarded(currentCtx)));
				longAtput((currentCtx + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1);
				currentCtx = nextCntx;
			}
		}
	}
	assert(pageListIsWellFormed());
	if (((((longAt((thisCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
		assert(checkIsStillMarriedContextcurrentFP(thisCtx, GIV(framePointer)));
		assert(isBaseFrame(frameOfMarriedContext(thisCtx)));
		/* begin frameOfMarriedContext: */
		senderOop5 = longAt((thisCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop5) & 7) == 1));
		theFP = pointerForOop(senderOop5 - 1);
		/* begin frameCallerContext:put: */
		assert((aContextOrNil == (nilObject()))
		 || (isContext(aContextOrNil)));
		assert(isBaseFrame(theFP));
		assert(((theFP + (frameStackedReceiverOffset(theFP))) + (2 * BytesPerWord)) == (((stackPageFor(theFP))->baseAddress)));
		assert((longAt((theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)) == (frameContext(theFP)));
		longAtput((theFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
	? ((mframeCogMethod(theFP))->cmNumArgs)
	: byteAt((theFP + FoxIFrameFlags) + 1))))) + (2 * BytesPerWord), aContextOrNil);
	}
	else {
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(thisCtx)));
		if ((assert(isNonImmediate(thisCtx)),
		oopisGreaterThanOrEqualTo(thisCtx, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((aContextOrNil & (tagMask())) == 0)
			 && (oopisLessThan(aContextOrNil, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(thisCtx))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(thisCtx);
				}
			}
		}
		longAtput((thisCtx + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), aContextOrNil);
	}
	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	assertValidStackedInstructionPointers(__LINE__);
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
}


/*	Void all internal VM state in the stack and machine code zones
	
	Override to jump to the interpreter because the machine code zone is now
	void. 
 */

	/* CoInterpreterPrimitives>>#primitiveVoidVMState */
static void
primitiveVoidVMState(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeContext;
    char *sp;

	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp;
	activeContext = voidVMStateForSnapshotFlushingExternalPrimitivesIf(0);
	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
	siglongjmp(reenterInterpreter, ReturnToInterpreter);
}


/*	The receiver (or first argument) must be a compiledMethod. The optional
	(or second) argument must be a
	boolean. Clear all VM state associated with the method, including any
	machine code, or machine code pcs
	in context objects. If the optional boolean argument is false do not scan
	the heap looking for contexts. */

	/* CoInterpreterPrimitives>>#primitiveVoidVMStateForMethod */
static void
primitiveVoidVMStateForMethod(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeContext;
    sqInt address;
    sqInt address1;
    StackPage *aPage;
    CogMethod *cogMethod;
    sqInt divorcedSome;
    sqInt divorcedSome1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt hasCogMethod;
    sqInt i;
    usqInt limit;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt methodObj;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt object;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt scanHeapForContexts;
    sqInt senderOop;
    char *sp;
    char *sp1;
    char *theFP;
    char *theFrame;
    StackPage *thePage;
    char *theSP;
    sqInt top;
    sqInt top1;


	/* See comment ''One might think...'' below */
	/* In Smalltalk allow both aMethod voidCogVMState and aMethod voidCogVMStateScanningContextsIf: aBoolean */
	scanHeapForContexts = 1;
	if (GIV(argumentCount) == 0) {
		methodObj = longAt(GIV(stackPointer));
	}
	else {
		methodObj = longAt(GIV(stackPointer) + (1 * BytesPerWord));
		/* begin booleanValueOf: */
		if ((longAt(GIV(stackPointer))) == GIV(trueObj)) {
			scanHeapForContexts = 1;
			goto l1;
		}
		if ((longAt(GIV(stackPointer))) == GIV(falseObj)) {
			scanHeapForContexts = 0;
			goto l1;
		}
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		scanHeapForContexts = null;
	l1:	/* end booleanValueOf: */;
		if (GIV(primFailCode)) {
			(GIV(primFailCode) = PrimErrBadArgument);
			return;
		}
	}
	if (GIV(argumentCount) > 1) {
		(GIV(primFailCode) = PrimErrBadNumArgs);
		return;
	}
	flushMethodCacheForMethod(methodObj);
	/* begin ensureFrameIsMarried:SP: */
	theFP = GIV(framePointer);
	theSP = GIV(stackPointer);
	if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
		assert(isContext(frameContext(theFP)));
		activeContext = longAt(theFP + FoxThisContext);
		goto l10;
	}
	activeContext = marryFrameSP(theFP, theSP);
	l10:	/* end ensureFrameIsMarried:SP: */;
	/* begin ensurePushedInstructionPointer */
	if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

		/* invoked directly from the interpreter */
		/* begin iframeSavedIP:put: */
		assert(!(isMachineCodeFrame(GIV(framePointer))));
		longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
		/* begin push: */
		object = ceReturnToInterpreterPC();
		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
		GIV(stackPointer) = sp;
	}
	else {

		/* instructionPointer == cogit ceReturnToInterpreterPC
		   ifTrue: [invoked from the interpreter via a machine code primitive]
		   ifFalse: [invoked from machine code].
		   If in the first case the bytecode instructionPointer has already been
		   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
		/* begin push: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp1;
	}
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if ((assert(isNonImmediate(methodObj)),
	/* begin isCogMethodReference: */
	(methodHeader = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))),
	assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(hasCogMethod = (methodHeader & (smallIntegerTag())) == 0))) {
		/* begin divorceMachineCodeFramesWithMethod: */
		methodHeader1 = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader1))
		 && ((((usqInt)methodHeader1)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader1);
		do {
			if (GIV(stackPage) != 0) {

				/* This is needed for the assert in externalDivorceFrame:andContext: */
				markStackPageMostRecentlyUsed(GIV(stackPage));
			}
			/* begin divorceSomeMachineCodeFramesWithMethod: */
			divorcedSome1 = 0;
			for (i = 0; i < GIV(numStackPages); i += 1) {
				/* begin stackPageAt: */
				aPage = stackPageAtpages(i, GIV(pages));
				if (!(isFree(aPage))) {

					/* this to avoid assert in externalDivorceFrame:andContext: */
					markStackPageMostRecentlyUsed(GIV(stackPage));
					if (divorceAMachineCodeFrameWithCogMethodin(cogMethod, aPage)) {
						divorcedSome1 = 1;
					}
				}
			}
			divorcedSome = divorcedSome1;
		} while(divorcedSome);
	}
	if (scanHeapForContexts) {
		/* begin ensureAllContextsWithMethodHaveBytecodePCs: */
		
		/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
		   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
		prevPrevObj = (prevObj = null);
		assert((((pastSpace()).start)) < (((eden()).start)));
		/* begin objectStartingAt: */
		address = ((pastSpace()).start);
		numSlots = byteAt(address + 7);
		objOop1 = (numSlots == (numSlotsMask())
			? address + BaseHeaderSize
			: address);
		limit = GIV(pastSpaceStart);
		while (oopisLessThan(objOop1, limit)) {
			assert(isEnumerableObjectNoAssert(objOop1));
			if ((((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)
			 && ((longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))))) == methodObj)) {
				widowOrForceToBytecodePC(objOop1);
			}
			prevPrevObj = prevObj;
			prevObj = objOop1;
			/* begin objectAfter:limit: */
			followingWordAddress = addressAfter(objOop1);
			if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
				objOop1 = limit;
				goto l17;
			}
			flag("endianness");
			followingWord = longAt(followingWordAddress);
			objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress + BaseHeaderSize
				: followingWordAddress);
	l17:	/* end objectAfter:limit: */;
		}
		/* begin objectStartingAt: */
		address1 = ((eden()).start);
		numSlots1 = byteAt(address1 + 7);
		objOop1 = (numSlots1 == (numSlotsMask())
			? address1 + BaseHeaderSize
			: address1);
		while (oopisLessThan(objOop1, GIV(freeStart))) {
			assert(isEnumerableObjectNoAssert(objOop1));
			if ((((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)
			 && ((longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))))) == methodObj)) {
				widowOrForceToBytecodePC(objOop1);
			}
			prevPrevObj = prevObj;
			prevObj = objOop1;
			/* begin objectAfter:limit: */
			followingWordAddress1 = addressAfter(objOop1);
			if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
				objOop1 = GIV(freeStart);
				goto l19;
			}
			flag("endianness");
			followingWord1 = longAt(followingWordAddress1);
			objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress1 + BaseHeaderSize
				: followingWordAddress1);
	l19:	/* end objectAfter:limit: */;
		}
		/* begin allOldSpaceObjectsDo: */
		assert(isOldObject(GIV(nilObj)));
		prevPrevObj1 = (prevObj1 = null);
		objOop11 = GIV(nilObj);
		while (1) {
			assert((objOop11 % (allocationUnit())) == 0);
			if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
			assert((long64At(objOop11)) != 0);
			if (isEnumerableObject(objOop11)) {
				if ((((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex)
				 && ((longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))))) == methodObj)) {
					widowOrForceToBytecodePC(objOop11);
				}
			}
			prevPrevObj1 = prevObj1;
			prevObj1 = objOop11;
			/* begin objectAfter:limit: */
			followingWordAddress2 = addressAfter(objOop11);
			if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
				objOop11 = GIV(endOfMemory);
				goto l15;
			}
			flag("endianness");
			followingWord2 = longAt(followingWordAddress2);
			objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress2 + BaseHeaderSize
				: followingWordAddress2);
	l15:	/* end objectAfter:limit: */;
		}
			}
	if (hasCogMethod) {
		unlinkSendsToandFreeIf(methodObj, 1);
	}
	if (!((((((longAt((activeContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(activeContext))))) {
		/* begin zeroStackPage */
		assert((GIV(stackPage) == 0)
		 || ((((GIV(stackPage)->headFP)) == GIV(framePointer))
		 && (((GIV(stackPage)->headSP)) == GIV(stackPointer))));
		GIV(stackPage) = 0;
		marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
		/* begin popStack */
		top = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		assert((methodObj == (stackTop()))
		 || ((GIV(argumentCount) > 0)
		 && (methodObj == (stackValue(1)))));
		/* begin pop: */
		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
		siglongjmp(reenterInterpreter, ReturnToInterpreter);
	}
	/* begin frameOfMarriedContext: */
	senderOop = longAt((activeContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop) & 7) == 1));
	theFrame = pointerForOop(senderOop - 1);
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	assert(((thePage->headFP)) == theFrame);
	/* begin setStackPageAndLimit: */
	assert(thePage != 0);
	GIV(stackPage) = thePage;
	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
	}
	markStackPageMostRecentlyUsed(thePage);
	/* begin setStackPointersFromPage: */
	GIV(stackPointer) = (thePage->headSP);
	GIV(framePointer) = (thePage->headFP);
	/* begin popStack */
	top1 = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top1;
	assert((methodObj == (stackTop()))
	 || ((GIV(argumentCount) > 0)
	 && (methodObj == (stackValue(1)))));
	/* begin pop: */
	GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
}

	/* CoInterpreterPrimitives>>#primitiveWait */
static void
primitiveWait(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeProc;
    sqInt excessSignals;
    int inInterpreter;
    sqInt objOop;
    sqInt objOop1;
    sqInt sema;


	/* rcvr */
	sema = longAt(GIV(stackPointer));
	excessSignals = fetchIntegerofObject(ExcessSignalsIndex, sema);
	if (excessSignals > 0) {
		/* begin storeInteger:ofObject:withValue: */
		if ((((((usqInt) (excessSignals - 1)) >> 60) + 1) & 15) <= 1) {
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(sema)));
			longAtput((sema + BaseHeaderSize) + (((sqInt)((usqInt)(ExcessSignalsIndex) << (shiftForWord())))), (((usqInt)(excessSignals - 1) << 3) | 1));
		}
		else {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
	else {

		/* We're going to switch process, either to an interpreted frame or a machine
		   code frame. To know whether to return or enter machine code we have to
		   know from whence we came.  We could have come from the interpreter,
		   either directly or via a machine code primitive.  We could have come from
		   machine code.  The instructionPointer tells us where from: */
		inInterpreter = GIV(instructionPointer) >= (startOfMemory());
		/* begin fetchPointer:ofObject: */
		objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
		objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
		activeProc = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
		addLastLinktoList(activeProc, sema);
		transferTofrom(wakeHighestPriority(), CSWait);
		/* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */
		if (GIV(nextProfileTick) > 0) {
			checkProfileTick(GIV(newMethod));
		}
		returnToExecutivepostContextSwitch(inInterpreter, 1);
	}
}


/*	primitively do the equivalent of Process>yield */

	/* CoInterpreterPrimitives>>#primitiveYield */
static void
primitiveYield(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeProc;
    int inInterpreter;
    sqInt objOop;
    sqInt oop;
    sqInt priority;
    sqInt processList;
    sqInt processLists;
    sqInt scheduler;

	/* begin fetchPointer:ofObject: */
	objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	scheduler = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	activeProc = longAt((scheduler + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
	/* begin quickFetchInteger:ofObject: */
	oop = longAt((activeProc + BaseHeaderSize) + (((sqInt)((usqInt)(PriorityIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	priority = (oop >> 3);
	processLists = longAt((scheduler + BaseHeaderSize) + (((sqInt)((usqInt)(ProcessListsIndex) << (shiftForWord())))));
	processList = longAt((processLists + BaseHeaderSize) + (((sqInt)((usqInt)((priority - 1)) << (shiftForWord())))));
	if ((assert(!(isForwarded(processList))),
	(longAt((processList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))))) == GIV(nilObj))) {
		return;
	}
	inInterpreter = GIV(instructionPointer) >= (startOfMemory());
	addLastLinktoList(activeProc, processList);
	transferTofrom(wakeHighestPriority(), CSYield);
	/* begin forProcessPrimitiveReturnToExecutivePostContextSwitch: */
	if (GIV(nextProfileTick) > 0) {
		checkProfileTick(GIV(newMethod));
	}
	returnToExecutivepostContextSwitch(inInterpreter, 1);
}

	/* CoInterpreterPrimitives>>#unmarkAllFrames */
static void
unmarkAllFrames(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt flags;
    sqInt i;
    sqInt methodField;
    char *theFP;
    StackPage *thePage;

	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		if (!(isFree(thePage))) {
			theFP = (thePage->headFP);
			do {
				methodField = longAt(theFP + FoxMethod);
				if ((((usqInt)methodField)) < (startOfMemory())) {
					if ((methodField & 4) != 0) {
						longAtput(theFP + FoxMethod, methodField - 4);
					}
				}
				else {
					flags = longAt(theFP + FoxIFrameFlags);
					if ((flags & 2) != 0) {
						longAtput(theFP + FoxIFrameFlags, flags - 2);
					}
				}
			} while(((theFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0);
		}
	}
}


/*	Initialize the stack pages. In the C VM theStackPages will be alloca'ed
	memory to hold the
	stack pages on the C stack. In the simulator they are housed in the memory
	between the
	cogMethodZone and the heap. */

	/* CoInterpreterStackPages>>#initializeStack:numSlots:pageSize: */
static void NoDbgRegParms
initializeStacknumSlotspageSize(char *theStackPages, sqInt stackSlots, sqInt slotsPerPage)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt count;
    sqInt index;
    sqInt numPages;
    StackPage *page;
    char *pageStructBase;
    usqIntptr_t structStackPageSize;
    sqInt theIndex;

	structStackPageSize = sizeof(CogStackPage);
	GIV(bytesPerPage) = slotsPerPage * BytesPerWord;

	/* Because stack pages grow down baseAddress is at the top of a stack page and so to avoid
	   subtracting BytesPerWord from baseAddress and lastAddress in the init loop below we simply
	   push the stackPage array up one word to avoid the overlap.  This word is extraStackBytes. */
	numPages = GIV(numStackPages);
	pageStructBase = (theStackPages + (numPages * GIV(bytesPerPage))) + BytesPerWord;

	/* make sure there's enough headroom */
	GIV(pages) = ((StackPage *) pageStructBase);
	assert((((stackPageByteSize()) - (stackLimitBytes())) - (stackLimitOffset())) >= (stackPageHeadroom()));
	for (index = 0; index < numPages; index += 1) {
		/* begin stackPageAt: */
		page = stackPageAtpages(index, GIV(pages));
		(page->lastAddress = theStackPages + (index * GIV(bytesPerPage)));
		(page->baseAddress = ((page->lastAddress)) + GIV(bytesPerPage));
		(page->stackLimit = ((page->baseAddress)) - ((((stackPageFrameBytes()) < (((stackPageByteSize()) - ((IFrameSlots + 64) * BytesPerWord)) - (osCogStackPageHeadroom()))) ? (stackPageFrameBytes()) : (((stackPageByteSize()) - ((IFrameSlots + 64) * BytesPerWord)) - (osCogStackPageHeadroom())))));
		(page->realStackLimit = (page->stackLimit));
		(page->baseFP = 0);
		(page->nextPage = stackPageAt((index == (numPages - 1)
			? 0
			: index + 1)));
		(page->prevPage = stackPageAt((index == 0
			? numPages - 1
			: index - 1)));
	}
	GIV(stackBasePlus1) = (((char *) theStackPages)) + 1;
	/* begin stackPageAt: */
	page = stackPageAtpages(0, GIV(pages));
	GIV(overflowLimit) = ((((page->baseAddress)) - ((page->realStackLimit))) * 3) / 5;
	for (index = 0; index < numPages; index += 1) {
		/* begin stackPageAt: */
		page = stackPageAtpages(index, GIV(pages));
		assert((pageIndexFor((page->baseAddress))) == index);
		assert((pageIndexFor(((page->baseAddress)) - ((slotsPerPage - 1) * BytesPerWord))) == index);
		assert((stackPageFor((page->baseAddress))) == page);
		assert((stackPageFor((page->stackLimit))) == page);
		/* begin initializePageTraceToInvalid: */
		(page->trace = StackPageTraceInvalid);
	}
	/* begin stackPageAt: */
	GIV(mostRecentlyUsedPage) = stackPageAtpages(0, GIV(pages));
	page = GIV(mostRecentlyUsedPage);
	count = 0;
	do {
		count += 1;
		assert((((((char *) ((page->baseAddress)))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) ((page->baseAddress)))) <= (((char *) GIV(pages))))));
		theIndex = pageIndexForstackBasePlus1bytesPerPage((page->baseAddress), GIV(stackBasePlus1), GIV(bytesPerPage));
		assert((stackPageAt(theIndex)) == page);
		assert((pageIndexFor((page->baseAddress))) == theIndex);
		assert((pageIndexFor((page->stackLimit))) == theIndex);
		assert((pageIndexFor(((page->lastAddress)) + 1)) == theIndex);
	} while(((page = (page->nextPage))) != GIV(mostRecentlyUsedPage));
	assert(count == numPages);
	assert(pageListIsWellFormed());
}


/*	<Integer> */
/*	Answer the page index for a pointer into stack memory, i.e. the index
	for the page the address is in. N.B. This is a zero-relative index. */

	/* CoInterpreterStackPages>>#pageIndexFor: */
static sqInt NoDbgRegParms
pageIndexFor(void *pointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages))))));
	return pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage));
}

	/* InterpreterPrimitives>>#canBeImmutable: */
#if IMMUTABILITY
static sqInt NoDbgRegParms
canBeImmutable(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objOop;
    sqInt processLists;
    sqInt scheduler;

	assert(isNonImmediate(oop));
	if (((oop & (tagMask())) == 0)
	 && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		return 0;
	}
	if ((assert(isNonImmediate(oop)),
	isEphemeronFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())))) {
		return 0;
	}
	if (isWeakFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))) {
		return 0;
	}
	if (((longAt(oop)) & (classIndexMask())) == (rawHashBitsOf(splObj(ClassSemaphore)))) {
		return 0;
	}
	/* begin fetchPointer:ofObject: */
	objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	scheduler = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	processLists = longAt((scheduler + BaseHeaderSize) + (((sqInt)((usqInt)(ProcessListsIndex) << (shiftForWord())))));
	if (oop == scheduler) {
		return 0;
	}
	if (oop == processLists) {
		return 0;
	}
	if ((classIndexOf(longAt((processLists + BaseHeaderSize) + (1U << (shiftForWord()))))) == ((longAt(oop)) & (classIndexMask()))) {
		return 0;
	}
	if ((classIndexOf(longAt((scheduler + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord()))))))) == ((longAt(oop)) & (classIndexMask()))) {
		return 0;
	}
	return 1;
}
#endif /* IMMUTABILITY */


/*	Answer either a malloced string with the null-terminated contents of oop
	if oop is a string,
	or the null pointer if oop is nil, or fail. It is the client's
	responsibility to free the string later. */

	/* InterpreterPrimitives>>#cStringOrNullFor: */
char *
cStringOrNullFor(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ccIndex;
    sqInt classOop;
    char *cString;
    sqInt fmt;
    sqInt isString;
    sqInt len;
    usqInt numSlots;
    usqInt numSlots1;

	/* begin is:instanceOf:compactClassIndex: */
	classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassByteString) << (shiftForWord())))));
	if (oop & (tagMask())) {
		isString = 0;
		goto l2;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop)));
	/* begin classIndexOf: */
	ccIndex = (longAt(oop)) & (classIndexMask());
	isString = ClassByteStringCompactIndex == ccIndex;
	goto l2;
	l2:	/* end is:instanceOf:compactClassIndex: */;
	if (!isString) {
		if (oop != GIV(nilObj)) {
			GIV(primFailCode) = PrimErrBadArgument;
		}
		return 0;
	}
	/* begin lengthOf:format: */
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOfAny: */
	numSlots1 = byteAt(oop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		len = numSlots;
		goto l4;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		len = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l4;
	}
	if (fmt >= (firstShortFormat())) {
		len = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l4;
	}
	if (fmt >= (firstLongFormat())) {
		len = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l4;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		len = numSlots;
		goto l4;
	}
	len = 0;
	l4:	/* end lengthOf:format: */;
	if (len == 0) {
		return 0;
	}
	cString = malloc(len + 1);
	if (!(cString)) {
		GIV(primFailCode) = PrimErrNoCMemory;
		return 0;
	}
	memcpy(cString, firstIndexableField(oop), len);
	cString[len] = 0;
	return cString;
}


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

	/* InterpreterPrimitives>>#failed */
sqInt
failed(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(primFailCode);
}


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

	/* InterpreterPrimitives>>#isNegativeIntegerValueOf: */
static sqInt NoDbgRegParms
isNegativeIntegerValueOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ccIndex;
    sqInt ccIndex1;
    sqInt ok;
    sqInt smallInt;

	if ((((oop) & 7) == 1)) {
		smallInt = (oop >> 3);
		return smallInt < 0;
	}
	if ((oop & (tagMask())) == 0) {
		/* begin isClassOfNonImm:equalTo:compactClassIndex: */
		assert(!(isImmediate(oop)));
		/* begin classIndexOf: */
		ccIndex = (longAt(oop)) & (classIndexMask());
		ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
		goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
		if (ok) {
			return 0;
		}
		/* begin isClassOfNonImm:equalTo:compactClassIndex: */
		assert(!(isImmediate(oop)));
		/* begin classIndexOf: */
		ccIndex1 = (longAt(oop)) & (classIndexMask());
		ok = ClassLargeNegativeIntegerCompactIndex == ccIndex1;
		goto l4;
	l4:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
		if (ok) {
			return 1;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	return 0;
}


/*	Answer if oop is a value of an integer in address range, i.e up to the
	size of a machine word.
	The object may be either a positive SmallInteger or a LargePositiveInteger
	of size <= word size.
 */

	/* InterpreterPrimitives>>#isPositiveMachineIntegerObject: */
sqInt
isPositiveMachineIntegerObject(sqInt oop)
{
    sqInt ccIndex;
    sqInt ok;

	if ((((oop) & 7) == 1)) {
		return ((oop >> 3)) >= 0;
	}
	if (oop & (tagMask())) {
		return 0;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop)));
	/* begin classIndexOf: */
	ccIndex = (longAt(oop)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
	goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	return ok
	 && ((numBytesOfBytes(oop)) <= (sizeof(usqIntptr_t)));
}


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

	/* InterpreterPrimitives>>#magnitude64BitIntegerFor:neg: */
static sqInt NoDbgRegParms
magnitude64BitIntegerForneg(usqLong magnitude, sqInt isNegative)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    int isSmall;
    sqInt largeClass;
    sqInt newLargeInteger;
    sqInt smallVal;
    sqInt sz;

	isSmall = (isNegative
		? magnitude <= ((MaxSmallInteger) + 1)
		: magnitude <= (MaxSmallInteger));
	if (isSmall) {
		smallVal = ((sqInt) magnitude);
		if (isNegative) {
			smallVal = 0 - smallVal;
		}
		return (((usqInt)smallVal << 3) | 1);
	}
	if (isNegative) {
		/* begin knownClassAtIndex: */
		assert(((ClassLargeNegativeIntegerCompactIndex >= 1) && (ClassLargeNegativeIntegerCompactIndex <= (classTablePageSize()))));
		/* begin fetchPointer:ofObject: */
		largeClass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassLargeNegativeIntegerCompactIndex) << (shiftForWord())))));
	}
	else {
		/* begin knownClassAtIndex: */
		assert(((ClassLargePositiveIntegerCompactIndex >= 1) && (ClassLargePositiveIntegerCompactIndex <= (classTablePageSize()))));
		/* begin fetchPointer:ofObject: */
		largeClass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassLargePositiveIntegerCompactIndex) << (shiftForWord())))));
	}
	sz = 8;
	newLargeInteger = instantiateClassindexableSize(largeClass, sz);
	
	/* Memory is eight byte aligned in SPUR, so we are sure to have room for 64bits word whatever allocated sz */
	long64Atput((newLargeInteger + BaseHeaderSize) + (0U << 3), SQ_SWAP_8_BYTES_IF_BIGENDIAN(magnitude));
	return newLargeInteger;
}


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

	/* InterpreterPrimitives>>#magnitude64BitValueOf: */
static usqLong NoDbgRegParms
magnitude64BitValueOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ccIndex;
    sqInt ccIndex1;
    sqInt fmt;
    sqInt ok;
    sqInt smallIntValue;
    sqInt sz;
    usqLong value;

	if ((((oop) & 7) == 1)) {
		smallIntValue = (oop >> 3);
		if (smallIntValue < 0) {
			smallIntValue = 0 - smallIntValue;
		}
		return ((usqLong) smallIntValue);
	}
	if (oop & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop)));
	/* begin classIndexOf: */
	ccIndex1 = (longAt(oop)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex1;
	goto l4;
	l4:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (!ok) {
		/* begin isClassOfNonImm:equalTo:compactClassIndex: */
		assert(!(isImmediate(oop)));
		/* begin classIndexOf: */
		ccIndex = (longAt(oop)) & (classIndexMask());
		ok = ClassLargeNegativeIntegerCompactIndex == ccIndex;
		goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
		if (!ok) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return 0;
		}
	}
	/* begin numBytesOfBytes: */
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	assert(fmt >= (firstByteFormat()));
	sz = ((numSlotsOf(oop)) << (shiftForWord())) - (fmt & 7);
	if (sz > (sizeof(sqLong))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	if (sz > 4) {
		value = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize) + (0U << 3))));
	}
	else {

		/* ] */
		value = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2))))));
	}
	return value;
}


/*	Answer a value of an integer in address range, i.e up to the size of a
	machine word.
	The object may be either a positive SmallInteger or a LargePositiveInteger
	of size <= word size.
 */
/*	only two callers & one is primitiveNewWithArg */

	/* InterpreterPrimitives>>#positiveMachineIntegerValueOf: */
usqIntptr_t
positiveMachineIntegerValueOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bs;
    sqInt ccIndex;
    sqInt fmt;
    sqInt ok;
    sqInt value;

	if ((((oop) & 7) == 1)) {
		value = (oop >> 3);
		if (value < 0) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return null;
		}
		return value;
	}
	if (oop & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop)));
	/* begin classIndexOf: */
	ccIndex = (longAt(oop)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
	goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (!ok) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	/* begin numBytesOfBytes: */
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	assert(fmt >= (firstByteFormat()));
	bs = ((numSlotsOf(oop)) << (shiftForWord())) - (fmt & 7);
	if (bs > (sizeof(usqIntptr_t))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	if (((sizeof(usqIntptr_t)) == 8)
	 && (bs > 4)) {
		return SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize) + (0U << 3))));
	}
	else {
		return ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2))))));
	}
}

	/* InterpreterPrimitives>>#primitiveAdd */
static void
primitiveAdd(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerResult;
    char *sp;

	/* begin pop2AndPushIntegerIfOK: */
	integerResult = (stackIntegerValue(1)) + (stackIntegerValue(0));
	if (!GIV(primFailCode)) {
		if ((((((usqInt) integerResult) >> 60) + 1) & 15) <= 1) {
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)integerResult << 3) | 1));
			GIV(stackPointer) = sp;
		}
		else {
			/* begin success: */
			
			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveAddLargeIntegers */
EXPORT(void)
primitiveAddLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt resultIsNegative;
    char *sp;

	oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (GIV(primFailCode)) {
		return;
	}
	if (aIsNegative == bIsNegative) {

		/* Protect against overflow */
		if (a > (0xFFFFFFFFFFFFFFFFULL - b)) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(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 (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(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. 
 */

	/* InterpreterPrimitives>>#primitiveAdoptInstance */
static void
primitiveAdoptInstance(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;
    sqInt err;
    sqInt rcvr;

	arg = longAt(GIV(stackPointer));
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((arg & (tagMask()))
	 || ((GIV(argumentCount) > 1)
	 && ((rcvr & (tagMask()))
	 || (!(objCouldBeClassObj(rcvr)))))) {
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	err = changeClassOfto(arg, rcvr);
	if (err == 0) {

		/* Flush at cache because rcvr's class has changed. */
		/* begin pop: */
		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	}
	else {

		/* changeClassOf:to: answers errors as if rcvr (the class) is an argument... */
		if (err == PrimErrBadReceiver) {
			err = PrimErrBadArgument;
		}
		else {
			if (err == PrimErrBadArgument) {
				err = PrimErrBadReceiver;
			}
		}
		GIV(primFailCode) = err;
	}
	return;
}


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

	/* InterpreterPrimitives>>#primitiveAllInstances */
EXPORT(void)
primitiveAllInstances(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt delta;
    sqInt result;
    char *sp;

	result = allInstancesOf(longAt(GIV(stackPointer)));
	if ((((result) & 7) == 1)) {
		/* begin growToAccomodateContainerWithNumSlots: */
		delta = (BaseHeaderSize * 2) + (((result >> 3)) * BytesPerOop);
		growOldSpaceByAtLeast(((GIV(growHeadroom) < delta) ? delta : GIV(growHeadroom)));
		result = allInstancesOf(longAt(GIV(stackPointer)));
		if ((((result) & 7) == 1)) {
			GIV(primFailCode) = PrimErrNoMemory;
			return;
		}
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result);
	GIV(stackPointer) = sp;
}


/*	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. */

	/* InterpreterPrimitives>>#primitiveAllObjects */
EXPORT(void)
primitiveAllObjects(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt delta;
    sqInt result;
    char *sp;

	result = allObjects();
	if ((((result) & 7) == 1)) {
		/* begin growToAccomodateContainerWithNumSlots: */
		delta = (BaseHeaderSize * 2) + (((result >> 3)) * BytesPerOop);
		growOldSpaceByAtLeast(((GIV(growHeadroom) < delta) ? delta : GIV(growHeadroom)));
		result = allObjects();
		if ((((result) & 7) == 1)) {
			GIV(primFailCode) = PrimErrNoMemory;
			return;
		}
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result);
	GIV(stackPointer) = sp;
}


/*	N.B. IMO we should be able to assume the receiver is a float because this
	primitive is specific to floats. eem 2/13/2017
 */

	/* InterpreterPrimitives>>#primitiveArctan */
static void
primitiveArctan(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    double rcvr;

	/* begin stackFloatValue: */
	rcvr = floatValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin stackTopPut: */
		aValue = floatObjectOf(atan(rcvr));
		longAtPointerput(GIV(stackPointer), aValue);
	}
}


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

	/* InterpreterPrimitives>>#primitiveArrayBecome */
static void
primitiveArrayBecome(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;
    sqInt ec;
    sqInt rcvr;

	arg = longAt(GIV(stackPointer));
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	ec = becomewithtwoWaycopyHash(rcvr, arg, 1, 0);
	if (ec == PrimNoErr) {
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
	else {
		GIV(primFailCode) = ec;
	}
}


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

	/* InterpreterPrimitives>>#primitiveArrayBecomeOneWay */
static void
primitiveArrayBecomeOneWay(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;
    sqInt ec;
    sqInt rcvr;

	arg = longAt(GIV(stackPointer));
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	ec = becomewithtwoWaycopyHash(rcvr, arg, 0, 1);
	if (ec == PrimNoErr) {
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
	else {
		GIV(primFailCode) = ec;
	}
}


/*	Similar to primitiveArrayBecomeOneWay but accepts a third argument
	deciding whether to
	copy the receiver's elements identity hashes over the argument's elements
	identity hashes.
 */

	/* InterpreterPrimitives>>#primitiveArrayBecomeOneWayCopyHash */
static void
primitiveArrayBecomeOneWayCopyHash(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt copyHashFlag;
    sqInt ec;

	copyHashFlag = 0;
	if ((longAt(GIV(stackPointer))) == GIV(trueObj)) {
		copyHashFlag = 1;
	}
	else {
		if ((longAt(GIV(stackPointer))) == GIV(falseObj)) {
			copyHashFlag = 0;
		}
		else {
			GIV(primFailCode) = PrimErrBadArgument;
			return;
		}
	}
	ec = becomewithtwoWaycopyHash(longAt(GIV(stackPointer) + (2 * BytesPerWord)), longAt(GIV(stackPointer) + (1 * BytesPerWord)), 0, copyHashFlag);
	if (ec == PrimNoErr) {
		/* begin pop: */
		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	}
	else {
		GIV(primFailCode) = ec;
	}
}


/*	Similar to primitiveArrayBecomeOneWay but does /not/ copy the receiver's
	elements identity hashes over the argument's elements identity hashes. */

	/* InterpreterPrimitives>>#primitiveArrayBecomeOneWayNoCopyHash */
static void
primitiveArrayBecomeOneWayNoCopyHash(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;
    sqInt ec;
    sqInt rcvr;

	arg = longAt(GIV(stackPointer));
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	ec = becomewithtwoWaycopyHash(rcvr, arg, 0, 0);
	if (ec == PrimNoErr) {
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
	else {
		GIV(primFailCode) = ec;
	}
}

	/* InterpreterPrimitives>>#primitiveAsCharacter */
static void
primitiveAsCharacter(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt characterCode;
    sqInt characterObject;
    sqInt reasonCode;
    char *sp;

	characterCode = longAt(GIV(stackPointer));
	if (!(((((characterCode) & 7) == 1))
		 && (((characterCode = (characterCode >> 3)),
		((characterCode >= 0) && (characterCode <= ((1U << 30) - 1))))))) {
		/* begin primitiveFailFor: */
		reasonCode = (GIV(argumentCount) == 0
			? PrimErrBadReceiver
			: PrimErrBadArgument);
		GIV(primFailCode) = reasonCode;
		return;
	}
	characterObject = (((sqInt)((usqInt)(characterCode) << (numTagBits())))) + (characterTag());
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), characterObject);
	GIV(stackPointer) = sp;
}


/*	N.B. This will answer inexact results for integers with > 53 bits of
	magnitude. 
 */

	/* InterpreterPrimitives>>#primitiveAsFloat */
static void
primitiveAsFloat(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt rcvr;
    char *sp;

	rcvr = longAt(GIV(stackPointer));
	assert((((rcvr) & 7) == 1));
	/* begin pop:thenPushFloat: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), floatObjectOf(((double) ((rcvr >> 3)) )));
	GIV(stackPointer) = sp;
}

	/* InterpreterPrimitives>>#primitiveAt */
static void
primitiveAt(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class;
    sqInt classFormat;
    sqInt fixedFields;
    usqLong fmt;
    sqLong hdr;
    sqInt index;
    unsigned int integerValue;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt rcvr;
    sqInt reasonCode;
    sqInt result;
    char *sp;
    sqInt sp1;
    sqInt sp2;
    sqInt stSize;
    sqInt totalLength;

	/* begin commonAt: */
	GIV(primFailCode) = 0;
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	index = longAt(GIV(stackPointer));
	if (rcvr & (tagMask())) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrInappropriate;
		goto l10;
	}
	if (((index & (smallIntegerTag())) == 0)
	 || ((GIV(argumentCount) > 1)
	 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		goto l10;
	}
	index = (index >> 3);
	/* begin stObject:at: */
	hdr = long64At(rcvr);
	fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots1 = byteAt(rcvr + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		totalLength = numSlots;
		goto l6;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l6;
	}
	if (fmt >= (firstShortFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l6;
	}
	if (fmt >= (firstLongFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l6;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		totalLength = numSlots;
		goto l6;
	}
	totalLength = 0;
	l6:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		fixedFields = 0;
		goto l7;
	}
	if (fmt < 2 /* arrayFormat */) {
		fixedFields = totalLength;
		goto l7;
	}
	class = fetchClassOfNonImm(rcvr);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l7:	/* end fixedFieldsOf:format:length: */;
	if ((fmt == (indexablePointersFormat()))
	 && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		/* begin stackPointerForMaybeMarriedContext: */
		if ((((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(rcvr)))) {
			sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr));
			assert((ReceiverIndex + ((sp2 >> 3))) < (lengthOf(rcvr)));
			stSize = sp2;
			goto l4;
		}
		/* begin fetchStackPointerOf: */
		sp1 = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
		if (!((((sp1) & 7) == 1))) {
			stSize = 0;
			goto l4;
		}
		assert((ReceiverIndex + ((sp1 >> 3))) < (lengthOf(rcvr)));
		stSize = (sp1 >> 3);
	l4:	/* end stackPointerForMaybeMarriedContext: */;
		if ((oopisGreaterThanOrEqualTo(index, 1))
		 && ((oopisLessThanOrEqualTo(index, stSize))
		 && ((((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(rcvr)))))) {
			result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr));
			goto l9;
		}
	}
	else {
		stSize = totalLength - fixedFields;
	}
	if ((oopisGreaterThanOrEqualTo(index, (fmt >= (firstCompiledMethodFormat())
		? (((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1
		: 1)))
	 && (oopisLessThanOrEqualTo(index, stSize))) {
		/* begin subscript:with:format: */
		if (fmt <= 5 /* lastPointerFormat */) {
			/* begin fetchPointer:ofObject: */
			result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))));
			goto l9;
		}
		if (fmt >= (firstByteFormat())) {
			result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 3) | 1);
			goto l9;
		}
		if (fmt >= (firstShortFormat())) {
			result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 3) | 1);
			goto l9;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3)))));
			goto l9;
		}
		/* begin positive32BitIntegerFor: */
		integerValue = long32At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))));
		result = ((((((usqInt)integerValue)) & 0xFFFFFFFFU) << 3) | 1);
		goto l9;
	}
	/* begin primitiveFailFor: */
	reasonCode = (fmt <= 1
		? PrimErrBadReceiver
		: PrimErrBadIndex);
	GIV(primFailCode) = reasonCode;
	result = 0;
	l9:	/* end stObject:at: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result);
		GIV(stackPointer) = sp;
	}
	l10:	/* end commonAt: */;
}

	/* InterpreterPrimitives>>#primitiveAtPut */
static void
primitiveAtPut(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class1;
    sqInt classFormat1;
    sqInt fixedFields1;
    usqLong fmt1;
    sqLong hdr1;
    sqInt index;
    usqInt numSlots11;
    usqInt numSlots2;
    sqInt rcvr;
    sqInt reasonCode1;
    sqInt signedValueToStore1;
    char *sp;
    sqInt sp11;
    sqInt sp3;
    sqInt stSize1;
    sqInt totalLength1;
    usqLong unsigned64BitValueToStore1;
    unsigned int unsignedValueToStore1;
    sqInt value;

	/* begin commonAtPut: */
	GIV(primFailCode) = 0;
	rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	value = longAt(GIV(stackPointer));
	if (rcvr & (tagMask())) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrInappropriate;
		goto l30;
	}
	if (((index & (smallIntegerTag())) == 0)
	 || ((GIV(argumentCount) > 2)
	 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		goto l30;
	}
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrNoModification;
		goto l30;
	}
	index = (index >> 3);
	/* begin stObject:at:put: */
	hdr1 = long64At(rcvr);
	fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots11 = byteAt(rcvr + 7);
	numSlots2 = (numSlots11 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots11);
	if (fmt1 <= 5 /* ephemeronFormat */) {
		totalLength1 = numSlots2;
		goto l21;
	}
	if (fmt1 >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7);
		goto l21;
	}
	if (fmt1 >= (firstShortFormat())) {
		totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3);
		goto l21;
	}
	if (fmt1 >= (firstLongFormat())) {
		totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1);
		goto l21;
	}
	if (fmt1 == (sixtyFourBitIndexableFormat())) {
		totalLength1 = numSlots2;
		goto l21;
	}
	totalLength1 = 0;
	l21:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt1 >= (sixtyFourBitIndexableFormat()))
	 || (fmt1 == 2 /* arrayFormat */)) {
		fixedFields1 = 0;
		goto l16;
	}
	if (fmt1 < 2 /* arrayFormat */) {
		fixedFields1 = totalLength1;
		goto l16;
	}
	class1 = fetchClassOfNonImm(rcvr);
	/* begin fixedFieldsOfClassFormat: */
	classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1);
	l16:	/* end fixedFieldsOf:format:length: */;
	if ((fmt1 == (indexablePointersFormat()))
	 && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		/* begin stackPointerForMaybeMarriedContext: */
		if ((((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(rcvr)))) {
			sp3 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr));
			assert((ReceiverIndex + ((sp3 >> 3))) < (lengthOf(rcvr)));
			stSize1 = sp3;
			goto l17;
		}
		/* begin fetchStackPointerOf: */
		sp11 = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
		if (!((((sp11) & 7) == 1))) {
			stSize1 = 0;
			goto l17;
		}
		assert((ReceiverIndex + ((sp11 >> 3))) < (lengthOf(rcvr)));
		stSize1 = (sp11 >> 3);
	l17:	/* end stackPointerForMaybeMarriedContext: */;
		if ((oopisGreaterThanOrEqualTo(index, 1))
		 && ((oopisLessThanOrEqualTo(index, stSize1))
		 && ((((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(rcvr)))))) {
			noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value);
			goto l29;
		}
	}
	else {
		stSize1 = totalLength1 - fixedFields1;
	}
	if ((oopisGreaterThanOrEqualTo(index, (fmt1 >= (firstCompiledMethodFormat())
		? (((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1
		: 1)))
	 && (oopisLessThanOrEqualTo(index, stSize1))) {
		/* begin subscript:with:storing:format: */
		if (fmt1 <= 5 /* lastPointerFormat */) {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(rcvr)));
			if ((assert(isNonImmediate(rcvr)),
			oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((value & (tagMask())) == 0)
				 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(rcvr);
					}
				}
			}
			longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value);
			goto l28;
		}
		if (fmt1 >= (firstByteFormat())) {
			if (!((((value) & 7) == 1))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l28;
			}
			signedValueToStore1 = (value >> 3);
			if (!((signedValueToStore1 >= 0)
				 && (signedValueToStore1 <= 0xFF))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l28;
			}
			/* begin storeByte:ofObject:withValue: */
			byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1);
			goto l28;
		}
		if (fmt1 >= (firstShortFormat())) {
			if (!((((value) & 7) == 1))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l28;
			}
			signedValueToStore1 = (value >> 3);
			if (!((signedValueToStore1 >= 0)
				 && (signedValueToStore1 <= 0xFFFF))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l28;
			}
			/* begin storeShort16:ofObject:withValue: */
			shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1);
			goto l28;
		}
		if (fmt1 == (sixtyFourBitIndexableFormat())) {
			unsigned64BitValueToStore1 = positive64BitValueOf(value);
			if (!GIV(primFailCode)) {
				/* begin storeLong64:ofObject:withValue: */
				long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1);
			}
			goto l28;
		}
		unsignedValueToStore1 = positive32BitValueOf(value);
		if (!GIV(primFailCode)) {
			/* begin storeLong32:ofObject:withValue: */
			long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1);
		}
	l28:	/* end subscript:with:storing:format: */;
	}
	else {
		/* begin primitiveFailFor: */
		reasonCode1 = (fmt1 <= 1
			? PrimErrBadReceiver
			: PrimErrBadIndex);
		GIV(primFailCode) = reasonCode1;
	}
	l29:	/* end stObject:at:put: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value);
		GIV(stackPointer) = sp;
	}
	l30:	/* end commonAtPut: */;
}


/*	Set the cursor to the given shape. The Mac only supports 16x16 pixel
	cursors. Cursor offsets are handled by Smalltalk.
 */

	/* InterpreterPrimitives>>#primitiveBeCursor */
static void
primitiveBeCursor(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bitsObj;
    sqInt cursorBitsIndex;
    sqInt cursorObj;
    sqInt depth;
    sqInt extentX;
    sqInt extentY;
    sqInt maskBitsIndex;
    sqInt maskObj;
    sqInt offsetObj;
    sqInt offsetX;
    sqInt offsetY;
    sqInt ourCursor;
    sqInt successBoolean;
    sqInt successBoolean1;
    sqInt successBoolean10;
    sqInt successBoolean11;
    sqInt successBoolean12;
    sqInt successBoolean2;
    sqInt successBoolean3;
    sqInt successBoolean4;
    sqInt successBoolean5;
    sqInt successBoolean6;
    sqInt successBoolean7;
    sqInt successBoolean8;
    sqInt successBoolean9;

	bitsObj = 0;
	cursorBitsIndex = 0;
	cursorObj = 0;
	depth = 0;
	extentX = 0;
	extentY = 0;
	maskBitsIndex = 0;
	maskObj = 0;
	offsetObj = 0;
	ourCursor = 0;
	if (GIV(argumentCount) == 0) {
		cursorObj = longAt(GIV(stackPointer));
		maskBitsIndex = null;
	}
	if (GIV(argumentCount) == 1) {
		cursorObj = longAt(GIV(stackPointer) + (1 * BytesPerWord));
		maskObj = longAt(GIV(stackPointer));
	}
	/* begin success: */
	if (!(GIV(argumentCount) < 2)) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (!GIV(primFailCode)) {
		/* begin success: */
		successBoolean = (((cursorObj & (tagMask())) == 0)
		 && (((((usqInt) (longAt(cursorObj))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
		 && ((lengthOfformat(cursorObj, (((usqInt) (longAt(cursorObj))) >> (formatShift())) & (formatMask()))) >= 5);
		if (!successBoolean) {

			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
	if (!GIV(primFailCode)) {
		bitsObj = longAt((cursorObj + BaseHeaderSize) + (0U << (shiftForWord())));
		extentX = fetchIntegerofObject(1, cursorObj);
		extentY = fetchIntegerofObject(2, cursorObj);
		depth = fetchIntegerofObject(3, cursorObj);
		offsetObj = longAt((cursorObj + BaseHeaderSize) + (4U << (shiftForWord())));
		/* begin success: */
		successBoolean1 = (((offsetObj & (tagMask())) == 0)
		 && (((((usqInt) (longAt(offsetObj))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
		 && ((lengthOfformat(offsetObj, (((usqInt) (longAt(offsetObj))) >> (formatShift())) & (formatMask()))) >= 2);
		if (!successBoolean1) {

			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
	if (!GIV(primFailCode)) {
		offsetX = fetchIntegerofObject(0, offsetObj);
		offsetY = fetchIntegerofObject(1, offsetObj);
		if ((GIV(argumentCount) == 0)
		 && (depth == 32)) {

			/* Support arbitrary-sized 32 bit ARGB forms --bf 3/1/2007 23:51 */
			/* begin success: */
			successBoolean2 = (extentX > 0)
			 && (extentY > 0);
			if (!successBoolean2) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin success: */
			successBoolean3 = (offsetX >= (extentX * -1))
			 && (offsetX <= 0);
			if (!successBoolean3) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin success: */
			successBoolean4 = (offsetY >= (extentY * -1))
			 && (offsetY <= 0);
			if (!successBoolean4) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin success: */
			successBoolean5 = (((bitsObj & (tagMask())) == 0)
			 && (((((((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask())) >= (firstLongFormat())) && (((((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask())) <= ((firstShortFormat()) - 1)))))
			 && ((lengthOfformat(bitsObj, (((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask()))) == (extentX * extentY));
			if (!successBoolean5) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			cursorBitsIndex = bitsObj + BaseHeaderSize;
		}
		else {
			/* begin success: */
			successBoolean6 = (extentX == 16)
			 && ((extentY == 16)
			 && (depth == 1));
			if (!successBoolean6) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin success: */
			successBoolean7 = (offsetX >= -16)
			 && (offsetX <= 0);
			if (!successBoolean7) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin success: */
			successBoolean8 = (offsetY >= -16)
			 && (offsetY <= 0);
			if (!successBoolean8) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin success: */
			successBoolean9 = (((bitsObj & (tagMask())) == 0)
			 && (((((((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask())) >= (firstLongFormat())) && (((((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask())) <= ((firstShortFormat()) - 1)))))
			 && ((lengthOfformat(bitsObj, (((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask()))) == 16);
			if (!successBoolean9) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			cursorBitsIndex = bitsObj + BaseHeaderSize;
		}
	}
	if (GIV(argumentCount) == 1) {
		/* begin success: */
		successBoolean12 = (((maskObj & (tagMask())) == 0)
		 && (((((usqInt) (longAt(maskObj))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
		 && ((lengthOfformat(maskObj, (((usqInt) (longAt(maskObj))) >> (formatShift())) & (formatMask()))) >= 5);
		if (!successBoolean12) {

			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
		if (!GIV(primFailCode)) {
			bitsObj = longAt((maskObj + BaseHeaderSize) + (0U << (shiftForWord())));
			extentX = fetchIntegerofObject(1, maskObj);
			extentY = fetchIntegerofObject(2, maskObj);
			depth = fetchIntegerofObject(3, maskObj);
		}
		if (!GIV(primFailCode)) {
			/* begin success: */
			successBoolean10 = (extentX == 16)
			 && ((extentY == 16)
			 && (depth == 1));
			if (!successBoolean10) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin success: */
			successBoolean11 = (((bitsObj & (tagMask())) == 0)
			 && (((((((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask())) >= (firstLongFormat())) && (((((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask())) <= ((firstShortFormat()) - 1)))))
			 && ((lengthOfformat(bitsObj, (((usqInt) (longAt(bitsObj))) >> (formatShift())) & (formatMask()))) == 16);
			if (!successBoolean11) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			maskBitsIndex = bitsObj + BaseHeaderSize;
		}
	}
	if (!GIV(primFailCode)) {
		if (GIV(argumentCount) == 0) {
			if (depth == 32) {
				if (!(ioSetCursorARGB(cursorBitsIndex, extentX, extentY, offsetX, offsetY))) {
					/* begin success: */
					
					/* Don't overwrite an error code that has already been set. */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
					return;
				}
			}
			else {
				ioSetCursor(cursorBitsIndex, offsetX, offsetY);
			}
		}
		else {
			ioSetCursorWithMask(cursorBitsIndex, maskBitsIndex, offsetX, offsetY);
		}
		/* begin pop: */
		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	}
}


/*	Record the system Display object in the specialObjectsTable,
	and if possible pin the display bitmap. Further, invoke ioBeDisplay
	to alow the VM to record the location, width heigth & depth of the bitmap. */

	/* InterpreterPrimitives>>#primitiveBeDisplay */
static void
primitiveBeDisplay(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bitsOop;
    void *bitsOrHandle;
    int changed;
    sqInt depthOop;
    sqInt heightOop;
    sqInt rcvr;
    sqInt widthOop;

	rcvr = longAt(GIV(stackPointer));
	if (!((((rcvr & (tagMask())) == 0)
		 && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
		 && (((lengthOfformat(rcvr, (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))) >= 4)
		 && (((bitsOop = longAt((rcvr + BaseHeaderSize) + (0U << (shiftForWord())))),
		((((bitsOop & (tagMask())) == 0)
			 && (isPureBitsFormat((((usqInt) (longAt(bitsOop))) >> (formatShift())) & (formatMask()))))
			 || ((((bitsOop) & 7) == 1)))
			 && (((((((widthOop = longAt((rcvr + BaseHeaderSize) + (1U << (shiftForWord())))))) & 7) == 1))
			 && (((((((heightOop = longAt((rcvr + BaseHeaderSize) + (2U << (shiftForWord())))))) & 7) == 1))
			 && ((((((depthOop = longAt((rcvr + BaseHeaderSize) + (3U << (shiftForWord())))))) & 7) == 1))))))))) {
		GIV(primFailCode) = PrimErrBadReceiver;
		return;
	}
	/* begin splObj:put: */
	assert(!(isForwarded(GIV(specialObjectsOop))));
	if ((assert(isNonImmediate(GIV(specialObjectsOop))),
	oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((rcvr & (tagMask())) == 0)
		 && (oopisLessThan(rcvr, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(GIV(specialObjectsOop));
			}
		}
	}
	longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheDisplay) << (shiftForWord())))), rcvr);
	if (((bitsOop & (tagMask())) == 0)
	 && (!(((((usqInt) (longAt(bitsOop))) >> (pinnedBitShift())) & 1) != 0))) {

		/* Answers 0 if memory required to pin bit not enough memory available. */
		rcvr = pinObject(bitsOop);
		if (rcvr != 0) {
			bitsOop = rcvr;
		}
	}
	/* begin ioBeDisplay:width:height:depth: */
	bitsOrHandle = ((bitsOop & (tagMask())) == 0
		? firstIndexableField(bitsOop)
		: ((void *)bitsOop));
	changed = displayBits != bitsOrHandle;
	displayBits = bitsOrHandle;
	displayWidth = (widthOop >> 3);
	displayHeight = (heightOop >> 3);
	displayDepth = (depthOop >> 3);
	ioNoteDisplayChangedwidthheightdepth(bitsOrHandle, (widthOop >> 3), (heightOop >> 3), (depthOop >> 3));
}


/*	make the basic beep noise */

	/* InterpreterPrimitives>>#primitiveBeep */
static void
primitiveBeep(void)
{
	ioBeep();
}

	/* InterpreterPrimitives>>#primitiveBehaviorHash */
static void
primitiveBehaviorHash(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt err;
    sqInt hash;
    sqInt hashOrError;
    char *sp;

	assert((isNonImmediate(stackTop()))
	 && (addressCouldBeClassObj(stackTop())));
	assert(addressCouldBeClassObj(longAt(GIV(stackPointer))));
	hashOrError = (((hash = (long32At((longAt(GIV(stackPointer))) + 4)) & (identityHashHalfWordMask()))) != 0
		? hash
		: (objCouldBeClassObj(longAt(GIV(stackPointer)))
				? (((err = enterIntoClassTable(longAt(GIV(stackPointer))))) != 0
						? -err
						: (long32At((longAt(GIV(stackPointer))) + 4)) & (identityHashHalfWordMask()))
				: -PrimErrBadReceiver));
	if (hashOrError >= 0) {
		/* begin pop:thenPushInteger: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)hashOrError << 3) | 1));
		GIV(stackPointer) = sp;
	}
	else {
		GIV(primFailCode) = -hashOrError;
	}
}


/*	Note no short-cut for SmallIntegers. Either the inline interpreter
	bytecode or the JIT primitive will handle this case. */

	/* InterpreterPrimitives>>#primitiveBitAnd */
static void
primitiveBitAnd(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bs;
    sqInt bs1;
    sqInt ccIndex;
    sqInt ccIndex1;
    sqInt fmt;
    sqInt fmt1;
    usqInt integerArgumentValue;
    usqInt integerReceiverValue;
    sqInt ok;
    sqInt ok1;
    sqInt oop;
    sqInt oop1;
    sqInt oop2;
    char *sp;
    sqInt value;
    sqInt value1;

	/* begin positiveMachineIntegerValueOf: */
	oop1 = longAt(GIV(stackPointer));
	if ((((oop1) & 7) == 1)) {
		value = (oop1 >> 3);
		if (value < 0) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			integerArgumentValue = ((usqIntptr_t) null);
			goto l4;
		}
		integerArgumentValue = ((usqIntptr_t) value);
		goto l4;
	}
	if (oop1 & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerArgumentValue = 0;
		goto l4;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop1)));
	/* begin classIndexOf: */
	ccIndex = (longAt(oop1)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
	goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (!ok) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerArgumentValue = 0;
		goto l4;
	}
	/* begin numBytesOfBytes: */
	fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask());
	assert(fmt >= (firstByteFormat()));
	bs = ((numSlotsOf(oop1)) << (shiftForWord())) - (fmt & 7);
	if (bs > (sizeof(usqIntptr_t))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerArgumentValue = 0;
		goto l4;
	}
	if (((sizeof(usqIntptr_t)) == 8)
	 && (bs > 4)) {
		integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3))))));
		goto l4;
	}
	else {
		integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2))))))));
		goto l4;
	}
	l4:	/* end positiveMachineIntegerValueOf: */;
	/* begin positiveMachineIntegerValueOf: */
	oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((((oop2) & 7) == 1)) {
		value1 = (oop2 >> 3);
		if (value1 < 0) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			integerReceiverValue = ((usqIntptr_t) null);
			goto l8;
		}
		integerReceiverValue = ((usqIntptr_t) value1);
		goto l8;
	}
	if (oop2 & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerReceiverValue = 0;
		goto l8;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop2)));
	/* begin classIndexOf: */
	ccIndex1 = (longAt(oop2)) & (classIndexMask());
	ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1;
	goto l7;
	l7:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (!ok1) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerReceiverValue = 0;
		goto l8;
	}
	/* begin numBytesOfBytes: */
	fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask());
	assert(fmt1 >= (firstByteFormat()));
	bs1 = ((numSlotsOf(oop2)) << (shiftForWord())) - (fmt1 & 7);
	if (bs1 > (sizeof(usqIntptr_t))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerReceiverValue = 0;
		goto l8;
	}
	if (((sizeof(usqIntptr_t)) == 8)
	 && (bs1 > 4)) {
		integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3))))));
		goto l8;
	}
	else {
		integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2))))))));
		goto l8;
	}
	l8:	/* end positiveMachineIntegerValueOf: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		oop = positiveMachineIntegerFor(integerArgumentValue & integerReceiverValue);
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop);
		GIV(stackPointer) = sp;
	}
}


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

	/* InterpreterPrimitives>>#primitiveBitAndLargeIntegers */
EXPORT(void)
primitiveBitAndLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong integerArg;
    usqLong integerRcvr;
    sqInt oopResult;
    char *sp;

	integerArg = positive64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	integerRcvr = positive64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	if (GIV(primFailCode)) {
		return;
	}
	oopResult = positive64BitIntegerFor(integerRcvr & integerArg);
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(stackPointer) = sp;
	}
}


/*	Note no short-cut for SmallIntegers. Either the inline interpreter
	bytecode or the JIT primitive will handle this case. */

	/* InterpreterPrimitives>>#primitiveBitOr */
static void
primitiveBitOr(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bs;
    sqInt bs1;
    sqInt ccIndex;
    sqInt ccIndex1;
    sqInt fmt;
    sqInt fmt1;
    usqInt integerArgumentValue;
    usqInt integerReceiverValue;
    sqInt ok;
    sqInt ok1;
    sqInt oop;
    sqInt oop1;
    sqInt oop2;
    char *sp;
    sqInt value;
    sqInt value1;

	/* begin positiveMachineIntegerValueOf: */
	oop1 = longAt(GIV(stackPointer));
	if ((((oop1) & 7) == 1)) {
		value = (oop1 >> 3);
		if (value < 0) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			integerArgumentValue = ((usqIntptr_t) null);
			goto l4;
		}
		integerArgumentValue = ((usqIntptr_t) value);
		goto l4;
	}
	if (oop1 & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerArgumentValue = 0;
		goto l4;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop1)));
	/* begin classIndexOf: */
	ccIndex = (longAt(oop1)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
	goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (!ok) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerArgumentValue = 0;
		goto l4;
	}
	/* begin numBytesOfBytes: */
	fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask());
	assert(fmt >= (firstByteFormat()));
	bs = ((numSlotsOf(oop1)) << (shiftForWord())) - (fmt & 7);
	if (bs > (sizeof(usqIntptr_t))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerArgumentValue = 0;
		goto l4;
	}
	if (((sizeof(usqIntptr_t)) == 8)
	 && (bs > 4)) {
		integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3))))));
		goto l4;
	}
	else {
		integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2))))))));
		goto l4;
	}
	l4:	/* end positiveMachineIntegerValueOf: */;
	/* begin positiveMachineIntegerValueOf: */
	oop2 = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((((oop2) & 7) == 1)) {
		value1 = (oop2 >> 3);
		if (value1 < 0) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			integerReceiverValue = ((usqIntptr_t) null);
			goto l8;
		}
		integerReceiverValue = ((usqIntptr_t) value1);
		goto l8;
	}
	if (oop2 & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerReceiverValue = 0;
		goto l8;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop2)));
	/* begin classIndexOf: */
	ccIndex1 = (longAt(oop2)) & (classIndexMask());
	ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1;
	goto l7;
	l7:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (!ok1) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerReceiverValue = 0;
		goto l8;
	}
	/* begin numBytesOfBytes: */
	fmt1 = (((usqInt) (longAt(oop2))) >> (formatShift())) & (formatMask());
	assert(fmt1 >= (firstByteFormat()));
	bs1 = ((numSlotsOf(oop2)) << (shiftForWord())) - (fmt1 & 7);
	if (bs1 > (sizeof(usqIntptr_t))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerReceiverValue = 0;
		goto l8;
	}
	if (((sizeof(usqIntptr_t)) == 8)
	 && (bs1 > 4)) {
		integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop2 + BaseHeaderSize) + (0U << 3))))));
		goto l8;
	}
	else {
		integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop2 + BaseHeaderSize) + (0U << 2))))))));
		goto l8;
	}
	l8:	/* end positiveMachineIntegerValueOf: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		oop = positiveMachineIntegerFor(integerArgumentValue | integerReceiverValue);
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop);
		GIV(stackPointer) = sp;
	}
}


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

	/* InterpreterPrimitives>>#primitiveBitOrLargeIntegers */
EXPORT(void)
primitiveBitOrLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong integerArg;
    usqLong integerRcvr;
    sqInt oopResult;
    char *sp;

	integerArg = positive64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	integerRcvr = positive64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	if (GIV(primFailCode)) {
		return;
	}
	oopResult = positive64BitIntegerFor(integerRcvr | integerArg);
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(stackPointer) = sp;
	}
}


/*	Perform a bitShift. In 32-bits deal only with non-negative 32-bit
	integers. In 64-bits deal with signed 64-bit quantities (max (2^63)-1). */

	/* InterpreterPrimitives>>#primitiveBitShift */
static void
primitiveBitShift(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArgument;
    sqInt integerReceiver;
    sqInt shifted;
    char *sp;

	integerArgument = longAt(GIV(stackPointer));
	if (!((((integerArgument) & 7) == 1))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	integerReceiver = signed64BitValueOf(integerReceiver);
	if (!GIV(primFailCode)) {
		if (((integerArgument = (integerArgument >> 3))) >= 0) {

			/* Left shift -- must fail bits would be lost */
			if (!(integerArgument <= 61 /* numSmallIntegerBits */)) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				return;
			}
			shifted = ((sqInt)((usqInt)(integerReceiver) << integerArgument));
			if (!(integerReceiver == (((sqInt) shifted) >> integerArgument))) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				return;
			}
		}
		else {

			/* Right shift -- OK to lose bits */
			if (!(integerArgument >= (-61 /* numSmallIntegerBits */))) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				return;
			}
			shifted = ((sqInt) integerReceiver) >> (0 - integerArgument);
		}
		shifted = ((((((usqInt) shifted) >> 60) + 1) & 15) <= 1
			? (((usqInt)shifted << 3) | 1)
			: signed64BitIntegerFor(shifted));
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), shifted);
		GIV(stackPointer) = sp;
	}
}


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

	/* InterpreterPrimitives>>#primitiveBitShiftLargeIntegers */
EXPORT(void)
primitiveBitShiftLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong a;
    sqInt aIsNegative;
    sqInt integerPointer;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt shift;
    char *sp;

	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		shift = (integerPointer >> 3);
		goto l1;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		shift = 0;
		goto l1;
	}
	l1:	/* end stackIntegerValue: */;
	oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	a = magnitude64BitValueOf(oopRcvr);
	if (GIV(primFailCode)) {
		return;
	}
	if (shift >= 0) {

		/* Protect against overflow */

		/* This is to avoid undue (usqInt) cast */
		result = 0xFFFFFFFFFFFFFFFFULL;
		if ((shift >= 64)
		 || (a > (result >> shift))) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return;
		}
		result = a << shift;
	}
	else {
		shift = 0 - shift;
		if (shift >= 64) {
			result = 0;
		}
		else {
			result = a >> shift;
		}
		if (aIsNegative
		 && ((result << shift) != a)) {
			result += 1;
		}
	}
	oopResult = magnitude64BitIntegerForneg(result, aIsNegative);
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveBitXor */
static void
primitiveBitXor(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bs;
    sqInt bs1;
    sqInt ccIndex;
    sqInt ccIndex1;
    sqInt fmt;
    sqInt fmt1;
    sqInt integerArgument;
    usqInt integerArgumentValue;
    sqInt integerReceiver;
    usqInt integerReceiverValue;
    sqInt ok;
    sqInt ok1;
    sqInt oop;
    sqInt oop1;
    char *sp;
    char *sp1;
    sqInt value;
    sqInt value1;

	integerArgument = longAt(GIV(stackPointer));
	integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (((((integerArgument) & 7) == 1))
	 && ((((integerReceiver) & 7) == 1))) {

		/* xoring will leave the tag bits zero, whether the tag is 1 or zero, so add it back in. */
		/* begin pop:thenPush: */
		oop = (integerArgument ^ integerReceiver) + (smallIntegerTag());
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop);
		GIV(stackPointer) = sp;
	}
	else {
		/* begin positiveMachineIntegerValueOf: */
		if ((((integerArgument) & 7) == 1)) {
			value = (integerArgument >> 3);
			if (value < 0) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				integerArgumentValue = ((usqIntptr_t) null);
				goto l4;
			}
			integerArgumentValue = ((usqIntptr_t) value);
			goto l4;
		}
		if (integerArgument & (tagMask())) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			integerArgumentValue = 0;
			goto l4;
		}
		/* begin isClassOfNonImm:equalTo:compactClassIndex: */
		assert(!(isImmediate(integerArgument)));
		/* begin classIndexOf: */
		ccIndex = (longAt(integerArgument)) & (classIndexMask());
		ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
		goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
		if (!ok) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			integerArgumentValue = 0;
			goto l4;
		}
		/* begin numBytesOfBytes: */
		fmt = (((usqInt) (longAt(integerArgument))) >> (formatShift())) & (formatMask());
		assert(fmt >= (firstByteFormat()));
		bs = ((numSlotsOf(integerArgument)) << (shiftForWord())) - (fmt & 7);
		if (bs > (sizeof(usqIntptr_t))) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			integerArgumentValue = 0;
			goto l4;
		}
		if (((sizeof(usqIntptr_t)) == 8)
		 && (bs > 4)) {
			integerArgumentValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerArgument + BaseHeaderSize) + (0U << 3))))));
			goto l4;
		}
		else {
			integerArgumentValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerArgument + BaseHeaderSize) + (0U << 2))))))));
			goto l4;
		}
	l4:	/* end positiveMachineIntegerValueOf: */;
		/* begin positiveMachineIntegerValueOf: */
		if ((((integerReceiver) & 7) == 1)) {
			value1 = (integerReceiver >> 3);
			if (value1 < 0) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				integerReceiverValue = ((usqIntptr_t) null);
				goto l8;
			}
			integerReceiverValue = ((usqIntptr_t) value1);
			goto l8;
		}
		if (integerReceiver & (tagMask())) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			integerReceiverValue = 0;
			goto l8;
		}
		/* begin isClassOfNonImm:equalTo:compactClassIndex: */
		assert(!(isImmediate(integerReceiver)));
		/* begin classIndexOf: */
		ccIndex1 = (longAt(integerReceiver)) & (classIndexMask());
		ok1 = ClassLargePositiveIntegerCompactIndex == ccIndex1;
		goto l7;
	l7:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
		if (!ok1) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			integerReceiverValue = 0;
			goto l8;
		}
		/* begin numBytesOfBytes: */
		fmt1 = (((usqInt) (longAt(integerReceiver))) >> (formatShift())) & (formatMask());
		assert(fmt1 >= (firstByteFormat()));
		bs1 = ((numSlotsOf(integerReceiver)) << (shiftForWord())) - (fmt1 & 7);
		if (bs1 > (sizeof(usqIntptr_t))) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			integerReceiverValue = 0;
			goto l8;
		}
		if (((sizeof(usqIntptr_t)) == 8)
		 && (bs1 > 4)) {
			integerReceiverValue = ((usqIntptr_t) (SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerReceiver + BaseHeaderSize) + (0U << 3))))));
			goto l8;
		}
		else {
			integerReceiverValue = ((usqIntptr_t) (((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerReceiver + BaseHeaderSize) + (0U << 2))))))));
			goto l8;
		}
	l8:	/* end positiveMachineIntegerValueOf: */;
		if (!GIV(primFailCode)) {
			/* begin pop:thenPush: */
			oop1 = positiveMachineIntegerFor(integerArgumentValue ^ integerReceiverValue);
			longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop1);
			GIV(stackPointer) = sp1;
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveBitXorLargeIntegers */
EXPORT(void)
primitiveBitXorLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong integerArg;
    usqLong integerRcvr;
    sqInt oopResult;
    char *sp;

	integerArg = positive64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	integerRcvr = positive64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	if (GIV(primFailCode)) {
		return;
	}
	oopResult = positive64BitIntegerFor(integerRcvr ^ integerArg);
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(stackPointer) = sp;
	}
}


/*	Answer bytes available at this moment. For more meaningful 
	results, calls to this primitive should be precedeed by a full 
	or incremental garbage collection. */

	/* InterpreterPrimitives>>#primitiveBytesLeft */
static void
primitiveBytesLeft(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aBool;
    sqInt chunk;
    sqInt freeChunk;
    sqInt i;
    sqInt integerVal;
    sqInt integerVal1;
    char *sp;
    char *sp1;
    char *sp2;

	if (GIV(argumentCount) == 0) {

		/* old behavior - just return the size of free memory */
		/* begin pop:thenPushInteger: */
		longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), ((GIV(totalFreeOldSpace) << 3) | 1));
		GIV(stackPointer) = sp;
		return;
	}
	if (GIV(argumentCount) == 1) {

		/* Spur behavior; if argument is nil answer size of largest free chunk in oldSpace. */
		if ((longAt(GIV(stackPointer))) == GIV(nilObj)) {
			/* begin pop:thenPushInteger: */
			freeChunk = findLargestFreeChunk();
			if (!(freeChunk)) {
				for (i = 0x3F; i >= 1; i += -1) {
					chunk = GIV(freeLists)[i];
					if (!(chunk == null)) {
						integerVal = bytesInObject(chunk);
						goto l2;
					}
				}
				integerVal = 0;
				goto l2;
			}
			integerVal = bytesInObject(freeChunk);
	l2:	/* end sizeOfLargestFreeChunk */;
			longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)integerVal << 3) | 1));
			GIV(stackPointer) = sp1;
			return;
		}
		/* begin booleanValueOf: */
		if ((longAt(GIV(stackPointer))) == GIV(trueObj)) {
			aBool = 1;
			goto l1;
		}
		if ((longAt(GIV(stackPointer))) == GIV(falseObj)) {
			aBool = 0;
			goto l1;
		}
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		aBool = null;
	l1:	/* end booleanValueOf: */;
		if (!GIV(primFailCode)) {
			/* begin pop:thenPushInteger: */
			integerVal1 = (((GIV(totalFreeOldSpace) + ((((eden()).limit)) - GIV(freeStart))) + ((((pastSpace()).limit)) - GIV(pastSpaceStart))) + ((((futureSpace()).limit)) - (((futureSpace()).limit)))) - (interpreterAllocationReserveBytes());
			longAtput((sp2 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)integerVal1 << 3) | 1));
			GIV(stackPointer) = sp2;
			return;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(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). */

	/* InterpreterPrimitives>>#primitiveCalloutToFFI */
static void
primitiveCalloutToFFI(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    static void *function = (void *)-1;
    void (*primitiveCallout)(void);

	/* begin functionForPrimitiveCallout */
	if ((((sqInt)function)) == -1) {
		function = ioLoadFunctionFrom("primitiveCallout", "SqueakFFIPrims");
	}
	primitiveCallout = ((void (*)(void)) function);
	if (primitiveCallout == null) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	else {
		primitiveCallout();
	}
}


/*	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. */

	/* InterpreterPrimitives>>#primitiveChangeClass */
static void
primitiveChangeClass(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;
    sqInt argClass;
    sqInt err;
    sqInt oop;
    sqInt oop1;
    sqInt rcvr;

	/* begin stackObjectValue: */
	oop = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	if (oop & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		arg = null;
		goto l2;
	}
	arg = oop;
	l2:	/* end stackObjectValue: */;
	/* begin stackObjectValue: */
	oop1 = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (oop1 & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		rcvr = null;
		goto l3;
	}
	rcvr = oop1;
	l3:	/* end stackObjectValue: */;
	if (GIV(primFailCode)) {
		return;
	}
	argClass = fetchClassOfNonImm(arg);
	err = changeClassOfto(rcvr, argClass);
	if (err == 0) {

		/* Flush at cache because rcvr's class has changed. */
		/* begin pop: */
		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	}
	else {
		GIV(primFailCode) = err;
	}
	return;
}

	/* InterpreterPrimitives>>#primitiveClass */
static void
primitiveClass(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt instance;
    sqInt oop;
    char *sp;
    sqInt tagBits;

	instance = longAt(GIV(stackPointer));
	if ((GIV(argumentCount) > 0)
	 && (((instance & (tagMask())) == 0)
	 && (((longAt(instance)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	else {
		/* begin pop:thenPush: */
		if (((tagBits = instance & (tagMask()))) != 0) {
			/* begin fetchPointer:ofObject: */
			oop = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))));
		}
		else {
			oop = fetchClassOfNonImm(instance);
		}
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
		GIV(stackPointer) = sp;
	}
}


/*	Primitive. Void the VM profile histograms. */

	/* InterpreterPrimitives>>#primitiveClearVMProfile */
static void
primitiveClearVMProfile(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	ioClearProfile();
	/* begin pop: */
	GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
}


/*	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. */

	/* InterpreterPrimitives>>#primitiveClipboardText */
static void
primitiveClipboardText(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fmt;
    sqInt formatField;
    usqInt newObj;
    usqInt numBytes1;
    sqInt numSlots;
    sqInt s;
    char *sp;
    sqInt sz;

	if (GIV(argumentCount) == 1) {
		s = longAt(GIV(stackPointer));
		if (!(((s & (tagMask())) == 0)
			 && (((((usqInt) (longAt(s))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return;
		}
		if (!GIV(primFailCode)) {
			/* begin numBytesOfBytes: */
			fmt = (((usqInt) (longAt(s))) >> (formatShift())) & (formatMask());
			assert(fmt >= (firstByteFormat()));
			sz = ((numSlotsOf(s)) << (shiftForWord())) - (fmt & 7);
			clipboardWriteFromAt(sz, s + BaseHeaderSize, 0);
			/* begin pop: */
			GIV(stackPointer) += 1 * BytesPerWord;
		}
	}
	else {
		sz = clipboardSize();
		/* begin allocateBytes:classIndex: */
		assert(addressCouldBeClassObj(classAtIndex(ClassByteStringCompactIndex)));
		assert((instSpecOfClass(classAtIndex(ClassByteStringCompactIndex))) == (firstByteFormat()));
		/* begin allocateSlots:format:classIndex: */
		numSlots = ((sz + BytesPerOop) - 1) / BytesPerOop;
		formatField = (firstByteFormat()) + ((8 - sz) & (BytesPerWord - 1));
		if (numSlots >= (numSlotsMask())) {
			if ((((usqInt) numSlots) >> 56) > 0) {
				s = null;
				goto l4;
			}
			newObj = GIV(freeStart) + BaseHeaderSize;
			numBytes1 = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop);
		}
		else {
			newObj = GIV(freeStart);
			numBytes1 = BaseHeaderSize + ((numSlots < 1
	? /* begin allocationUnit */ 8
	: numSlots * BytesPerOop));
		}
		if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) {
			if (!GIV(needGCFlag)) {
				/* begin scheduleScavenge */
				GIV(needGCFlag) = 1;
				forceInterruptCheck();
			}
			s = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes1, formatField, ClassByteStringCompactIndex);
			goto l4;
		}
		if (numSlots >= (numSlotsMask())) {

			/* for header parsing we put a saturated slot count in the prepended overflow size word */
			flag("endianness");
			longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots);
			longAtput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), formatField, ClassByteStringCompactIndex));
		}
		else {
			longAtput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + ClassByteStringCompactIndex);
		}
		assert((numBytes1 % (allocationUnit())) == 0);
		assert((newObj % (allocationUnit())) == 0);
		GIV(freeStart) += numBytes1;
		s = newObj;
	l4:	/* end allocateBytes:classIndex: */;
		if (!(s)) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return;
		}
		clipboardReadIntoAt(sz, s + BaseHeaderSize, 0);
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), s);
		GIV(stackPointer) = sp;
	}
}


/*	Take a boolean which if true turns or keeps clock logging on. Answer an
	array supplying
	the size of the clock logs, the address of the usecs log, the index in it,
	the address of the
	msecs log, and the index into it. */

	/* InterpreterPrimitives>>#primitiveClockLogAddresses */
EXPORT(sqInt)
primitiveClockLogAddresses(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt midx;
    void *msecs;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop2;
    sqInt objOop3;
    sqInt objOop4;
    sqInt oop;
    sqInt oop1;
    sqInt oop2;
    sqInt result;
    sqInt runInNOut;
    char *sp;
    sqInt uidx;
    void *usecs;
    sqInt v1;
    sqInt v2;


	/* bypass type inference which would deduce int */
	midx = 0;
	msecs = ((void *) 0);
	uidx = 0;
	usecs = ((void *) 0);
	if (GIV(argumentCount) != 1) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	runInNOut = (longAt(GIV(stackPointer) + (0 * BytesPerWord))) == GIV(trueObj);
	ioGetClockLogSizeUsecsIdxMsecsIdx((&runInNOut), (&usecs), (&uidx), (&msecs), (&midx));
	result = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassArray) << (shiftForWord()))))), 5);
	if (result == 0) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin pushRemappableOop: */
	assert(addressCouldBeOop(result));
	GIV(remapBuffer)[(GIV(remapBufferCount) += 1)] = result;
	if (!(GIV(remapBufferCount) <= RemapBufferSize)) {
		error("remapBuffer overflow");
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	objOop = GIV(remapBuffer)[GIV(remapBufferCount)];
	assert(!(isOopForwarded(objOop)));
	longAtput((objOop + BaseHeaderSize) + (0U << (shiftForWord())), (((usqInt)runInNOut << 3) | 1));
	/* begin positive32BitIntegerFor: */
	v1 = ((((((usqInt)(((unsigned int) (((usqInt)usecs)))))) & 0xFFFFFFFFU) << 3) | 1);
	goto l5;
	l5:	/* end positive32BitIntegerFor: */;
	/* begin positive32BitIntegerFor: */
	v2 = ((((((usqInt)(((unsigned int) (((usqInt)msecs)))))) & 0xFFFFFFFFU) << 3) | 1);
	goto l6;
	l6:	/* end positive32BitIntegerFor: */;
	if (GIV(primFailCode)) {
		/* begin popRemappableOop */
		oop = GIV(remapBuffer)[GIV(remapBufferCount)];
		GIV(remapBufferCount) -= 1;
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin storePointer:ofObject:withValue: */
	objOop3 = GIV(remapBuffer)[GIV(remapBufferCount)];
	assert(!(isForwarded(objOop3)));
	if ((assert(isNonImmediate(objOop3)),
	oopisGreaterThanOrEqualTo(objOop3, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((v1 & (tagMask())) == 0)
		 && (oopisLessThan(v1, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(objOop3))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(objOop3);
			}
		}
	}
	longAtput((objOop3 + BaseHeaderSize) + (1U << (shiftForWord())), v1);
	/* begin storePointerUnchecked:ofObject:withValue: */
	objOop1 = GIV(remapBuffer)[GIV(remapBufferCount)];
	assert(!(isOopForwarded(objOop1)));
	longAtput((objOop1 + BaseHeaderSize) + (2U << (shiftForWord())), (((usqInt)uidx << 3) | 1));
	/* begin storePointer:ofObject:withValue: */
	objOop4 = GIV(remapBuffer)[GIV(remapBufferCount)];
	assert(!(isForwarded(objOop4)));
	if ((assert(isNonImmediate(objOop4)),
	oopisGreaterThanOrEqualTo(objOop4, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((v2 & (tagMask())) == 0)
		 && (oopisLessThan(v2, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(objOop4))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(objOop4);
			}
		}
	}
	longAtput((objOop4 + BaseHeaderSize) + (3U << (shiftForWord())), v2);
	/* begin storePointerUnchecked:ofObject:withValue: */
	objOop2 = GIV(remapBuffer)[GIV(remapBufferCount)];
	assert(!(isOopForwarded(objOop2)));
	longAtput((objOop2 + BaseHeaderSize) + (4U << (shiftForWord())), (((usqInt)midx << 3) | 1));
	/* begin pop:thenPush: */
	oop2 = GIV(remapBuffer)[GIV(remapBufferCount)];
	GIV(remapBufferCount) -= 1;
	oop1 = oop2;
	longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop1);
	GIV(stackPointer) = sp;
	return 0;
}

	/* InterpreterPrimitives>>#primitiveClosureValue */
static void
primitiveClosureValue(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt blockClosure;
    sqInt closureIP;
    sqInt closureMethod;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt i;
    int inInterpreter;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt methodHeader2;
    sqInt numArgs;
    sqInt numCopied;
    sqInt object;
    sqInt object1;
    sqInt object11;
    sqInt object12;
    sqInt object2;
    sqInt object3;
    sqInt objOop;
    sqInt oop;
    sqInt oop1;
    sqInt outerContext;
    char *sp;
    char *sp1;
    char *sp11;
    char *sp12;
    char *sp2;
    char *sp21;
    char *sp22;
    char *sp3;
    char *sp31;
    char *sp32;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;
    sqInt switched;

	blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));
	/* begin quickFetchInteger:ofObject: */
	oop = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	numArgs = (oop >> 3);
	if (!(GIV(argumentCount) == numArgs)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	outerContext = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))));
	if (!(((outerContext & (tagMask())) == 0)
		 && (((longAt(outerContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}

	/* Check if the closure's method is actually a CompiledMethod. */
	closureMethod = longAt((outerContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
	if (!(((closureMethod & (tagMask())) == 0)
		 && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin activateNewClosure:outer:method:numArgs:mayContextSwitch: */
	assert(isContext(outerContext));
	numCopied = (numSlotsOf(blockClosure)) - ClosureFirstCopiedValueIndex;
	assert(closureMethod == (fetchPointerofObject(MethodIndex, outerContext)));
	assert(isOopCompiledMethod(closureMethod));
	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)) {
		/* begin executeCogBlock:closure:mayContextSwitch: */
		methodHeader1 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader1))
		 && ((((usqInt)methodHeader1)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader1);
		assertCStackWellAligned();
		/* begin assertValidExecutionPointe:r:s: */
		assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
		/* begin ensurePushedInstructionPointer */
		if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

			/* invoked directly from the interpreter */
			/* begin iframeSavedIP:put: */
			assert(!(isMachineCodeFrame(GIV(framePointer))));
			longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
			/* begin push: */
			object2 = ceReturnToInterpreterPC();
			longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object2);
			GIV(stackPointer) = sp8;
		}
		else {

			/* instructionPointer == cogit ceReturnToInterpreterPC
			   ifTrue: [invoked from the interpreter via a machine code primitive]
			   ifFalse: [invoked from machine code].
			   If in the first case the bytecode instructionPointer has already been
			   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
			/* begin push: */
			longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp11;
		}
		/* begin push: */
		object11 = (((sqInt)cogMethod)) + ((cogMethod->blockEntryOffset));
		longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11);
		GIV(stackPointer) = sp21;
		/* begin push: */
		longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure);
		GIV(stackPointer) = sp31;
		ceCallCogCodePopReceiverReg();
		goto l8;
	}
	if (((assert((((methodHeader) & 7) == 1)),
	((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
		if ((GIV(instructionPointer) < (startOfMemory()))
		 || (closureMethod == GIV(lastCoggableInterpretedBlockMethod))) {

			/* If from interpreter and repeat block, attempt jitting */
			if (closureMethod != GIV(lastUncoggableInterpretedBlockMethod)) {
				cogselector(closureMethod, GIV(nilObj));
				if ((assert(isNonImmediate(closureMethod)),
				isCogMethodReference(longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
					/* begin executeCogBlock:closure:mayContextSwitch: */
					methodHeader2 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
					assert((isNonImmediate(methodHeader2))
					 && ((((usqInt)methodHeader2)) < (startOfMemory())));
					cogMethod1 = ((CogMethod *) methodHeader2);
					assertCStackWellAligned();
					/* begin assertValidExecutionPointe:r:s: */
					assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
					/* begin ensurePushedInstructionPointer */
					if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

						/* invoked directly from the interpreter */
						/* begin iframeSavedIP:put: */
						assert(!(isMachineCodeFrame(GIV(framePointer))));
						longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
						/* begin push: */
						object3 = ceReturnToInterpreterPC();
						longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object3);
						GIV(stackPointer) = sp9;
					}
					else {

						/* instructionPointer == cogit ceReturnToInterpreterPC
						   ifTrue: [invoked from the interpreter via a machine code primitive]
						   ifFalse: [invoked from machine code].
						   If in the first case the bytecode instructionPointer has already been
						   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
						/* begin push: */
						longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
						GIV(stackPointer) = sp12;
					}
					/* begin push: */
					object12 = (((sqInt)cogMethod1)) + ((cogMethod1->blockEntryOffset));
					longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12);
					GIV(stackPointer) = sp22;
					/* begin push: */
					longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure);
					GIV(stackPointer) = sp32;
					ceCallCogCodePopReceiverReg();
					goto l8;
				}
				if (!GIV(cogCompiledCodeCompactionCalledFor)) {
					GIV(lastUncoggableInterpretedBlockMethod) = closureMethod;
				}
			}
		}
		else {
			GIV(lastCoggableInterpretedBlockMethod) = closureMethod;
		}
	}
	else {
		maybeFlagMethodAsInterpreted(closureMethod);
	}
	assert(!(methodHasCogMethod(closureMethod)));
	if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) {
		if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
			GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
		}
	}
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp1;
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
	GIV(stackPointer) = sp2;
	GIV(framePointer) = GIV(stackPointer);
	/* begin push: */
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), closureMethod);
	GIV(stackPointer) = sp3;
	/* begin push: */
	longAtput((sp4 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
	GIV(stackPointer) = sp4;
	/* begin push: */
	object = (VMBIGENDIAN
		? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1ULL << ((BytesPerWord * 8) - 24))
		: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24));
	longAtput((sp5 = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp5;
	/* begin push: */
	longAtput((sp6 = GIV(stackPointer) - BytesPerWord), 0);
	GIV(stackPointer) = sp6;
	/* begin push: */
	objOop = longAt((outerContext + BaseHeaderSize) + (((sqInt)((usqInt)(ReceiverIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop = fixFollowedFieldofObjectwithInitialValue(ReceiverIndex, outerContext, objOop);
	}
	object1 = objOop;
	longAtput((sp7 = GIV(stackPointer) - BytesPerWord), object1);
	GIV(stackPointer) = sp7;
	for (i = 0; i < numCopied; i += 1) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + ClosureFirstCopiedValueIndex)) << (shiftForWord()))))));
		GIV(stackPointer) = sp;
	}
	assert(frameIsBlockActivation(GIV(framePointer)));
	assert(!(frameHasContext(GIV(framePointer))));
	/* begin quickFetchInteger:ofObject: */
	oop1 = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))));
	assert((((oop1) & 7) == 1));
	closureIP = (oop1 >> 3);
	GIV(instructionPointer) = ((closureMethod + closureIP) + BaseHeaderSize) - 2;
	/* begin setMethod:methodHeader: */
	GIV(method) = closureMethod;
	assert(isOopCompiledMethod(GIV(method)));
	assert((methodHeaderOf(GIV(method))) == methodHeader);
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	switched = 0;
	if (GIV(stackPointer) < GIV(stackLimit)) {
		switched = handleStackOverflowOrEventAllowContextSwitch(1);
	}
	returnToExecutivepostContextSwitch(inInterpreter, switched);
	l8:	/* end activateNewClosure:outer:method:numArgs:mayContextSwitch: */;
}


/*	An exact clone of primitiveClosureValue except that this version will not
	check for interrupts on stack overflow. It may invoke the garbage
	collector but will not switch processes. See
	checkForInterruptsMayContextSwitch:  */

	/* InterpreterPrimitives>>#primitiveClosureValueNoContextSwitch */
void
primitiveClosureValueNoContextSwitch(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt blockClosure;
    sqInt closureIP;
    sqInt closureMethod;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt i;
    int inInterpreter;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt methodHeader2;
    sqInt numArgs;
    sqInt numCopied;
    sqInt object;
    sqInt object1;
    sqInt object11;
    sqInt object12;
    sqInt object2;
    sqInt object3;
    sqInt objOop;
    sqInt oop;
    sqInt oop1;
    sqInt outerContext;
    char *sp;
    char *sp1;
    char *sp11;
    char *sp12;
    char *sp2;
    char *sp21;
    char *sp22;
    char *sp3;
    char *sp31;
    char *sp32;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;
    sqInt switched;

	blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));
	/* begin quickFetchInteger:ofObject: */
	oop = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	numArgs = (oop >> 3);
	if (!(GIV(argumentCount) == numArgs)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	outerContext = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))));
	if (!(((outerContext & (tagMask())) == 0)
		 && (((longAt(outerContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}

	/* Check if the closure's method is actually a CompiledMethod. */
	closureMethod = longAt((outerContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
	if (!(((closureMethod & (tagMask())) == 0)
		 && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin activateNewClosure:outer:method:numArgs:mayContextSwitch: */
	assert(isContext(outerContext));
	numCopied = (numSlotsOf(blockClosure)) - ClosureFirstCopiedValueIndex;
	assert(closureMethod == (fetchPointerofObject(MethodIndex, outerContext)));
	assert(isOopCompiledMethod(closureMethod));
	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)) {
		/* begin executeCogBlock:closure:mayContextSwitch: */
		methodHeader1 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader1))
		 && ((((usqInt)methodHeader1)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader1);
		assertCStackWellAligned();
		/* begin assertValidExecutionPointe:r:s: */
		assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
		/* begin ensurePushedInstructionPointer */
		if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

			/* invoked directly from the interpreter */
			/* begin iframeSavedIP:put: */
			assert(!(isMachineCodeFrame(GIV(framePointer))));
			longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
			/* begin push: */
			object2 = ceReturnToInterpreterPC();
			longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object2);
			GIV(stackPointer) = sp8;
		}
		else {

			/* instructionPointer == cogit ceReturnToInterpreterPC
			   ifTrue: [invoked from the interpreter via a machine code primitive]
			   ifFalse: [invoked from machine code].
			   If in the first case the bytecode instructionPointer has already been
			   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
			/* begin push: */
			longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp11;
		}
		/* begin push: */
		object11 = (((sqInt)cogMethod)) + (((cogMethod->blockEntryOffset)) - (noContextSwitchBlockEntryOffset()));
		longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11);
		GIV(stackPointer) = sp21;
		/* begin push: */
		longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure);
		GIV(stackPointer) = sp31;
		ceCallCogCodePopReceiverReg();
		goto l8;
	}
	if (((assert((((methodHeader) & 7) == 1)),
	((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
		if ((GIV(instructionPointer) < (startOfMemory()))
		 || (closureMethod == GIV(lastCoggableInterpretedBlockMethod))) {

			/* If from interpreter and repeat block, attempt jitting */
			if (closureMethod != GIV(lastUncoggableInterpretedBlockMethod)) {
				cogselector(closureMethod, GIV(nilObj));
				if ((assert(isNonImmediate(closureMethod)),
				isCogMethodReference(longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
					/* begin executeCogBlock:closure:mayContextSwitch: */
					methodHeader2 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
					assert((isNonImmediate(methodHeader2))
					 && ((((usqInt)methodHeader2)) < (startOfMemory())));
					cogMethod1 = ((CogMethod *) methodHeader2);
					assertCStackWellAligned();
					/* begin assertValidExecutionPointe:r:s: */
					assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
					/* begin ensurePushedInstructionPointer */
					if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

						/* invoked directly from the interpreter */
						/* begin iframeSavedIP:put: */
						assert(!(isMachineCodeFrame(GIV(framePointer))));
						longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
						/* begin push: */
						object3 = ceReturnToInterpreterPC();
						longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object3);
						GIV(stackPointer) = sp9;
					}
					else {

						/* instructionPointer == cogit ceReturnToInterpreterPC
						   ifTrue: [invoked from the interpreter via a machine code primitive]
						   ifFalse: [invoked from machine code].
						   If in the first case the bytecode instructionPointer has already been
						   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
						/* begin push: */
						longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
						GIV(stackPointer) = sp12;
					}
					/* begin push: */
					object12 = (((sqInt)cogMethod1)) + (((cogMethod1->blockEntryOffset)) - (noContextSwitchBlockEntryOffset()));
					longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12);
					GIV(stackPointer) = sp22;
					/* begin push: */
					longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure);
					GIV(stackPointer) = sp32;
					ceCallCogCodePopReceiverReg();
					goto l8;
				}
				if (!GIV(cogCompiledCodeCompactionCalledFor)) {
					GIV(lastUncoggableInterpretedBlockMethod) = closureMethod;
				}
			}
		}
		else {
			GIV(lastCoggableInterpretedBlockMethod) = closureMethod;
		}
	}
	else {
		maybeFlagMethodAsInterpreted(closureMethod);
	}
	assert(!(methodHasCogMethod(closureMethod)));
	if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) {
		if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
			GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
		}
	}
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp1;
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
	GIV(stackPointer) = sp2;
	GIV(framePointer) = GIV(stackPointer);
	/* begin push: */
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), closureMethod);
	GIV(stackPointer) = sp3;
	/* begin push: */
	longAtput((sp4 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
	GIV(stackPointer) = sp4;
	/* begin push: */
	object = (VMBIGENDIAN
		? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1ULL << ((BytesPerWord * 8) - 24))
		: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24));
	longAtput((sp5 = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp5;
	/* begin push: */
	longAtput((sp6 = GIV(stackPointer) - BytesPerWord), 0);
	GIV(stackPointer) = sp6;
	/* begin push: */
	objOop = longAt((outerContext + BaseHeaderSize) + (((sqInt)((usqInt)(ReceiverIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop = fixFollowedFieldofObjectwithInitialValue(ReceiverIndex, outerContext, objOop);
	}
	object1 = objOop;
	longAtput((sp7 = GIV(stackPointer) - BytesPerWord), object1);
	GIV(stackPointer) = sp7;
	for (i = 0; i < numCopied; i += 1) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + ClosureFirstCopiedValueIndex)) << (shiftForWord()))))));
		GIV(stackPointer) = sp;
	}
	assert(frameIsBlockActivation(GIV(framePointer)));
	assert(!(frameHasContext(GIV(framePointer))));
	/* begin quickFetchInteger:ofObject: */
	oop1 = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))));
	assert((((oop1) & 7) == 1));
	closureIP = (oop1 >> 3);
	GIV(instructionPointer) = ((closureMethod + closureIP) + BaseHeaderSize) - 2;
	/* begin setMethod:methodHeader: */
	GIV(method) = closureMethod;
	assert(isOopCompiledMethod(GIV(method)));
	assert((methodHeaderOf(GIV(method))) == methodHeader);
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	switched = 0;
	if (GIV(stackPointer) < GIV(stackLimit)) {
		switched = handleStackOverflowOrEventAllowContextSwitch(0);
	}
	returnToExecutivepostContextSwitch(inInterpreter, switched);
	l8:	/* end activateNewClosure:outer:method:numArgs:mayContextSwitch: */;
}

	/* InterpreterPrimitives>>#primitiveClosureValueWithArgs */
static void
primitiveClosureValueWithArgs(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt argumentArray;
    usqInt arraySize;
    sqInt blockClosure;
    sqInt closureIP;
    sqInt closureMethod;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt i;
    sqInt index;
    int inInterpreter;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt methodHeader2;
    sqInt numArgs;
    sqInt numCopied;
    usqInt numSlots;
    sqInt object;
    sqInt object1;
    sqInt object11;
    sqInt object12;
    sqInt object2;
    sqInt object3;
    sqInt objOop;
    sqInt oop;
    sqInt oop1;
    sqInt outerContext;
    char *sp;
    char *sp1;
    char *sp10;
    char *sp11;
    char *sp12;
    char *sp2;
    char *sp21;
    char *sp22;
    char *sp3;
    char *sp31;
    char *sp32;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;
    sqInt switched;
    sqInt top;

	argumentArray = longAt(GIV(stackPointer));
	if (!(((argumentArray & (tagMask())) == 0)
		 && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin numSlotsOf: */
	assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(argumentArray + 7);
	arraySize = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(argumentArray - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	if (!(roomToPushNArgs(arraySize))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));
	/* begin quickFetchInteger:ofObject: */
	oop = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	numArgs = (oop >> 3);
	if (!(arraySize == numArgs)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	outerContext = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureOuterContextIndex) << (shiftForWord())))));
	if (!(((outerContext & (tagMask())) == 0)
		 && (((longAt(outerContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}

	/* Check if the closure's method is actually a CompiledMethod. */
	closureMethod = longAt((outerContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
	if (!(((closureMethod & (tagMask())) == 0)
		 && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	index = 1;
	while (index <= numArgs) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((argumentArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord()))))));
		GIV(stackPointer) = sp;
		index += 1;
	}
	/* begin activateNewClosure:outer:method:numArgs:mayContextSwitch: */
	assert(isContext(outerContext));
	numCopied = (numSlotsOf(blockClosure)) - ClosureFirstCopiedValueIndex;
	assert(closureMethod == (fetchPointerofObject(MethodIndex, outerContext)));
	assert(isOopCompiledMethod(closureMethod));
	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)) {
		/* begin executeCogBlock:closure:mayContextSwitch: */
		methodHeader1 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader1))
		 && ((((usqInt)methodHeader1)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader1);
		assertCStackWellAligned();
		/* begin assertValidExecutionPointe:r:s: */
		assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
		/* begin ensurePushedInstructionPointer */
		if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

			/* invoked directly from the interpreter */
			/* begin iframeSavedIP:put: */
			assert(!(isMachineCodeFrame(GIV(framePointer))));
			longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
			/* begin push: */
			object2 = ceReturnToInterpreterPC();
			longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object2);
			GIV(stackPointer) = sp8;
		}
		else {

			/* instructionPointer == cogit ceReturnToInterpreterPC
			   ifTrue: [invoked from the interpreter via a machine code primitive]
			   ifFalse: [invoked from machine code].
			   If in the first case the bytecode instructionPointer has already been
			   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
			/* begin push: */
			longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp11;
		}
		/* begin push: */
		object11 = (((sqInt)cogMethod)) + ((cogMethod->blockEntryOffset));
		longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11);
		GIV(stackPointer) = sp21;
		/* begin push: */
		longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure);
		GIV(stackPointer) = sp31;
		ceCallCogCodePopReceiverReg();
		goto l10;
	}
	if (((assert((((methodHeader) & 7) == 1)),
	((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
		if ((GIV(instructionPointer) < (startOfMemory()))
		 || (closureMethod == GIV(lastCoggableInterpretedBlockMethod))) {

			/* If from interpreter and repeat block, attempt jitting */
			if (closureMethod != GIV(lastUncoggableInterpretedBlockMethod)) {
				cogselector(closureMethod, GIV(nilObj));
				if ((assert(isNonImmediate(closureMethod)),
				isCogMethodReference(longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
					/* begin executeCogBlock:closure:mayContextSwitch: */
					methodHeader2 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
					assert((isNonImmediate(methodHeader2))
					 && ((((usqInt)methodHeader2)) < (startOfMemory())));
					cogMethod1 = ((CogMethod *) methodHeader2);
					assertCStackWellAligned();
					/* begin assertValidExecutionPointe:r:s: */
					assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
					/* begin ensurePushedInstructionPointer */
					if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

						/* invoked directly from the interpreter */
						/* begin iframeSavedIP:put: */
						assert(!(isMachineCodeFrame(GIV(framePointer))));
						longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
						/* begin push: */
						object3 = ceReturnToInterpreterPC();
						longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object3);
						GIV(stackPointer) = sp9;
					}
					else {

						/* instructionPointer == cogit ceReturnToInterpreterPC
						   ifTrue: [invoked from the interpreter via a machine code primitive]
						   ifFalse: [invoked from machine code].
						   If in the first case the bytecode instructionPointer has already been
						   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
						/* begin push: */
						longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
						GIV(stackPointer) = sp12;
					}
					/* begin push: */
					object12 = (((sqInt)cogMethod1)) + ((cogMethod1->blockEntryOffset));
					longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12);
					GIV(stackPointer) = sp22;
					/* begin push: */
					longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure);
					GIV(stackPointer) = sp32;
					ceCallCogCodePopReceiverReg();
					goto l10;
				}
				if (!GIV(cogCompiledCodeCompactionCalledFor)) {
					GIV(lastUncoggableInterpretedBlockMethod) = closureMethod;
				}
			}
		}
		else {
			GIV(lastCoggableInterpretedBlockMethod) = closureMethod;
		}
	}
	else {
		maybeFlagMethodAsInterpreted(closureMethod);
	}
	assert(!(methodHasCogMethod(closureMethod)));
	if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) {
		if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
			GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
		}
	}
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp1;
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
	GIV(stackPointer) = sp2;
	GIV(framePointer) = GIV(stackPointer);
	/* begin push: */
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), closureMethod);
	GIV(stackPointer) = sp3;
	/* begin push: */
	longAtput((sp4 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
	GIV(stackPointer) = sp4;
	/* begin push: */
	object = (VMBIGENDIAN
		? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1ULL << ((BytesPerWord * 8) - 24))
		: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24));
	longAtput((sp5 = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp5;
	/* begin push: */
	longAtput((sp6 = GIV(stackPointer) - BytesPerWord), 0);
	GIV(stackPointer) = sp6;
	/* begin push: */
	objOop = longAt((outerContext + BaseHeaderSize) + (((sqInt)((usqInt)(ReceiverIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop = fixFollowedFieldofObjectwithInitialValue(ReceiverIndex, outerContext, objOop);
	}
	object1 = objOop;
	longAtput((sp7 = GIV(stackPointer) - BytesPerWord), object1);
	GIV(stackPointer) = sp7;
	for (i = 0; i < numCopied; i += 1) {
		/* begin push: */
		longAtput((sp10 = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + ClosureFirstCopiedValueIndex)) << (shiftForWord()))))));
		GIV(stackPointer) = sp10;
	}
	assert(frameIsBlockActivation(GIV(framePointer)));
	assert(!(frameHasContext(GIV(framePointer))));
	/* begin quickFetchInteger:ofObject: */
	oop1 = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord())))));
	assert((((oop1) & 7) == 1));
	closureIP = (oop1 >> 3);
	GIV(instructionPointer) = ((closureMethod + closureIP) + BaseHeaderSize) - 2;
	/* begin setMethod:methodHeader: */
	GIV(method) = closureMethod;
	assert(isOopCompiledMethod(GIV(method)));
	assert((methodHeaderOf(GIV(method))) == methodHeader);
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	switched = 0;
	if (GIV(stackPointer) < GIV(stackLimit)) {
		switched = handleStackOverflowOrEventAllowContextSwitch(1);
	}
	returnToExecutivepostContextSwitch(inInterpreter, switched);
	l10:	/* end activateNewClosure:outer:method:numArgs:mayContextSwitch: */;
}


/*	Return the value of the microsecond clock in the local timezone, as
	updated by the heartbeat, as an integer.
	This is the number of microseconds since the Smalltalk epoch, 1901/1/1
	12:00am. The microsecond clock is at least 60 bits wide which means it'll
	get to around August
	38435 before it wraps around. Be sure to put it on your calendar. The
	coarse clock is
	updated by the heartbeat thread and as such is much cheaper than
	primitiveUTCMicrosecondClock, which always entails a system call. */

	/* InterpreterPrimitives>>#primitiveCoarseLocalMicrosecondClock */
static void
primitiveCoarseLocalMicrosecondClock(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;
    char *sp;

	/* begin pop:thenPush: */
	oop = positive64BitIntegerFor(ioLocalMicroseconds());
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}


/*	Return the value of the microsecond clock as updated by the heartbeat as
	an integer.
	This is the number of microseconds since the Smalltalk epoch, 1901/1/1
	12:00am. The microsecond clock is at least 60 bits wide which means it'll
	get to around August
	38435 before it wraps around. Be sure to put it on your calendar. The
	coarse clock is
	updated by the heartbeat thread and as such is much cheaper than
	primitiveUTCMicrosecondClock, which always entails a system call. */

	/* InterpreterPrimitives>>#primitiveCoarseUTCMicrosecondClock */
static void
primitiveCoarseUTCMicrosecondClock(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;
    char *sp;

	/* begin pop:thenPush: */
	oop = positive64BitIntegerFor(ioUTCMicroseconds());
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}


/*	Primitive. Compare two byte-indexed objects for equality */

	/* InterpreterPrimitives>>#primitiveCompareBytes */
EXPORT(void)
primitiveCompareBytes(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg1;
    sqInt arg2;
    sqInt fmt;
    sqInt fmt1;
    sqInt i;
    sqInt len1;
    sqInt len2;
    usqInt numBytes;
    usqInt numBytes1;
    usqInt numSlots;
    usqInt numSlots1;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;

	if (!(GIV(argumentCount) == 1)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	arg1 = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	arg2 = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	if (!((((arg1 & (tagMask())) == 0)
		 && (((((usqInt) (longAt(arg1))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))
		 && (((arg2 & (tagMask())) == 0)
		 && (((((usqInt) (longAt(arg2))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	if (arg1 == arg2) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(trueObj));
		GIV(stackPointer) = sp;
		return;
	}
	/* begin byteSizeOf: */
	if (arg1 & (tagMask())) {
		len1 = 0;
		goto l2;
	}
	/* begin numBytesOf: */
	fmt = (((usqInt) (longAt(arg1))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOf: */
	assert((classIndexOf(arg1)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(arg1 + 7);
	numBytes = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(arg1 - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	numBytes = numBytes << (shiftForWord());
	if (fmt >= (firstByteFormat())) {

		/* bytes (the common case), including CompiledMethod */
		len1 = numBytes - (fmt & 7);
		goto l2;
	}
	if (fmt <= (sixtyFourBitIndexableFormat())) {
		len1 = numBytes;
		goto l2;
	}
	if (fmt >= (firstShortFormat())) {
		len1 = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1)));
		goto l2;
	}
	len1 = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2)));
	l2:	/* end byteSizeOf: */;
	/* begin byteSizeOf: */
	if (arg2 & (tagMask())) {
		len2 = 0;
		goto l4;
	}
	/* begin numBytesOf: */
	fmt1 = (((usqInt) (longAt(arg2))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOf: */
	assert((classIndexOf(arg2)) > (isForwardedObjectClassIndexPun()));
	numSlots1 = byteAt(arg2 + 7);
	numBytes1 = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(arg2 - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	numBytes1 = numBytes1 << (shiftForWord());
	if (fmt1 >= (firstByteFormat())) {

		/* bytes (the common case), including CompiledMethod */
		len2 = numBytes1 - (fmt1 & 7);
		goto l4;
	}
	if (fmt1 <= (sixtyFourBitIndexableFormat())) {
		len2 = numBytes1;
		goto l4;
	}
	if (fmt1 >= (firstShortFormat())) {
		len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 3)) << 1)));
		goto l4;
	}
	len2 = numBytes1 - (((sqInt)((usqInt)((fmt1 & 1)) << 2)));
	l4:	/* end byteSizeOf: */;
	if (!(len1 == len2)) {
		/* begin pop:thenPush: */
		longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj));
		GIV(stackPointer) = sp1;
		return;
	}
	for (i = 0; i < len1; i += 1) {
		if (!((byteAt((arg1 + BaseHeaderSize) + i)) == (byteAt((arg2 + BaseHeaderSize) + i)))) {
			/* begin pop:thenPush: */
			longAtput((sp2 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj));
			GIV(stackPointer) = sp2;
			return;
		}
	}
	/* begin pop:thenPush: */
	longAtput((sp3 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(trueObj));
	GIV(stackPointer) = sp3;
}


/*	<string1> primitiveCompareWith: string2 [collated: order] */
/*	1 - fetch the parameters from the stack */

	/* InterpreterPrimitives>>#primitiveCompareWith */
EXPORT(void)
primitiveCompareWith(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt c1;
    sqInt c11;
    sqInt c2;
    sqInt c21;
    sqInt fmt;
    sqInt fmt1;
    sqInt i;
    sqInt i1;
    sqInt min;
    sqInt min1;
    sqInt order;
    sqInt result;
    char *sp;
    sqInt string1;
    sqInt string2;
    sqInt strLength1;
    sqInt strLength2;

	order = 0;
	if (!(GIV(argumentCount) == 1)) {
		if (GIV(argumentCount) != 2) {
			GIV(primFailCode) = PrimErrBadNumArgs;
			return;
		}
		order = longAt(GIV(stackPointer));
		if (!((((order & (tagMask())) == 0)
			 && (((((usqInt) (longAt(order))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))
			 && ((numBytesOfBytes(order)) == 256))) {
			GIV(primFailCode) = PrimErrBadArgument;
			return;
		}
	}
	string1 = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));

	/* 2 - check their types - all parameters are ByteObject */
	string2 = longAt(GIV(stackPointer) + ((GIV(argumentCount) - 1) * BytesPerWord));
	if (!((((string1 & (tagMask())) == 0)
		 && (((((usqInt) (longAt(string1))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))
		 && (((string2 & (tagMask())) == 0)
		 && (((((usqInt) (longAt(string2))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))))) {
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	/* begin numBytesOfBytes: */
	fmt = (((usqInt) (longAt(string1))) >> (formatShift())) & (formatMask());
	assert(fmt >= (firstByteFormat()));
	strLength1 = ((numSlotsOf(string1)) << (shiftForWord())) - (fmt & 7);
	/* begin numBytesOfBytes: */
	fmt1 = (((usqInt) (longAt(string2))) >> (formatShift())) & (formatMask());
	assert(fmt1 >= (firstByteFormat()));
	strLength2 = ((numSlotsOf(string2)) << (shiftForWord())) - (fmt1 & 7);
	if (order == null) {
		/* begin rawCompare:length:with:length:accessBlock: */
		min = ((strLength1 < strLength2) ? strLength1 : strLength2);
		for (i = 0; i < min; i += 1) {
			c1 = byteAt((string1 + BaseHeaderSize) + i);
			c2 = byteAt((string2 + BaseHeaderSize) + i);
			if (!(c1 == c2)) {
				result = c1 - c2;
				goto l1;
			}
		}
		result = strLength1 - strLength2;
	l1:	/* end rawCompare:length:with:length:accessBlock: */;
	}
	else {
		/* begin rawCompare:length:with:length:accessBlock: */
		min1 = ((strLength1 < strLength2) ? strLength1 : strLength2);
		for (i1 = 0; i1 < min1; i1 += 1) {
			/* begin fetchByte:ofObject: */
			c11 = byteAt((order + BaseHeaderSize) + ((byteAt((string1 + BaseHeaderSize) + i1)) + 1));
			/* begin fetchByte:ofObject: */
			c21 = byteAt((order + BaseHeaderSize) + ((byteAt((string2 + BaseHeaderSize) + i1)) + 1));
			if (!(c11 == c21)) {
				result = c11 - c21;
				goto l3;
			}
		}
		result = strLength1 - strLength2;
	l3:	/* end rawCompare:length:with:length:accessBlock: */;
	}
	/* begin methodReturnInteger: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)result << 3) | 1));
	GIV(stackPointer) = sp;
}


/*	Fill the receiver, which must be an indexable non-pointer
	object, with the given integer value. */

	/* InterpreterPrimitives>>#primitiveConstantFill */
static void
primitiveConstantFill(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt end;
    usqLong fillValue;
    sqInt format;
    usqInt i;
    sqInt oddBytes;
    sqInt rcvr;

	/* begin primitiveConstantFillSpur */
	fillValue = positive64BitValueOf(longAt(GIV(stackPointer)));
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!((!GIV(primFailCode))
		 && (((rcvr & (tagMask())) == 0)
		 && (((format = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))) >= (sixtyFourBitIndexableFormat()))))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		goto l2;
	}
	if (format >= (firstShortFormat())) {
		if (format >= (firstByteFormat())) {
			if ((fillValue > 0xFF)
			 || (format >= (firstCompiledMethodFormat()))) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				goto l2;
			}
			fillValue = ((fillValue + (fillValue << 8)) + (fillValue << 16)) + (fillValue << 24);
			oddBytes = format & 7;
		}
		else {
			if (fillValue > 0xFFFF) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				goto l2;
			}
			fillValue += fillValue << 16;
			oddBytes = ((sqInt)((usqInt)((format & 3)) << 1));
		}
		fillValue += fillValue << 32;
	}
	else {
		if (format == (sixtyFourBitIndexableFormat())) {
			oddBytes = 0;
		}
		else {
			if (fillValue > 0xFFFFFFFFU) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				goto l2;
			}
			fillValue += fillValue << 32;
			oddBytes = ((sqInt)((usqInt)((format & 1)) << 2));
		}
	}
	end = addressAfter(rcvr);
	i = rcvr + BaseHeaderSize;
	while (i < end) {
		long64Atput(i, fillValue);
		i += 8;
	}
	if (oddBytes > 0) {
		flag("endianness");
		fillValue = fillValue >> (8 * oddBytes);
		long64Atput(i - 8, fillValue);
	}
	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	l2:	/* end primitiveConstantFillSpur */;
}


/*	Primitive. Start or stop the VM profiler. The first argument is a boolean
	to switch profiling on or off. The second argument is an integer or nil.
	If an integer it determines the maximum number of samples in the VM's
	sample buffer. Answer the current number of samples in the buffer. */

	/* InterpreterPrimitives>>#primitiveControlVMProfiling */
static void
primitiveControlVMProfiling(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bufferSize;
    sqInt numSamples;
    sqInt onOffBar;
    char *sp;

	if (GIV(argumentCount) != 2) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	if (((onOffBar = longAt(GIV(stackPointer) + (1 * BytesPerWord)))) == GIV(trueObj)) {
		onOffBar = 1;
	}
	else {
		if (onOffBar == GIV(falseObj)) {
			onOffBar = 0;
		}
		else {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return;
		}
	}
	if (((bufferSize = longAt(GIV(stackPointer)))) == GIV(nilObj)) {
		bufferSize = 0;
	}
	else {
		if (!(((((bufferSize) & 7) == 1))
			 && (((bufferSize = (bufferSize >> 3))) > 0))) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return;
		}
	}
	numSamples = ioControlNewProfile(onOffBar,bufferSize);
	/* begin pop:thenPushInteger: */
	longAtput((sp = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), (((usqInt)numSamples << 3) | 1));
	GIV(stackPointer) = sp;
}


/*	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 contexts (because of context-to-stack
	mapping). Fail if receiver and argument have different lengths (for
	indexable objects).
	Fail if the objects are not in a fit state to be copied (e.g. married
	contexts and Cogged methods) */

	/* InterpreterPrimitives>>#primitiveCopyObject */
static void
primitiveCopyObject(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;
    sqInt fmt;
    sqInt i;
    usqInt length;
    usqInt numBytes;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt rcvr;
    sqInt valuePointer;

	if (!(GIV(argumentCount) >= 1)) {
		GIV(primFailCode) = PrimErrBadNumArgs;
		return;
	}
	arg = longAt(GIV(stackPointer));
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (rcvr & (tagMask())) {
		GIV(primFailCode) = PrimErrBadReceiver;
		return;
	}
	if (arg & (tagMask())) {
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	if (((longAt(rcvr)) & (classIndexMask())) != ((longAt(arg)) & (classIndexMask()))) {
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	if (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))) {
		/* begin numBytesOf: */
		fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
		/* begin numSlotsOf: */
		assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
		numSlots1 = byteAt(rcvr + 7);
		numBytes = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		numBytes = numBytes << (shiftForWord());
		if (fmt >= (firstByteFormat())) {

			/* bytes (the common case), including CompiledMethod */
			length = numBytes - (fmt & 7);
			goto l4;
		}
		if (fmt <= (sixtyFourBitIndexableFormat())) {
			length = ((sqInt) numBytes);
			goto l4;
		}
		if (fmt >= (firstShortFormat())) {
			length = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1)));
			goto l4;
		}
		length = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2)));
	l4:	/* end numBytesOf: */;
		if (!((((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) == ((((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask())))
			 && (length == (numBytesOf(arg))))) {
			GIV(primFailCode) = PrimErrBadArgument;
			return;
		}
		memcpy(((void *)(rcvr + BaseHeaderSize)), ((void *)(arg + BaseHeaderSize)), length);
	}
	else {
		if (!(isAppropriateForCopyObject(rcvr))) {
			GIV(primFailCode) = PrimErrBadReceiver;
			return;
		}
		/* begin numSlotsOf: */
		assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(rcvr + 7);
		length = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
		if (!((isAppropriateForCopyObject(arg))
			 && (length == (lengthOfformat(arg, (((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask())))))) {
			GIV(primFailCode) = PrimErrBadArgument;
			return;
		}
		for (i = 0; i < length; i += 1) {
			/* begin storePointer:ofObject:withValue: */
			valuePointer = longAt((arg + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
			assert(!(isForwarded(rcvr)));
			if ((assert(isNonImmediate(rcvr)),
			oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((valuePointer & (tagMask())) == 0)
				 && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(rcvr);
					}
				}
			}
			longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer);
		}
	}
	/* begin pop: */
	GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
}


/*	Crash the VM by indirecting through a null pointer. If the sole argument
	is true crash in this thread, and if it is false crash in a new thread. If
	the argument is an integer use the method that implies.
	bit 0 = thread to crash in; 1 => this thread
	bit 1 = crash method; 0 => indirect through null pointer; 1 => call exit */

	/* InterpreterPrimitives>>#primitiveCrashVM */
EXPORT(sqInt)
primitiveCrashVM(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt crashInThisThread;

	if (((((longAt(GIV(stackPointer)))) & 7) == 1)) {
		crashInThisThread = ((longAt(GIV(stackPointer))) >> 3);
	}
	else {
		/* begin booleanValueOf: */
		if ((longAt(GIV(stackPointer))) == GIV(trueObj)) {
			crashInThisThread = 1;
			goto l1;
		}
		if ((longAt(GIV(stackPointer))) == GIV(falseObj)) {
			crashInThisThread = 0;
			goto l1;
		}
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		crashInThisThread = null;
	l1:	/* end booleanValueOf: */;
	}
	if (GIV(primFailCode)
	 || (GIV(argumentCount) != 1)) {
		return (GIV(primFailCode) = PrimErrBadNumArgs);
	}
	crashInThisOrAnotherThread(crashInThisThread);
	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	return 0;
}


/*	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)
 */

	/* InterpreterPrimitives>>#primitiveDisablePowerManager */
EXPORT(sqInt)
primitiveDisablePowerManager(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integer;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		integer = (integerPointer >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integer = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	if (!GIV(primFailCode)) {
		ioDisablePowerManager(integer);
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
	return 0;
}

	/* InterpreterPrimitives>>#primitiveDiv */
static void
primitiveDiv(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt quotient;
    char *sp;

	quotient = doPrimitiveDivby(longAt(GIV(stackPointer) + (1 * BytesPerWord)), longAt(GIV(stackPointer)));
	/* begin pop2AndPushIntegerIfOK: */
	if (!GIV(primFailCode)) {
		if ((((((usqInt) quotient) >> 60) + 1) & 15) <= 1) {
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)quotient << 3) | 1));
			GIV(stackPointer) = sp;
		}
		else {
			/* begin success: */
			
			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
}

	/* InterpreterPrimitives>>#primitiveDivide */
static void
primitiveDivide(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArgument;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt integerReceiver;
    char *sp;

	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		integerReceiver = (integerPointer >> 3);
		goto l1;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerReceiver = 0;
		goto l1;
	}
	l1:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer1) & 7) == 1)) {
		integerArgument = (integerPointer1 >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerArgument = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	if ((integerArgument != 0)
	 && ((integerReceiver % integerArgument) == 0)) {
		/* begin pop2AndPushIntegerIfOK: */
		if (!GIV(primFailCode)) {
			if ((((((usqInt) (integerReceiver / integerArgument)) >> 60) + 1) & 15) <= 1) {
				/* begin pop:thenPush: */
				longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)(integerReceiver / integerArgument) << 3) | 1));
				GIV(stackPointer) = sp;
			}
			else {
				/* begin success: */
				
				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
		}
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveDivideLargeIntegers */
EXPORT(void)
primitiveDivideLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    char *sp;

	oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (GIV(primFailCode)) {
		return;
	}
	if (!((b != 0)
		 && ((a % b) == 0))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	result = a / b;
	oopResult = magnitude64BitIntegerForneg(result, aIsNegative != bIsNegative);
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(stackPointer) = sp;
	}
}


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

	/* InterpreterPrimitives>>#primitiveDivLargeIntegers */
EXPORT(void)
primitiveDivLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong rem;
    usqLong result;
    char *sp;

	oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (b == 0) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (GIV(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 (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveEqual */
static void
primitiveEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArgument;
    sqInt integerReceiver;
    int result;
    char *sp;
    char *sp1;

	integerArgument = longAt(GIV(stackPointer));
	integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((integerReceiver & integerArgument) & (smallIntegerTag())) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerReceiver == integerArgument
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
	else {
		result = (signed64BitValueOf(integerReceiver)) == (signed64BitValueOf(integerArgument));
		if (!GIV(primFailCode)) {
			/* begin pop:thenPushBool: */
			longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (result
				? GIV(trueObj)
				: GIV(falseObj)));
			GIV(stackPointer) = sp1;
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveEqualLargeIntegers */
EXPORT(void)
primitiveEqualLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqLong integerArg;
    sqLong integerRcvr;
    char *sp;

	integerArg = signed64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	integerRcvr = signed64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerRcvr == integerArg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveExitToDebugger */
static void
primitiveExitToDebugger(void)
{
	error("Exit to debugger at user request");
}


/*	Computes E raised to the receiver power.
	N.B. IMO we should be able to assume the receiver is a float because this
	primitive is specific to floats. eem 2/13/2017 */

	/* InterpreterPrimitives>>#primitiveExp */
static void
primitiveExp(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    double rcvr;

	/* begin stackFloatValue: */
	rcvr = floatValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin stackTopPut: */
		aValue = floatObjectOf(exp(rcvr));
		longAtPointerput(GIV(stackPointer), aValue);
	}
}


/*	Exponent part of this float.
	N.B. IMO we should be able to assume the receiver is a float because this
	primitive is specific to floats. eem 2/13/2017 */

	/* InterpreterPrimitives>>#primitiveExponent */
static void
primitiveExponent(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    int pwr;
    double rcvr;

	pwr = 0;
	/* begin stackFloatValue: */
	rcvr = floatValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	if (!GIV(primFailCode)) {

		/* rcvr = frac * 2^pwr, where frac is in [0.5..1.0) */
		frexp(rcvr, (&pwr));
		longAtPointerput(GIV(stackPointer), (((usqInt)(pwr - 1) << 3) | 1));
	}
}


/*	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. */

	/* InterpreterPrimitives>>#primitiveFail */
sqInt
primitiveFail(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	return 0;
}


/*	Set PrimErrFFIException primitive failure and associated exceptionCode
	(a.k.a. 
	osErrorCode) and exceptionPC. Under control of the ffiExceptionResponse
	flag, if in a primitive with an error code and the inFFIFlags indicate
	we're in an FFI call,
	then fail the primitive.
	ffiExceptionResponse < 0 never fail
	ffiExceptionResponse = 0 fail if method has a primitive error code
	(default) ffiExceptionResponse > 0 always fail */

	/* InterpreterPrimitives>>#primitiveFailForFFIException:at: */
sqInt
primitiveFailForFFIExceptionat(usqLong exceptionCode, usqInt pc)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    CogMethod *cogMethod;
    sqInt i;
    usqInt initialIP;
    sqInt methodHeader;
    sqInt numArgs;
    sqInt numTemps;
    sqInt object;
    sqInt object1;
    sqInt rcvr;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;

	cogMethod = ((CogMethod *) 0);
	if (((GIV(inFFIFlags) & DisownVMForFFICall) == 0)
	 || (ffiExceptionResponse < 0)) {

		/* i.e. never fail */
		return 0;
	}
	GIV(osErrorCode) = ((sqLong) exceptionCode);
	GIV(exceptionPC) = pc;
	GIV(primFailCode) = PrimErrFFIException;
	if ((ffiExceptionResponse > 0)
	 || ((((GIV(newMethod) & (tagMask())) == 0)
	 && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))
	 && (methodUsesPrimitiveErrorCode(GIV(newMethod))))) {
		ownVM(DisownVMForFFICall);
		/* begin activateFailingPrimitiveMethod */
		assert(GIV(primFailCode) != 0);
		assert(addressCouldBeObj(GIV(newMethod)));
		assert(isCompiledMethod(GIV(newMethod)));
		assert((primitiveIndexOf(GIV(newMethod))) != 0);
		/* begin justActivateNewMethod: */
		methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if (0) {
			cogMethod = ((CogMethod *) methodHeader);
			methodHeader = (cogMethod->methodHeader);
		}
		numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F;
		numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15;

		/* could new rcvr be set at point of send? */
		rcvr = longAt(GIV(stackPointer) + (numArgs * BytesPerWord));
		assert(!(isOopForwarded(rcvr)));
		if ((cogMethod != null)
		 && ((((usqInt)GIV(instructionPointer))) >= (startOfMemory()))) {
			/* begin iframeSavedIP:put: */
			assert(!(isMachineCodeFrame(GIV(framePointer))));
			longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
			GIV(instructionPointer) = ceReturnToInterpreterPC();
		}
		/* begin push: */
		longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp7;
		/* begin push: */
		longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
		GIV(stackPointer) = sp8;
		GIV(framePointer) = GIV(stackPointer);
		initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize;
		if (cogMethod == null) {
			/* begin push: */
			longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
			GIV(stackPointer) = sp;
			/* begin setMethod:methodHeader: */
			GIV(method) = GIV(newMethod);
			assert(isOopCompiledMethod(GIV(method)));
			assert((methodHeaderOf(GIV(method))) == methodHeader);
			
#      if MULTIPLEBYTECODESETS
			GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0
				? 256
				: 0);
#      endif /* MULTIPLEBYTECODESETS */
			/* begin push: */
			longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
			GIV(stackPointer) = sp1;
			/* begin push: */
			object = (VMBIGENDIAN
				? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0)
				: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0));
			longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object);
			GIV(stackPointer) = sp2;
			/* begin push: */
			longAtput((sp3 = GIV(stackPointer) - BytesPerWord), 0);
			GIV(stackPointer) = sp3;
			GIV(instructionPointer) = initialIP - 1;
		}
		else {
			/* begin push: */
			object1 = ((usqInt)cogMethod);
			longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object1);
			GIV(stackPointer) = sp4;
			/* begin push: */
			longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
			GIV(stackPointer) = sp5;
			GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
		}
		/* begin push: */
		longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr);
		GIV(stackPointer) = sp9;
		for (i = (numArgs + 1); i <= numTemps; i += 1) {
			/* begin push: */
			longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
			GIV(stackPointer) = sp6;
		}
		if ((/* begin alternateHeaderHasPrimitiveFlag: */
		methodHeader & AlternateHeaderHasPrimFlag)) {

			/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
			   with a long store temp.  Strictly no need to skip the store because it's effectively a noop. */
			if (!(cogMethod)) {
				GIV(instructionPointer) += 3;
			}
			if (GIV(primFailCode) != 0) {
				reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader);
			}
		}
		siglongjmp(reenterInterpreter, ReturnToInterpreter);
	}
	return 0;
}


/*	Set PrimErrOSError primitive failure and associated osErrorCode. */

	/* InterpreterPrimitives>>#primitiveFailForOSError: */
sqInt
primitiveFailForOSError(sqLong osError)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(osErrorCode) = osError;
	return (GIV(primFailCode) = PrimErrOSError);
}


/*	Set specific primitive failure.
	N.B. primitiveFailFor: PrimNoErr is expected to clear the primFailCode. */

	/* InterpreterPrimitives>>#primitiveFailFor: */
sqInt
primitiveFailFor(sqInt reasonCode)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (GIV(primFailCode) = reasonCode);
}

	/* InterpreterPrimitives>>#primitiveFailureCode */
sqInt
primitiveFailureCode(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(primFailCode);
}

	/* InterpreterPrimitives>>#primitiveFetchNextMourner */
static void
primitiveFetchNextMourner(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt mourner;
    char *sp;

	mourner = (GIV(mournQueue) != GIV(nilObj)
		? popObjStack(GIV(mournQueue))
		: 0);
	if (mourner == null) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrNotFound;
	}
	else {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), mourner);
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveFloatAdd */
static void
primitiveFloatAdd(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    sqInt argOop;
    usqLong bits;
    usqLong bits1;
    double rcvr;
    sqInt rcvrOop;
    double result;
    double result1;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    sqInt shift1;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    double value;
    double value1;

	/* begin primitiveFloatAdd:toArg: */
	rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argOop = longAt(GIV(stackPointer));
	/* begin loadFloatOrIntFrom: */
	if (((tagBits = rcvrOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(rcvrOop));
			rot = ((usqInt) (((usqInt)rcvrOop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			rcvr = value;
			goto l3;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(rcvrOop) << shift)))) >> shift) == rcvrOop))) {
			rcvr = ((double) ((rcvrOop >> 3)) );
			goto l3;
		}
	}
	else {
		if (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(rcvrOop + BaseHeaderSize, result);
			rcvr = result;
			goto l3;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	rcvr = 0.0;
	l3:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if (((tagBits1 = argOop & (tagMask()))) != 0) {
		if (tagBits1 == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(argOop));
			rot1 = ((usqInt) (((usqInt)argOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits1 == (smallIntegerTag()))
		 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(argOop) << shift1)))) >> shift1) == argOop))) {
			arg = ((double) ((argOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(argOop + BaseHeaderSize, result1);
			arg = result1;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushFloat: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr + arg));
		GIV(stackPointer) = sp;
	}
	return;
}


/*	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. */

	/* InterpreterPrimitives>>#primitiveFloatAt */
static void
primitiveFloatAt(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt index;
    unsigned int integerValue;
    unsigned int integerValue1;
    sqInt rcvr;
    sqInt reasonCode;
    usqInt result;
    char *sp;
    char *sp1;

	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	index = longAt(GIV(stackPointer));
	if (index == ConstOne) {
		/* begin positive32BitIntegerFor: */
		integerValue = ((unsigned int) (fetchLong32ofFloatObject((VMBIGENDIAN
	? 0
	: 1), rcvr)));
		result = ((((((usqInt)integerValue)) & 0xFFFFFFFFU) << 3) | 1);
		goto l2;
	l2:	/* end positive32BitIntegerFor: */;
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result);
		GIV(stackPointer) = sp;
		return;
	}
	if (index == ConstTwo) {
		/* begin positive32BitIntegerFor: */
		integerValue1 = ((unsigned int) (fetchLong32ofFloatObject((VMBIGENDIAN
	? 1
	: 0), rcvr)));
		result = ((((((usqInt)integerValue1)) & 0xFFFFFFFFU) << 3) | 1);
		goto l3;
	l3:	/* end positive32BitIntegerFor: */;
		/* begin pop:thenPush: */
		longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result);
		GIV(stackPointer) = sp1;
		return;
	}
	/* begin primitiveFailFor: */
	reasonCode = ((((index) & 7) == 1)
		? PrimErrBadIndex
		: PrimErrBadArgument);
	GIV(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. */

	/* InterpreterPrimitives>>#primitiveFloatAtPut */
static void
primitiveFloatAtPut(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt index;
    sqInt oopToStore;
    sqInt rcvr;
    sqInt reasonCode;
    char *sp;
    char *sp1;
    usqInt valueToStore;

	oopToStore = longAt(GIV(stackPointer));
	valueToStore = positive32BitValueOf(oopToStore);
	if (GIV(primFailCode)) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (rcvr & (smallFloatTag())) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadReceiver;
		return;
	}
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrNoModification;
		return;
	}
	if (index == ConstOne) {
		/* begin storeLong32:ofObject:withValue: */
		fieldIndex = (VMBIGENDIAN
			? 0
			: 1);
		long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))), valueToStore);
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), oopToStore);
		GIV(stackPointer) = sp;
		return;
	}
	if (index == ConstTwo) {
		/* begin storeLong32:ofObject:withValue: */
		fieldIndex1 = (VMBIGENDIAN
			? 1
			: 0);
		long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << 2))), valueToStore);
		/* begin pop:thenPush: */
		longAtput((sp1 = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), oopToStore);
		GIV(stackPointer) = sp1;
		return;
	}
	/* begin primitiveFailFor: */
	reasonCode = ((((index) & 7) == 1)
		? PrimErrBadIndex
		: PrimErrBadArgument);
	GIV(primFailCode) = reasonCode;
}

	/* InterpreterPrimitives>>#primitiveFloatDivide */
static void
primitiveFloatDivide(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    sqInt argOop;
    usqLong bits;
    usqLong bits1;
    double rcvr;
    sqInt rcvrOop;
    double result;
    double result1;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    sqInt shift1;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    double value;
    double value1;

	/* begin primitiveFloatDivide:byArg: */
	rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argOop = longAt(GIV(stackPointer));
	/* begin loadFloatOrIntFrom: */
	if (((tagBits = rcvrOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(rcvrOop));
			rot = ((usqInt) (((usqInt)rcvrOop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			rcvr = value;
			goto l3;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(rcvrOop) << shift)))) >> shift) == rcvrOop))) {
			rcvr = ((double) ((rcvrOop >> 3)) );
			goto l3;
		}
	}
	else {
		if (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(rcvrOop + BaseHeaderSize, result);
			rcvr = result;
			goto l3;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	rcvr = 0.0;
	l3:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if (((tagBits1 = argOop & (tagMask()))) != 0) {
		if (tagBits1 == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(argOop));
			rot1 = ((usqInt) (((usqInt)argOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits1 == (smallIntegerTag()))
		 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(argOop) << shift1)))) >> shift1) == argOop))) {
			arg = ((double) ((argOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(argOop + BaseHeaderSize, result1);
			arg = result1;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	/* begin success: */
	if (!(arg != 0.0)) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushFloat: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr / arg));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveFloatEqual */
static void
primitiveFloatEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aBool;
    double arg;
    sqInt argOop;
    usqLong bits;
    usqLong bits1;
    double rcvr;
    sqInt rcvrOop;
    double result;
    double result1;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    sqInt shift1;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    double value;
    double value1;

	/* begin primitiveFloatEqual:toArg: */
	rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argOop = longAt(GIV(stackPointer));
	/* begin loadFloatOrIntFrom: */
	if (((tagBits = rcvrOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(rcvrOop));
			rot = ((usqInt) (((usqInt)rcvrOop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			rcvr = value;
			goto l3;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(rcvrOop) << shift)))) >> shift) == rcvrOop))) {
			rcvr = ((double) ((rcvrOop >> 3)) );
			goto l3;
		}
	}
	else {
		if (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(rcvrOop + BaseHeaderSize, result);
			rcvr = result;
			goto l3;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	rcvr = 0.0;
	l3:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if (((tagBits1 = argOop & (tagMask()))) != 0) {
		if (tagBits1 == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(argOop));
			rot1 = ((usqInt) (((usqInt)argOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits1 == (smallIntegerTag()))
		 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(argOop) << shift1)))) >> shift1) == argOop))) {
			arg = ((double) ((argOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(argOop + BaseHeaderSize, result1);
			arg = result1;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	aBool = rcvr == arg;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (aBool
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveFloatGreaterOrEqual */
static void
primitiveFloatGreaterOrEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aBool;
    double arg;
    sqInt argOop;
    usqLong bits;
    usqLong bits1;
    double rcvr;
    sqInt rcvrOop;
    double result;
    double result1;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    sqInt shift1;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    double value;
    double value1;

	/* begin primitiveFloatGreaterOrEqual:toArg: */
	rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argOop = longAt(GIV(stackPointer));
	/* begin loadFloatOrIntFrom: */
	if (((tagBits = rcvrOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(rcvrOop));
			rot = ((usqInt) (((usqInt)rcvrOop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			rcvr = value;
			goto l3;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(rcvrOop) << shift)))) >> shift) == rcvrOop))) {
			rcvr = ((double) ((rcvrOop >> 3)) );
			goto l3;
		}
	}
	else {
		if (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(rcvrOop + BaseHeaderSize, result);
			rcvr = result;
			goto l3;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	rcvr = 0.0;
	l3:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if (((tagBits1 = argOop & (tagMask()))) != 0) {
		if (tagBits1 == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(argOop));
			rot1 = ((usqInt) (((usqInt)argOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits1 == (smallIntegerTag()))
		 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(argOop) << shift1)))) >> shift1) == argOop))) {
			arg = ((double) ((argOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(argOop + BaseHeaderSize, result1);
			arg = result1;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	aBool = rcvr >= arg;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (aBool
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveFloatGreaterThan */
static void
primitiveFloatGreaterThan(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aBool;
    double arg;
    sqInt argOop;
    usqLong bits;
    usqLong bits1;
    double rcvr;
    sqInt rcvrOop;
    double result;
    double result1;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    sqInt shift1;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    double value;
    double value1;

	/* begin primitiveFloatGreater:thanArg: */
	rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argOop = longAt(GIV(stackPointer));
	/* begin loadFloatOrIntFrom: */
	if (((tagBits = rcvrOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(rcvrOop));
			rot = ((usqInt) (((usqInt)rcvrOop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			rcvr = value;
			goto l3;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(rcvrOop) << shift)))) >> shift) == rcvrOop))) {
			rcvr = ((double) ((rcvrOop >> 3)) );
			goto l3;
		}
	}
	else {
		if (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(rcvrOop + BaseHeaderSize, result);
			rcvr = result;
			goto l3;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	rcvr = 0.0;
	l3:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if (((tagBits1 = argOop & (tagMask()))) != 0) {
		if (tagBits1 == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(argOop));
			rot1 = ((usqInt) (((usqInt)argOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits1 == (smallIntegerTag()))
		 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(argOop) << shift1)))) >> shift1) == argOop))) {
			arg = ((double) ((argOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(argOop + BaseHeaderSize, result1);
			arg = result1;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	aBool = rcvr > arg;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (aBool
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveFloatLessOrEqual */
static void
primitiveFloatLessOrEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aBool;
    double arg;
    sqInt argOop;
    usqLong bits;
    usqLong bits1;
    double rcvr;
    sqInt rcvrOop;
    double result;
    double result1;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    sqInt shift1;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    double value;
    double value1;

	/* begin primitiveFloatLessOrEqual:toArg: */
	rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argOop = longAt(GIV(stackPointer));
	/* begin loadFloatOrIntFrom: */
	if (((tagBits = rcvrOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(rcvrOop));
			rot = ((usqInt) (((usqInt)rcvrOop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			rcvr = value;
			goto l3;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(rcvrOop) << shift)))) >> shift) == rcvrOop))) {
			rcvr = ((double) ((rcvrOop >> 3)) );
			goto l3;
		}
	}
	else {
		if (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(rcvrOop + BaseHeaderSize, result);
			rcvr = result;
			goto l3;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	rcvr = 0.0;
	l3:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if (((tagBits1 = argOop & (tagMask()))) != 0) {
		if (tagBits1 == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(argOop));
			rot1 = ((usqInt) (((usqInt)argOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits1 == (smallIntegerTag()))
		 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(argOop) << shift1)))) >> shift1) == argOop))) {
			arg = ((double) ((argOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(argOop + BaseHeaderSize, result1);
			arg = result1;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	aBool = rcvr <= arg;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (aBool
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveFloatLessThan */
static void
primitiveFloatLessThan(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aBool;
    double arg;
    sqInt argOop;
    usqLong bits;
    usqLong bits1;
    double rcvr;
    sqInt rcvrOop;
    double result;
    double result1;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    sqInt shift1;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    double value;
    double value1;

	/* begin primitiveFloatLess:thanArg: */
	rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argOop = longAt(GIV(stackPointer));
	/* begin loadFloatOrIntFrom: */
	if (((tagBits = rcvrOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(rcvrOop));
			rot = ((usqInt) (((usqInt)rcvrOop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			rcvr = value;
			goto l3;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(rcvrOop) << shift)))) >> shift) == rcvrOop))) {
			rcvr = ((double) ((rcvrOop >> 3)) );
			goto l3;
		}
	}
	else {
		if (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(rcvrOop + BaseHeaderSize, result);
			rcvr = result;
			goto l3;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	rcvr = 0.0;
	l3:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if (((tagBits1 = argOop & (tagMask()))) != 0) {
		if (tagBits1 == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(argOop));
			rot1 = ((usqInt) (((usqInt)argOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits1 == (smallIntegerTag()))
		 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(argOop) << shift1)))) >> shift1) == argOop))) {
			arg = ((double) ((argOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(argOop + BaseHeaderSize, result1);
			arg = result1;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	aBool = rcvr < arg;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (aBool
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveFloatMultiply */
static void
primitiveFloatMultiply(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    sqInt argOop;
    usqLong bits;
    usqLong bits1;
    double rcvr;
    sqInt rcvrOop;
    double result;
    double result1;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    sqInt shift1;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    double value;
    double value1;

	/* begin primitiveFloatMultiply:byArg: */
	rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argOop = longAt(GIV(stackPointer));
	/* begin loadFloatOrIntFrom: */
	if (((tagBits = rcvrOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(rcvrOop));
			rot = ((usqInt) (((usqInt)rcvrOop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			rcvr = value;
			goto l3;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(rcvrOop) << shift)))) >> shift) == rcvrOop))) {
			rcvr = ((double) ((rcvrOop >> 3)) );
			goto l3;
		}
	}
	else {
		if (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(rcvrOop + BaseHeaderSize, result);
			rcvr = result;
			goto l3;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	rcvr = 0.0;
	l3:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if (((tagBits1 = argOop & (tagMask()))) != 0) {
		if (tagBits1 == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(argOop));
			rot1 = ((usqInt) (((usqInt)argOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits1 == (smallIntegerTag()))
		 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(argOop) << shift1)))) >> shift1) == argOop))) {
			arg = ((double) ((argOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(argOop + BaseHeaderSize, result1);
			arg = result1;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushFloat: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr * arg));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveFloatNotEqual */
static void
primitiveFloatNotEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aBool;
    double arg;
    sqInt argOop;
    usqLong bits;
    usqLong bits1;
    double rcvr;
    sqInt rcvrOop;
    double result;
    double result1;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    sqInt shift1;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    double value;
    double value1;

	/* begin primitiveFloatEqual:toArg: */
	rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argOop = longAt(GIV(stackPointer));
	/* begin loadFloatOrIntFrom: */
	if (((tagBits = rcvrOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(rcvrOop));
			rot = ((usqInt) (((usqInt)rcvrOop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			rcvr = value;
			goto l3;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(rcvrOop) << shift)))) >> shift) == rcvrOop))) {
			rcvr = ((double) ((rcvrOop >> 3)) );
			goto l3;
		}
	}
	else {
		if (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(rcvrOop + BaseHeaderSize, result);
			rcvr = result;
			goto l3;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	rcvr = 0.0;
	l3:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if (((tagBits1 = argOop & (tagMask()))) != 0) {
		if (tagBits1 == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(argOop));
			rot1 = ((usqInt) (((usqInt)argOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits1 == (smallIntegerTag()))
		 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(argOop) << shift1)))) >> shift1) == argOop))) {
			arg = ((double) ((argOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(argOop + BaseHeaderSize, result1);
			arg = result1;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	aBool = rcvr == arg;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (!aBool
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveFloatSubtract */
static void
primitiveFloatSubtract(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    sqInt argOop;
    usqLong bits;
    usqLong bits1;
    double rcvr;
    sqInt rcvrOop;
    double result;
    double result1;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    sqInt shift1;
    char *sp;
    sqInt tagBits;
    sqInt tagBits1;
    double value;
    double value1;

	/* begin primitiveFloatSubtract:fromArg: */
	rcvrOop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argOop = longAt(GIV(stackPointer));
	/* begin loadFloatOrIntFrom: */
	if (((tagBits = rcvrOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(rcvrOop));
			rot = ((usqInt) (((usqInt)rcvrOop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			rcvr = value;
			goto l3;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(rcvrOop) << shift)))) >> shift) == rcvrOop))) {
			rcvr = ((double) ((rcvrOop >> 3)) );
			goto l3;
		}
	}
	else {
		if (((longAt(rcvrOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(rcvrOop + BaseHeaderSize, result);
			rcvr = result;
			goto l3;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	rcvr = 0.0;
	l3:	/* end loadFloatOrIntFrom: */;
	/* begin loadFloatOrIntFrom: */
	if (((tagBits1 = argOop & (tagMask()))) != 0) {
		if (tagBits1 == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(argOop));
			rot1 = ((usqInt) (((usqInt)argOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits1 == (smallIntegerTag()))
		 && (((shift1 = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(argOop) << shift1)))) >> shift1) == argOop))) {
			arg = ((double) ((argOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(argOop + BaseHeaderSize, result1);
			arg = result1;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushFloat: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr - arg));
		GIV(stackPointer) = sp;
	}
	return;
}


/*	Clear the method lookup cache. This must be done after every programming
	change. 
 */

	/* InterpreterPrimitives>>#primitiveFlushCache */
static void
primitiveFlushCache(void)
{
	flushMethodCache();
}


/*	Primitive. Flush all the existing external primitives in the image thus
	forcing a reload on next invokation.
 */

	/* InterpreterPrimitives>>#primitiveFlushExternalPrimitives */
static void
primitiveFlushExternalPrimitives(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt i;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	/* begin flushExternalPrimitives */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {

			/* This is a compiled method */
			flushExternalPrimitiveOf(objOop1);
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {

			/* This is a compiled method */
			flushExternalPrimitiveOf(objOop1);
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {

				/* This is a compiled method */
				flushExternalPrimitiveOf(objOop11);
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	flushMethodCache();
	/* begin flushExternalPrimitiveTable */
	for (i = 0; i < MaxExternalPrimitiveTableSize; i += 1) {
		externalPrimitiveTable[i] = 0;
	}
	GIV(externalPrimitiveTableFirstFreeIndex) = 0;
}


/*	On some platforms, this primitive forces enqueued display updates to be
	processed immediately. On others, it does nothing.
 */

	/* InterpreterPrimitives>>#primitiveForceDisplayUpdate */
static void
primitiveForceDisplayUpdate(void)
{
	ioForceDisplayUpdate();
}


/*	On platforms that support it, this primitive prints the receiver, assumed
	to be a Form, to the default printer.
 */

	/* InterpreterPrimitives>>#primitiveFormPrint */
static void
primitiveFormPrint(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bitsArray;
    sqInt bitsArraySize;
    sqInt depth;
    sqInt fmt;
    sqInt h;
    double hScale;
    sqInt landscapeFlag;
    usqInt numBytes;
    usqInt numSlots;
    sqInt ok;
    sqInt pixelsPerWord;
    sqInt rcvr;
    double vScale;
    sqInt w;
    sqInt wordsPerLine;

	/* begin booleanValueOf: */
	if ((longAt(GIV(stackPointer))) == GIV(trueObj)) {
		landscapeFlag = 1;
		goto l2;
	}
	if ((longAt(GIV(stackPointer))) == GIV(falseObj)) {
		landscapeFlag = 0;
		goto l2;
	}
	/* begin success: */
	
	/* Don't overwrite an error code that has already been set. */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	landscapeFlag = null;
	l2:	/* end booleanValueOf: */;
	vScale = floatValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	hScale = floatValueOf(longAt(GIV(stackPointer) + (2 * BytesPerWord)));
	rcvr = longAt(GIV(stackPointer) + (3 * BytesPerWord));
	if (!((((rcvr & (tagMask())) == 0)
		 && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
		 && ((lengthOfformat(rcvr, (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))) >= 4))) {
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (!GIV(primFailCode)) {
		bitsArray = longAt((rcvr + BaseHeaderSize) + (0U << (shiftForWord())));
		w = fetchIntegerofObject(1, rcvr);
		h = fetchIntegerofObject(2, rcvr);
		depth = fetchIntegerofObject(3, rcvr);
		if (!((w > 0)
			 && (h > 0))) {
			/* begin success: */
			
			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
		pixelsPerWord = 32 / depth;
		wordsPerLine = (w + (pixelsPerWord - 1)) / pixelsPerWord;
		if (((bitsArray & (tagMask())) == 0)
		 && (isPureBitsFormat((((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask())))) {
			/* begin numBytesOf: */
			fmt = (((usqInt) (longAt(bitsArray))) >> (formatShift())) & (formatMask());
			/* begin numSlotsOf: */
			assert((classIndexOf(bitsArray)) > (isForwardedObjectClassIndexPun()));
			numSlots = byteAt(bitsArray + 7);
			numBytes = (numSlots == (numSlotsMask())
				? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(bitsArray - BaseHeaderSize))) << 8)))))) >> 8
				: numSlots);
			numBytes = numBytes << (shiftForWord());
			if (fmt >= (firstByteFormat())) {

				/* bytes (the common case), including CompiledMethod */
				bitsArraySize = numBytes - (fmt & 7);
				goto l4;
			}
			if (fmt <= (sixtyFourBitIndexableFormat())) {
				bitsArraySize = numBytes;
				goto l4;
			}
			if (fmt >= (firstShortFormat())) {
				bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1)));
				goto l4;
			}
			bitsArraySize = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2)));
	l4:	/* end numBytesOf: */;
			/* begin success: */
			if (!(bitsArraySize == ((wordsPerLine * h) * 4))) {

				/* Don't overwrite an error code that has already been set. */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
		}
		else {
			/* begin success: */
			
			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
	if (!GIV(primFailCode)) {
		ok = ioFormPrint(bitsArray + BaseHeaderSize, w, h, depth, hScale, vScale, landscapeFlag);
		/* begin success: */
		if (!ok) {

			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
	if (!GIV(primFailCode)) {
		/* begin pop: */
		GIV(stackPointer) += 3 * BytesPerWord;
	}
}


/*	Fractional part of this float.
	N.B. IMO we should be able to assume the receiver is a float because this
	primitive is specific to floats. eem 2/13/2017 */

	/* InterpreterPrimitives>>#primitiveFractionalPart */
static void
primitiveFractionalPart(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    double rcvr;
    double trunc;

	/* begin stackFloatValue: */
	rcvr = floatValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin stackTopPut: */
		aValue = floatObjectOf(modf(rcvr, (&trunc)));
		longAtPointerput(GIV(stackPointer), aValue);
	}
}

	/* InterpreterPrimitives>>#primitiveFullClosureValue */
static void
primitiveFullClosureValue(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt blockClosure;
    sqInt closureMethod;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt header;
    sqInt i;
    int inInterpreter;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt methodHeader2;
    sqInt numArgs;
    sqInt numCopied;
    sqInt numTemps;
    sqInt object;
    sqInt object1;
    sqInt object11;
    sqInt object12;
    sqInt object2;
    sqInt object3;
    sqInt objOop;
    sqInt oop;
    char *sp;
    char *sp1;
    char *sp10;
    char *sp11;
    char *sp12;
    char *sp2;
    char *sp21;
    char *sp22;
    char *sp3;
    char *sp31;
    char *sp32;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;
    sqInt switched;

	blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));
	/* begin quickFetchInteger:ofObject: */
	oop = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	numArgs = (oop >> 3);
	if (!(GIV(argumentCount) == numArgs)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	closureMethod = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord())))));
	if (!(((closureMethod & (tagMask())) == 0)
		 && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin activateNewFullClosure:method:numArgs:mayContextSwitch: */
	assert(closureMethod == (fetchPointerofObject(FullClosureCompiledBlockIndex, blockClosure)));
	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)) {
		/* begin executeFullCogBlock:closure:mayContextSwitch: */
		methodHeader1 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader1))
		 && ((((usqInt)methodHeader1)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader1);
		assertCStackWellAligned();
		/* begin assertValidExecutionPointe:r:s: */
		assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
		/* begin ensurePushedInstructionPointer */
		if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

			/* invoked directly from the interpreter */
			/* begin iframeSavedIP:put: */
			assert(!(isMachineCodeFrame(GIV(framePointer))));
			longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
			/* begin push: */
			object2 = ceReturnToInterpreterPC();
			longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object2);
			GIV(stackPointer) = sp9;
		}
		else {

			/* instructionPointer == cogit ceReturnToInterpreterPC
			   ifTrue: [invoked from the interpreter via a machine code primitive]
			   ifFalse: [invoked from machine code].
			   If in the first case the bytecode instructionPointer has already been
			   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
			/* begin push: */
			longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp11;
		}
		/* begin push: */
		object11 = (((sqInt)cogMethod)) + (fullBlockEntryOffset());
		longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11);
		GIV(stackPointer) = sp21;
		/* begin push: */
		longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure);
		GIV(stackPointer) = sp31;
		ceCallCogCodePopReceiverReg();
		goto l11;
	}

	/* How do we know when to compile a block method?
	   One simple criterion is to check if the block is running within its inner context,
	   i.e. if the outerContext is married.
	   Even simpler is to remember the previous block entered via the interpreter and
	   compile if this is the same one.  But we can thrash trying to compile an uncoggable
	   method unless we try and remember which ones can't be cogged.  So also record
	   the last block method we failed to compile and avoid recompiling it. */
	numCopied = (numSlotsOf(blockClosure)) - FullClosureFirstCopiedValueIndex;
	if (((assert((((methodHeader) & 7) == 1)),
	((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
		if ((GIV(instructionPointer) < (startOfMemory()))
		 || (closureMethod == GIV(lastCoggableInterpretedBlockMethod))) {

			/* If from interpreter and repeat block, attempt jitting */
			if (closureMethod != GIV(lastUncoggableInterpretedBlockMethod)) {
				cogFullBlockMethodnumCopied(closureMethod, numCopied);
				if ((assert(isNonImmediate(closureMethod)),
				isCogMethodReference(longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
					/* begin executeFullCogBlock:closure:mayContextSwitch: */
					methodHeader2 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
					assert((isNonImmediate(methodHeader2))
					 && ((((usqInt)methodHeader2)) < (startOfMemory())));
					cogMethod1 = ((CogMethod *) methodHeader2);
					assertCStackWellAligned();
					/* begin assertValidExecutionPointe:r:s: */
					assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
					/* begin ensurePushedInstructionPointer */
					if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

						/* invoked directly from the interpreter */
						/* begin iframeSavedIP:put: */
						assert(!(isMachineCodeFrame(GIV(framePointer))));
						longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
						/* begin push: */
						object3 = ceReturnToInterpreterPC();
						longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object3);
						GIV(stackPointer) = sp10;
					}
					else {

						/* instructionPointer == cogit ceReturnToInterpreterPC
						   ifTrue: [invoked from the interpreter via a machine code primitive]
						   ifFalse: [invoked from machine code].
						   If in the first case the bytecode instructionPointer has already been
						   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
						/* begin push: */
						longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
						GIV(stackPointer) = sp12;
					}
					/* begin push: */
					object12 = (((sqInt)cogMethod1)) + (fullBlockEntryOffset());
					longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12);
					GIV(stackPointer) = sp22;
					/* begin push: */
					longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure);
					GIV(stackPointer) = sp32;
					ceCallCogCodePopReceiverReg();
					goto l11;
				}
				if (!GIV(cogCompiledCodeCompactionCalledFor)) {
					GIV(lastUncoggableInterpretedBlockMethod) = closureMethod;
				}
			}
		}
		else {
			GIV(lastCoggableInterpretedBlockMethod) = closureMethod;
		}
	}
	else {
		maybeFlagMethodAsInterpreted(closureMethod);
	}
	assert(!(methodHasCogMethod(closureMethod)));
	if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) {
		if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
			GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
		}
	}
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp2;
	/* begin push: */
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
	GIV(stackPointer) = sp3;
	GIV(framePointer) = GIV(stackPointer);
	/* begin push: */
	longAtput((sp4 = GIV(stackPointer) - BytesPerWord), closureMethod);
	GIV(stackPointer) = sp4;
	/* begin push: */
	longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
	GIV(stackPointer) = sp5;
	/* begin push: */
	object = (VMBIGENDIAN
		? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1ULL << ((BytesPerWord * 8) - 24))
		: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24));
	longAtput((sp6 = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp6;
	/* begin push: */
	longAtput((sp7 = GIV(stackPointer) - BytesPerWord), 0);
	GIV(stackPointer) = sp7;
	/* begin push: */
	objOop = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(FullClosureReceiverIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop = fixFollowedFieldofObjectwithInitialValue(FullClosureReceiverIndex, blockClosure, objOop);
	}
	object1 = objOop;
	longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object1);
	GIV(stackPointer) = sp8;
	for (i = 0; i < numCopied; i += 1) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + FullClosureFirstCopiedValueIndex)) << (shiftForWord()))))));
		GIV(stackPointer) = sp;
	}
	assert(frameIsBlockActivation(GIV(framePointer)));
	assert(!(frameHasContext(GIV(framePointer))));
	/* begin methodHeaderOf: */
	assert(isCompiledMethod(closureMethod));
	header = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F;
	for (i = ((numArgs + numCopied) + 1); i <= numTemps; i += 1) {
		/* begin push: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp1;
	}
	GIV(instructionPointer) = ((closureMethod + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1;
	/* begin setMethod: */
	assert((((usqInt)closureMethod)) >= (startOfMemory()));
	GIV(method) = closureMethod;
	assert(isOopCompiledMethod(GIV(method)));
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	switched = 0;
	if (GIV(stackPointer) < GIV(stackLimit)) {
		switched = handleStackOverflowOrEventAllowContextSwitch(1);
	}
	returnToExecutivepostContextSwitch(inInterpreter, switched);
	l11:	/* end activateNewFullClosure:method:numArgs:mayContextSwitch: */;
}


/*	An exact clone of primitiveFullClosureValue except that this version will
	not check for interrupts on stack overflow. It may invoke the garbage
	collector but will not switch processes. See
	checkForInterruptsMayContextSwitch:  */

	/* InterpreterPrimitives>>#primitiveFullClosureValueNoContextSwitch */
void
primitiveFullClosureValueNoContextSwitch(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt blockClosure;
    sqInt closureMethod;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt header;
    sqInt i;
    int inInterpreter;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt methodHeader2;
    sqInt numArgs;
    sqInt numCopied;
    sqInt numTemps;
    sqInt object;
    sqInt object1;
    sqInt object11;
    sqInt object12;
    sqInt object2;
    sqInt object3;
    sqInt objOop;
    sqInt oop;
    char *sp;
    char *sp1;
    char *sp10;
    char *sp11;
    char *sp12;
    char *sp2;
    char *sp21;
    char *sp22;
    char *sp3;
    char *sp31;
    char *sp32;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;
    sqInt switched;

	blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));
	/* begin quickFetchInteger:ofObject: */
	oop = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	numArgs = (oop >> 3);
	if (!(GIV(argumentCount) == numArgs)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	closureMethod = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord())))));
	if (!(((closureMethod & (tagMask())) == 0)
		 && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin activateNewFullClosure:method:numArgs:mayContextSwitch: */
	assert(closureMethod == (fetchPointerofObject(FullClosureCompiledBlockIndex, blockClosure)));
	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)) {
		/* begin executeFullCogBlock:closure:mayContextSwitch: */
		methodHeader1 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader1))
		 && ((((usqInt)methodHeader1)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader1);
		assertCStackWellAligned();
		/* begin assertValidExecutionPointe:r:s: */
		assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
		/* begin ensurePushedInstructionPointer */
		if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

			/* invoked directly from the interpreter */
			/* begin iframeSavedIP:put: */
			assert(!(isMachineCodeFrame(GIV(framePointer))));
			longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
			/* begin push: */
			object2 = ceReturnToInterpreterPC();
			longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object2);
			GIV(stackPointer) = sp9;
		}
		else {

			/* instructionPointer == cogit ceReturnToInterpreterPC
			   ifTrue: [invoked from the interpreter via a machine code primitive]
			   ifFalse: [invoked from machine code].
			   If in the first case the bytecode instructionPointer has already been
			   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
			/* begin push: */
			longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp11;
		}
		/* begin push: */
		object11 = (((sqInt)cogMethod)) + (fullBlockNoContextSwitchEntryOffset());
		longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11);
		GIV(stackPointer) = sp21;
		/* begin push: */
		longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure);
		GIV(stackPointer) = sp31;
		ceCallCogCodePopReceiverReg();
		goto l11;
	}

	/* How do we know when to compile a block method?
	   One simple criterion is to check if the block is running within its inner context,
	   i.e. if the outerContext is married.
	   Even simpler is to remember the previous block entered via the interpreter and
	   compile if this is the same one.  But we can thrash trying to compile an uncoggable
	   method unless we try and remember which ones can't be cogged.  So also record
	   the last block method we failed to compile and avoid recompiling it. */
	numCopied = (numSlotsOf(blockClosure)) - FullClosureFirstCopiedValueIndex;
	if (((assert((((methodHeader) & 7) == 1)),
	((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
		if ((GIV(instructionPointer) < (startOfMemory()))
		 || (closureMethod == GIV(lastCoggableInterpretedBlockMethod))) {

			/* If from interpreter and repeat block, attempt jitting */
			if (closureMethod != GIV(lastUncoggableInterpretedBlockMethod)) {
				cogFullBlockMethodnumCopied(closureMethod, numCopied);
				if ((assert(isNonImmediate(closureMethod)),
				isCogMethodReference(longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
					/* begin executeFullCogBlock:closure:mayContextSwitch: */
					methodHeader2 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
					assert((isNonImmediate(methodHeader2))
					 && ((((usqInt)methodHeader2)) < (startOfMemory())));
					cogMethod1 = ((CogMethod *) methodHeader2);
					assertCStackWellAligned();
					/* begin assertValidExecutionPointe:r:s: */
					assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
					/* begin ensurePushedInstructionPointer */
					if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

						/* invoked directly from the interpreter */
						/* begin iframeSavedIP:put: */
						assert(!(isMachineCodeFrame(GIV(framePointer))));
						longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
						/* begin push: */
						object3 = ceReturnToInterpreterPC();
						longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object3);
						GIV(stackPointer) = sp10;
					}
					else {

						/* instructionPointer == cogit ceReturnToInterpreterPC
						   ifTrue: [invoked from the interpreter via a machine code primitive]
						   ifFalse: [invoked from machine code].
						   If in the first case the bytecode instructionPointer has already been
						   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
						/* begin push: */
						longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
						GIV(stackPointer) = sp12;
					}
					/* begin push: */
					object12 = (((sqInt)cogMethod1)) + (fullBlockNoContextSwitchEntryOffset());
					longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12);
					GIV(stackPointer) = sp22;
					/* begin push: */
					longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure);
					GIV(stackPointer) = sp32;
					ceCallCogCodePopReceiverReg();
					goto l11;
				}
				if (!GIV(cogCompiledCodeCompactionCalledFor)) {
					GIV(lastUncoggableInterpretedBlockMethod) = closureMethod;
				}
			}
		}
		else {
			GIV(lastCoggableInterpretedBlockMethod) = closureMethod;
		}
	}
	else {
		maybeFlagMethodAsInterpreted(closureMethod);
	}
	assert(!(methodHasCogMethod(closureMethod)));
	if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) {
		if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
			GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
		}
	}
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp2;
	/* begin push: */
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
	GIV(stackPointer) = sp3;
	GIV(framePointer) = GIV(stackPointer);
	/* begin push: */
	longAtput((sp4 = GIV(stackPointer) - BytesPerWord), closureMethod);
	GIV(stackPointer) = sp4;
	/* begin push: */
	longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
	GIV(stackPointer) = sp5;
	/* begin push: */
	object = (VMBIGENDIAN
		? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1ULL << ((BytesPerWord * 8) - 24))
		: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24));
	longAtput((sp6 = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp6;
	/* begin push: */
	longAtput((sp7 = GIV(stackPointer) - BytesPerWord), 0);
	GIV(stackPointer) = sp7;
	/* begin push: */
	objOop = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(FullClosureReceiverIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop = fixFollowedFieldofObjectwithInitialValue(FullClosureReceiverIndex, blockClosure, objOop);
	}
	object1 = objOop;
	longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object1);
	GIV(stackPointer) = sp8;
	for (i = 0; i < numCopied; i += 1) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + FullClosureFirstCopiedValueIndex)) << (shiftForWord()))))));
		GIV(stackPointer) = sp;
	}
	assert(frameIsBlockActivation(GIV(framePointer)));
	assert(!(frameHasContext(GIV(framePointer))));
	/* begin methodHeaderOf: */
	assert(isCompiledMethod(closureMethod));
	header = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F;
	for (i = ((numArgs + numCopied) + 1); i <= numTemps; i += 1) {
		/* begin push: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp1;
	}
	GIV(instructionPointer) = ((closureMethod + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1;
	/* begin setMethod: */
	assert((((usqInt)closureMethod)) >= (startOfMemory()));
	GIV(method) = closureMethod;
	assert(isOopCompiledMethod(GIV(method)));
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	switched = 0;
	if (GIV(stackPointer) < GIV(stackLimit)) {
		switched = handleStackOverflowOrEventAllowContextSwitch(0);
	}
	returnToExecutivepostContextSwitch(inInterpreter, switched);
	l11:	/* end activateNewFullClosure:method:numArgs:mayContextSwitch: */;
}

	/* InterpreterPrimitives>>#primitiveFullClosureValueWithArgs */
static void
primitiveFullClosureValueWithArgs(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt argumentArray;
    usqInt arraySize;
    sqInt blockClosure;
    sqInt closureMethod;
    CogMethod *cogMethod;
    CogMethod *cogMethod1;
    sqInt header;
    sqInt i;
    sqInt index;
    int inInterpreter;
    sqInt methodHeader;
    sqInt methodHeader1;
    sqInt methodHeader2;
    sqInt numArgs;
    sqInt numCopied;
    usqInt numSlots;
    sqInt numTemps;
    sqInt object;
    sqInt object1;
    sqInt object11;
    sqInt object12;
    sqInt object2;
    sqInt object3;
    sqInt objOop;
    sqInt oop;
    char *sp;
    char *sp1;
    char *sp10;
    char *sp11;
    char *sp12;
    char *sp13;
    char *sp2;
    char *sp21;
    char *sp22;
    char *sp3;
    char *sp31;
    char *sp32;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;
    sqInt switched;
    sqInt top;

	argumentArray = longAt(GIV(stackPointer));
	if (!(((argumentArray & (tagMask())) == 0)
		 && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin numSlotsOf: */
	assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(argumentArray + 7);
	arraySize = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(argumentArray - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	if (!(roomToPushNArgs(arraySize))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	blockClosure = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));
	/* begin quickFetchInteger:ofObject: */
	oop = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	numArgs = (oop >> 3);
	if (!(arraySize == numArgs)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	closureMethod = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(FullClosureCompiledBlockIndex) << (shiftForWord())))));
	if (!(((closureMethod & (tagMask())) == 0)
		 && (((((usqInt) (longAt(closureMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	index = 1;
	while (index <= numArgs) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((argumentArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord()))))));
		GIV(stackPointer) = sp;
		index += 1;
	}
	/* begin activateNewFullClosure:method:numArgs:mayContextSwitch: */
	assert(closureMethod == (fetchPointerofObject(FullClosureCompiledBlockIndex, blockClosure)));
	/* begin fetchPointer:ofObject: */
	methodHeader = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((assert(((((methodHeader) & 7) == 1))
		 || (((((usqInt)methodHeader)) < (startOfMemory()))
		 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
	(methodHeader & (smallIntegerTag())) == 0)) {
		/* begin executeFullCogBlock:closure:mayContextSwitch: */
		methodHeader1 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		assert((isNonImmediate(methodHeader1))
		 && ((((usqInt)methodHeader1)) < (startOfMemory())));
		cogMethod = ((CogMethod *) methodHeader1);
		assertCStackWellAligned();
		/* begin assertValidExecutionPointe:r:s: */
		assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
		/* begin ensurePushedInstructionPointer */
		if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

			/* invoked directly from the interpreter */
			/* begin iframeSavedIP:put: */
			assert(!(isMachineCodeFrame(GIV(framePointer))));
			longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
			/* begin push: */
			object2 = ceReturnToInterpreterPC();
			longAtput((sp9 = GIV(stackPointer) - BytesPerWord), object2);
			GIV(stackPointer) = sp9;
		}
		else {

			/* instructionPointer == cogit ceReturnToInterpreterPC
			   ifTrue: [invoked from the interpreter via a machine code primitive]
			   ifFalse: [invoked from machine code].
			   If in the first case the bytecode instructionPointer has already been
			   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
			/* begin push: */
			longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
			GIV(stackPointer) = sp11;
		}
		/* begin push: */
		object11 = (((sqInt)cogMethod)) + (fullBlockEntryOffset());
		longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object11);
		GIV(stackPointer) = sp21;
		/* begin push: */
		longAtput((sp31 = GIV(stackPointer) - BytesPerWord), blockClosure);
		GIV(stackPointer) = sp31;
		ceCallCogCodePopReceiverReg();
		goto l13;
	}

	/* How do we know when to compile a block method?
	   One simple criterion is to check if the block is running within its inner context,
	   i.e. if the outerContext is married.
	   Even simpler is to remember the previous block entered via the interpreter and
	   compile if this is the same one.  But we can thrash trying to compile an uncoggable
	   method unless we try and remember which ones can't be cogged.  So also record
	   the last block method we failed to compile and avoid recompiling it. */
	numCopied = (numSlotsOf(blockClosure)) - FullClosureFirstCopiedValueIndex;
	if (((assert((((methodHeader) & 7) == 1)),
	((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) <= maxLiteralCountForCompile) {
		if ((GIV(instructionPointer) < (startOfMemory()))
		 || (closureMethod == GIV(lastCoggableInterpretedBlockMethod))) {

			/* If from interpreter and repeat block, attempt jitting */
			if (closureMethod != GIV(lastUncoggableInterpretedBlockMethod)) {
				cogFullBlockMethodnumCopied(closureMethod, numCopied);
				if ((assert(isNonImmediate(closureMethod)),
				isCogMethodReference(longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
					/* begin executeFullCogBlock:closure:mayContextSwitch: */
					methodHeader2 = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
					assert((isNonImmediate(methodHeader2))
					 && ((((usqInt)methodHeader2)) < (startOfMemory())));
					cogMethod1 = ((CogMethod *) methodHeader2);
					assertCStackWellAligned();
					/* begin assertValidExecutionPointe:r:s: */
					assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
					/* begin ensurePushedInstructionPointer */
					if ((((usqInt)GIV(instructionPointer))) >= (startOfMemory())) {

						/* invoked directly from the interpreter */
						/* begin iframeSavedIP:put: */
						assert(!(isMachineCodeFrame(GIV(framePointer))));
						longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
						/* begin push: */
						object3 = ceReturnToInterpreterPC();
						longAtput((sp10 = GIV(stackPointer) - BytesPerWord), object3);
						GIV(stackPointer) = sp10;
					}
					else {

						/* instructionPointer == cogit ceReturnToInterpreterPC
						   ifTrue: [invoked from the interpreter via a machine code primitive]
						   ifFalse: [invoked from machine code].
						   If in the first case the bytecode instructionPointer has already been
						   saved in iframeSavedIP so all we need to do is push the instructionPointer. */
						/* begin push: */
						longAtput((sp12 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
						GIV(stackPointer) = sp12;
					}
					/* begin push: */
					object12 = (((sqInt)cogMethod1)) + (fullBlockEntryOffset());
					longAtput((sp22 = GIV(stackPointer) - BytesPerWord), object12);
					GIV(stackPointer) = sp22;
					/* begin push: */
					longAtput((sp32 = GIV(stackPointer) - BytesPerWord), blockClosure);
					GIV(stackPointer) = sp32;
					ceCallCogCodePopReceiverReg();
					goto l13;
				}
				if (!GIV(cogCompiledCodeCompactionCalledFor)) {
					GIV(lastUncoggableInterpretedBlockMethod) = closureMethod;
				}
			}
		}
		else {
			GIV(lastCoggableInterpretedBlockMethod) = closureMethod;
		}
	}
	else {
		maybeFlagMethodAsInterpreted(closureMethod);
	}
	assert(!(methodHasCogMethod(closureMethod)));
	if (!((inInterpreter = GIV(instructionPointer) >= (startOfMemory())))) {
		if (GIV(instructionPointer) == (ceReturnToInterpreterPC())) {
			GIV(instructionPointer) = longAt(GIV(framePointer) + FoxIFSavedIP);
		}
	}
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp2;
	/* begin push: */
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
	GIV(stackPointer) = sp3;
	GIV(framePointer) = GIV(stackPointer);
	/* begin push: */
	longAtput((sp4 = GIV(stackPointer) - BytesPerWord), closureMethod);
	GIV(stackPointer) = sp4;
	/* begin push: */
	longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
	GIV(stackPointer) = sp5;
	/* begin push: */
	object = (VMBIGENDIAN
		? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (1ULL << ((BytesPerWord * 8) - 24))
		: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (1U << 24));
	longAtput((sp6 = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp6;
	/* begin push: */
	longAtput((sp7 = GIV(stackPointer) - BytesPerWord), 0);
	GIV(stackPointer) = sp7;
	/* begin push: */
	objOop = longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)(FullClosureReceiverIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop = fixFollowedFieldofObjectwithInitialValue(FullClosureReceiverIndex, blockClosure, objOop);
	}
	object1 = objOop;
	longAtput((sp8 = GIV(stackPointer) - BytesPerWord), object1);
	GIV(stackPointer) = sp8;
	for (i = 0; i < numCopied; i += 1) {
		/* begin push: */
		longAtput((sp13 = GIV(stackPointer) - BytesPerWord), longAt((blockClosure + BaseHeaderSize) + (((sqInt)((usqInt)((i + FullClosureFirstCopiedValueIndex)) << (shiftForWord()))))));
		GIV(stackPointer) = sp13;
	}
	assert(frameIsBlockActivation(GIV(framePointer)));
	assert(!(frameHasContext(GIV(framePointer))));
	/* begin methodHeaderOf: */
	assert(isCompiledMethod(closureMethod));
	header = longAt((closureMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F;
	for (i = ((numArgs + numCopied) + 1); i <= numTemps; i += 1) {
		/* begin push: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp1;
	}
	GIV(instructionPointer) = ((closureMethod + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) - 1;
	/* begin setMethod: */
	assert((((usqInt)closureMethod)) >= (startOfMemory()));
	GIV(method) = closureMethod;
	assert(isOopCompiledMethod(GIV(method)));
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	switched = 0;
	if (GIV(stackPointer) < GIV(stackLimit)) {
		switched = handleStackOverflowOrEventAllowContextSwitch(1);
	}
	returnToExecutivepostContextSwitch(inInterpreter, switched);
	l13:	/* end activateNewFullClosure:method:numArgs:mayContextSwitch: */;
}


/*	Fetch the system attribute with the given integer ID. The 
	result is a string, which will be empty if the attribute is not 
	defined. */

	/* InterpreterPrimitives>>#primitiveGetAttribute */
static void
primitiveGetAttribute(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt attr;
    sqInt integerPointer;
    sqInt s;
    char *sp;
    sqInt sz;

	sz = 0;
	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		attr = (integerPointer >> 3);
		goto l1;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		attr = 0;
		goto l1;
	}
	l1:	/* end stackIntegerValue: */;
	if (!GIV(primFailCode)) {
		sz = attributeSize(attr);
	}
	if (!GIV(primFailCode)) {
		s = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassByteString) << (shiftForWord()))))), sz);
		getAttributeIntoLength(attr, s + BaseHeaderSize, sz);
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), s);
		GIV(stackPointer) = sp;
	}
}


/*	Access to environment variables via getenv. No putenv or setenv as yet. */

	/* InterpreterPrimitives>>#primitiveGetenv */
EXPORT(sqInt)
primitiveGetenv(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *key;
    sqInt oop;
    sqInt result;
    char *sp;
    char *var;

	result = 0;
	if (sHEAFn != 0) {

		/* secHasEnvironmentAccess */
		if (!(sHEAFn())) {
			/* begin primitiveFailFor: */
			return (GIV(primFailCode) = PrimErrInappropriate);
		}
	}
	key = cStringOrNullFor(longAt(GIV(stackPointer)));
	if (key == 0) {
		if (!GIV(primFailCode)) {
			/* begin primitiveFailFor: */
			return (GIV(primFailCode) = PrimErrBadArgument);
		}
		/* begin primitiveFailFor: */
		return (GIV(primFailCode) = GIV(primFailCode));
	}
	var = getenv(key);
	free(key);
	if (var != 0) {
		result = stringForCString(var);
		if (!(result)) {
			/* begin primitiveFailFor: */
			return (GIV(primFailCode) = PrimErrNoMemory);
		}
	}
	assert(GIV(primFailCode) == 0);
	/* begin pop:thenPush: */
	oop = (var == 0
		? GIV(nilObj)
		: result);
	longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
	return 0;
}

	/* InterpreterPrimitives>>#primitiveGetImmutability */
#if IMMUTABILITY
static void
primitiveGetImmutability(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt rcvr;
    char *sp;
    sqInt trueOrFalse;

	rcvr = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin pop:thenPushBool: */
	trueOrFalse = (rcvr & (tagMask()))
	 || (((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0);
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse
		? GIV(trueObj)
		: GIV(falseObj)));
	GIV(stackPointer) = sp;
}
#endif /* IMMUTABILITY */


/*	Primitive. Answer the VM's current log directory */

	/* InterpreterPrimitives>>#primitiveGetLogDirectory */
EXPORT(sqInt)
primitiveGetLogDirectory(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    char *ptr;
    char *sp;
    sqInt stringOop;
    sqInt sz;

	ptr = ioGetLogDirectory();
	if (ptr == null) {
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	sz = strlen(ptr);
	stringOop = instantiateClassindexableSize(splObj(ClassByteString), sz);
	for (i = 0; i < sz; i += 1) {
		byteAtput((stringOop + BaseHeaderSize) + i, ptr[i]);
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), stringOop);
	GIV(stackPointer) = sp;
	return 0;
}


/*	Primitive. Return the next input event from the VM event queue. */

	/* InterpreterPrimitives>>#primitiveGetNextEvent */
static void
primitiveGetNextEvent(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;
    sqIntptr_t eventTypeIs;
    sqIntptr_t evtBuf[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
    sqInt i;
    sqIntptr_t value;

	arg = longAt(GIV(stackPointer));
	if (!((((arg & (tagMask())) == 0)
		 && (((((usqInt) (longAt(arg))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && ((slotSizeOf(arg)) == 8))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	ioGetNextEvent(((sqInputEvent*) evtBuf));
	if (GIV(primFailCode)) {
		return;
	}
	eventTypeIs = evtBuf[0];
	/* begin storeInteger:ofObject:withValue: */
	if ((((((usqInt) (evtBuf[0])) >> 60) + 1) & 15) <= 1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(arg)));
		longAtput((arg + BaseHeaderSize) + (0U << (shiftForWord())), (((usqInt)(evtBuf[0]) << 3) | 1));
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (GIV(primFailCode)) {
		return;
	}
	if (eventTypeIs == 6) {

		/* Event is Complex, assume evtBuf is populated correctly and return */
		for (i = 1; i <= 7; i += 1) {
			value = evtBuf[i];
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(arg)));
			if ((assert(isNonImmediate(arg)),
			oopisGreaterThanOrEqualTo(arg, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((value & (tagMask())) == 0)
				 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(arg))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(arg);
					}
				}
			}
			longAtput((arg + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), value);
		}
	}
	else {

		/* Event time stamp */
		/* begin storeInteger:ofObject:withValue: */
		if ((((((usqInt) ((evtBuf[1]) & MillisecondClockMask)) >> 60) + 1) & 15) <= 1) {
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(arg)));
			longAtput((arg + BaseHeaderSize) + (1U << (shiftForWord())), (((usqInt)((evtBuf[1]) & MillisecondClockMask) << 3) | 1));
		}
		else {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
		if (GIV(primFailCode)) {
			return;
		}
		for (i = 2; i <= 7; i += 1) {
			value = evtBuf[i];
			if ((((((usqInt) value) >> 60) + 1) & 15) <= 1) {
				/* begin storeInteger:ofObject:withValue: */
				if ((((((usqInt) value) >> 60) + 1) & 15) <= 1) {
					/* begin storePointerUnchecked:ofObject:withValue: */
					assert(!(isOopForwarded(arg)));
					longAtput((arg + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), (((usqInt)value << 3) | 1));
				}
				else {
					/* begin primitiveFail */
					if (!GIV(primFailCode)) {
						GIV(primFailCode) = 1;
					}
				}
			}
			else {
				value = positiveMachineIntegerFor(value);
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(arg)));
				if ((assert(isNonImmediate(arg)),
				oopisGreaterThanOrEqualTo(arg, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((value & (tagMask())) == 0)
					 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(arg))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(arg);
						}
					}
				}
				longAtput((arg + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), value);
			}
		}
	}
	if (!GIV(primFailCode)) {
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
}


/*	Primitive. Answer the OS window's label */

	/* InterpreterPrimitives>>#primitiveGetWindowLabel */
EXPORT(sqInt)
primitiveGetWindowLabel(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt labelOop;
    char *ptr;
    char *sp;
    sqInt sz;

	ptr = ioGetWindowLabel();
	if (ptr == null) {
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	sz = strlen(ptr);
	labelOop = instantiateClassindexableSize(splObj(ClassByteString), sz);
	for (i = 0; i < sz; i += 1) {
		byteAtput((labelOop + BaseHeaderSize) + i, ptr[i]);
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), labelOop);
	GIV(stackPointer) = sp;
	return 0;
}


/*	Primitive. Answer the OS window's size (extent) */

	/* InterpreterPrimitives>>#primitiveGetWindowSize */
EXPORT(sqInt)
primitiveGetWindowSize(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classObj;
    sqInt h;
    sqInt knownClassIndex;
    usqInt newObj;
    usqInt numBytes;
    sqInt numSlots;
    sqInt object;
    sqInt objFormat;
    usqInt pointResult;
    char *sp;
    sqInt w;

	w = ioGetWindowWidth();
	h = ioGetWindowHeight();
	/* begin pop: */
	GIV(stackPointer) += (GIV(argumentCount) + 1) * BytesPerWord;
	/* begin push: */
	classObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
	numSlots = YIndex + 1;
	assert((rawHashBitsOf(classObj)) != 0);
	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
	knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
	/* begin instSpecOfClassFormat: */
	objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3))) >> (fixedFieldsFieldWidth())) & (formatMask());
	assert((numSlots >= 0)
	 && ((knownClassIndex != 0)
	 && ((knownClassAtIndex(knownClassIndex)) != GIV(nilObj))));
	assert(((objFormat < (firstByteFormat())
		? objFormat
		: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex))));
	/* begin allocateSmallNewSpaceSlots:format:classIndex: */
	assert(numSlots < (numSlotsMask()));
	newObj = GIV(freeStart);
	numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
			error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
			pointResult = 0;
			goto l3;
		}
	}
	long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex);
	GIV(freeStart) += numBytes;
	pointResult = newObj;
	l3:	/* end eeInstantiateSmallClass:numSlots: */;
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(pointResult)));
	longAtput((pointResult + BaseHeaderSize) + (((sqInt)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)w << 3) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(pointResult)));
	longAtput((pointResult + BaseHeaderSize) + (((sqInt)((usqInt)(YIndex) << (shiftForWord())))), (((usqInt)h << 3) | 1));
	object = pointResult;
	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
	return 0;
}

	/* InterpreterPrimitives>>#primitiveGreaterOrEqual */
static void
primitiveGreaterOrEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArgument;
    sqInt integerReceiver;
    char *sp;

	integerArgument = longAt(GIV(stackPointer));
	integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((integerReceiver & integerArgument) & (smallIntegerTag())) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerReceiver >= integerArgument
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveGreaterOrEqualLargeIntegers */
EXPORT(void)
primitiveGreaterOrEqualLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqLong integerArg;
    sqLong integerRcvr;
    char *sp;

	integerArg = signed64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	integerRcvr = signed64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerRcvr >= integerArg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveGreaterThan */
static void
primitiveGreaterThan(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArgument;
    sqInt integerReceiver;
    char *sp;

	integerArgument = longAt(GIV(stackPointer));
	integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((integerReceiver & integerArgument) & (smallIntegerTag())) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerReceiver > integerArgument
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveGreaterThanLargeIntegers */
EXPORT(void)
primitiveGreaterThanLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqLong integerArg;
    sqLong integerRcvr;
    char *sp;

	integerArg = signed64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	integerRcvr = signed64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerRcvr > integerArg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveGrowMemoryByAtLeast */
static void
primitiveGrowMemoryByAtLeast(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ammount;
    sqInt segSize;
    char *sp;

	ammount = longAt(GIV(stackPointer));
	if (!((((ammount) & 7) == 1))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	segSize = growOldSpaceByAtLeast((ammount >> 3));
	if (segSize == null) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrNoMemory;
	}
	else {
		/* begin pop:thenPushInteger: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)segSize << 3) | 1));
		GIV(stackPointer) = sp;
	}
}


/*	Implement 28-bit hashMultiply for SmallInteger and LargePositiveInteger
	receivers. 
 */

	/* InterpreterPrimitives>>#primitiveHashMultiply */
static void
primitiveHashMultiply(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ccIndex;
    sqInt ok;
    char *sp;
    sqInt value;

	value = longAt(GIV(stackPointer));
	if ((((value) & 7) == 1)) {
		value = (value >> 3);
	}
	else {
		/* begin is:instanceOf:compactClassIndex: */
		if (value & (tagMask())) {
			ok = 0;
			goto l3;
		}
		/* begin isClassOfNonImm:equalTo:compactClassIndex: */
		assert(!(isImmediate(value)));
		/* begin classIndexOf: */
		ccIndex = (longAt(value)) & (classIndexMask());
		ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
		goto l3;
	l3:	/* end is:instanceOf:compactClassIndex: */;
		if (!ok) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadReceiver;
			return;
		}
		value = SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((value + BaseHeaderSize) + (0U << 2))));
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)((value * HashMultiplyConstant) & 0xFFFFFFF) << 3) | 1));
	GIV(stackPointer) = sp;
}


/*	Answer the heartbeat frequency in beats per second. If the argument is
	true, reset the frequency measure. */

	/* InterpreterPrimitives>>#primitiveHeartbeatFrequency */
EXPORT(sqInt)
primitiveHeartbeatFrequency(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    unsigned int integerValue;
    sqInt oop;
    sqInt reset;
    char *sp;

	reset = (GIV(argumentCount) == 1)
	 && ((longAt(GIV(stackPointer))) == GIV(trueObj));
	/* begin pop:thenPush: */
	integerValue = ((unsigned int) (ioHeartbeatFrequency(reset)));
	oop = ((((((usqInt)integerValue)) & 0xFFFFFFFFU) << 3) | 1);
	goto l1;
	l1:	/* end positive32BitIntegerFor: */;
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
	return 0;
}


/*	Return the value of the high resolution clock if this system has any. The
	exact frequency of the high res clock is undefined specifically so that we
	can use processor dependent instructions (like RDTSC). The only use for
	the high res clock is for profiling where we can allocate time based on
	sub-msec resolution of the high res clock. If no high-resolution counter
	is available, the platform should return zero.
 */

	/* InterpreterPrimitives>>#primitiveHighResClock */
EXPORT(sqInt)
primitiveHighResClock(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt object;
    char *sp;

	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	/* begin push: */
	object = positive64BitIntegerFor(ioHighResClock());
	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
	return 0;
}


/*	is the receiver/first argument the same object as the (last) argument?.
	pop argumentCount because this can be used as a mirror primitive. */

	/* InterpreterPrimitives>>#primitiveIdentical */
static void
primitiveIdentical(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt otherObject;
    char *sp;
    sqInt thisObject;

	otherObject = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	thisObject = longAt(GIV(stackPointer));
	if ((((otherObject & (tagMask())) == 0)
	 && (((longAt(otherObject)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))
	 || ((GIV(argumentCount) > 1)
	 && (((thisObject & (tagMask())) == 0)
	 && (((longAt(thisObject)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
	}
	else {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (thisObject == otherObject
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveIdentityHash */
static void
primitiveIdentityHash(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt hash;
    sqInt hash1;
    sqInt integerVal;
    char *sp;
    sqInt thisReceiver;

	thisReceiver = longAt(GIV(stackPointer));
	if ((thisReceiver & (tagMask()))
	 || ((GIV(argumentCount) > 0)
	 && (((longAt(thisReceiver)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	else {
		/* begin pop:thenPushInteger: */
		hash = (long32At(thisReceiver + 4)) & (identityHashHalfWordMask());
		if (hash == 0) {

			/* would like to assert
			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
			   but instance-specific behaviors that are instances of themselves may
			   fail this test. */
			/* begin newHashBitsOf: */
			hash1 = (newObjectHash()) & (identityHashHalfWordMask());
			/* begin setHashBitsOf:to: */
			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash1);
			hash = hash1;
		}
		integerVal = hash;
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)integerVal << 3) | 1));
		GIV(stackPointer) = sp;
	}
}


/*	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)
 */

	/* InterpreterPrimitives>>#primitiveImageFormatVersion */
EXPORT(sqInt)
primitiveImageFormatVersion(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;
    char *sp;

	/* begin pop:thenPush: */
	oop = ((((((usqInt)68021 /* imageFormatVersion */)) & 0xFFFFFFFFU) << 3) | 1);
	goto l1;
	l1:	/* end positive32BitIntegerFor: */;
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
	return 0;
}


/*	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.
 */

	/* InterpreterPrimitives>>#primitiveImageName */
static void
primitiveImageName(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classOop;
    sqInt ok;
    sqInt okToRename;
    sqInt s;
    void *sCRIfn;
    char *sp;
    sqInt sz;

	if (GIV(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 (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				return;
			}
		}
		s = longAt(GIV(stackPointer));
		/* begin assertClassOf:is: */
		classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassByteString) << (shiftForWord())))));
		/* begin isNonImmediate: */
		ok = (s & (tagMask())) == 0;
		if (ok) {
			/* begin isClassOfNonImm:equalTo: */
			assert(isNonImmediate(s));
			ok = ((longAt(s)) & (classIndexMask())) == ((long32At(classOop + 4)) & (identityHashHalfWordMask()));
		}
		/* begin success: */
		if (!ok) {

			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
		if (!GIV(primFailCode)) {
			sz = stSizeOf(s);
			imageNamePutLength(s + BaseHeaderSize, sz);
			/* begin pop: */
			GIV(stackPointer) += 1 * BytesPerWord;
		}
	}
	else {
		sz = imageNameSize();
		s = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassByteString) << (shiftForWord()))))), sz);
		imageNameGetLength(s + BaseHeaderSize, sz);
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), s);
		GIV(stackPointer) = sp;
	}
}


/*	For a Smalllnteger, answer itself.
	For a Character, answer its code as an unsigned integer.
	For a SmallFloat, answer the signed, but unadjusted bit pattern (so as to
	keep the result a SmallInteger).
	This is a good value for an immediate's hash. */

	/* InterpreterPrimitives>>#primitiveImmediateAsInteger */
static void
primitiveImmediateAsInteger(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;
    char *sp;
    usqInt value;

	value = 0;
	oop = longAt(GIV(stackPointer));
	if ((((oop) & 7) == 1)) {
		value = (oop >> 3);
	}
	else {
		if (oop & (characterTag())) {
			value = ((usqInt) (((usqInt)oop))) >> (numTagBits());
		}
		else {
			if (oop & (smallFloatTag())) {
				assert(isImmediateFloat(oop));
				value = (((usqInt) (((usqInt)oop))) >> ((numTagBits()) + 1)) + ((oop & (1U << (numTagBits()))
	? (((usqInt)-1)) << ((64 - (numTagBits())) - 1)
	: 0));
			}
			else {
				/* begin primitiveFailFor: */
				GIV(primFailCode) = PrimErrBadReceiver;
				return;
			}
		}
	}
	/* begin pop:thenPushInteger: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), ((value << 3) | 1));
	GIV(stackPointer) = sp;
}


/*	Register the input semaphore. If the argument is not a 
	Semaphore, unregister the current input semaphore. */

	/* InterpreterPrimitives>>#primitiveInputSemaphore */
static void
primitiveInputSemaphore(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;

	arg = longAt(GIV(stackPointer));
	if ((((arg) & 7) == 1)) {

		/* If arg is integer, then use it as an index
		   into the external objects array and install it
		   as the new event semaphore */
		ioSetInputSemaphore((arg >> 3));
		if (!GIV(primFailCode)) {
			/* begin pop: */
			GIV(stackPointer) += 1 * BytesPerWord;
		}
		return;
	}
	if (TheInputSemaphore == null) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	if ((arg == GIV(nilObj))
	 || (((arg & (tagMask())) == 0)
	 && (((longAt(arg)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord())))))))))) {
		/* begin splObj:put: */
		assert(!(isForwarded(GIV(specialObjectsOop))));
		if ((assert(isNonImmediate(GIV(specialObjectsOop))),
		oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((arg & (tagMask())) == 0)
			 && (oopisLessThan(arg, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(GIV(specialObjectsOop));
				}
			}
		}
		longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheInputSemaphore) << (shiftForWord())))), arg);
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
	else {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
	}
}


/*	Return an integer indicating the reason for the most recent input
	interrupt. 
 */

	/* InterpreterPrimitives>>#primitiveInputWord */
static void
primitiveInputWord(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	/* begin pop:thenPushInteger: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)0 << 3) | 1));
	GIV(stackPointer) = sp;
}

	/* InterpreterPrimitives>>#primitiveIntegerAt */
static void
primitiveIntegerAt(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classFormat;
    sqInt classPointer;
    sqInt fmt1;
    sqInt fmt2;
    sqInt index1;
    sqInt numFixed;
    usqInt numSlots11;
    usqInt numSlots2;
    sqInt oop;
    sqInt rcvr1;
    char *sp2;
    char *sp3;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    sqInt value;

	/* begin primitiveSpurIntegerAt */
	index1 = longAt(GIV(stackPointer));
	rcvr1 = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!((((index1) & 7) == 1))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		goto l17;
	}
	if (rcvr1 & (tagMask())) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadReceiver;
		goto l17;
	}
	fmt2 = (((usqInt) (longAt(rcvr1))) >> (formatShift())) & (formatMask());
	index1 = ((index1 >> 3)) - 1;
	if (fmt2 >= (firstByteFormat())) {
		if (fmt2 >= (firstCompiledMethodFormat())) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrUnsupported;
			goto l17;
		}
		/* begin numBytesOfBytes: */
		fmt1 = (((usqInt) (longAt(rcvr1))) >> (formatShift())) & (formatMask());
		assert(fmt1 >= (firstByteFormat()));
		numSlots2 = ((numSlotsOf(rcvr1)) << (shiftForWord())) - (fmt1 & 7);
		if ((((usqInt)index1)) < numSlots2) {
			value = byteAt((rcvr1 + BaseHeaderSize) + index1);
			if (value > 0x7F) {
				value -= 256;
			}
			/* begin methodReturnInteger: */
			longAtput((sp4 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)value << 3) | 1));
			GIV(stackPointer) = sp4;
			goto l17;
		}
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		goto l17;
	}
	if (fmt2 >= (firstShortFormat())) {
		numSlots2 = ((usqInt) (numBytesOf(rcvr1))) >> 1;
		if ((((usqInt)index1)) < numSlots2) {
			value = shortAt((rcvr1 + BaseHeaderSize) + (((sqInt)((usqInt)(index1) << 1))));
			if (value > 0x7FFF) {
				value -= 65536;
			}
			/* begin methodReturnInteger: */
			longAtput((sp5 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)value << 3) | 1));
			GIV(stackPointer) = sp5;
			goto l17;
		}
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		goto l17;
	}
	if (fmt2 == (sixtyFourBitIndexableFormat())) {
		numSlots2 = ((usqInt) (numBytesOf(rcvr1))) >> 3;
		if ((((usqInt)index1)) < numSlots2) {
			/* begin methodReturnValue: */
			oop = signed64BitIntegerFor(long64At((rcvr1 + BaseHeaderSize) + (((sqInt)((usqInt)(index1) << 3)))));
			/* begin pop:thenPush: */
			longAtput((sp7 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
			GIV(stackPointer) = sp7;
			goto l17;
		}
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		goto l17;
	}
	if (fmt2 >= (firstLongFormat())) {
		numSlots2 = ((usqInt) (numBytesOf(rcvr1))) >> 2;
		if ((((usqInt)index1)) < numSlots2) {
			value = long32At((rcvr1 + BaseHeaderSize) + (((sqInt)((usqInt)(index1) << 2))));
			if (value > 0x7FFFFFFF) {
				value -= 0x100000000LL;
			}
			/* begin methodReturnInteger: */
			longAtput((sp6 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)value << 3) | 1));
			GIV(stackPointer) = sp6;
			goto l17;
		}
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		goto l17;
	}
	if ((fmt2 <= 5 /* lastPointerFormat */)
	 && ((fmt2 >= 2 /* arrayFormat */)
	 && ((fmt2 <= (weakArrayFormat()))
	 || (fmt2 >= (sixtyFourBitIndexableFormat()))))) {
		/* begin numSlotsOf: */
		assert((classIndexOf(rcvr1)) > (isForwardedObjectClassIndexPun()));
		numSlots11 = byteAt(rcvr1 + 7);
		numSlots2 = (numSlots11 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr1 - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots11);
		if (fmt2 == 2 /* arrayFormat */) {
			if ((((usqInt)index1)) < numSlots2) {
				/* begin methodReturnValue: */
				longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), longAt((rcvr1 + BaseHeaderSize) + (((sqInt)((usqInt)(index1) << (shiftForWord()))))));
				GIV(stackPointer) = sp2;
				goto l17;
			}
		}
		/* begin fixedFieldsOfClassFormat: */
		classPointer = fetchClassOfNonImm(rcvr1);
		classFormat = ((longAt((classPointer + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
		numFixed = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
		if ((((index1 + 1) >= numFixed) && ((index1 + 1) <= numSlots2))) {
			/* begin methodReturnValue: */
			longAtput((sp3 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), longAt((rcvr1 + BaseHeaderSize) + (((sqInt)((usqInt)((index1 + numFixed)) << (shiftForWord()))))));
			GIV(stackPointer) = sp3;
			goto l17;
		}
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		goto l17;
	}
	/* begin primitiveFailFor: */
	GIV(primFailCode) = PrimErrBadReceiver;
	l17:	/* end primitiveSpurIntegerAt */;
}

	/* InterpreterPrimitives>>#primitiveIntegerAtPut */
static void
primitiveIntegerAtPut(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classFormat;
    sqInt classPointer;
    sqInt fmt;
    sqInt fmt1;
    sqInt index;
    sqInt numFixed;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt rcvr;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    char *sp4;
    char *sp5;
    sqLong value;
    sqInt valueOop;

	/* begin primitiveSpurIntegerAtPut */
	valueOop = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	value = signed64BitValueOf(valueOop);
	if (!((!GIV(primFailCode))
		 && ((((index) & 7) == 1)))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		goto l14;
	}
	if (rcvr & (tagMask())) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadReceiver;
		goto l14;
	}
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrNoModification;
		goto l14;
	}
	fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
	index = ((index >> 3)) - 1;
	if (fmt >= (firstByteFormat())) {
		if (fmt >= (firstCompiledMethodFormat())) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrUnsupported;
			goto l14;
		}
		if (!((((usqInt)((((sqLong)value >> 7)) + 1))) <= 1)) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadArgument;
			goto l14;
		}
		/* begin numBytesOfBytes: */
		fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
		assert(fmt1 >= (firstByteFormat()));
		numSlots = ((numSlotsOf(rcvr)) << (shiftForWord())) - (fmt1 & 7);
		if ((((usqInt)index)) < numSlots) {
			byteAtput((rcvr + BaseHeaderSize) + index, value);
			/* begin methodReturnValue: */
			longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), valueOop);
			GIV(stackPointer) = sp;
			goto l14;
		}
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		goto l14;
	}
	if (fmt >= (firstShortFormat())) {
		if (!((((usqInt)((((sqLong)value >> 15)) + 1))) <= 1)) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadArgument;
			goto l14;
		}
		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1;
		if ((((usqInt)index)) < numSlots) {
			shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1))), value);
			/* begin methodReturnValue: */
			longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), valueOop);
			GIV(stackPointer) = sp1;
			goto l14;
		}
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		goto l14;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {

		/* No range check on value in this case because signed64BitValueOf: performed it above. */
		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 3;
		if ((((usqInt)index)) < numSlots) {
			long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 3))), value);
			/* begin methodReturnValue: */
			longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), valueOop);
			GIV(stackPointer) = sp2;
			goto l14;
		}
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		goto l14;
	}
	if (fmt >= (firstLongFormat())) {
		if (!((((usqInt)((((sqLong)value >> 31)) + 1))) <= 1)) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadArgument;
			goto l14;
		}
		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2;
		if ((((usqInt)index)) < numSlots) {
			long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 2))), value);
			/* begin methodReturnValue: */
			longAtput((sp3 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), valueOop);
			GIV(stackPointer) = sp3;
			goto l14;
		}
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		goto l14;
	}
	if ((fmt <= 5 /* lastPointerFormat */)
	 && ((fmt >= 2 /* arrayFormat */)
	 && ((fmt <= (weakArrayFormat()))
	 || (fmt >= (sixtyFourBitIndexableFormat()))))) {
		/* begin numSlotsOf: */
		assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
		numSlots1 = byteAt(rcvr + 7);
		numSlots = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		if (fmt == 2 /* arrayFormat */) {
			if ((((usqInt)index)) < numSlots) {
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(rcvr)));
				if ((assert(isNonImmediate(rcvr)),
				oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((valueOop & (tagMask())) == 0)
					 && (oopisLessThan(valueOop, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(rcvr);
						}
					}
				}
				longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))), valueOop);
				/* begin methodReturnValue: */
				longAtput((sp4 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), valueOop);
				GIV(stackPointer) = sp4;
				goto l14;
			}
		}
		/* begin fixedFieldsOfClassFormat: */
		classPointer = fetchClassOfNonImm(rcvr);
		classFormat = ((longAt((classPointer + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
		numFixed = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
		if ((((index + 1) >= numFixed) && ((index + 1) <= numSlots))) {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(rcvr)));
			if ((assert(isNonImmediate(rcvr)),
			oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((valueOop & (tagMask())) == 0)
				 && (oopisLessThan(valueOop, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(rcvr);
					}
				}
			}
			longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index + numFixed)) << (shiftForWord())))), valueOop);
			/* begin methodReturnValue: */
			longAtput((sp5 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), valueOop);
			GIV(stackPointer) = sp5;
			goto l14;
		}
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		goto l14;
	}
	/* begin primitiveFailFor: */
	GIV(primFailCode) = PrimErrBadReceiver;
	l14:	/* end primitiveSpurIntegerAtPut */;
}


/*	Primitive. Answer the number of interrupt checks per milliseconds that we
	execute on this machine. This can be used to adjust the sub-msecs profiler
	to check (roughly) 
	n times per millisecond.
 */

	/* InterpreterPrimitives>>#primitiveInterruptChecksPerMSec */
EXPORT(sqInt)
primitiveInterruptChecksPerMSec(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;
    char *sp;

	if (!(GIV(argumentCount) == 0)) {
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin pop:thenPush: */
	oop = (((usqInt)(ioHeartbeatMilliseconds()) << 3) | 1);
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
	return 0;
}


/*	Register the user interrupt semaphore. If the argument is 
	not a Semaphore, unregister the current interrupt 
	semaphore. */

	/* InterpreterPrimitives>>#primitiveInterruptSemaphore */
static void
primitiveInterruptSemaphore(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;

	arg = longAt(GIV(stackPointer));
	if ((arg == GIV(nilObj))
	 || (((arg & (tagMask())) == 0)
	 && (((longAt(arg)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord())))))))))) {
		/* begin splObj:put: */
		assert(!(isForwarded(GIV(specialObjectsOop))));
		if ((assert(isNonImmediate(GIV(specialObjectsOop))),
		oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((arg & (tagMask())) == 0)
			 && (oopisLessThan(arg, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(GIV(specialObjectsOop));
				}
			}
		}
		longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheInterruptSemaphore) << (shiftForWord())))), arg);
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
	else {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
	}
}


/*	Primitive. 'Invoke' an object like a function, sending the special message
	run: originalSelector with: arguments in: aReceiver.
	 */

	/* InterpreterPrimitives>>#primitiveInvokeObjectAsMethod */
static void
primitiveInvokeObjectAsMethod(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt lookupClassTag;
    sqInt runArgs;
    sqInt runReceiver;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    sqInt tagBits;
    sqInt top;
    sqInt top1;
    sqInt valuePointer;

	/* begin eeInstantiateClassIndex:format:numSlots: */
	assert((GIV(argumentCount) >= 0)
	 && ((knownClassAtIndex(ClassArrayCompactIndex)) != GIV(nilObj)));
	assert((2 /* arrayFormat */) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex))));
	runArgs = allocateNewSpaceSlotsformatclassIndex(GIV(argumentCount), 2 /* arrayFormat */, ClassArrayCompactIndex);
	for (i = (GIV(argumentCount) - 1); i >= 0; i += -1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		top1 = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		valuePointer = top1;
		assert(!(isOopForwarded(runArgs)));
		longAtput((runArgs + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer);
	}
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	runReceiver = top;
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
	GIV(stackPointer) = sp;
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(messageSelector));
	GIV(stackPointer) = sp1;
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), runArgs);
	GIV(stackPointer) = sp2;
	/* begin push: */
	longAtput((sp3 = GIV(stackPointer) - BytesPerWord), runReceiver);
	GIV(stackPointer) = sp3;
	/* begin fetchPointer:ofObject: */
	GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorRunWithIn) << (shiftForWord())))));
	GIV(argumentCount) = 3;
	if (((tagBits = GIV(newMethod) & (tagMask()))) != 0) {
		lookupClassTag = tagBits;
	}
	else {
		/* begin classIndexOf: */
		lookupClassTag = (longAt(GIV(newMethod))) & (classIndexMask());
	}
	findNewMethodInClassTag(lookupClassTag);
	executeNewMethod();
	/* begin initPrimCall */
	GIV(primFailCode) = 0;
}


/*	Answer if running on a big endian machine. */

	/* InterpreterPrimitives>>#primitiveIsBigEnder */
EXPORT(sqInt)
primitiveIsBigEnder(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	/* begin pop:thenPushBool: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (VMBIGENDIAN
		? GIV(trueObj)
		: GIV(falseObj)));
	GIV(stackPointer) = sp;
	return 0;
}


/*	Answer if the receiver is pinned, i.e. immobile. */

	/* InterpreterPrimitives>>#primitiveIsPinned */
static void
primitiveIsPinned(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt obj;
    char *sp;
    sqInt trueOrFalse;

	obj = longAt(GIV(stackPointer));
	if ((obj & (tagMask()))
	 || (((longAt(obj)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadReceiver;
		return;
	}
	/* begin pop:thenPushBool: */
	trueOrFalse = ((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0;
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (trueOrFalse
		? GIV(trueObj)
		: GIV(falseObj)));
	GIV(stackPointer) = sp;
}


/*	Primitive. Answer whether the OS window is currently partially or fully
	obscured. 
 */

	/* InterpreterPrimitives>>#primitiveIsWindowObscured */
EXPORT(sqInt)
primitiveIsWindowObscured(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt object;
    char *sp;
    sqInt trueOrFalse;

	/* begin pop: */
	GIV(stackPointer) += (GIV(argumentCount) + 1) * BytesPerWord;
	/* begin pushBool: */
	trueOrFalse = ioIsWindowObscured();
	/* begin push: */
	object = (trueOrFalse
		? GIV(trueObj)
		: GIV(falseObj));
	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
	return 0;
}


/*	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>.
 */

	/* InterpreterPrimitives>>#primitiveKbdNext */
static void
primitiveKbdNext(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt keystrokeWord;
    char *sp;
    char *sp1;

	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	keystrokeWord = ioGetKeystroke();
	if (keystrokeWord >= 0) {
		/* begin pushInteger: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), (((usqInt)keystrokeWord << 3) | 1));
		GIV(stackPointer) = sp1;
	}
	else {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(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>.
 */

	/* InterpreterPrimitives>>#primitiveKbdPeek */
static void
primitiveKbdPeek(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt keystrokeWord;
    char *sp;
    char *sp1;

	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	keystrokeWord = ioPeekKeystroke();
	if (keystrokeWord >= 0) {
		/* begin pushInteger: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), (((usqInt)keystrokeWord << 3) | 1));
		GIV(stackPointer) = sp1;
	}
	else {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveLessOrEqual */
static void
primitiveLessOrEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArgument;
    sqInt integerReceiver;
    char *sp;

	integerArgument = longAt(GIV(stackPointer));
	integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((integerReceiver & integerArgument) & (smallIntegerTag())) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerReceiver <= integerArgument
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveLessOrEqualLargeIntegers */
EXPORT(void)
primitiveLessOrEqualLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqLong integerArg;
    sqLong integerRcvr;
    char *sp;

	integerArg = signed64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	integerRcvr = signed64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerRcvr <= integerArg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveLessThan */
static void
primitiveLessThan(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArgument;
    sqInt integerReceiver;
    char *sp;

	integerArgument = longAt(GIV(stackPointer));
	integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((integerReceiver & integerArgument) & (smallIntegerTag())) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerReceiver < integerArgument
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveLessThanLargeIntegers */
EXPORT(void)
primitiveLessThanLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqLong integerArg;
    sqLong integerRcvr;
    char *sp;

	integerArg = signed64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	integerRcvr = signed64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerRcvr < integerArg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}


/*	Primitive. Return the n-th builtin module name. */

	/* InterpreterPrimitives>>#primitiveListBuiltinModule */
static void
primitiveListBuiltinModule(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt index;
    sqInt integerPointer;
    sqInt length;
    char *moduleName;
    sqInt nameOop;
    char *sp;
    char *sp1;

	if (!(GIV(argumentCount) == 1)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		index = (integerPointer >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		index = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	if (index <= 0) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	moduleName = ioListBuiltinModule(index);
	if (moduleName == null) {
		/* begin pop: */
		GIV(stackPointer) += 2 * BytesPerWord;
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp;
		return;
	}
	length = strlen(moduleName);
	nameOop = instantiateClassindexableSize(splObj(ClassByteString), length);
	for (i = 0; i < length; i += 1) {
		byteAtput((nameOop + BaseHeaderSize) + i, moduleName[i]);
	}
	forceInterruptCheck();
	/* begin pop:thenPush: */
	longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), nameOop);
	GIV(stackPointer) = sp1;
}


/*	Primitive. Return the n-th loaded external module name. */

	/* InterpreterPrimitives>>#primitiveListExternalModule */
static void
primitiveListExternalModule(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt index;
    sqInt integerPointer;
    sqInt length;
    char *moduleName;
    sqInt nameOop;
    char *sp;
    char *sp1;

	if (!(GIV(argumentCount) == 1)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		index = (integerPointer >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		index = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	if (index <= 0) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	moduleName = ioListLoadedModule(index);
	if (moduleName == null) {
		/* begin pop: */
		GIV(stackPointer) += 2 * BytesPerWord;
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
		GIV(stackPointer) = sp;
		return;
	}
	length = strlen(moduleName);
	nameOop = instantiateClassindexableSize(splObj(ClassByteString), length);
	for (i = 0; i < length; i += 1) {
		byteAtput((nameOop + BaseHeaderSize) + i, moduleName[i]);
	}
	forceInterruptCheck();
	/* begin pop:thenPush: */
	longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), nameOop);
	GIV(stackPointer) = sp1;
}


/*	This primitive is called from Smalltalk 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 one word,
	i.e. retaining the version
	stamp. 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?
	[How about saving it so the system functions as primtiives are intended?
	eem 5/9/2017 16:31]
	
	In Spur, if the primitive succeeds, the segmentWordArray is also becomed
	into the array of loaded
	objects, to allow fixing up of loaded objects directly without nextObject,
	which Spur doesn't support. */

	/* InterpreterPrimitives>>#primitiveLoadImageSegment */
static void
primitiveLoadImageSegment(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt outPointerArray;
    sqInt result;
    sqInt segmentWordArray;
    char *sp;

	outPointerArray = longAt(GIV(stackPointer));

	/* Essential type checks */
	segmentWordArray = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!((((outPointerArray & (tagMask())) == 0)
		 && (((((usqInt) (longAt(outPointerArray))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && (((segmentWordArray & (tagMask())) == 0)
		 && (((((((usqInt) (longAt(segmentWordArray))) >> (formatShift())) & (formatMask())) >= (firstLongFormat())) && (((((usqInt) (longAt(segmentWordArray))) >> (formatShift())) & (formatMask())) <= ((firstShortFormat()) - 1))))))) {

		/* Must be indexable words */
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	result = loadImageSegmentFromoutPointers(segmentWordArray, outPointerArray);
	if (oopisGreaterThan(result, segmentWordArray)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), result);
		GIV(stackPointer) = sp;
	}
	else {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = result;
	}
}


/*	Return the value of the microsecond clock in the local timezone as an
	integer. This is the number of microseconds since the Smalltalk epoch,
	1901/1/1 12:00am.
	The microsecond clock is at least 60 bits wide which means it'll get to
	around August
	38435 before it wraps around. Be sure to put it on your calendar. This
	primitive accesses the time as answered by the OS. */

	/* InterpreterPrimitives>>#primitiveLocalMicrosecondClock */
static void
primitiveLocalMicrosecondClock(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;
    char *sp;

	/* begin pop:thenPush: */
	oop = positive64BitIntegerFor(ioLocalMicrosecondsNow());
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}


/*	Natural log.
	N.B. IMO we should be able to assume the receiver is a float because this
	primitive is specific to floats. eem 2/13/2017 */

	/* InterpreterPrimitives>>#primitiveLogN */
static void
primitiveLogN(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    double rcvr;

	/* begin stackFloatValue: */
	rcvr = floatValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin stackTopPut: */
		aValue = floatObjectOf(log(rcvr));
		longAtPointerput(GIV(stackPointer), aValue);
	}
}


/*	Register the low-space semaphore. If the argument is not a 
	Semaphore, unregister the current low-space Semaphore. */

	/* InterpreterPrimitives>>#primitiveLowSpaceSemaphore */
static void
primitiveLowSpaceSemaphore(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;

	arg = longAt(GIV(stackPointer));
	if ((arg == GIV(nilObj))
	 || (((arg & (tagMask())) == 0)
	 && (((longAt(arg)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord())))))))))) {
		/* begin splObj:put: */
		assert(!(isForwarded(GIV(specialObjectsOop))));
		if ((assert(isNonImmediate(GIV(specialObjectsOop))),
		oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((arg & (tagMask())) == 0)
			 && (oopisLessThan(arg, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(GIV(specialObjectsOop));
				}
			}
		}
		longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheLowSpaceSemaphore) << (shiftForWord())))), arg);
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
	else {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
	}
}

	/* InterpreterPrimitives>>#primitiveMakePoint */
static void
primitiveMakePoint(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;
    sqInt classObj;
    sqInt knownClassIndex;
    usqInt newObj;
    usqInt numBytes;
    sqInt numSlots;
    sqInt objFormat;
    usqInt pt;
    sqInt rcvr;
    char *sp;

	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	arg = longAt(GIV(stackPointer));
	if (!((arg & (tagMask())
			? !(arg & (characterTag()))
			: ((longAt(arg)) & (classIndexMask())) == ClassFloatCompactIndex))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	/* begin eeInstantiateSmallClass:numSlots: */
	classObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
	numSlots = YIndex + 1;
	assert((rawHashBitsOf(classObj)) != 0);
	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
	knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
	/* begin instSpecOfClassFormat: */
	objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3))) >> (fixedFieldsFieldWidth())) & (formatMask());
	assert((numSlots >= 0)
	 && ((knownClassIndex != 0)
	 && ((knownClassAtIndex(knownClassIndex)) != GIV(nilObj))));
	assert(((objFormat < (firstByteFormat())
		? objFormat
		: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex))));
	/* begin allocateSmallNewSpaceSlots:format:classIndex: */
	assert(numSlots < (numSlotsMask()));
	newObj = GIV(freeStart);
	numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
			error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
			pt = 0;
			goto l2;
		}
	}
	long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex);
	GIV(freeStart) += numBytes;
	pt = newObj;
	l2:	/* end eeInstantiateSmallClass:numSlots: */;
	assert(!(isOopForwarded(pt)));
	longAtput((pt + BaseHeaderSize) + (((sqInt)((usqInt)(XIndex) << (shiftForWord())))), rcvr);
	assert(!(isOopForwarded(pt)));
	longAtput((pt + BaseHeaderSize) + (((sqInt)((usqInt)(YIndex) << (shiftForWord())))), arg);
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), pt);
	GIV(stackPointer) = sp;
}

	/* InterpreterPrimitives>>#primitiveMaxIdentityHash */
static void
primitiveMaxIdentityHash(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerVal;
    char *sp;

	/* begin pop:thenPushInteger: */
	integerVal = identityHashHalfWordMask();
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)integerVal << 3) | 1));
	GIV(stackPointer) = sp;
}


/*	Return the method an external primitive was defined in */

	/* InterpreterPrimitives>>#primitiveMethod */
usqInt
primitiveMethod(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(newMethod);
}


/*	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.
 */

	/* InterpreterPrimitives>>#primitiveMillisecondClock */
static void
primitiveMillisecondClock(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;
    char *sp;

	/* begin pop:thenPush: */
	oop = (((usqInt)((ioMSecs()) & MillisecondClockMask) << 3) | 1);
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}


/*	Provide access to the millisecond clock mask to support calculation
	of durations based on the millisecond clock value. */

	/* InterpreterPrimitives>>#primitiveMillisecondClockMask */
EXPORT(sqInt)
primitiveMillisecondClockMask(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)MillisecondClockMask << 3) | 1));
	GIV(stackPointer) = sp;
	return 0;
}

	/* InterpreterPrimitives>>#primitiveMod */
static void
primitiveMod(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt mod;
    char *sp;

	mod = doPrimitiveModby(longAt(GIV(stackPointer) + (1 * BytesPerWord)), longAt(GIV(stackPointer)));
	/* begin pop2AndPushIntegerIfOK: */
	if (!GIV(primFailCode)) {
		if ((((((usqInt) mod) >> 60) + 1) & 15) <= 1) {
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)mod << 3) | 1));
			GIV(stackPointer) = sp;
		}
		else {
			/* begin success: */
			
			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveModLargeIntegers */
EXPORT(void)
primitiveModLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    char *sp;

	oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (b == 0) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (GIV(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 (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(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>.
 */

	/* InterpreterPrimitives>>#primitiveMouseButtons */
static void
primitiveMouseButtons(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt buttonWord;
    char *sp;

	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	buttonWord = ioGetButtonState();
	/* begin pushInteger: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), (((usqInt)buttonWord << 3) | 1));
	GIV(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.
 */

	/* InterpreterPrimitives>>#primitiveMousePoint */
static void
primitiveMousePoint(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classObj;
    sqInt knownClassIndex;
    usqInt newObj;
    usqInt numBytes;
    sqInt numSlots;
    sqInt objFormat;
    sqInt oop;
    usqInt pointResult;
    sqInt pointWord;
    char *sp;
    sqInt x;
    sqInt y;

	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 pop:thenPush: */
	classObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
	numSlots = YIndex + 1;
	assert((rawHashBitsOf(classObj)) != 0);
	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
	knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
	/* begin instSpecOfClassFormat: */
	objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3))) >> (fixedFieldsFieldWidth())) & (formatMask());
	assert((numSlots >= 0)
	 && ((knownClassIndex != 0)
	 && ((knownClassAtIndex(knownClassIndex)) != GIV(nilObj))));
	assert(((objFormat < (firstByteFormat())
		? objFormat
		: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex))));
	/* begin allocateSmallNewSpaceSlots:format:classIndex: */
	assert(numSlots < (numSlotsMask()));
	newObj = GIV(freeStart);
	numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
			error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
			pointResult = 0;
			goto l3;
		}
	}
	long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex);
	GIV(freeStart) += numBytes;
	pointResult = newObj;
	l3:	/* end eeInstantiateSmallClass:numSlots: */;
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(pointResult)));
	longAtput((pointResult + BaseHeaderSize) + (((sqInt)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)x << 3) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(pointResult)));
	longAtput((pointResult + BaseHeaderSize) + (((sqInt)((usqInt)(YIndex) << (shiftForWord())))), (((usqInt)y << 3) | 1));
	oop = pointResult;
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}

	/* InterpreterPrimitives>>#primitiveMultiply */
static void
primitiveMultiply(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArg;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt integerRcvr;
    sqInt integerResult;
    sqInt overflow;
    char *sp;

	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		integerRcvr = (integerPointer >> 3);
		goto l1;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerRcvr = 0;
		goto l1;
	}
	l1:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer1) & 7) == 1)) {
		integerArg = (integerPointer1 >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerArg = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	if (!GIV(primFailCode)) {
		overflow = (integerRcvr > 0
			? (integerArg > 0
					? integerRcvr > ((MaxSmallInteger) / integerArg)
					: integerArg < ((MinSmallInteger) / integerRcvr))
			: (integerArg > 0
					? integerRcvr < ((MinSmallInteger) / integerArg)
					: (integerRcvr < 0)
						 && (integerArg < ((MaxSmallInteger) / integerRcvr))));
		if (overflow) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
		else {
			integerResult = integerRcvr * integerArg;
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)integerResult << 3) | 1));
			GIV(stackPointer) = sp;
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveMultiplyLargeIntegers */
EXPORT(void)
primitiveMultiplyLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    char *sp;

	oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (GIV(primFailCode)) {
		return;
	}
	if ((a > 1)
	 && ((b > 1)
	 && (a > (0xFFFFFFFFFFFFFFFFULL / b)))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	result = a * b;
	oopResult = magnitude64BitIntegerForneg(result, aIsNegative != bIsNegative);
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveNew */
static void
primitiveNew(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt obj;
    sqInt reasonCode;
    char *sp;

	
	/* Allocate a new fixed-size instance.  Fail if the allocation would leave
	   less than lowSpaceThreshold bytes free. This *will not* cause a GC :-) */
	obj = instantiateClass(longAt(GIV(stackPointer)));
	if (obj == null) {
		/* begin primitiveFailFor: */
		reasonCode = (isFixedSizePointerFormat(instSpecOfClass(longAt(GIV(stackPointer))))
			? PrimErrNoMemory
			: PrimErrBadReceiver);
		GIV(primFailCode) = reasonCode;
	}
	else {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), obj);
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveNewMethod */
static void
primitiveNewMethod(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bytecodeCount;
    sqInt class;
    sqInt classFormat;
    sqInt classIndex;
    sqInt err;
    sqInt hash;
    sqInt header;
    sqInt i;
    sqInt instSpec;
    sqInt literalCount;
    sqInt newObj;
    usqInt newObj1;
    usqInt numBytes;
    usqInt numSlots;
    usqInt p;
    sqInt reasonCode;
    sqInt size;
    char *sp;
    sqInt theMethod;

	header = longAt(GIV(stackPointer));
	bytecodeCount = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!(((((header) & 7) == 1))
		 && (((((bytecodeCount) & 7) == 1))
		 && (((bytecodeCount = (bytecodeCount >> 3))) >= 0)))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	class = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	assert((((header) & 7) == 1));
	literalCount = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
	size = ((literalCount + LiteralStart) * BytesPerOop) + bytecodeCount;
	/* begin instantiateCompiledMethodClass:indexableSize: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask());
	if (instSpec != (firstCompiledMethodFormat())) {
		theMethod = null;
		goto l8;
	}
	numSlots = (size + 7) / 8;
	instSpec += (8 - size) & 7;
	assert(addressCouldBeClassObj(class));
	classIndex = (((hash = (long32At(class + 4)) & (identityHashHalfWordMask()))) != 0
		? hash
		: (objCouldBeClassObj(class)
				? (((err = enterIntoClassTable(class))) != 0
						? -err
						: (/* begin rawHashBitsOf: */
							(long32At(class + 4)) & (identityHashHalfWordMask())))
				: -PrimErrBadReceiver));
	if (classIndex < 0) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = -classIndex;
		theMethod = null;
		goto l8;
	}
	if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) {
		if (numSlots > (0x10000000000LL)) {
			theMethod = null;
			goto l8;
		}
		newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0
			? 8 /* allocationUnit */ + BaseHeaderSize
			: (numSlots << (shiftForWord())) + ((numSlots >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))), instSpec, classIndex);
	}
	else {
		/* begin allocateSlots:format:classIndex: */
		if (numSlots >= (numSlotsMask())) {
			if ((((usqInt) numSlots) >> 56) > 0) {
				newObj = null;
				goto l4;
			}
			newObj1 = GIV(freeStart) + BaseHeaderSize;
			numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop);
		}
		else {
			newObj1 = GIV(freeStart);
			numBytes = BaseHeaderSize + ((numSlots < 1
	? /* begin allocationUnit */ 8
	: numSlots * BytesPerOop));
		}
		if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
			if (!GIV(needGCFlag)) {
				/* begin scheduleScavenge */
				GIV(needGCFlag) = 1;
				forceInterruptCheck();
			}
			newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex);
			goto l4;
		}
		if (numSlots >= (numSlotsMask())) {

			/* for header parsing we put a saturated slot count in the prepended overflow size word */
			flag("endianness");
			longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots);
			longAtput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex));
		}
		else {
			longAtput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex);
		}
		assert((numBytes % (allocationUnit())) == 0);
		assert((newObj1 % (allocationUnit())) == 0);
		GIV(freeStart) += numBytes;
		newObj = newObj1;
	l4:	/* end allocateSlots:format:classIndex: */;
	}
	if (!(newObj == null)) {
		/* begin fillObj:numSlots:with: */
		assert(oopisLessThan(((newObj + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(newObj)));
		for (p = (((usqInt)(newObj + BaseHeaderSize))); p <= (((usqInt)(((newObj + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8 /* allocationUnit */) {
			longAtput(p, 0);
		}
	}
	theMethod = newObj;
	l8:	/* end instantiateCompiledMethodClass:indexableSize: */;
	if (!(theMethod)) {
		/* begin primitiveFailFor: */
		reasonCode = (isCompiledMethodFormat(instSpecOfClassFormat(((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)))
			? PrimErrNoMemory
			: PrimErrBadReceiver);
		GIV(primFailCode) = reasonCode;
		return;
	}
	assert(!(isOopForwarded(theMethod)));
	longAtput((theMethod + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))), header);
	for (i = 1; i <= literalCount; i += 1) {
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(theMethod)));
		if ((assert(isNonImmediate(theMethod)),
		oopisGreaterThanOrEqualTo(theMethod, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((GIV(nilObj) & (tagMask())) == 0)
			 && (oopisLessThan(GIV(nilObj), GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(theMethod))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(theMethod);
				}
			}
		}
		longAtput((theMethod + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), GIV(nilObj));
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), theMethod);
	GIV(stackPointer) = sp;
}


/*	Allocate a new indexable instance. Fail if the allocation would leave less
	than lowSpaceThreshold bytes free. May cause a GC.
 */

	/* InterpreterPrimitives>>#primitiveNewWithArg */
static void
primitiveNewWithArg(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bs;
    sqInt ccIndex;
    sqInt classFormat;
    sqInt fmt;
    sqInt instSpec;
    sqInt obj;
    sqInt ok;
    sqInt oop1;
    sqInt reasonCode;
    usqIntptr_t size;
    char *sp;
    sqInt value;

	/* begin positiveMachineIntegerValueOf: */
	oop1 = longAt(GIV(stackPointer));
	if ((((oop1) & 7) == 1)) {
		value = (oop1 >> 3);
		if (value < 0) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			size = null;
			goto l9;
		}
		size = value;
		goto l9;
	}
	if (oop1 & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		size = 0;
		goto l9;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop1)));
	/* begin classIndexOf: */
	ccIndex = (longAt(oop1)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
	goto l8;
	l8:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (!ok) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		size = 0;
		goto l9;
	}
	/* begin numBytesOfBytes: */
	fmt = (((usqInt) (longAt(oop1))) >> (formatShift())) & (formatMask());
	assert(fmt >= (firstByteFormat()));
	bs = ((numSlotsOf(oop1)) << (shiftForWord())) - (fmt & 7);
	if (bs > (sizeof(usqIntptr_t))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		size = 0;
		goto l9;
	}
	if (((sizeof(usqIntptr_t)) == 8)
	 && (bs > 4)) {
		size = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop1 + BaseHeaderSize) + (0U << 3))));
		goto l9;
	}
	else {
		size = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop1 + BaseHeaderSize) + (0U << 2))))));
		goto l9;
	}
	l9:	/* end positiveMachineIntegerValueOf: */;
	if (GIV(primFailCode)) {

		/* positiveMachineIntegerValueOf: succeeds only for non-negative integers. */
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	obj = instantiateClassindexableSize(longAt(GIV(stackPointer) + (1 * BytesPerWord)), size);
	if (obj == null) {
		/* begin instSpecOfClass: */
		classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
		instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask());
		/* begin primitiveFailFor: */
		reasonCode = (((instSpec >= 2 /* arrayFormat */)
		 && ((instSpec <= (weakArrayFormat()))
		 || (instSpec >= (sixtyFourBitIndexableFormat()))))
		 && (!(instSpec >= (firstCompiledMethodFormat())))
			? PrimErrNoMemory
			: PrimErrBadReceiver);
		GIV(primFailCode) = reasonCode;
	}
	else {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), obj);
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveNextInstance */
static void
primitiveNextInstance(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt actualObj;
    sqInt address;
    sqInt classIndex;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt numSlots;
    sqInt object;
    char *sp;
    sqInt subsequentObject;

	object = longAt(GIV(stackPointer));
	if (!(object & (tagMask()))) {
		/* begin instanceAfter: */
		actualObj = object;
		/* begin classIndexOf: */
		classIndex = (longAt(object)) & (classIndexMask());
		if (oopisGreaterThanOrEqualToandLessThan(object, ((eden()).start), GIV(freeStart))) {
			while (1) {
				/* begin objectAfter:limit: */
				followingWordAddress = addressAfter(actualObj);
				if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) {
					actualObj = GIV(freeStart);
					goto l2;
				}
				flag("endianness");
				followingWord = longAt(followingWordAddress);
				actualObj = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
					? followingWordAddress + BaseHeaderSize
					: followingWordAddress);
	l2:	/* end objectAfter:limit: */;
				if (!(oopisLessThan(actualObj, GIV(freeStart)))) break;
				if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) {
					subsequentObject = actualObj;
					goto l6;
				}
			}
			if (oopisGreaterThan(GIV(pastSpaceStart), ((pastSpace()).start))) {
				/* begin objectStartingAt: */
				address = ((pastSpace()).start);
				numSlots = byteAt(address + 7);
				actualObj = (numSlots == (numSlotsMask())
					? address + BaseHeaderSize
					: address);
			}
			else {
				actualObj = GIV(nilObj);
			}
		}
		if (oopisGreaterThanOrEqualToandLessThan(actualObj, ((pastSpace()).start), GIV(pastSpaceStart))) {
			while (1) {
				/* begin objectAfter:limit: */
				followingWordAddress1 = addressAfter(actualObj);
				if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) {
					actualObj = GIV(pastSpaceStart);
					goto l4;
				}
				flag("endianness");
				followingWord1 = longAt(followingWordAddress1);
				actualObj = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
					? followingWordAddress1 + BaseHeaderSize
					: followingWordAddress1);
	l4:	/* end objectAfter:limit: */;
				if (!(oopisLessThan(actualObj, GIV(pastSpaceStart)))) break;
				if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) {
					subsequentObject = actualObj;
					goto l6;
				}
			}
			actualObj = GIV(nilObj);
		}
		while (1) {
			/* begin objectAfter:limit: */
			followingWordAddress2 = addressAfter(actualObj);
			if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
				actualObj = GIV(endOfMemory);
				goto l5;
			}
			flag("endianness");
			followingWord2 = longAt(followingWordAddress2);
			actualObj = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress2 + BaseHeaderSize
				: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
			if (!(oopisLessThan(actualObj, GIV(endOfMemory)))) break;
			if (classIndex == ((longAt(actualObj)) & (classIndexMask()))) {
				subsequentObject = actualObj;
				goto l6;
			}
		}
		subsequentObject = null;
	l6:	/* end instanceAfter: */;
		if (!(subsequentObject == null)) {
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), subsequentObject);
			GIV(stackPointer) = sp;
			return;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
}


/*	Return the object following the receiver in the heap. Return the
	SmallInteger zero when there are no more objects.
 */

	/* InterpreterPrimitives>>#primitiveNextObject */
static void
primitiveNextObject(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt instance;
    char *sp;
    char *sp1;

	instance = accessibleObjectAfter(longAt(GIV(stackPointer)));
	if (instance == null) {
		/* begin pop:thenPushInteger: */
		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)0 << 3) | 1));
		GIV(stackPointer) = sp1;
	}
	else {
		assert(isInMemory(instance));
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), instance);
		GIV(stackPointer) = sp;
	}
}


/*	A placeholder for primitives that haven't been implemented or are being
	withdrawn gradually. Just absorbs any arguments and returns the receiver.
 */

	/* InterpreterPrimitives>>#primitiveNoop */
static void
primitiveNoop(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin pop: */
	GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
}

	/* InterpreterPrimitives>>#primitiveNotEqual */
static void
primitiveNotEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArgument;
    sqInt integerReceiver;
    int result;
    char *sp;
    char *sp1;

	integerArgument = longAt(GIV(stackPointer));
	integerReceiver = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((integerReceiver & integerArgument) & (smallIntegerTag())) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerReceiver != integerArgument
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
	else {
		result = (signedMachineIntegerValueOf(integerReceiver)) != (signedMachineIntegerValueOf(integerArgument));
		if (!GIV(primFailCode)) {
			/* begin pop:thenPushBool: */
			longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (result
				? GIV(trueObj)
				: GIV(falseObj)));
			GIV(stackPointer) = sp1;
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveNotEqualLargeIntegers */
EXPORT(void)
primitiveNotEqualLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqLong integerArg;
    sqLong integerRcvr;
    char *sp;

	integerArg = signed64BitValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	integerRcvr = signed64BitValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (integerRcvr != integerArg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(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. 
 */

	/* InterpreterPrimitives>>#primitiveNotIdentical */
static void
primitiveNotIdentical(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt otherObject;
    sqInt referent;
    sqInt referent1;
    char *sp;
    sqInt thisObject;

	otherObject = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	thisObject = longAt(GIV(stackPointer));
	if (((otherObject & (tagMask())) == 0)
	 && (((longAt(otherObject)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		assert(GIV(argumentCount) > 1);
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(thisObject));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((thisObject + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		otherObject = referent;
	}
	if (((thisObject & (tagMask())) == 0)
	 && (((longAt(thisObject)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(thisObject));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent1 = longAt((thisObject + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent1 & (tagMask())) == 0)
		 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		thisObject = referent1;
	}
	/* begin pop:thenPushBool: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (thisObject != otherObject
		? GIV(trueObj)
		: GIV(falseObj)));
	GIV(stackPointer) = sp;
}


/*	primitivePathTo: anObject using: stack <Array> followWeak: boolean
	Answer a path to anObject from the root that does not pass through
	the current context */

	/* InterpreterPrimitives>>#primitivePathToUsing */
EXPORT(sqInt)
primitivePathToUsing(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt current;
    sqInt err;
    sqInt fmt;
    sqInt fmt1;
    sqInt fmt2;
    sqInt followWeak;
    usqInt freeStartAtStart;
    sqInt goal;
    sqInt i;
    sqInt i1;
    sqInt iLimiT;
    sqInt iLimiT1;
    sqInt index;
    sqInt methodField;
    sqInt next;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots12;
    usqInt numSlots2;
    usqInt numSlots3;
    sqInt path;
    char *sp;
    sqInt stack;
    sqInt stackp;
    sqInt stackSize;

	err = 0;
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if (!(GIV(argumentCount) >= 2)) {
		/* begin primitiveFailFor: */
		return (GIV(primFailCode) = PrimErrBadNumArgs);
	}
	if (!(((longAt(GIV(stackPointer))) == GIV(trueObj))
		 || ((longAt(GIV(stackPointer))) == GIV(falseObj)))) {
		/* begin primitiveFailFor: */
		return (GIV(primFailCode) = PrimErrBadArgument);
	}
	/* begin pathTo:using:followWeak: */
	goal = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	stack = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	followWeak = (longAt(GIV(stackPointer))) == GIV(trueObj);
	if (!(((stack & (tagMask())) == 0)
		 && (((((usqInt) (longAt(stack))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))) {
		err = PrimErrBadArgument;
		goto l8;
	}
	assert(allObjectsUnmarked());

	/* check no allocations during search */
	freeStartAtStart = freeStart();
	beRootIfOld(stack);
	/* begin lengthOf:format: */
	fmt1 = (((usqInt) (longAt(stack))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOfAny: */
	numSlots11 = byteAt(stack + 7);
	numSlots2 = (numSlots11 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(stack - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots11);
	if (fmt1 <= 5 /* ephemeronFormat */) {
		stackSize = numSlots2;
		goto l5;
	}
	if (fmt1 >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		stackSize = (numSlots2 << (shiftForWord())) - (fmt1 & 7);
		goto l5;
	}
	if (fmt1 >= (firstShortFormat())) {
		stackSize = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3);
		goto l5;
	}
	if (fmt1 >= (firstLongFormat())) {
		stackSize = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1);
		goto l5;
	}
	if (fmt1 == (sixtyFourBitIndexableFormat())) {
		stackSize = numSlots2;
		goto l5;
	}
	stackSize = 0;
	l5:	/* end lengthOf:format: */;
	/* begin mark: */
	assert(!(isFreeObject(stack)));
	longAtput(stack, (longAt(stack)) | (1ULL << (markedBitFullShift())));
	current = GIV(specialObjectsOop);
	/* begin mark: */
	assert(!(isFreeObject(current)));
	longAtput(current, (longAt(current)) | (1ULL << (markedBitFullShift())));
	/* begin lengthOf:format: */
	fmt2 = (((usqInt) (longAt(current))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOfAny: */
	numSlots12 = byteAt(current + 7);
	numSlots3 = (numSlots12 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(current - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots12);
	if (fmt2 <= 5 /* ephemeronFormat */) {
		index = numSlots3;
		goto l7;
	}
	if (fmt2 >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		index = (numSlots3 << (shiftForWord())) - (fmt2 & 7);
		goto l7;
	}
	if (fmt2 >= (firstShortFormat())) {
		index = (numSlots3 << ((shiftForWord()) - 1)) - (fmt2 & 3);
		goto l7;
	}
	if (fmt2 >= (firstLongFormat())) {
		index = (numSlots3 << ((shiftForWord()) - 2)) - (fmt2 & 1);
		goto l7;
	}
	if (fmt2 == (sixtyFourBitIndexableFormat())) {
		index = numSlots3;
		goto l7;
	}
	index = 0;
	l7:	/* end lengthOf:format: */;
	stackp = 0;
	while(1) {
		while (((index -= 1)) >= -1) {
			if ((((((usqInt)current)) & (BytesPerWord - 1)) == 0)
			 && ((((((usqInt)current)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)current)) <= (((usqInt)GIV(pages))))))) {
				if (index >= 0) {
					next = fieldofFrame(index, ((char *) current));
				}
				else {
					next = GIV(nilObj);
				}
			}
			else {
				if (index >= 0) {
					if (((longAt(current)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
						next = fieldOrSenderFPofContext(index, current);
					}
					else {
						next = longAt((current + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
					}
				}
				else {
					next = fetchClassOfNonImm(current);
				}
			}
			if ((((((usqInt)next)) & (BytesPerWord - 1)) == 0)
			 && ((((((usqInt)next)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)next)) <= (((usqInt)GIV(pages))))))) {
				assert(isFrameonPage(((char *) next), stackPageFor(((char *) next))));
			}
			else {
				if (next >= heapBase) {

					/* exclude Cog methods */
					assert(checkOkayOop(next));
				}
			}
			if (next == goal) {
				assert(freeStartAtStart == (freeStart()));
				unmarkAfterPathTo();
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(stack)));
				if ((assert(isNonImmediate(stack)),
				oopisGreaterThanOrEqualTo(stack, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((current & (tagMask())) == 0)
					 && (oopisLessThan(current, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(stack))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(stack);
						}
					}
				}
				longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(stackp) << (shiftForWord())))), current);
				pruneStackstackp(stack, stackp);
				err = 0;
				goto l8;
			}
			if (((next & (smallIntegerTag())) == 0)
			 && (((((((usqInt)next)) & (BytesPerWord - 1)) == 0)
			 && ((((((usqInt)next)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)next)) <= (((usqInt)GIV(pages))))))
				? !(frameIsMarked(next))
				: (next >= heapBase)
					 && ((!(((((usqInt) (longAt(next))) >> (markedBitFullShift())) & 1) != 0))
					 && (((((next & (tagMask())) == 0)
					 && (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
					 || (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))
					 && (followWeak
					 || (!(isWeakFormat((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())))))))))) {
				if ((stackp + 2) > stackSize) {
					assert(freeStartAtStart == (freeStart()));
					unmarkAfterPathTo();
					/* begin nilFieldsOf: */
					for (i = 0, iLimiT = ((numSlotsOf(stack)) - 1); i <= iLimiT; i += 1) {
						assert(!(isOopForwarded(stack)));
						longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), GIV(nilObj));
					}
					err = PrimErrBadIndex;
					goto l8;
				}
				assert(!(isOopForwarded(stack)));
				longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(stackp) << (shiftForWord())))), current);
				assert(!(isOopForwarded(stack)));
				longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)((stackp + 1)) << (shiftForWord())))), (((usqInt)index << 3) | 1));
				stackp += 2;
				if ((((((usqInt)(((char *) next)))) & (BytesPerWord - 1)) == 0)
				 && ((((((usqInt)(((char *) next)))) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)(((char *) next)))) <= (((usqInt)GIV(pages))))))) {
					/* begin markFrame: */
					methodField = longAt(next + FoxMethod);
					if ((((usqInt)methodField)) < (startOfMemory())) {
						longAtput(next + FoxMethod, methodField | 4);
					}
					else {
						longAtput(next + FoxIFrameFlags, (longAt(next + FoxIFrameFlags)) | 2);
					}
					index = CtxtTempFrameStart + (stackPointerIndexForFrame(((char *) next)));
				}
				else {
					/* begin mark: */
					assert(!(isFreeObject(next)));
					longAtput(next, (longAt(next)) | (1ULL << (markedBitFullShift())));
					if (((((usqInt) (longAt(next))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
						index = (literalCountOfMethodHeader(methodHeaderOf(next))) + LiteralStart;
					}
					else {
						/* begin lengthOf:format: */
						fmt = (((usqInt) (longAt(next))) >> (formatShift())) & (formatMask());
						/* begin numSlotsOfAny: */
						numSlots1 = byteAt(next + 7);
						numSlots = (numSlots1 == (numSlotsMask())
							? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(next - BaseHeaderSize))) << 8)))))) >> 8
							: numSlots1);
						if (fmt <= 5 /* ephemeronFormat */) {
							index = numSlots;
							goto l3;
						}
						if (fmt >= (firstByteFormat())) {

							/* bytes, including CompiledMethod */
							index = (numSlots << (shiftForWord())) - (fmt & 7);
							goto l3;
						}
						if (fmt >= (firstShortFormat())) {
							index = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
							goto l3;
						}
						if (fmt >= (firstLongFormat())) {
							index = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
							goto l3;
						}
						if (fmt == (sixtyFourBitIndexableFormat())) {
							index = numSlots;
							goto l3;
						}
						index = 0;
	l3:	/* end lengthOf:format: */;
					}
				}
				current = next;
			}
		}
		if (current == GIV(specialObjectsOop)) {
			assert(freeStartAtStart == (freeStart()));
			unmarkAfterPathTo();
			/* begin nilFieldsOf: */
			for (i1 = 0, iLimiT1 = ((numSlotsOf(stack)) - 1); i1 <= iLimiT1; i1 += 1) {
				assert(!(isOopForwarded(stack)));
				longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), GIV(nilObj));
			}
			err = PrimErrNotFound;
			goto l8;
		}
		index = ((longAt((stack + BaseHeaderSize) + (((sqInt)((usqInt)((stackp - 1)) << (shiftForWord())))))) >> 3);
		current = longAt((stack + BaseHeaderSize) + (((sqInt)((usqInt)((stackp - 2)) << (shiftForWord())))));
		stackp -= 2;
	}
	l8:	/* end pathTo:using:followWeak: */;
	if (err != 0) {
		/* begin primitiveFailFor: */
		return (GIV(primFailCode) = err);
	}
	path = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), path);
	GIV(stackPointer) = sp;
	return 0;
}

	/* InterpreterPrimitives>>#primitivePerformInSuperclass */
static void
primitivePerformInSuperclass(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt argumentArray;
    usqInt arraySize;
    sqInt currentClass;
    sqInt delta;
    sqInt err;
    sqInt hash;
    sqInt index;
    sqInt lookupClass;
    sqInt nItems;
    usqInt numSlots;
    sqInt objOop;
    sqInt offset;
    sqInt performArgCount;
    sqInt rcvr;
    sqInt selector;
    sqInt selector1;
    char *sp;
    char *sp1;
    char *sp2;
    sqInt tagBits;
    sqInt tagBits1;
    sqInt tagBits2;
    sqInt top;

	rcvr = longAt(GIV(stackPointer) + (3 * BytesPerWord));
	lookupClass = longAt(GIV(stackPointer));
	if ((GIV(argumentCount) > 3)
	 && (((rcvr & (tagMask())) == 0)
	 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	if (((tagBits = rcvr & (tagMask()))) != 0) {
		/* begin fetchPointer:ofObject: */
		currentClass = longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))));
	}
	else {
		currentClass = fetchClassOfNonImm(rcvr);
	}
	while (currentClass != lookupClass) {
		/* begin followField:ofObject: */
		objOop = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop & (tagMask())) == 0)
		 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop);
		}
		currentClass = objOop;
		if (currentClass == GIV(nilObj)) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadArgument;
			return;
		}
	}
	/* begin primitiveObject:perform:withArguments:lookedUpIn: */
	selector = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	argumentArray = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!(((argumentArray & (tagMask())) == 0)
		 && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		goto l11;
	}
	/* begin numSlotsOf: */
	assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(argumentArray + 7);
	arraySize = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(argumentArray - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	if (arraySize > (LargeContextSlots - CtxtTempFrameStart)) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadNumArgs;
		goto l11;
	}

	/* Push newMethod to save it in case of failure,
	   then push the actual receiver and the args in the array. */
	performArgCount = GIV(argumentCount);
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
	GIV(stackPointer) = sp1;
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), rcvr);
	GIV(stackPointer) = sp2;
	for (index = 1; index <= arraySize; index += 1) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((argumentArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord()))))));
		GIV(stackPointer) = sp;
	}
	GIV(argumentCount) = arraySize;
	GIV(messageSelector) = selector;
	/* begin sendBreakpoint:receiver: */
	selector1 = GIV(messageSelector);
	sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector1), lengthOfMaybeImmediate(selector1), rcvr);
	if (printOnTrace()) {
		printActivationNameForSelectorstartClass(GIV(messageSelector), (lookupClass == null
			? (/* begin fetchClassOf: */
				(((tagBits2 = rcvr & (tagMask()))) != 0
						? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits2) << (shiftForWord())))))
						: fetchClassOfNonImm(rcvr)))
			: lookupClass));
		/* begin cr */
		printf("\n");
	}
	findNewMethodInClassTag((lookupClass == null
		? (((tagBits1 = rcvr & (tagMask()))) != 0
				? tagBits1
				: (longAt(rcvr)) & (classIndexMask()))
		: (assert(addressCouldBeClassObj(lookupClass)),
			(((hash = (long32At(lookupClass + 4)) & (identityHashHalfWordMask()))) != 0
					? hash
					: (objCouldBeClassObj(lookupClass)
							? (((err = enterIntoClassTable(lookupClass))) != 0
									? -err
									: (/* begin rawHashBitsOf: */
										(long32At(lookupClass + 4)) & (identityHashHalfWordMask())))
							: -PrimErrBadReceiver)))));
	if ((((GIV(newMethod) & (tagMask())) == 0)
	 && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))
	 && ((argumentCountOf(GIV(newMethod))) != GIV(argumentCount))) {

		/* Restore the state by popping the array entries, the actual receiver and the saved
		   newMethod, leaving the selector and array, and fail.  N.B.  If an MNU has happened
		   then argumentCount will match newMethod, so this code will not be reached. */
		/* These asserts check that an MNU has not occurred if the argumentCount doesn't match the newMethod. */
		assert((stackTop()) == ((arraySize == 0
			? rcvr
			: fetchPointerofObject(arraySize - 1, argumentArray))));
		assert(GIV(argumentCount) == arraySize);
		/* begin pop: */
		nItems = arraySize + 1;
		GIV(stackPointer) += nItems * BytesPerWord;
		/* begin popStack */
		top = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		GIV(newMethod) = top;
		GIV(argumentCount) = performArgCount;
		primitiveFunctionPointer = (lookupClass == null
			? primitivePerformWithArgs
			: primitivePerformInSuperclass);
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadNumArgs;
		goto l11;
	}

	/* +2 = receiver + saved newMethod */
	delta = BytesPerWord * (performArgCount + 2);
	for (offset = (GIV(argumentCount) * BytesPerWord); offset >= 0; offset += (-BytesPerWord)) {
		longAtput((GIV(stackPointer) + offset) + delta, longAt(GIV(stackPointer) + offset));
	}
	/* begin pop: */
	GIV(stackPointer) += (performArgCount + 2) * BytesPerWord;
	executeNewMethod();
	/* begin initPrimCall */
	GIV(primFailCode) = 0;
	l11:	/* end primitiveObject:perform:withArguments:lookedUpIn: */;
}

	/* InterpreterPrimitives>>#primitivePerformWithArgs */
static void
primitivePerformWithArgs(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt actualReceiver;
    sqInt argumentArray;
    usqInt arraySize;
    sqInt delta;
    sqInt index;
    sqInt nItems;
    usqInt numSlots;
    sqInt offset;
    sqInt performArgCount;
    sqInt selector;
    sqInt selector1;
    char *sp;
    char *sp1;
    char *sp2;
    sqInt tagBits;
    sqInt tagBits1;
    sqInt top;

	/* begin primitiveObject:perform:withArguments:lookedUpIn: */
	actualReceiver = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	selector = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	argumentArray = longAt(GIV(stackPointer));
	if (!(((argumentArray & (tagMask())) == 0)
		 && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		goto l7;
	}
	/* begin numSlotsOf: */
	assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(argumentArray + 7);
	arraySize = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(argumentArray - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	if (arraySize > (LargeContextSlots - CtxtTempFrameStart)) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadNumArgs;
		goto l7;
	}

	/* Push newMethod to save it in case of failure,
	   then push the actual receiver and the args in the array. */
	performArgCount = GIV(argumentCount);
	/* begin push: */
	longAtput((sp1 = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
	GIV(stackPointer) = sp1;
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), actualReceiver);
	GIV(stackPointer) = sp2;
	for (index = 1; index <= arraySize; index += 1) {
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), longAt((argumentArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord()))))));
		GIV(stackPointer) = sp;
	}
	GIV(argumentCount) = arraySize;
	GIV(messageSelector) = selector;
	/* begin sendBreakpoint:receiver: */
	selector1 = GIV(messageSelector);
	sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector1), lengthOfMaybeImmediate(selector1), actualReceiver);
	if (printOnTrace()) {
		printActivationNameForSelectorstartClass(GIV(messageSelector), (/* begin fetchClassOf: */
		(((tagBits = actualReceiver & (tagMask()))) != 0
				? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))
				: fetchClassOfNonImm(actualReceiver))));
		/* begin cr */
		printf("\n");
	}
	findNewMethodInClassTag((((tagBits1 = actualReceiver & (tagMask()))) != 0
		? tagBits1
		: (longAt(actualReceiver)) & (classIndexMask())));
	if ((((GIV(newMethod) & (tagMask())) == 0)
	 && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))
	 && ((argumentCountOf(GIV(newMethod))) != GIV(argumentCount))) {

		/* Restore the state by popping the array entries, the actual receiver and the saved
		   newMethod, leaving the selector and array, and fail.  N.B.  If an MNU has happened
		   then argumentCount will match newMethod, so this code will not be reached. */
		/* These asserts check that an MNU has not occurred if the argumentCount doesn't match the newMethod. */
		assert((stackTop()) == ((arraySize == 0
			? actualReceiver
			: fetchPointerofObject(arraySize - 1, argumentArray))));
		assert(GIV(argumentCount) == arraySize);
		/* begin pop: */
		nItems = arraySize + 1;
		GIV(stackPointer) += nItems * BytesPerWord;
		/* begin popStack */
		top = longAt(GIV(stackPointer));
		GIV(stackPointer) += BytesPerWord;
		GIV(newMethod) = top;
		GIV(argumentCount) = performArgCount;
		primitiveFunctionPointer = (null == null
			? primitivePerformWithArgs
			: primitivePerformInSuperclass);
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadNumArgs;
		goto l7;
	}

	/* +2 = receiver + saved newMethod */
	delta = BytesPerWord * (performArgCount + 2);
	for (offset = (GIV(argumentCount) * BytesPerWord); offset >= 0; offset += (-BytesPerWord)) {
		longAtput((GIV(stackPointer) + offset) + delta, longAt(GIV(stackPointer) + offset));
	}
	/* begin pop: */
	GIV(stackPointer) += (performArgCount + 2) * BytesPerWord;
	executeNewMethod();
	/* begin initPrimCall */
	GIV(primFailCode) = 0;
	l7:	/* end primitiveObject:perform:withArguments:lookedUpIn: */;
}


/*	Primitive. Answer the last primitive method sampled by the profiler. */

	/* InterpreterPrimitives>>#primitiveProfilePrimitive */
EXPORT(sqInt)
primitiveProfilePrimitive(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	if (!(GIV(argumentCount) == 0)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), GIV(profileMethod));
	GIV(stackPointer) = sp;
	GIV(profileMethod) = GIV(nilObj);
	return 0;
}


/*	Primitive. Answer the last sample taken by the profiler, or nil if the
	profiler isn't active.
	See also primitiveProfileStart.
 */

	/* InterpreterPrimitives>>#primitiveProfileSample */
EXPORT(sqInt)
primitiveProfileSample(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	if (!(GIV(argumentCount) == 0)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), GIV(profileProcess));
	GIV(stackPointer) = sp;
	GIV(profileProcess) = GIV(nilObj);
	return 0;
}


/*	Primitive. Begin profiling execution every by using the interrupt
	check-counter instead of a time-based process (which is limited to timing
	resolution and triggers off the same signal that many of the processes
	being profiled trigger off leading to consistently wrong results).
	The argument is the number of interrupt checks (method activations) to let
	go by before taking a sample. The sample is being stored in the
	profileSample iVar which can be retrieved by executing
	primitiveProfileSample. When a sample is taken, it signals the semaphore
	specified in primitiveProfileSemaphore.
	If the argument is less or equal to zero, it disables profiling.
 */

	/* InterpreterPrimitives>>#primitiveProfileStart */
EXPORT(sqInt)
primitiveProfileStart(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt deltaTicks;
    sqInt integerPointer;

	if (!(GIV(argumentCount) == 1)) {
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		deltaTicks = (integerPointer >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		deltaTicks = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	if (!GIV(primFailCode)) {
		GIV(nextProfileTick) = (ioHighResClock()) + deltaTicks;
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
	return 0;
}

	/* InterpreterPrimitives>>#primitiveQuit */
static void
primitiveQuit(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	ioExitWithErrorCode((GIV(argumentCount) == 1
		? ((longAt(GIV(stackPointer))) >> 3)
		: 0));
}


/*	Rounds negative results towards zero. */

	/* InterpreterPrimitives>>#primitiveQuo */
static void
primitiveQuo(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArg;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt integerRcvr;
    sqInt integerResult;
    char *sp;

	integerResult = 0;
	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		integerRcvr = (integerPointer >> 3);
		goto l1;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerRcvr = 0;
		goto l1;
	}
	l1:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer1) & 7) == 1)) {
		integerArg = (integerPointer1 >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		integerArg = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	/* begin success: */
	if (!(integerArg != 0)) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (!GIV(primFailCode)) {
		integerResult = (integerRcvr > 0
			? (integerArg > 0
					? integerRcvr / integerArg
					: 0 - (integerRcvr / (0 - integerArg)))
			: (integerArg > 0
					? 0 - ((0 - integerRcvr) / integerArg)
					: (0 - integerRcvr) / (0 - integerArg)));
	}
	/* begin pop2AndPushIntegerIfOK: */
	if (!GIV(primFailCode)) {
		if ((((((usqInt) integerResult) >> 60) + 1) & 15) <= 1) {
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)integerResult << 3) | 1));
			GIV(stackPointer) = sp;
		}
		else {
			/* begin success: */
			
			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveQuoLargeIntegers */
EXPORT(void)
primitiveQuoLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    char *sp;

	oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (b == 0) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (GIV(primFailCode)) {
		return;
	}
	result = a / b;
	oopResult = magnitude64BitIntegerForneg(result, bIsNegative != aIsNegative);
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(stackPointer) = sp;
	}
}


/*	Relinquish the processor for up to the given number of microseconds. The
	exact behavior of this primitive is platform dependent.
 */

	/* InterpreterPrimitives>>#primitiveRelinquishProcessor */
static void
primitiveRelinquishProcessor(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerPointer;
    sqInt microSecs;

	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		microSecs = (integerPointer >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		microSecs = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	if (!GIV(primFailCode)) {

		/* DO NOT allow relinquishing the processor while we are profiling since this
		   may skew the time base for our measures (it may reduce processor speed etc).
		   Instead we go full speed, therefore measuring the precise time we spend in the
		   inner idle loop as a busy loop. */
		if (GIV(nextProfileTick) == 0) {
			ioRelinquishProcessorForMicroseconds(microSecs);
		}
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
}


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

	/* InterpreterPrimitives>>#primitiveRemLargeIntegers */
EXPORT(void)
primitiveRemLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    char *sp;

	oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (b == 0) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (GIV(primFailCode)) {
		return;
	}
	result = a % b;
	oopResult = magnitude64BitIntegerForneg(result, aIsNegative);
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(stackPointer) = sp;
	}
}


/*	The character scanner primitive. */

	/* InterpreterPrimitives>>#primitiveScanCharacters */
static void
primitiveScanCharacters(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ascii;
    sqInt glyphIndex;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt integerPointer2;
    sqInt integerPointer3;
    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;
    char *sp;
    char *sp1;
    char *sp2;
    sqInt stopReason;
    sqInt stops;

	if (!(GIV(argumentCount) == 6)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		kernDelta = (integerPointer >> 3);
		goto l9;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		kernDelta = 0;
		goto l9;
	}
	l9:	/* end stackIntegerValue: */;
	stops = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer1) & 7) == 1)) {
		scanRightX = (integerPointer1 >> 3);
		goto l10;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		scanRightX = 0;
		goto l10;
	}
	l10:	/* end stackIntegerValue: */;
	sourceString = longAt(GIV(stackPointer) + (3 * BytesPerWord));
	/* begin stackIntegerValue: */
	integerPointer2 = longAt(GIV(stackPointer) + (4 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer2) & 7) == 1)) {
		scanStopIndex = (integerPointer2 >> 3);
		goto l11;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		scanStopIndex = 0;
		goto l11;
	}
	l11:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer3 = longAt(GIV(stackPointer) + (5 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer3) & 7) == 1)) {
		scanStartIndex = (integerPointer3 >> 3);
		goto l12;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		scanStartIndex = 0;
		goto l12;
	}
	l12:	/* end stackIntegerValue: */;
	rcvr = longAt(GIV(stackPointer) + (6 * BytesPerWord));
	if (GIV(primFailCode)) {
		return;
	}
	if (!((((stops & (tagMask())) == 0)
		 && (((((usqInt) (longAt(stops))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && (((slotSizeOf(stops)) >= 258)
		 && ((((sourceString & (tagMask())) == 0)
		 && (((((usqInt) (longAt(sourceString))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))
		 && ((scanStartIndex > 0)
		 && ((scanStopIndex > 0)
		 && ((scanStopIndex <= (byteSizeOf(sourceString)))
		 && ((((rcvr & (tagMask())) == 0)
		 && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
		 && ((slotSizeOf(rcvr)) >= 4))))))))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	scanDestX = fetchIntegerofObject(0, rcvr);
	scanLastIndex = fetchIntegerofObject(1, rcvr);
	scanXTable = longAt((rcvr + BaseHeaderSize) + (2U << (shiftForWord())));
	scanMap = longAt((rcvr + BaseHeaderSize) + (3U << (shiftForWord())));
	if (!((((scanXTable & (tagMask())) == 0)
		 && (((((usqInt) (longAt(scanXTable))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && ((((scanMap & (tagMask())) == 0)
		 && (((((usqInt) (longAt(scanMap))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && (((slotSizeOf(scanMap)) == 256)
		 && (!GIV(primFailCode)))))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}

	/* Okay, here we go. We have eliminated nearly all failure
	   conditions, to optimize the inner fetches. */
	maxGlyph = (slotSizeOf(scanXTable)) - 2;
	scanLastIndex = scanStartIndex;
	nilOop = GIV(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 + BaseHeaderSize) + (scanLastIndex - 1));
		if (!(((stopReason = longAt((stops + BaseHeaderSize) + (((sqInt)((usqInt)(ascii) << (shiftForWord()))))))) == nilOop)) {

			/* Store everything back and get out of here since some stop conditionn needs to be checked */
			if (!((((((usqInt) scanDestX) >> 60) + 1) & 15) <= 1)) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				return;
			}
			/* begin storeInteger:ofObject:withValue: */
			if ((((((usqInt) scanDestX) >> 60) + 1) & 15) <= 1) {
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(rcvr)));
				longAtput((rcvr + BaseHeaderSize) + (0U << (shiftForWord())), (((usqInt)scanDestX << 3) | 1));
			}
			else {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin storeInteger:ofObject:withValue: */
			if ((((((usqInt) scanLastIndex) >> 60) + 1) & 15) <= 1) {
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(rcvr)));
				longAtput((rcvr + BaseHeaderSize) + (1U << (shiftForWord())), (((usqInt)scanLastIndex << 3) | 1));
			}
			else {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + ((7 - 1) * BytesPerWord)), stopReason);
			GIV(stackPointer) = sp;
			return;
		}

		/* fail if the glyphIndex is out of range */
		glyphIndex = fetchIntegerofObject(ascii, scanMap);
		if (GIV(primFailCode)
		 || ((glyphIndex < 0)
		 || (glyphIndex > maxGlyph))) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return;
		}
		sourceX = fetchIntegerofObject(glyphIndex, scanXTable);

		/* Above may fail if non-integer entries in scanXTable */
		sourceX2 = fetchIntegerofObject(glyphIndex + 1, scanXTable);
		if (GIV(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 (!((((((usqInt) scanDestX) >> 60) + 1) & 15) <= 1)) {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
				return;
			}
			/* begin storeInteger:ofObject:withValue: */
			if ((((((usqInt) scanDestX) >> 60) + 1) & 15) <= 1) {
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(rcvr)));
				longAtput((rcvr + BaseHeaderSize) + (0U << (shiftForWord())), (((usqInt)scanDestX << 3) | 1));
			}
			else {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin storeInteger:ofObject:withValue: */
			if ((((((usqInt) scanLastIndex) >> 60) + 1) & 15) <= 1) {
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(rcvr)));
				longAtput((rcvr + BaseHeaderSize) + (1U << (shiftForWord())), (((usqInt)scanLastIndex << 3) | 1));
			}
			else {
				/* begin primitiveFail */
				if (!GIV(primFailCode)) {
					GIV(primFailCode) = 1;
				}
			}
			/* begin pop:thenPush: */
			longAtput((sp1 = GIV(stackPointer) + ((7 - 1) * BytesPerWord)), longAt((stops + BaseHeaderSize) + (((sqInt)((usqInt)((CrossedX - 1)) << (shiftForWord()))))));
			GIV(stackPointer) = sp1;
			return;
		}
		scanDestX = nextDestX + kernDelta;
		scanLastIndex += 1;
	}
	if (!((((((usqInt) scanDestX) >> 60) + 1) & 15) <= 1)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin storeInteger:ofObject:withValue: */
	if ((((((usqInt) scanDestX) >> 60) + 1) & 15) <= 1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(rcvr)));
		longAtput((rcvr + BaseHeaderSize) + (0U << (shiftForWord())), (((usqInt)scanDestX << 3) | 1));
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	/* begin storeInteger:ofObject:withValue: */
	if ((((((usqInt) scanStopIndex) >> 60) + 1) & 15) <= 1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(rcvr)));
		longAtput((rcvr + BaseHeaderSize) + (1U << (shiftForWord())), (((usqInt)scanStopIndex << 3) | 1));
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	/* begin pop:thenPush: */
	longAtput((sp2 = GIV(stackPointer) + ((7 - 1) * BytesPerWord)), longAt((stops + BaseHeaderSize) + (((sqInt)((usqInt)((EndOfRun - 1)) << (shiftForWord()))))));
	GIV(stackPointer) = sp2;
}


/*	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
 */

	/* InterpreterPrimitives>>#primitiveScreenDepth */
EXPORT(sqInt)
primitiveScreenDepth(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt depth;
    char *sp;

	depth = ioScreenDepth();
	if (GIV(primFailCode)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin pop:thenPushInteger: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)depth << 3) | 1));
	GIV(stackPointer) = sp;
	return 0;
}


/*	Answer a float indicating the current scale factor for pixels of the
	Smalltalk window.
 */

	/* InterpreterPrimitives>>#primitiveScreenScaleFactor */
EXPORT(sqInt)
primitiveScreenScaleFactor(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double factor;
    sqInt object;
    char *sp;

	factor = ioScreenScaleFactor();
	if (GIV(primFailCode)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	/* begin pushFloat: */
	object = floatObjectOf(factor);
	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
	return 0;
}


/*	Answer 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 */

	/* InterpreterPrimitives>>#primitiveScreenSize */
static void
primitiveScreenSize(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classObj;
    sqInt knownClassIndex;
    usqInt newObj;
    usqInt numBytes;
    sqInt numSlots;
    sqInt objFormat;
    sqInt oop;
    usqInt pointResult;
    sqInt pointWord;
    char *sp;

	pointWord = ioScreenSize();
	/* begin pop:thenPush: */
	classObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
	numSlots = YIndex + 1;
	assert((rawHashBitsOf(classObj)) != 0);
	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
	knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
	/* begin instSpecOfClassFormat: */
	objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3))) >> (fixedFieldsFieldWidth())) & (formatMask());
	assert((numSlots >= 0)
	 && ((knownClassIndex != 0)
	 && ((knownClassAtIndex(knownClassIndex)) != GIV(nilObj))));
	assert(((objFormat < (firstByteFormat())
		? objFormat
		: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex))));
	/* begin allocateSmallNewSpaceSlots:format:classIndex: */
	assert(numSlots < (numSlotsMask()));
	newObj = GIV(freeStart);
	numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
			error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
			pointResult = 0;
			goto l3;
		}
	}
	long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex);
	GIV(freeStart) += numBytes;
	pointResult = newObj;
	l3:	/* end eeInstantiateSmallClass:numSlots: */;
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(pointResult)));
	longAtput((pointResult + BaseHeaderSize) + (((sqInt)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)((((usqInt) pointWord) >> 16) & 0xFFFF) << 3) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(pointResult)));
	longAtput((pointResult + BaseHeaderSize) + (((sqInt)((usqInt)(YIndex) << (shiftForWord())))), (((usqInt)(pointWord & 0xFFFF) << 3) | 1));
	oop = pointResult;
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}


/*	Return the number of seconds since January 1, 1901 as an integer. */

	/* InterpreterPrimitives>>#primitiveSecondsClock */
static void
primitiveSecondsClock(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    unsigned int integerValue;
    sqInt oop;
    char *sp;

	/* begin pop:thenPush: */
	integerValue = ((unsigned int) (ioSecondsNow()));
	oop = ((((((usqInt)integerValue)) & 0xFFFFFFFFU) << 3) | 1);
	goto l1;
	l1:	/* end positive32BitIntegerFor: */;
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}


/*	Set to OS to the requested display mode.
	See also DisplayScreen setDisplayDepth:extent:fullscreen: */

	/* InterpreterPrimitives>>#primitiveSetDisplayMode */
static void
primitiveSetDisplayMode(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt d;
    sqInt fsFlag;
    sqInt h;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt integerPointer2;
    sqInt okay;
    char *sp;
    sqInt w;

	okay = 0;
	/* begin booleanValueOf: */
	if ((longAt(GIV(stackPointer))) == GIV(trueObj)) {
		fsFlag = 1;
		goto l1;
	}
	if ((longAt(GIV(stackPointer))) == GIV(falseObj)) {
		fsFlag = 0;
		goto l1;
	}
	/* begin success: */
	
	/* Don't overwrite an error code that has already been set. */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	fsFlag = null;
	l1:	/* end booleanValueOf: */;
	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		h = (integerPointer >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		h = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer1) & 7) == 1)) {
		w = (integerPointer1 >> 3);
		goto l3;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		w = 0;
		goto l3;
	}
	l3:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer2 = longAt(GIV(stackPointer) + (3 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer2) & 7) == 1)) {
		d = (integerPointer2 >> 3);
		goto l4;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		d = 0;
		goto l4;
	}
	l4:	/* end stackIntegerValue: */;
	if (!GIV(primFailCode)) {
		okay = ioSetDisplayMode(w, h, d, fsFlag);
	}
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((5 - 1) * BytesPerWord)), (okay
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}


/*	On platforms that support it, set full-screen mode to the value of the
	boolean argument.
 */

	/* InterpreterPrimitives>>#primitiveSetFullScreen */
static void
primitiveSetFullScreen(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt argOop;

	argOop = longAt(GIV(stackPointer));
	if (argOop == GIV(trueObj)) {
		ioSetFullScreen(1);
	}
	else {
		if (argOop == GIV(falseObj)) {
			ioSetFullScreen(0);
		}
		else {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
	if (!GIV(primFailCode)) {
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
}

	/* InterpreterPrimitives>>#primitiveSetImmutability */
#if IMMUTABILITY
static void
primitiveSetImmutability(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt rcvr;
    char *sp;
    sqInt wasImmutable;

	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (rcvr & (tagMask())) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadReceiver;
		return;
	}
	wasImmutable = 
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		;
	if ((longAt(GIV(stackPointer))) == GIV(trueObj)) {
		if (!(canBeImmutable(rcvr))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrInappropriate;
			return;
		}
		/* begin setIsImmutableOf:to: */
		longAtput(rcvr, (longAt(rcvr)) | (1U << (immutableBitShift())));
	}
	else {
		if ((longAt(GIV(stackPointer))) == GIV(falseObj)) {
			/* begin setIsImmutableOf:to: */
			longAtput(rcvr, (longAt(rcvr)) & (~(usqIntptr_t)(1U << (immutableBitShift()))));
		}
		else {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadArgument;
			return;
		}
	}
	/* begin pop:thenPushBool: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (wasImmutable
		? GIV(trueObj)
		: GIV(falseObj)));
	GIV(stackPointer) = sp;
}
#endif /* IMMUTABILITY */


/*	Set the user interrupt keycode. The keycode is an integer whose encoding
	is described in the comment for primitiveKbdNext.
 */

	/* InterpreterPrimitives>>#primitiveSetInterruptKey */
static void
primitiveSetInterruptKey(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerPointer;
    sqInt keycode;

	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		keycode = (integerPointer >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		keycode = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	if (!GIV(primFailCode)) {
		/* begin setInterruptKeycode: */
		GIV(interruptKeycode) = keycode;
		/* begin pop: */
		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	}
}


/*	Primitive. Set the VM's log directory */

	/* InterpreterPrimitives>>#primitiveSetLogDirectory */
EXPORT(sqInt)
primitiveSetLogDirectory(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fmt;
    usqInt numBytes;
    usqInt numSlots;
    sqInt stringOop;
    sqInt sz;

	stringOop = longAt(GIV(stackPointer));
	if (!(((stringOop & (tagMask())) == 0)
		 && (((((usqInt) (longAt(stringOop))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))) {
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin byteSizeOf: */
	if (stringOop & (tagMask())) {
		sz = 0;
		goto l3;
	}
	/* begin numBytesOf: */
	fmt = (((usqInt) (longAt(stringOop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOf: */
	assert((classIndexOf(stringOop)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(stringOop + 7);
	numBytes = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(stringOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	numBytes = numBytes << (shiftForWord());
	if (fmt >= (firstByteFormat())) {

		/* bytes (the common case), including CompiledMethod */
		sz = numBytes - (fmt & 7);
		goto l3;
	}
	if (fmt <= (sixtyFourBitIndexableFormat())) {
		sz = numBytes;
		goto l3;
	}
	if (fmt >= (firstShortFormat())) {
		sz = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1)));
		goto l3;
	}
	sz = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2)));
	l3:	/* end byteSizeOf: */;
	ioSetLogDirectoryOfSize(firstIndexableField(stringOop), sz);
	if (!GIV(primFailCode)) {
		/* begin pop: */
		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	}
	return 0;
}

	/* InterpreterPrimitives>>#primitiveSetOrHasIdentityHash */
static void
primitiveSetOrHasIdentityHash(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt hasHash;
    sqInt hash;
    sqInt hash1;
    sqInt hash2;
    sqInt integerPointer;
    sqInt isReceiverAClass;
    sqInt oldHash;
    sqInt oop;
    char *sp;
    char *sp1;
    sqInt thisReceiver;

	if (GIV(argumentCount) == 0) {
		hasHash = (((longAt(GIV(stackPointer))) & (tagMask())) == 0)
		 && ((long32At((longAt(GIV(stackPointer))) + 4)) & (identityHashHalfWordMask()));
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (hasHash
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
		return;
	}
	if (GIV(argumentCount) == 2) {
		/* begin booleanValueOf: */
		if ((longAt(GIV(stackPointer))) == GIV(trueObj)) {
			isReceiverAClass = 1;
			goto l2;
		}
		if ((longAt(GIV(stackPointer))) == GIV(falseObj)) {
			isReceiverAClass = 0;
			goto l2;
		}
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		isReceiverAClass = null;
	l2:	/* end booleanValueOf: */;
		if (GIV(primFailCode)) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadArgument;
		}
	}
	else {
		isReceiverAClass = 0;
	}
	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + ((GIV(argumentCount) - 1) * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		hash = (integerPointer >> 3);
		goto l4;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		hash = 0;
		goto l4;
	}
	l4:	/* end stackIntegerValue: */;
	/* begin stackObjectValue: */
	oop = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));
	if (oop & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		thisReceiver = null;
		goto l3;
	}
	thisReceiver = oop;
	l3:	/* end stackObjectValue: */;
	if (!GIV(primFailCode)) {
		/* begin hashBitsOf: */
		hash2 = (long32At(thisReceiver + 4)) & (identityHashHalfWordMask());
		if (hash2 == 0) {

			/* would like to assert
			   self assert: (coInterpreter addressCouldBeClassObj: objOop) not
			   but instance-specific behaviors that are instances of themselves may
			   fail this test. */
			/* begin newHashBitsOf: */
			hash1 = (newObjectHash()) & (identityHashHalfWordMask());
			/* begin setHashBitsOf:to: */
			assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
			long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash1);
			hash2 = hash1;
		}
		oldHash = hash2;
		/* begin setHashBitsOf:to: */
		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
		long32Atput(thisReceiver + 4, ((((long32At(thisReceiver + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash);
		if (isReceiverAClass
		 && (1)) {
			classAtIndexput(hash, thisReceiver);
			allInstancesOf(thisReceiver);
		}
		/* begin pop:thenPushInteger: */
		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)oldHash << 3) | 1));
		GIV(stackPointer) = sp1;
	}
}


/*	Primitive. Set the OS window's label */

	/* InterpreterPrimitives>>#primitiveSetWindowLabel */
EXPORT(sqInt)
primitiveSetWindowLabel(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fmt;
    sqInt labelOop;
    usqInt numBytes;
    usqInt numSlots;
    sqInt sz;

	labelOop = longAt(GIV(stackPointer));
	if (!(((labelOop & (tagMask())) == 0)
		 && (((((usqInt) (longAt(labelOop))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))) {
		/* begin success: */
		
		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin byteSizeOf: */
	if (labelOop & (tagMask())) {
		sz = 0;
		goto l3;
	}
	/* begin numBytesOf: */
	fmt = (((usqInt) (longAt(labelOop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOf: */
	assert((classIndexOf(labelOop)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(labelOop + 7);
	numBytes = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(labelOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	numBytes = numBytes << (shiftForWord());
	if (fmt >= (firstByteFormat())) {

		/* bytes (the common case), including CompiledMethod */
		sz = numBytes - (fmt & 7);
		goto l3;
	}
	if (fmt <= (sixtyFourBitIndexableFormat())) {
		sz = numBytes;
		goto l3;
	}
	if (fmt >= (firstShortFormat())) {
		sz = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1)));
		goto l3;
	}
	sz = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2)));
	l3:	/* end byteSizeOf: */;
	ioSetWindowLabelOfSize(firstIndexableField(labelOop), sz);
	if (!GIV(primFailCode)) {
		/* begin pop: */
		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	}
	return 0;
}


/*	Primitive. Answer the OS window's size (extent) */

	/* InterpreterPrimitives>>#primitiveSetWindowSize */
EXPORT(sqInt)
primitiveSetWindowSize(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt h;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt w;

	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		h = (integerPointer >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		h = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer1) & 7) == 1)) {
		w = (integerPointer1 >> 3);
		goto l3;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		w = 0;
		goto l3;
	}
	l3:	/* end stackIntegerValue: */;
	if (!GIV(primFailCode)) {
		ioSetWindowWidthHeight(w, h);
		/* begin pop: */
		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	}
	return 0;
}


/*	Treat the receiver, which can be indexible by either bytes or words, as
	an array of signed 16-bit values. Answer the contents of the given index.
	Note that the index specifies the i-th 16-bit entry, not the i-th byte or
	word.  */

	/* InterpreterPrimitives>>#primitiveShortAt */
static void
primitiveShortAt(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt index;
    sqInt rcvr;
    char *sp;
    sqInt value;

	index = longAt(GIV(stackPointer));
	if (!((((index) & 7) == 1))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!(((rcvr & (tagMask())) == 0)
		 && (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrInappropriate;
		return;
	}
	index = (index >> 3);
	if (!((index >= 1)
		 && (index <= (((usqInt) (numBytesOf(rcvr))) >> 1)))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		return;
	}
	value = shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))));
	/* begin pop:thenPushInteger: */
	longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)value << 3) | 1));
	GIV(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. 
 */

	/* InterpreterPrimitives>>#primitiveShortAtPut */
static void
primitiveShortAtPut(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt index;
    sqInt rcvr;
    char *sp;
    sqInt value;

	value = longAt(GIV(stackPointer));
	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!(((((value) & 7) == 1))
		 && (((((index) & 7) == 1))
		 && (((value = (value >> 3)),
		(value >= -32768)
			 && (value <= 0x7FFF)))))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	if (!(((rcvr & (tagMask())) == 0)
		 && (isPureBitsFormat((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask()))))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrInappropriate;
		return;
	}
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrNoModification;
		return;
	}
	index = (index >> 3);
	if (!((index >= 1)
		 && (index <= (((usqInt) (numBytesOf(rcvr))) >> 1)))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		return;
	}
	shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))), value);
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((3 - 1) * BytesPerWord)), (((usqInt)value << 3) | 1));
	GIV(stackPointer) = sp;
}


/*	Force the given rectangular section of the Display to be 
	copied to the screen. */

	/* InterpreterPrimitives>>#primitiveShowDisplayRect */
static void
primitiveShowDisplayRect(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bottom;
    sqInt integerPointer;
    sqInt integerPointer1;
    sqInt integerPointer2;
    sqInt integerPointer3;
    sqInt left;
    sqInt right;
    sqInt top;

	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		bottom = (integerPointer >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		bottom = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer1 = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer1) & 7) == 1)) {
		top = (integerPointer1 >> 3);
		goto l3;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		top = 0;
		goto l3;
	}
	l3:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer2 = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer2) & 7) == 1)) {
		right = (integerPointer2 >> 3);
		goto l4;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		right = 0;
		goto l4;
	}
	l4:	/* end stackIntegerValue: */;
	/* begin stackIntegerValue: */
	integerPointer3 = longAt(GIV(stackPointer) + (3 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer3) & 7) == 1)) {
		left = (integerPointer3 >> 3);
		goto l5;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		left = 0;
		goto l5;
	}
	l5:	/* end stackIntegerValue: */;
	updateDisplayLeftTopRightBottom(left, top, right, bottom);
	if (!GIV(primFailCode)) {
		ioForceDisplayUpdate();
		/* begin pop: */
		GIV(stackPointer) += 4 * BytesPerWord;
	}
}


/*	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. */

	/* InterpreterPrimitives>>#primitiveSignalAtBytesLeft */
static void
primitiveSignalAtBytesLeft(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bytes;

	bytes = longAt(GIV(stackPointer));
	if (((((bytes) & 7) == 1))
	 && (((bytes = (bytes >> 3))) >= 0)) {
		/* begin lowSpaceThreshold: */

		/* N.B. The threshold > 0 guard eliminates a warning when
		   self lowSpaceThreshold: 0
		   is inlined into setSignalLowSpaceFlagAndSaveProcess */
		GIV(lowSpaceThreshold) = bytes;
		if ((bytes > 0)
		 && (GIV(totalFreeOldSpace) < bytes)) {
			growOldSpaceByAtLeast(bytes - GIV(totalFreeOldSpace));
		}
		assert(GIV(totalFreeOldSpace) >= GIV(lowSpaceThreshold));
		/* begin pop: */
		GIV(stackPointer) += 1 * BytesPerWord;
	}
	else {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
	}
}


/*	N.B. IMO we should be able to assume the receiver is a float because this
	primitive is specific to floats. eem 2/13/2017
 */

	/* InterpreterPrimitives>>#primitiveSine */
static void
primitiveSine(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    double rcvr;

	/* begin stackFloatValue: */
	rcvr = floatValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		/* begin stackTopPut: */
		aValue = floatObjectOf(sin(rcvr));
		longAtPointerput(GIV(stackPointer), aValue);
	}
}

	/* InterpreterPrimitives>>#primitiveSize */
static void
primitiveSize(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class;
    sqInt classFormat;
    sqInt fixedFields;
    usqLong fmt;
    sqLong hdr;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt rcvr;
    char *sp;
    sqInt totalLength;

	rcvr = longAt(GIV(stackPointer));
	if ((rcvr & (tagMask()))
	 || (((hdr = long64At(rcvr)),
	((fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask()))) < 2))) {

		/* This is not an indexable object */
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadReceiver;
		return;
	}
	if ((fmt == (indexablePointersFormat()))
	 && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		primitiveContextSize();
		return;
	}
	/* begin lengthOf:format: */
	numSlots1 = byteAt(rcvr + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		totalLength = numSlots;
		goto l3;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l3;
	}
	if (fmt >= (firstShortFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l3;
	}
	if (fmt >= (firstLongFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l3;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		totalLength = numSlots;
		goto l3;
	}
	totalLength = 0;
	l3:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		fixedFields = 0;
		goto l4;
	}
	if (fmt < 2 /* arrayFormat */) {
		fixedFields = totalLength;
		goto l4;
	}
	class = fetchClassOfNonImm(rcvr);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l4:	/* end fixedFieldsOf:format:length: */;
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)(totalLength - fixedFields) << 3) | 1));
	GIV(stackPointer) = sp;
}

	/* InterpreterPrimitives>>#primitiveSizeInBytes */
static void
primitiveSizeInBytes(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong byteSize;
    sqInt oop;
    char *sp;

	byteSize = ((longAt(GIV(stackPointer))) & (tagMask())
		? 0
		: bytesInObject(longAt(GIV(stackPointer))));
	/* begin pop:thenPush: */
	oop = positive64BitIntegerFor(byteSize);
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}


/*	Answer the byte size of an instance of the receiver. If num args > 0
	then the last argument is a variable size and the size answered is the
	size of an instance of the receiver with that many indexable elements. */

	/* InterpreterPrimitives>>#primitiveSizeInBytesOfInstance */
static void
primitiveSizeInBytesOfInstance(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt byteSize;
    sqInt classFormat;
    sqInt classFormat1;
    sqInt code;
    sqInt err;
    sqInt instSpec;
    sqInt instSpec1;
    sqInt nElements;
    usqInt numSlots;
    sqInt numSlots1;
    sqInt oop;
    char *sp;
    char *sp1;

	if (GIV(argumentCount) > 1) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadNumArgs;
		return;
	}
	err = -1;
	if (GIV(argumentCount) >= 1) {
		if (!(((((longAt(GIV(stackPointer)))) & 7) == 1))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadArgument;
			return;
		}
		/* begin byteSizeOfInstanceOf:withIndexableSlots:errInto: */
		nElements = ((longAt(GIV(stackPointer))) >> 3);
		classFormat = ((longAt(((longAt(GIV(stackPointer) + (1 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
		instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask());
		
		switch (instSpec) {
		case 2 /* arrayFormat */:
			numSlots = nElements;
			break;
		case indexablePointersFormat():
		case weakArrayFormat():
			numSlots = (classFormat & ((1U << (fixedFieldsFieldWidth())) - 1)) + nElements;
			break;
		case sixtyFourBitIndexableFormat():
			numSlots = nElements;
			break;
		case firstLongFormat():
			numSlots = (nElements + 1) / 2;
			break;
		case firstShortFormat():
			numSlots = (nElements + 3) / 4;
			break;
		case firstByteFormat():
		case firstCompiledMethodFormat():
			numSlots = (nElements + (BytesPerOop - 1)) / BytesPerOop;
			break;
		default:
			byteSize = (err = PrimErrBadReceiver);
			goto l6;

		}
		if (numSlots >= ((((usqInt)1)) << ((BytesPerOop * 8) - 3 /* logBytesPerOop */))) {
			code = (nElements < 0
				? PrimErrBadArgument
				: PrimErrLimitExceeded);
			byteSize = (err = code);
			goto l6;
		}
		byteSize = (numSlots == 0
			? 8 /* allocationUnit */ + BaseHeaderSize
			: (numSlots << (shiftForWord())) + ((numSlots >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize)));
	l6:	/* end byteSizeOfInstanceOf:withIndexableSlots:errInto: */;
		if (err >= 0) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = err;
			return;
		}
		/* begin pop:thenPush: */
		oop = positive64BitIntegerFor(byteSize);
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
		GIV(stackPointer) = sp;
		return;
	}
	/* begin byteSizeOfInstanceOf:errInto: */
	classFormat1 = ((longAt(((longAt(GIV(stackPointer) + (0 * BytesPerWord))) + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	instSpec1 = (((usqInt) classFormat1) >> (fixedFieldsFieldWidth())) & (formatMask());
	if (!((instSpec1 <= 1 /* nonIndexablePointerFormat */)
		 || (instSpec1 == 5 /* ephemeronFormat */))) {
		byteSize = (err = PrimErrBadReceiver);
		goto l7;
	}
	numSlots1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1);
	byteSize = (numSlots1 == 0
		? 8 /* allocationUnit */ + BaseHeaderSize
		: (((sqInt)((usqInt)(numSlots1) << (shiftForWord())))) + ((numSlots1 >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize)));
	l7:	/* end byteSizeOfInstanceOf:errInto: */;
	if (err >= 0) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = err;
		return;
	}
	/* begin pop:thenPushInteger: */
	longAtput((sp1 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), ((byteSize << 3) | 1));
	GIV(stackPointer) = sp1;
}

	/* InterpreterPrimitives>>#primitiveSmallFloatAdd */
static void
primitiveSmallFloatAdd(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    usqLong bits;
    usqLong bits1;
    sqInt floatOrIntOop;
    sqInt oop;
    double rcvr;
    double result;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    char *sp;
    sqInt tagBits;
    double value;
    double value1;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin loadFloatOrIntFrom: */
	floatOrIntOop = longAt(GIV(stackPointer));
	if (((tagBits = floatOrIntOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrIntOop));
			rot1 = ((usqInt) (((usqInt)floatOrIntOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrIntOop) << shift)))) >> shift) == floatOrIntOop))) {
			arg = ((double) ((floatOrIntOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(floatOrIntOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrIntOop + BaseHeaderSize, result);
			arg = result;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushFloat: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr + arg));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveSmallFloatArctan */
static void
primitiveSmallFloatArctan(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    usqLong bits;
    sqInt oop;
    double rcvr;
    usqLong rot;
    double value;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin stackTopPut: */
	aValue = floatObjectOf(atan(rcvr));
	longAtPointerput(GIV(stackPointer), aValue);
}

	/* InterpreterPrimitives>>#primitiveSmallFloatDivide */
static void
primitiveSmallFloatDivide(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    usqLong bits;
    usqLong bits1;
    sqInt floatOrIntOop;
    sqInt oop;
    double rcvr;
    double result;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    char *sp;
    sqInt tagBits;
    double value;
    double value1;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin loadFloatOrIntFrom: */
	floatOrIntOop = longAt(GIV(stackPointer));
	if (((tagBits = floatOrIntOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrIntOop));
			rot1 = ((usqInt) (((usqInt)floatOrIntOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrIntOop) << shift)))) >> shift) == floatOrIntOop))) {
			arg = ((double) ((floatOrIntOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(floatOrIntOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrIntOop + BaseHeaderSize, result);
			arg = result;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (arg == 0.0) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushFloat: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr / arg));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveSmallFloatEqual */
static void
primitiveSmallFloatEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    usqLong bits;
    usqLong bits1;
    sqInt floatOrIntOop;
    sqInt oop;
    double rcvr;
    double result;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    char *sp;
    sqInt tagBits;
    double value;
    double value1;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin loadFloatOrIntFrom: */
	floatOrIntOop = longAt(GIV(stackPointer));
	if (((tagBits = floatOrIntOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrIntOop));
			rot1 = ((usqInt) (((usqInt)floatOrIntOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrIntOop) << shift)))) >> shift) == floatOrIntOop))) {
			arg = ((double) ((floatOrIntOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(floatOrIntOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrIntOop + BaseHeaderSize, result);
			arg = result;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (rcvr == arg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}


/*	Computes E raised to the receiver power.
	Since SmallFloats cannot represent NaNs there's no need to special case. */

	/* InterpreterPrimitives>>#primitiveSmallFloatExp */
static void
primitiveSmallFloatExp(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;

	/* begin stackTopPut: */
	aValue = floatObjectOf(exp(smallFloatValueOf(longAt(GIV(stackPointer)))));
	longAtPointerput(GIV(stackPointer), aValue);
}


/*	Answer the exponent part of this float. */

	/* InterpreterPrimitives>>#primitiveSmallFloatExponent */
static void
primitiveSmallFloatExponent(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    usqInt exp;

	/* begin stackTopPut: */
	aValue = (((((assert(((longAt(GIV(stackPointer))) & (tagMask())) == (smallFloatTag())),
((((usqInt)(longAt(GIV(stackPointer))))) <= 15
		? 0
		: ((exp = ((usqInt) (((usqInt)(longAt(GIV(stackPointer)))))) >> (((numTagBits()) + (smallFloatMantissaBits())) + 1)),
			(exp + (smallFloatExponentOffset())) - 0x3FE)))) - 1) << 3) | 1);
	longAtPointerput(GIV(stackPointer), aValue);
}

	/* InterpreterPrimitives>>#primitiveSmallFloatFractionalPart */
static void
primitiveSmallFloatFractionalPart(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    usqLong bits;
    double frac;
    sqInt oop;
    double rcvr;
    usqLong rot;
    double trunc;
    double value;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	frac = modf(rcvr, (&trunc));
	/* begin stackTopPut: */
	aValue = floatObjectOf(frac);
	longAtPointerput(GIV(stackPointer), aValue);
}

	/* InterpreterPrimitives>>#primitiveSmallFloatGreaterOrEqual */
static void
primitiveSmallFloatGreaterOrEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    usqLong bits;
    usqLong bits1;
    sqInt floatOrIntOop;
    sqInt oop;
    double rcvr;
    double result;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    char *sp;
    sqInt tagBits;
    double value;
    double value1;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin loadFloatOrIntFrom: */
	floatOrIntOop = longAt(GIV(stackPointer));
	if (((tagBits = floatOrIntOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrIntOop));
			rot1 = ((usqInt) (((usqInt)floatOrIntOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrIntOop) << shift)))) >> shift) == floatOrIntOop))) {
			arg = ((double) ((floatOrIntOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(floatOrIntOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrIntOop + BaseHeaderSize, result);
			arg = result;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (rcvr >= arg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveSmallFloatGreaterThan */
static void
primitiveSmallFloatGreaterThan(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    usqLong bits;
    usqLong bits1;
    sqInt floatOrIntOop;
    sqInt oop;
    double rcvr;
    double result;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    char *sp;
    sqInt tagBits;
    double value;
    double value1;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin loadFloatOrIntFrom: */
	floatOrIntOop = longAt(GIV(stackPointer));
	if (((tagBits = floatOrIntOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrIntOop));
			rot1 = ((usqInt) (((usqInt)floatOrIntOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrIntOop) << shift)))) >> shift) == floatOrIntOop))) {
			arg = ((double) ((floatOrIntOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(floatOrIntOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrIntOop + BaseHeaderSize, result);
			arg = result;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (rcvr > arg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveSmallFloatLessOrEqual */
static void
primitiveSmallFloatLessOrEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    usqLong bits;
    usqLong bits1;
    sqInt floatOrIntOop;
    sqInt oop;
    double rcvr;
    double result;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    char *sp;
    sqInt tagBits;
    double value;
    double value1;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin loadFloatOrIntFrom: */
	floatOrIntOop = longAt(GIV(stackPointer));
	if (((tagBits = floatOrIntOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrIntOop));
			rot1 = ((usqInt) (((usqInt)floatOrIntOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrIntOop) << shift)))) >> shift) == floatOrIntOop))) {
			arg = ((double) ((floatOrIntOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(floatOrIntOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrIntOop + BaseHeaderSize, result);
			arg = result;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (rcvr <= arg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveSmallFloatLessThan */
static void
primitiveSmallFloatLessThan(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    usqLong bits;
    usqLong bits1;
    sqInt floatOrIntOop;
    sqInt oop;
    double rcvr;
    double result;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    char *sp;
    sqInt tagBits;
    double value;
    double value1;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin loadFloatOrIntFrom: */
	floatOrIntOop = longAt(GIV(stackPointer));
	if (((tagBits = floatOrIntOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrIntOop));
			rot1 = ((usqInt) (((usqInt)floatOrIntOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrIntOop) << shift)))) >> shift) == floatOrIntOop))) {
			arg = ((double) ((floatOrIntOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(floatOrIntOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrIntOop + BaseHeaderSize, result);
			arg = result;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (rcvr < arg
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}


/*	Natural log. */

	/* InterpreterPrimitives>>#primitiveSmallFloatLogN */
static void
primitiveSmallFloatLogN(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    usqLong bits;
    sqInt oop;
    double rcvr;
    usqLong rot;
    double value;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin stackTopPut: */
	aValue = floatObjectOf(log(rcvr));
	longAtPointerput(GIV(stackPointer), aValue);
}

	/* InterpreterPrimitives>>#primitiveSmallFloatMultiply */
static void
primitiveSmallFloatMultiply(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    usqLong bits;
    usqLong bits1;
    sqInt floatOrIntOop;
    sqInt oop;
    double rcvr;
    double result;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    char *sp;
    sqInt tagBits;
    double value;
    double value1;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin loadFloatOrIntFrom: */
	floatOrIntOop = longAt(GIV(stackPointer));
	if (((tagBits = floatOrIntOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrIntOop));
			rot1 = ((usqInt) (((usqInt)floatOrIntOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrIntOop) << shift)))) >> shift) == floatOrIntOop))) {
			arg = ((double) ((floatOrIntOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(floatOrIntOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrIntOop + BaseHeaderSize, result);
			arg = result;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushFloat: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr * arg));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveSmallFloatNotEqual */
static void
primitiveSmallFloatNotEqual(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    usqLong bits;
    usqLong bits1;
    sqInt floatOrIntOop;
    sqInt oop;
    double rcvr;
    double result;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    char *sp;
    sqInt tagBits;
    double value;
    double value1;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin loadFloatOrIntFrom: */
	floatOrIntOop = longAt(GIV(stackPointer));
	if (((tagBits = floatOrIntOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrIntOop));
			rot1 = ((usqInt) (((usqInt)floatOrIntOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrIntOop) << shift)))) >> shift) == floatOrIntOop))) {
			arg = ((double) ((floatOrIntOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(floatOrIntOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrIntOop + BaseHeaderSize, result);
			arg = result;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (!(rcvr == arg)
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}

	/* InterpreterPrimitives>>#primitiveSmallFloatSine */
static void
primitiveSmallFloatSine(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    usqLong bits;
    sqInt oop;
    double rcvr;
    usqLong rot;
    double value;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin stackTopPut: */
	aValue = floatObjectOf(sin(rcvr));
	longAtPointerput(GIV(stackPointer), aValue);
}

	/* InterpreterPrimitives>>#primitiveSmallFloatSquareRoot */
static void
primitiveSmallFloatSquareRoot(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    usqLong bits;
    sqInt oop;
    double rcvr;
    usqLong rot;
    double value;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	if (rcvr >= 0.0) {
		/* begin stackTopPut: */
		aValue = floatObjectOf(sqrt(rcvr));
		longAtPointerput(GIV(stackPointer), aValue);
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}

	/* InterpreterPrimitives>>#primitiveSmallFloatSubtract */
static void
primitiveSmallFloatSubtract(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double arg;
    usqLong bits;
    usqLong bits1;
    sqInt floatOrIntOop;
    sqInt oop;
    double rcvr;
    double result;
    usqLong rot;
    usqLong rot1;
    sqInt shift;
    char *sp;
    sqInt tagBits;
    double value;
    double value1;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	/* begin loadFloatOrIntFrom: */
	floatOrIntOop = longAt(GIV(stackPointer));
	if (((tagBits = floatOrIntOop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrIntOop));
			rot1 = ((usqInt) (((usqInt)floatOrIntOop))) >> (numTagBits());
			if (rot1 > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot1 += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot1 = (rot1 << 0x3F) + (((usqInt) (((usqInt)rot1))) >> 1);
			bits1 = rot1;
			memcpy((&value1), (&bits1), sizeof(value1));
			arg = value1;
			goto l6;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrIntOop) << shift)))) >> shift) == floatOrIntOop))) {
			arg = ((double) ((floatOrIntOop >> 3)) );
			goto l6;
		}
	}
	else {
		if (((longAt(floatOrIntOop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrIntOop + BaseHeaderSize, result);
			arg = result;
			goto l6;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	arg = 0.0;
	l6:	/* end loadFloatOrIntFrom: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushFloat: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(rcvr - arg));
		GIV(stackPointer) = sp;
	}
}


/*	Multiply the receiver by the power of the argument. */

	/* InterpreterPrimitives>>#primitiveSmallFloatTimesTwoPower */
static void
primitiveSmallFloatTimesTwoPower(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;
    sqInt rcvr;
    sqInt result;
    char *sp;
    int twiceMaxExponent;

	arg = longAt(GIV(stackPointer));
	if (!((((arg) & 7) == 1))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}

	/* N.B. SmallFloats are finite.  NaN and Infinity overflow into boxed floats.
	   This is doing range checking work that is done in ldexp, but we include
	   it explicitly to exemplify bit manipulation of SmallFloats. */
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((assert(isImmediateFloat(rcvr)),
	(((usqInt)rcvr)) <= ((1U << (numTagBits())) + (smallFloatTag())))) {
		result = rcvr;
	}
	else {
		arg = (arg >> 3);
		twiceMaxExponent = 2 * (1U << 11 /* floatExponentBits */);
		if (arg < (-twiceMaxExponent)) {
			assert(isImmediateFloat(rcvr));
			result = rcvr & ((1U << (numTagBits())) + (tagMask()));
		}
		else {

			/* clip arg to at most int range; ldexp's last arg is of type int */
			if (arg > twiceMaxExponent) {
				arg = twiceMaxExponent;
			}
			result = floatObjectOf(ldexp(smallFloatValueOf(rcvr), ((int) arg)));
		}
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), result);
	GIV(stackPointer) = sp;
}

	/* InterpreterPrimitives>>#primitiveSmallFloatTruncated */
static void
primitiveSmallFloatTruncated(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong bits;
    sqInt oop;
    double rcvr;
    usqLong rot;
    double trunc;
    double value;

	/* begin smallFloatValueOf: */
	oop = longAt(GIV(stackPointer));
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	rcvr = value;
	modf(rcvr, (&trunc));
	if (((trunc >= (((double) (MinSmallInteger) ))) && (trunc <= (((double) (MaxSmallInteger) ))))) {
		longAtPointerput(GIV(stackPointer), (((usqInt)(((sqInt)trunc)) << 3) | 1));
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}

	/* InterpreterPrimitives>>#primitiveSomeInstance */
static void
primitiveSomeInstance(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class;
    sqInt instance;
    char *sp;

	class = longAt(GIV(stackPointer));
	instance = initialInstanceOf(class);
	if (instance == null) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	else {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), instance);
		GIV(stackPointer) = sp;
	}
}


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

	/* InterpreterPrimitives>>#primitiveSomeObject */
static void
primitiveSomeObject(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt object;
    char *sp;

	/* begin pop: */
	GIV(stackPointer) += (GIV(argumentCount) + 1) * BytesPerWord;
	/* begin push: */
	object = firstAccessibleObject();
	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
}


/*	Return the oop of the SpecialObjectsArray. */

	/* InterpreterPrimitives>>#primitiveSpecialObjectsOop */
static void
primitiveSpecialObjectsOop(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), GIV(specialObjectsOop));
	GIV(stackPointer) = sp;
}


/*	N.B. IMO we should be able to assume the receiver is a float because this
	primitive is specific to floats. eem 2/13/2017
 */

	/* InterpreterPrimitives>>#primitiveSquareRoot */
static void
primitiveSquareRoot(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aValue;
    double rcvr;

	/* begin stackFloatValue: */
	rcvr = floatValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	if ((!GIV(primFailCode))
	 && (rcvr >= 0.0)) {
		/* begin stackTopPut: */
		aValue = floatObjectOf(sqrt(rcvr));
		longAtPointerput(GIV(stackPointer), aValue);
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}


/*	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.
 */

	/* InterpreterPrimitives>>#primitiveStoreImageSegment */
static void
primitiveStoreImageSegment(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arrayOfRoots;
    sqInt ecode;
    sqInt outPointerArray;
    sqInt segmentWordArray;

	outPointerArray = longAt(GIV(stackPointer));
	segmentWordArray = longAt(GIV(stackPointer) + (1 * BytesPerWord));

	/* Essential type checks */
	arrayOfRoots = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	if (!((((arrayOfRoots & (tagMask())) == 0)
		 && (((((usqInt) (longAt(arrayOfRoots))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && ((((outPointerArray & (tagMask())) == 0)
		 && (((((usqInt) (longAt(outPointerArray))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && (((segmentWordArray & (tagMask())) == 0)
		 && (((((((usqInt) (longAt(segmentWordArray))) >> (formatShift())) & (formatMask())) >= (firstLongFormat())) && (((((usqInt) (longAt(segmentWordArray))) >> (formatShift())) & (formatMask())) <= ((firstShortFormat()) - 1)))))))) {

		/* Must be indexable words */
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	ecode = storeImageSegmentIntooutPointersroots(segmentWordArray, outPointerArray, arrayOfRoots);
	if (ecode == PrimNoErr) {
		/* begin pop: */
		GIV(stackPointer) += 3 * BytesPerWord;
	}
	else {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = ecode;
	}
}

	/* InterpreterPrimitives>>#primitiveStringAt */
static void
primitiveStringAt(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class;
    sqInt classFormat;
    sqInt fixedFields;
    usqLong fmt;
    sqLong hdr;
    sqInt index;
    unsigned int integerValue;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt rcvr;
    sqInt reasonCode;
    sqInt result;
    char *sp;
    sqInt sp1;
    sqInt sp2;
    sqInt stSize;
    sqInt totalLength;

	/* begin commonAt: */
	GIV(primFailCode) = 0;
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	index = longAt(GIV(stackPointer));
	if (rcvr & (tagMask())) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrInappropriate;
		goto l10;
	}
	if (((index & (smallIntegerTag())) == 0)
	 || ((GIV(argumentCount) > 1)
	 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		goto l10;
	}
	index = (index >> 3);
	/* begin stObject:at: */
	hdr = long64At(rcvr);
	fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots1 = byteAt(rcvr + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		totalLength = numSlots;
		goto l6;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l6;
	}
	if (fmt >= (firstShortFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l6;
	}
	if (fmt >= (firstLongFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l6;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		totalLength = numSlots;
		goto l6;
	}
	totalLength = 0;
	l6:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		fixedFields = 0;
		goto l7;
	}
	if (fmt < 2 /* arrayFormat */) {
		fixedFields = totalLength;
		goto l7;
	}
	class = fetchClassOfNonImm(rcvr);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l7:	/* end fixedFieldsOf:format:length: */;
	if ((fmt == (indexablePointersFormat()))
	 && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		/* begin stackPointerForMaybeMarriedContext: */
		if ((((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(rcvr)))) {
			sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr));
			assert((ReceiverIndex + ((sp2 >> 3))) < (lengthOf(rcvr)));
			stSize = sp2;
			goto l4;
		}
		/* begin fetchStackPointerOf: */
		sp1 = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
		if (!((((sp1) & 7) == 1))) {
			stSize = 0;
			goto l4;
		}
		assert((ReceiverIndex + ((sp1 >> 3))) < (lengthOf(rcvr)));
		stSize = (sp1 >> 3);
	l4:	/* end stackPointerForMaybeMarriedContext: */;
		if ((oopisGreaterThanOrEqualTo(index, 1))
		 && ((oopisLessThanOrEqualTo(index, stSize))
		 && ((((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(rcvr)))))) {
			result = noInlineTemporaryin(index - 1, frameOfMarriedContext(rcvr));
			goto l9;
		}
	}
	else {
		stSize = totalLength - fixedFields;
	}
	if ((oopisGreaterThanOrEqualTo(index, (fmt >= (firstCompiledMethodFormat())
		? (((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1
		: 1)))
	 && (oopisLessThanOrEqualTo(index, stSize))) {
		/* begin subscript:with:format: */
		if (fmt <= 5 /* lastPointerFormat */) {
			/* begin fetchPointer:ofObject: */
			result = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))));
			goto l9;
		}
		if (fmt >= (firstByteFormat())) {
			result = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1))) << 3) | 1);
			goto l9;
		}
		if (fmt >= (firstShortFormat())) {
			result = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 3) | 1);
			goto l9;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			result = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3)))));
			goto l9;
		}
		/* begin positive32BitIntegerFor: */
		integerValue = long32At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))));
		result = ((((((usqInt)integerValue)) & 0xFFFFFFFFU) << 3) | 1);
		goto l9;
	}
	/* begin primitiveFailFor: */
	reasonCode = (fmt <= 1
		? PrimErrBadReceiver
		: PrimErrBadIndex);
	GIV(primFailCode) = reasonCode;
	result = 0;
	l9:	/* end stObject:at: */;
	if (!GIV(primFailCode)) {
		if (!(((result >= 0) && (result <= ((1U << 30) - 1))))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadReceiver;
			goto l10;
		}
		/* begin characterForAscii: */
		result = (((sqInt)((usqInt)(((result >> 3))) << (numTagBits())))) + (characterTag());
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result);
		GIV(stackPointer) = sp;
	}
	l10:	/* end commonAt: */;
}

	/* InterpreterPrimitives>>#primitiveStringAtPut */
static void
primitiveStringAtPut(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class;
    sqInt classFormat;
    sqInt fixedFields;
    usqLong fmt;
    sqLong hdr;
    sqInt index;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt rcvr;
    sqInt reasonCode;
    sqInt signedValueToStore;
    char *sp;
    sqInt sp1;
    sqInt sp2;
    sqInt stSize;
    sqInt totalLength;
    usqLong unsigned64BitValueToStore;
    unsigned int unsignedValueToStore;
    sqInt value;
    sqInt value1;

	/* begin commonAtPut: */
	GIV(primFailCode) = 0;
	rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	value = longAt(GIV(stackPointer));
	if (rcvr & (tagMask())) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrInappropriate;
		goto l30;
	}
	if (((index & (smallIntegerTag())) == 0)
	 || ((GIV(argumentCount) > 2)
	 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		goto l30;
	}
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrNoModification;
		goto l30;
	}
	index = (index >> 3);
	/* begin stObject:at:put: */
	value1 = asciiOfCharacter(value);
	/* begin baseHeader: */
	hdr = long64At(rcvr);
	fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots1 = byteAt(rcvr + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		totalLength = numSlots;
		goto l6;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l6;
	}
	if (fmt >= (firstShortFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l6;
	}
	if (fmt >= (firstLongFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l6;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		totalLength = numSlots;
		goto l6;
	}
	totalLength = 0;
	l6:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		fixedFields = 0;
		goto l7;
	}
	if (fmt < 2 /* arrayFormat */) {
		fixedFields = totalLength;
		goto l7;
	}
	class = fetchClassOfNonImm(rcvr);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l7:	/* end fixedFieldsOf:format:length: */;
	if ((fmt == (indexablePointersFormat()))
	 && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		/* begin stackPointerForMaybeMarriedContext: */
		if ((((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(rcvr)))) {
			sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr));
			assert((ReceiverIndex + ((sp2 >> 3))) < (lengthOf(rcvr)));
			stSize = sp2;
			goto l4;
		}
		/* begin fetchStackPointerOf: */
		sp1 = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
		if (!((((sp1) & 7) == 1))) {
			stSize = 0;
			goto l4;
		}
		assert((ReceiverIndex + ((sp1 >> 3))) < (lengthOf(rcvr)));
		stSize = (sp1 >> 3);
	l4:	/* end stackPointerForMaybeMarriedContext: */;
		if ((oopisGreaterThanOrEqualTo(index, 1))
		 && ((oopisLessThanOrEqualTo(index, stSize))
		 && ((((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(rcvr)))))) {
			noInlineTemporaryinput(index - 1, frameOfMarriedContext(rcvr), value1);
			goto l15;
		}
	}
	else {
		stSize = totalLength - fixedFields;
	}
	if ((oopisGreaterThanOrEqualTo(index, (fmt >= (firstCompiledMethodFormat())
		? (((literalCountOf(rcvr)) + LiteralStart) * BytesPerOop) + 1
		: 1)))
	 && (oopisLessThanOrEqualTo(index, stSize))) {
		/* begin subscript:with:storing:format: */
		if (fmt <= 5 /* lastPointerFormat */) {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(rcvr)));
			if ((assert(isNonImmediate(rcvr)),
			oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((value1 & (tagMask())) == 0)
				 && (oopisLessThan(value1, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(rcvr);
					}
				}
			}
			longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value1);
			goto l13;
		}
		if (fmt >= (firstByteFormat())) {
			if (!((((value1) & 7) == 1))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l13;
			}
			signedValueToStore = (value1 >> 3);
			if (!((signedValueToStore >= 0)
				 && (signedValueToStore <= 0xFF))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l13;
			}
			/* begin storeByte:ofObject:withValue: */
			byteAtput((rcvr + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore);
			goto l13;
		}
		if (fmt >= (firstShortFormat())) {
			if (!((((value1) & 7) == 1))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l13;
			}
			signedValueToStore = (value1 >> 3);
			if (!((signedValueToStore >= 0)
				 && (signedValueToStore <= 0xFFFF))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l13;
			}
			/* begin storeShort16:ofObject:withValue: */
			shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore);
			goto l13;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			unsigned64BitValueToStore = positive64BitValueOf(value1);
			if (!GIV(primFailCode)) {
				/* begin storeLong64:ofObject:withValue: */
				long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore);
			}
			goto l13;
		}
		unsignedValueToStore = positive32BitValueOf(value1);
		if (!GIV(primFailCode)) {
			/* begin storeLong32:ofObject:withValue: */
			long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore);
		}
	l13:	/* end subscript:with:storing:format: */;
	}
	else {
		/* begin primitiveFailFor: */
		reasonCode = (fmt <= 1
			? PrimErrBadReceiver
			: PrimErrBadIndex);
		GIV(primFailCode) = reasonCode;
	}
	l15:	/* end stObject:at:put: */;
	if (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value);
		GIV(stackPointer) = sp;
	}
	l30:	/* end commonAtPut: */;
}


/*	<array> primReplaceFrom: start to: stop with: replacement startingAt:
	repStart 
	<primitive: 105> */

	/* InterpreterPrimitives>>#primitiveStringReplace */
static void
primitiveStringReplace(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt array;
    sqInt arrayFmt;
    sqInt arrayInstSize;
    sqInt arrayLength;
    sqInt class;
    sqInt class1;
    sqInt classFormat;
    sqInt classFormat1;
    sqInt i;
    sqInt mustRemember;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    sqInt oop;
    sqInt repl;
    sqInt replFmt;
    sqInt replInstSize;
    sqInt replLength;
    sqInt replStart;
    sqInt srcDelta;
    sqInt start;
    sqInt stop;

	/* begin primitiveSpurStringReplace */
	array = longAt(GIV(stackPointer) + (4 * BytesPerWord));
	start = longAt(GIV(stackPointer) + (3 * BytesPerWord));
	stop = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	repl = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	replStart = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	if (((start & (smallIntegerTag())) == 0)
	 || (((stop & (smallIntegerTag())) == 0)
	 || (((replStart & (smallIntegerTag())) == 0)
	 || (repl & (tagMask()))))) {

		/* can happen in LgInt copy */
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		goto l16;
	}
	start = (start >> 3);
	stop = (stop >> 3);
	replStart = (replStart >> 3);
	if ((stop >= start)
	 && (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(array))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		)) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrNoModification;
		goto l16;
	}
	arrayFmt = (((usqInt) (longAt(array))) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots1 = byteAt(array + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(array - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (arrayFmt <= 5 /* ephemeronFormat */) {
		arrayLength = numSlots;
		goto l11;
	}
	if (arrayFmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		arrayLength = (numSlots << (shiftForWord())) - (arrayFmt & 7);
		goto l11;
	}
	if (arrayFmt >= (firstShortFormat())) {
		arrayLength = (numSlots << ((shiftForWord()) - 1)) - (arrayFmt & 3);
		goto l11;
	}
	if (arrayFmt >= (firstLongFormat())) {
		arrayLength = (numSlots << ((shiftForWord()) - 2)) - (arrayFmt & 1);
		goto l11;
	}
	if (arrayFmt == (sixtyFourBitIndexableFormat())) {
		arrayLength = numSlots;
		goto l11;
	}
	arrayLength = 0;
	l11:	/* end lengthOf:format: */;
	/* begin classFormatFromInstFormat: */
	if (arrayFmt >= (firstByteFormat())) {

		/* this is likely the common case */
		arrayFmt = arrayFmt & -8;
		goto l12;
	}
	if (arrayFmt <= (sixtyFourBitIndexableFormat())) {
		arrayFmt = arrayFmt;
		goto l12;
	}
	if (arrayFmt < (firstShortFormat())) {
		arrayFmt = arrayFmt & -2;
		goto l12;
	}
	arrayFmt = arrayFmt & -4;
	l12:	/* end classFormatFromInstFormat: */;
	replFmt = (((usqInt) (longAt(repl))) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots11 = byteAt(repl + 7);
	numSlots2 = (numSlots11 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(repl - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots11);
	if (replFmt <= 5 /* ephemeronFormat */) {
		replLength = numSlots2;
		goto l14;
	}
	if (replFmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		replLength = (numSlots2 << (shiftForWord())) - (replFmt & 7);
		goto l14;
	}
	if (replFmt >= (firstShortFormat())) {
		replLength = (numSlots2 << ((shiftForWord()) - 1)) - (replFmt & 3);
		goto l14;
	}
	if (replFmt >= (firstLongFormat())) {
		replLength = (numSlots2 << ((shiftForWord()) - 2)) - (replFmt & 1);
		goto l14;
	}
	if (replFmt == (sixtyFourBitIndexableFormat())) {
		replLength = numSlots2;
		goto l14;
	}
	replLength = 0;
	l14:	/* end lengthOf:format: */;
	/* begin classFormatFromInstFormat: */
	if (replFmt >= (firstByteFormat())) {

		/* this is likely the common case */
		replFmt = replFmt & -8;
		goto l15;
	}
	if (replFmt <= (sixtyFourBitIndexableFormat())) {
		replFmt = replFmt;
		goto l15;
	}
	if (replFmt < (firstShortFormat())) {
		replFmt = replFmt & -2;
		goto l15;
	}
	replFmt = replFmt & -4;
	l15:	/* end classFormatFromInstFormat: */;
	if (!((arrayFmt == replFmt)
		 && (arrayFmt < (firstCompiledMethodFormat())))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrInappropriate;
		goto l16;
	}
	if (arrayFmt <= 5 /* lastPointerFormat */) {
		/* begin fixedFieldsOf:format:length: */
		if ((arrayFmt >= (sixtyFourBitIndexableFormat()))
		 || (arrayFmt == 2 /* arrayFormat */)) {
			arrayInstSize = 0;
			goto l8;
		}
		if (arrayFmt < 2 /* arrayFormat */) {
			arrayInstSize = arrayLength;
			goto l8;
		}
		class = fetchClassOfNonImm(array);
		/* begin fixedFieldsOfClassFormat: */
		classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
		arrayInstSize = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l8:	/* end fixedFieldsOf:format:length: */;
		/* begin fixedFieldsOf:format:length: */
		if ((replFmt >= (sixtyFourBitIndexableFormat()))
		 || (replFmt == 2 /* arrayFormat */)) {
			replInstSize = 0;
			goto l9;
		}
		if (replFmt < 2 /* arrayFormat */) {
			replInstSize = replLength;
			goto l9;
		}
		class1 = fetchClassOfNonImm(repl);
		/* begin fixedFieldsOfClassFormat: */
		classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
		replInstSize = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1);
	l9:	/* end fixedFieldsOf:format:length: */;
		if (!((start >= 1)
			 && (((start - 1) <= stop)
			 && (((stop + arrayInstSize) <= arrayLength)
			 && ((replStart >= 1)
			 && ((((stop - start) + replStart) + replInstSize) <= replLength)))))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadIndex;
			goto l16;
		}
		start += arrayInstSize;
		stop += arrayInstSize;
		srcDelta = (replStart + replInstSize) - start;
		if ((assert(isNonImmediate(array)),
		oopisGreaterThanOrEqualTo(array, GIV(oldSpaceStart)))) {
			mustRemember = 0;
			for (i = (start - 1); i < stop; i += 1) {
				oop = longAt((repl + BaseHeaderSize) + (((sqInt)((usqInt)((srcDelta + i)) << (shiftForWord())))));
				if (((oop & (tagMask())) == 0)
				 && (oopisLessThan(oop, GIV(newSpaceLimit)))) {
					mustRemember = 1;
				}
				assert(!(isOopForwarded(array)));
				longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), oop);
			}
			if (mustRemember) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(array))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(array);
				}
			}
		}
		else {
			for (i = (start - 1); i < stop; i += 1) {
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(array)));
				longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), longAt((repl + BaseHeaderSize) + (((sqInt)((usqInt)((srcDelta + i)) << (shiftForWord()))))));
			}
		}
	}
	else {
		if (!((start >= 1)
			 && (((start - 1) <= stop)
			 && ((stop <= arrayLength)
			 && ((replStart >= 1)
			 && (((stop - start) + replStart) <= replLength)))))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadIndex;
			goto l16;
		}
		srcDelta = replStart - start;
		if (arrayFmt >= (firstShortFormat())) {

			/* 8 & 16-bit word type objects */
			if (arrayFmt >= (firstByteFormat())) {

				/* byte-type objects */
				for (i = (start - 1); i < stop; i += 1) {
					/* begin storeByte:ofObject:withValue: */
					byteAtput((array + BaseHeaderSize) + i, byteAt((repl + BaseHeaderSize) + (srcDelta + i)));
				}
			}
			else {

				/* short type objects */
				for (i = (start - 1); i < stop; i += 1) {
					/* begin storeShort16:ofObject:withValue: */
					shortAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << 1))), shortAt((repl + BaseHeaderSize) + (((sqInt)((usqInt)((srcDelta + i)) << 1)))));
				}
			}
		}
		else {

			/* 32 & 64-bit word type objects */
			if (arrayFmt >= (firstLongFormat())) {

				/* word-type objects */
				for (i = (start - 1); i < stop; i += 1) {
					/* begin storeLong32:ofObject:withValue: */
					long32Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << 2))), long32At((repl + BaseHeaderSize) + (((sqInt)((usqInt)((srcDelta + i)) << 2)))));
				}
			}
			else {

				/* long type objects */
				for (i = (start - 1); i < stop; i += 1) {
					/* begin storeLong64:ofObject:withValue: */
					long64Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(i) << 3))), long64At((repl + BaseHeaderSize) + (((sqInt)((usqInt)((srcDelta + i)) << 3)))));
				}
			}
		}
	}
	/* begin pop: */
	GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	l16:	/* end primitiveSpurStringReplace */;
}

	/* InterpreterPrimitives>>#primitiveSubtract */
static void
primitiveSubtract(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerResult;
    char *sp;

	/* begin pop2AndPushIntegerIfOK: */
	integerResult = (stackIntegerValue(1)) - (stackIntegerValue(0));
	if (!GIV(primFailCode)) {
		if ((((((usqInt) integerResult) >> 60) + 1) & 15) <= 1) {
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (((usqInt)integerResult << 3) | 1));
			GIV(stackPointer) = sp;
		}
		else {
			/* begin success: */
			
			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
}


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

	/* InterpreterPrimitives>>#primitiveSubtractLargeIntegers */
EXPORT(void)
primitiveSubtractLargeIntegers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong a;
    sqInt aIsNegative;
    usqLong b;
    sqInt bIsNegative;
    sqInt oopArg;
    sqInt oopRcvr;
    sqInt oopResult;
    usqLong result;
    sqInt resultIsNegative;
    char *sp;

	oopArg = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	oopRcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	aIsNegative = isNegativeIntegerValueOf(oopRcvr);
	bIsNegative = isNegativeIntegerValueOf(oopArg);
	a = magnitude64BitValueOf(oopRcvr);
	b = magnitude64BitValueOf(oopArg);
	if (GIV(primFailCode)) {
		return;
	}
	if (aIsNegative != bIsNegative) {

		/* Protect against overflow */
		if (a > (0xFFFFFFFFFFFFFFFFULL - b)) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(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 (!GIV(primFailCode)) {
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), oopResult);
		GIV(stackPointer) = sp;
	}
}


/*	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). */

	/* InterpreterPrimitives>>#primitiveTestAndSetOwnershipOfCriticalSection */
static void
primitiveTestAndSetOwnershipOfCriticalSection(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeProc;
    sqInt criticalSection;
    sqInt objOop;
    sqInt objOop1;
    sqInt owningProcess;
    sqInt owningProcessIndex;
    char *sp;
    char *sp1;
    char *sp2;

	if (GIV(argumentCount) > 0) {

		/* rcvr */
		criticalSection = longAt(GIV(stackPointer) + (1 * BytesPerWord));
		activeProc = longAt(GIV(stackPointer));
	}
	else {

		/* rcvr */
		criticalSection = longAt(GIV(stackPointer));
		/* begin fetchPointer:ofObject: */
		objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
		objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
		activeProc = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
	}

	/* CriticalSections are laid out like Semaphores */
	owningProcessIndex = ExcessSignalsIndex;
	owningProcess = longAt((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(owningProcessIndex) << (shiftForWord())))));
	if (owningProcess == GIV(nilObj)) {
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(criticalSection)));
		if ((assert(isNonImmediate(criticalSection)),
		oopisGreaterThanOrEqualTo(criticalSection, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((activeProc & (tagMask())) == 0)
			 && (oopisLessThan(activeProc, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(criticalSection))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(criticalSection);
				}
			}
		}
		longAtput((criticalSection + BaseHeaderSize) + (((sqInt)((usqInt)(owningProcessIndex) << (shiftForWord())))), activeProc);
		/* begin pop:thenPush: */
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), GIV(falseObj));
		GIV(stackPointer) = sp;
		return;
	}
	if (owningProcess == activeProc) {
		/* begin pop:thenPush: */
		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), GIV(trueObj));
		GIV(stackPointer) = sp1;
		return;
	}
	/* begin pop:thenPush: */
	longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), GIV(nilObj));
	GIV(stackPointer) = sp2;
}


/*	Return true if the host OS does support the given display depth. */

	/* InterpreterPrimitives>>#primitiveTestDisplayDepth */
static void
primitiveTestDisplayDepth(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bitsPerPixel;
    sqInt integerPointer;
    sqInt okay;
    char *sp;

	okay = 0;
	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		bitsPerPixel = (integerPointer >> 3);
		goto l1;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		bitsPerPixel = 0;
		goto l1;
	}
	l1:	/* end stackIntegerValue: */;
	if (!GIV(primFailCode)) {
		okay = ioHasDisplayDepth(bitsPerPixel);
	}
	if (!GIV(primFailCode)) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (okay
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
	}
}


/*	Multiply the receiver by the power of the argument. */

	/* InterpreterPrimitives>>#primitiveTimesTwoPower */
static void
primitiveTimesTwoPower(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arg;
    double rcvr;
    double result;
    char *sp;
    int twiceMaxExponent;

	arg = longAt(GIV(stackPointer));
	if (!((((arg) & 7) == 1))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	arg = (arg >> 3);
	
	/* clip arg to at most int range; ldexp's last arg is of type int */
	twiceMaxExponent = 2 * (1U << 11 /* floatExponentBits */);
	if (arg < (-twiceMaxExponent)) {
		arg = -twiceMaxExponent;
	}
	else {
		if (arg > twiceMaxExponent) {
			arg = twiceMaxExponent;
		}
	}
	rcvr = floatValueOf(longAt(GIV(stackPointer) + (1 * BytesPerWord)));
	result = ldexp(rcvr, ((int) arg));
	/* begin pop:thenPushFloat: */
	longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), floatObjectOf(result));
	GIV(stackPointer) = sp;
}


/*	N.B. IMO we should be able to assume the receiver is a float because this
	primitive is specific to floats. eem 2/13/2017
 */

	/* InterpreterPrimitives>>#primitiveTruncated */
static void
primitiveTruncated(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double rcvr;
    double trunc;

	/* begin stackFloatValue: */
	rcvr = floatValueOf(longAt(GIV(stackPointer) + (0 * BytesPerWord)));
	if (!GIV(primFailCode)) {
		modf(rcvr, (&trunc));
		if (((trunc >= (((double) (MinSmallInteger) ))) && (trunc <= (((double) (MaxSmallInteger) ))))) {
			longAtPointerput(GIV(stackPointer), (((usqInt)(((sqInt)trunc)) << 3) | 1));
		}
		else {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
}


/*	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. 
 */

	/* InterpreterPrimitives>>#primitiveUnloadModule */
static void
primitiveUnloadModule(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt i;
    usqInt limit;
    sqInt moduleName;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	if (!(GIV(argumentCount) == 1)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	moduleName = longAt(GIV(stackPointer));
	if ((((moduleName) & 7) == 1)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	if (!(((moduleName & (tagMask())) == 0)
		 && (((((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	if (!(ioUnloadModuleOfLength(oopForPointer(firstIndexableField(moduleName)), byteSizeOf(moduleName)))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin flushExternalPrimitives */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {

			/* This is a compiled method */
			flushExternalPrimitiveOf(objOop1);
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l6;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l6:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {

			/* This is a compiled method */
			flushExternalPrimitiveOf(objOop1);
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {

				/* This is a compiled method */
				flushExternalPrimitiveOf(objOop11);
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	flushMethodCache();
	/* begin flushExternalPrimitiveTable */
	for (i = 0; i < MaxExternalPrimitiveTableSize; i += 1) {
		externalPrimitiveTable[i] = 0;
	}
	GIV(externalPrimitiveTableFirstFreeIndex) = 0;
	forceInterruptCheck();
	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
}


/*	Update the VMs notion of the current timezone. The VM sets its notion
	of the timezone once at start-up. If one wants the VM to keep its notion
	up-to-date arrange to invoke this primitive periodically. */

	/* InterpreterPrimitives>>#primitiveUpdateTimezone */
static void
primitiveUpdateTimezone(void)
{
	ioUpdateVMTimezone();
}


/*	Return the value of the microsecond clock in UTC as an integer.
	This is the number of microseconds since the Smalltalk epoch, 1901/1/1
	12:00am. The microsecond clock is at least 60 bits wide which means it'll
	get to around August
	38435 before it wraps around. Be sure to put it on your calendar. This
	primitive accesses the time as answered by the OS. */

	/* InterpreterPrimitives>>#primitiveUTCMicrosecondClock */
static void
primitiveUTCMicrosecondClock(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;
    char *sp;

	/* begin pop:thenPush: */
	oop = positive64BitIntegerFor(ioUTCMicrosecondsNow());
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}


/*	Answer an array with UTC microseconds since the Smalltalk epoch and the
	current seconds offset from GMT in the local time zone. Any pointer object
	with two or more slots) may be supplied as a parameter. */

	/* InterpreterPrimitives>>#primitiveUtcAndTimezoneOffset */
static void
primitiveUtcAndTimezoneOffset(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt resultArray;
    char *sp;
    sqInt valuePointer;
    sqInt valuePointer1;

	if (GIV(argumentCount) > 0) {
		if (GIV(argumentCount) > 1) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadNumArgs;
			return;
		}
		resultArray = longAt(GIV(stackPointer));
		if (!((((resultArray & (tagMask())) == 0)
			 && (((((usqInt) (longAt(resultArray))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
			 && ((lengthOfformat(resultArray, (((usqInt) (longAt(resultArray))) >> (formatShift())) & (formatMask()))) >= 2))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadArgument;
			return;
		}
	}
	else {
		resultArray = instantiateClassindexableSize(splObj(ClassArray), 2);
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = (((usqInt)(ioLocalSecondsOffset()) << 3) | 1);
	assert(!(isOopForwarded(resultArray)));
	longAtput((resultArray + BaseHeaderSize) + (1U << (shiftForWord())), valuePointer);
	/* begin storePointer:ofObject:withValue: */
	valuePointer1 = positive64BitIntegerFor(ioUTCMicroseconds());
	assert(!(isForwarded(resultArray)));
	if ((assert(isNonImmediate(resultArray)),
	oopisGreaterThanOrEqualTo(resultArray, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((valuePointer1 & (tagMask())) == 0)
		 && (oopisLessThan(valuePointer1, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(resultArray))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(resultArray);
			}
		}
	}
	longAtput((resultArray + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer1);
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), resultArray);
	GIV(stackPointer) = sp;
}


/*	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) */

	/* InterpreterPrimitives>>#primitiveUtcWithOffset */
EXPORT(sqInt)
primitiveUtcWithOffset(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    static usqLong epochDelta = 2177452800000000ULL;
    sqInt resultArray;
    char *sp;
    sqInt valuePointer;
    sqInt valuePointer1;

	if (GIV(argumentCount) > 0) {
		if (GIV(argumentCount) > 1) {
			/* begin primitiveFailFor: */
			return (GIV(primFailCode) = PrimErrBadNumArgs);
		}
		resultArray = longAt(GIV(stackPointer));
		if (!((((resultArray & (tagMask())) == 0)
			 && (((((usqInt) (longAt(resultArray))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
			 && ((lengthOfformat(resultArray, (((usqInt) (longAt(resultArray))) >> (formatShift())) & (formatMask()))) >= 2))) {
			/* begin primitiveFailFor: */
			return (GIV(primFailCode) = PrimErrBadArgument);
		}
	}
	else {
		resultArray = instantiateClassindexableSize(splObj(ClassArray), 2);
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = (((usqInt)(ioLocalSecondsOffset()) << 3) | 1);
	assert(!(isOopForwarded(resultArray)));
	longAtput((resultArray + BaseHeaderSize) + (1U << (shiftForWord())), valuePointer);
	/* begin storePointer:ofObject:withValue: */
	valuePointer1 = positive64BitIntegerFor((ioUTCMicroseconds()) - epochDelta);
	assert(!(isForwarded(resultArray)));
	if ((assert(isNonImmediate(resultArray)),
	oopisGreaterThanOrEqualTo(resultArray, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((valuePointer1 & (tagMask())) == 0)
		 && (oopisLessThan(valuePointer1, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(resultArray))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(resultArray);
			}
		}
	}
	longAtput((resultArray + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer1);
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), resultArray);
	GIV(stackPointer) = sp;
	return 0;
}


/*	Return a string containing the path name of VM's directory. */

	/* InterpreterPrimitives>>#primitiveVMPath */
static void
primitiveVMPath(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt s;
    char *sp;
    sqInt sz;

	sz = vmPathSize();
	s = instantiateClassindexableSize(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassByteString) << (shiftForWord()))))), sz);
	vmPathGetLength(s + BaseHeaderSize, sz);
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), s);
	GIV(stackPointer) = sp;
}


/*	Primitive.
	0 args: Answer whether the VM Profiler is running or not.
	1 arg:	Copy the sample data into the supplied argument, which must be a
	Bitmap of suitable size. Answer the number of samples copied into the
	buffer.  */

	/* InterpreterPrimitives>>#primitiveVMProfileSamplesInto */
static void
primitiveVMProfileSamplesInto(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    long bufferSize;
    sqInt numSamples;
    sqInt running;
    sqInt sampleBuffer;
    char *sp;
    char *sp1;
    sqInt v;

	bufferSize = 0;
	running = 0;
	v = 0;
	ioNewProfileStatus((&running), (&bufferSize));
	if (GIV(argumentCount) == 0) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (running
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
		return;
	}
	if (!(GIV(argumentCount) == 1)) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadNumArgs;
		return;
	}
	sampleBuffer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	if (!(((sampleBuffer & (tagMask())) == 0)
		 && ((isPureBitsFormat((((usqInt) (longAt(sampleBuffer))) >> (formatShift())) & (formatMask())))
		 && ((numBytesOf(sampleBuffer)) >= (bufferSize * BytesPerWord))))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	numSamples = ioNewProfileSamplesInto(firstFixedField(sampleBuffer));
	/* begin pop:thenPushInteger: */
	longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)numSamples << 3) | 1));
	GIV(stackPointer) = sp1;
}


/*	Signal the given semaphore from within the interpreter. Used to serialize
	callbacks. 
 */

	/* InterpreterPrimitives>>#signalNoResume: */
sqInt
signalNoResume(sqInt aSemaphore)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt empty;

	assert(!(isForwarded(aSemaphore)));
	empty = (longAt((aSemaphore + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))))) == GIV(nilObj);
	if (!empty) {
		putToSleepyieldingIf(removeFirstLinkOfList(aSemaphore), 1);
	}
	return empty;
}


/*	Answer a signed value of an integer up to the size of a machine word.
	The object may be either a positive SmallInteger or a LargeInteger of size
	<= word size.
 */

	/* InterpreterPrimitives>>#signedMachineIntegerValueOf: */
sqIntptr_t
signedMachineIntegerValueOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bs;
    sqInt ccIndex;
    sqInt ccIndex1;
    sqInt fmt;
    usqIntptr_t limit;
    usqIntptr_t magnitude;
    sqInt negative;
    usqInt numBytes;
    usqInt numSlots;
    sqInt ok;
    sqInt value;

	if ((((oop) & 7) == 1)) {
		return (oop >> 3);
	}
	if (oop & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop)));
	/* begin classIndexOf: */
	ccIndex1 = (longAt(oop)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex1;
	goto l4;
	l4:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (ok) {
		negative = 0;
	}
	else {
		negative = 1;
		/* begin isClassOfNonImm:equalTo:compactClassIndex: */
		assert(!(isImmediate(oop)));
		/* begin classIndexOf: */
		ccIndex = (longAt(oop)) & (classIndexMask());
		ok = ClassLargeNegativeIntegerCompactIndex == ccIndex;
		goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
		if (!ok) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return null;
		}
	}
	/* begin numBytesOf: */
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOf: */
	assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(oop + 7);
	numBytes = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	numBytes = numBytes << (shiftForWord());
	if (fmt >= (firstByteFormat())) {

		/* bytes (the common case), including CompiledMethod */
		bs = numBytes - (fmt & 7);
		goto l6;
	}
	if (fmt <= (sixtyFourBitIndexableFormat())) {
		bs = numBytes;
		goto l6;
	}
	if (fmt >= (firstShortFormat())) {
		bs = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1)));
		goto l6;
	}
	bs = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2)));
	l6:	/* end numBytesOf: */;
	if (bs > (sizeof(usqIntptr_t))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	if (((sizeof(sqIntptr_t)) == 8)
	 && (bs > 4)) {
		magnitude = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((oop + BaseHeaderSize) + (0U << 3))));
	}
	else {

		/* ] */
		magnitude = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((oop + BaseHeaderSize) + (0U << 2))))));
	}
	limit = (((usqIntptr_t)1)) << (((sizeof(sqIntptr_t)) * 8) - 1);
	if ((negative
		? magnitude > limit
		: magnitude >= limit)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	if (negative) {
		value = 0 - magnitude;
	}
	else {
		value = magnitude;
	}
	return value;
}


/*	Answer the start of the Alien's data or fail if oop is not an Alien. */

	/* InterpreterPrimitives>>#sizeOfAlienData: */
usqInt
sizeOfAlienData(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt size;

	if (!(isKindOfClass(oop, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord())))))))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return 0;
	}
	size = longAt(oop + BaseHeaderSize);
	return SQABS(size);
}


/*	Answer the start of the Alien's data or fail if oop is not an Alien. */

	/* InterpreterPrimitives>>#startOfAlienData: */
void *
startOfAlienData(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!(isKindOfClass(oop, longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord())))))))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return 0;
	}
	return ((void *) (((longAt(oop + BaseHeaderSize)) > 0
	? (oop + BaseHeaderSize) + BytesPerOop
	: longAt((oop + BaseHeaderSize) + BytesPerOop))));
}


/*	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. */

	/* InterpreterPrimitives>>#success: */
sqInt
success(sqInt successBoolean)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!successBoolean) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	return 0;
}

	/* Spur64BitCoMemoryManager>>#ceScheduleScavenge */
void
ceScheduleScavenge(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(GIV(freeStart) >= GIV(scavengeThreshold));
	/* begin scheduleScavenge */
	GIV(needGCFlag) = 1;
	forceInterruptCheck();
}

	/* Spur64BitCoMemoryManager>>#classSmallFloat */
sqInt
classSmallFloat(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fieldIndex;

	/* begin fetchPointer:ofObject: */
	fieldIndex = smallFloatTag();
	return longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
}


/*	Perform an integrity/leak check using the heapMap. Set a bit at each
	object's header. */
/*	Perform an integrity/leak check using the heapMap. Set a bit at each
	object's header.
	Override to set a bit at each Cog method */

	/* Spur64BitCoMemoryManager>>#clearLeakMapAndMapAccessibleObjects */
static void
clearLeakMapAndMapAccessibleObjects(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	clearHeapMap();
	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		heapMapAtWordPut(pointerForOop(objOop1), 1);
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		heapMapAtWordPut(pointerForOop(objOop1), 1);
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			heapMapAtWordPut(pointerForOop(objOop11), 1);
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	addCogMethodsToHeapMap();
}


/*	Ensure there are no forwarded literals in the argument. */

	/* Spur64BitCoMemoryManager>>#ensureNoForwardedLiteralsIn: */
void
ensureNoForwardedLiteralsIn(sqInt aMethodObj)
{
	followForwardedObjectFieldstoDepth(aMethodObj, 0);
}

	/* Spur64BitCoMemoryManager>>#freeStartAddress */
usqInt
freeStartAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(freeStart))));
}

	/* Spur64BitCoMemoryManager>>#getScavengeThreshold */
usqInt
getScavengeThreshold(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(scavengeThreshold);
}


/*	Answer the header of the argument even though
	it may have its header word in a forwarding block
	(which shouldn't happen with Spur). */

	/* Spur64BitCoMemoryManager>>#headerWhileForwardingOf: */
static sqLong NoDbgRegParms
headerWhileForwardingOf(sqInt aCompiledMethodObjOop)
{
	assert(!(isForwarded(aCompiledMethodObjOop)));
	return long64At(aCompiledMethodObjOop);
}


/*	A lenient tester of forwarded class indices for inline cache management in
	the Cogit.
 */

	/* Spur64BitCoMemoryManager>>#isForwardedClassIndex: */
sqInt
isForwardedClassIndex(sqInt maybeClassIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classTablePage;
    sqInt entry;
    sqInt fieldIndex;
    sqInt fieldIndex1;

	if ((((usqInt)maybeClassIndex)) >= (1U << (22 /* classIndexFieldWidth */ - (classTableMajorIndexShift())))) {
		return 0;
	}
	/* begin fetchPointer:ofObject: */
	fieldIndex = ((usqInt) maybeClassIndex) >> (classTableMajorIndexShift());
	classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (classTablePage == GIV(nilObj)) {
		return 0;
	}
	/* begin fetchPointer:ofObject: */
	fieldIndex1 = maybeClassIndex & ((1U << (classTableMajorIndexShift())) - 1);
	entry = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	return ((longAt(entry)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0;
}

	/* Spur64BitCoMemoryManager>>#isImmediateClass: */
sqInt
isImmediateClass(sqInt classObj)
{
	return (instSpecOfClassFormat(((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3))) == 7 /* forwardedFormat */;
}


/*	Answer if obj is young. Require that obj is non-immediate. Override to
	filter-out Cog methods
 */

	/* Spur64BitCoMemoryManager>>#isReallyYoungObject: */
sqInt
isReallyYoungObject(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(isNonImmediate(objOop));
	return (oopisLessThan(objOop, GIV(newSpaceLimit)))
	 && (oopisGreaterThanOrEqualTo(objOop, GIV(newSpaceStart)));
}


/*	Answer the method header of a CompiledMethod object.
	If the method has been cogged then the header is a pointer to
	the CogMethod and the real header will be stored in the CogMethod. */

	/* Spur64BitCoMemoryManager>>#methodHeaderOf: */
sqInt
methodHeaderOf(sqInt methodObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt header;

	assert(isCompiledMethod(methodObj));
	header = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	return ((((header) & 7) == 1)
		? header
		: (assert((((usqInt)header)) < GIV(newSpaceStart)),
			assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod())),
			((((CogMethod *) header))->methodHeader)));
}

	/* Spur64BitCoMemoryManager>>#needGCFlagAddress */
usqInt
needGCFlagAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(needGCFlag))));
}

	/* Spur64BitCoMemoryManager>>#nullHeaderForMachineCodeMethod */
sqLong
nullHeaderForMachineCodeMethod(void)
{
	return ((((sqInt)((usqInt)((firstLongFormat())) << (formatShift())))) + (1ULL << (markedBitFullShift()))) + ClassBitmapCompactIndex;
}


/*	Answer the tag bits for the receiver based on the method's methodClass, if
	any. 
 */

	/* Spur64BitCoMemoryManager>>#receiverTagBitsForMethod: */
sqInt
receiverTagBitsForMethod(sqInt aMethodObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt literal;
    sqInt methodClassOrNil;
    sqInt objOop;
    sqInt objOop1;
    sqInt offset;

	/* begin methodClassOf: */
	offset = (literalCountOfMethodHeader(methodHeaderOf(aMethodObj))) - 1;
	/* begin followField:ofObject: */
	objOop1 = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
	if (((objOop1 & (tagMask())) == 0)
	 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop1 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, aMethodObj, objOop1);
	}
	literal = objOop1;
	if ((literal != GIV(nilObj))
	 && (((literal & (tagMask())) == 0)
	 && (((((usqInt) (longAt(literal))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))) {
		assert((numSlotsOf(literal)) > ValueIndex);
		/* begin followField:ofObject: */
		objOop = longAt((literal + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
		if (((objOop & (tagMask())) == 0)
		 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop);
		}
		methodClassOrNil = objOop;
	}
	else {
		/* begin nilObject */
		methodClassOrNil = GIV(nilObj);
	}
	if ((methodClassOrNil == GIV(nilObj))
	 || ((instSpecOfClassFormat(((longAt((methodClassOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3))) != 7 /* forwardedFormat */)) {
		return 0;
	}
	if (methodClassOrNil == (fetchPointerofObject(smallIntegerTag(), GIV(classTableFirstPage)))) {
		return smallIntegerTag();
	}
	if (methodClassOrNil == (fetchPointerofObject(characterTag(), GIV(classTableFirstPage)))) {
		return characterTag();
	}
	assert(methodClassOrNil == (fetchPointerofObject(smallFloatTag(), GIV(classTableFirstPage))));
	return smallFloatTag();
}

	/* Spur64BitCoMemoryManager>>#scavengeThresholdAddress */
usqInt
scavengeThresholdAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(scavengeThreshold))));
}

	/* Spur64BitCoMemoryManager>>#specialObjectsArrayAddress */
usqInt
specialObjectsArrayAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((usqInt)((&GIV(specialObjectsOop))));
}


/*	For the purposes of become: send selector to the cogit with obj1, obj2
	and aBool and answer the result. Undo forwarding for the selector. */

	/* Spur64BitCoMemoryManager>>#withoutForwardingOn:and:with:sendToCogit: */
sqInt
withoutForwardingOnandwithsendToCogit(sqInt obj1, sqInt obj2, sqInt aBool, sqInt (*selector)(sqInt,sqInt,sqInt))
{
    sqInt referent;
    sqInt referent1;
    sqInt targetA;
    sqInt targetB;

	/* begin followForwarded: */
	assert(isUnambiguouslyForwarder(obj1));
	/* begin fetchPointer:ofMaybeForwardedObject: */
	referent = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord())));
	while (((referent & (tagMask())) == 0)
	 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	targetA = referent;
	/* begin followForwarded: */
	assert(isUnambiguouslyForwarder(obj2));
	/* begin fetchPointer:ofMaybeForwardedObject: */
	referent1 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord())));
	while (((referent1 & (tagMask())) == 0)
	 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	targetB = referent1;
	return selector(targetA, targetB, aBool);
}


/*	Answer the address immediately following an object. */

	/* Spur64BitMemoryManager>>#addressAfter: */
static usqInt NoDbgRegParms
addressAfter(sqInt objOop)
{
    usqInt numSlots;

	numSlots = byteAt(objOop + 7);
	if (numSlots == 0) {
		return (objOop + 8 /* allocationUnit */) + BaseHeaderSize;
	}
	if (numSlots == (numSlotsMask())) {
		numSlots = ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8;
	}
	return (objOop + BaseHeaderSize) + (((usqInt) numSlots << 3));
}


/*	Answer the oop of a chunk of space in oldSpace with numSlots slots. Try
	and allocate in a segment that already includes pinned objects. The header
	of the
	result will have been filled-in but not the contents. */

	/* Spur64BitMemoryManager>>#allocateSlotsForPinningInOldSpace:bytes:format:classIndex: */
static sqInt NoDbgRegParms
allocateSlotsForPinningInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt formatField, sqInt classIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt acceptedChunk;
    sqInt acceptedNode;
    sqInt child;
    usqInt childBytes;
    sqInt chunk;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt fieldIndex2;
    usqInt index;
    usqInt initialIndex;
    sqInt next;
    sqInt next1;
    sqInt next2;
    sqInt next3;
    sqInt nextFreeChunk;
    sqInt nextFreeChunk1;
    sqInt node;
    sqInt prev;

	/* begin allocateOldSpaceChunkOfBytes:suchThat: */

	/* be optimistic (& don't wait for the write) */
	GIV(totalFreeOldSpace) -= totalBytes;
	initialIndex = totalBytes / 8 /* allocationUnit */;
	if ((initialIndex < 64 /* numFreeLists */)
	 && ((1ULL << initialIndex) <= GIV(freeListsMask))) {
		if (GIV(freeListsMask) & (1ULL << initialIndex)) {
			if (((node = GIV(freeLists)[initialIndex])) == 0) {
				GIV(freeListsMask) -= 1ULL << initialIndex;
			}
			else {
				prev = 0;
				while (node != 0) {
					assert(node == (startOfObject(node)));
					/* begin assertValidFreeObject: */
					assert(assertInnerValidFreeObject(node));
					/* begin fetchPointer:ofFreeChunk: */
					next = longAt((node + BaseHeaderSize) + (0U << (shiftForWord())));
					if (((segmentContainingObj(node))->containsPinned)) {
						if (prev == 0) {
							/* begin unlinkFreeChunk:atIndex:isLilliputianSize: */
							assert(((bytesInObject(node)) == (initialIndex * (allocationUnit())))
							 && ((initialIndex > 1)
							 && ((startOfObject(node)) == node)));
							GIV(freeLists)[initialIndex] = ((next1 = longAt((node + BaseHeaderSize) + (0U << (shiftForWord())))));
							if ((!((assert(totalBytes >= (BaseHeaderSize + (allocationUnit()))),
							totalBytes == (BaseHeaderSize + 8 /* allocationUnit */))))
							 && (next1 != 0)) {
								/* begin storePointer:ofFreeChunk:withValue: */
								fieldIndex = 1 /* freeChunkPrevIndex */;
								assert(isFreeObject(next1));
								assert(1);
								longAtput((next1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), 0);
							}
						}
						else {
							/* begin setNextFreeChunkOf:withValue:chunkBytes: */
							assert(isFreeObject(prev));
							assert((next == 0)
							 || (isFreeObject(next)));
							longAtput((prev + BaseHeaderSize) + (0U << (shiftForWord())), next);
							if ((next != 0)
							 && (!((assert(totalBytes >= (BaseHeaderSize + (allocationUnit()))),
							totalBytes == (BaseHeaderSize + 8 /* allocationUnit */))))) {
								/* begin storePointer:ofFreeChunk:withValue: */
								assert(isFreeObject(next));
								assert((prev == 0)
								 || (isFreeObject(prev)));
								longAtput((next + BaseHeaderSize) + (1U << (shiftForWord())), prev);
							}
						}
						chunk = node;
						goto l27;
					}
					prev = node;
					node = next;
				}
			}
		}
		index = initialIndex;
		while ((((index += initialIndex)) < 64 /* numFreeLists */)
		 && ((1ULL << index) <= GIV(freeListsMask))) {
			if (GIV(freeListsMask) & (1ULL << index)) {
				if (((node = GIV(freeLists)[index])) == 0) {
					GIV(freeListsMask) -= 1ULL << index;
				}
				else {
					prev = 0;
					while (node != 0) {
						assert(node == (startOfObject(node)));
						/* begin assertValidFreeObject: */
						assert(assertInnerValidFreeObject(node));
						/* begin fetchPointer:ofFreeChunk: */
						next = longAt((node + BaseHeaderSize) + (0U << (shiftForWord())));
						if (((segmentContainingObj(node))->containsPinned)) {
							if (prev == 0) {
								/* begin unlinkFreeChunk:atIndex:isLilliputianSize: */
								assert(((bytesInObject(node)) == (index * (allocationUnit())))
								 && ((index > 1)
								 && ((startOfObject(node)) == node)));
								GIV(freeLists)[index] = ((next2 = longAt((node + BaseHeaderSize) + (0U << (shiftForWord())))));
								if (next2 != 0) {
									/* begin storePointer:ofFreeChunk:withValue: */
									fieldIndex1 = 1 /* freeChunkPrevIndex */;
									assert(isFreeObject(next2));
									assert(1);
									longAtput((next2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), 0);
								}
							}
							else {
								/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
								assert(isFreeObject(prev));
								assert((next == 0)
								 || (isFreeObject(next)));
								longAtput((prev + BaseHeaderSize) + (0U << (shiftForWord())), next);
								if ((next != 0)
								 && (!0)) {
									/* begin storePointer:ofFreeChunk:withValue: */
									assert(isFreeObject(next));
									assert((prev == 0)
									 || (isFreeObject(prev)));
									longAtput((next + BaseHeaderSize) + (1U << (shiftForWord())), prev);
								}
							}
							freeChunkWithBytesat((index * 8 /* allocationUnit */) - totalBytes, (((byteAt(node + 7)) == (numSlotsMask())
	? node - BaseHeaderSize
	: node)) + totalBytes);
							chunk = node;
							goto l27;
						}
						prev = node;
						node = next;
					}
				}
			}
		}
		index = initialIndex + 1;
		while ((((index += 1)) < 64 /* numFreeLists */)
		 && ((1ULL << index) <= GIV(freeListsMask))) {
			if (GIV(freeListsMask) & (1ULL << index)) {
				if (((node = GIV(freeLists)[index])) == 0) {
					GIV(freeListsMask) -= 1ULL << index;
				}
				else {
					prev = 0;
					while (node != 0) {
						assert(node == (startOfObject(node)));
						/* begin assertValidFreeObject: */
						assert(assertInnerValidFreeObject(node));
						/* begin fetchPointer:ofFreeChunk: */
						next = longAt((node + BaseHeaderSize) + (0U << (shiftForWord())));
						if (((segmentContainingObj(node))->containsPinned)) {
							if (prev == 0) {
								/* begin unlinkFreeChunk:atIndex:isLilliputianSize: */
								assert(((bytesInObject(node)) == (index * (allocationUnit())))
								 && ((index > 1)
								 && ((startOfObject(node)) == node)));
								GIV(freeLists)[index] = ((next3 = longAt((node + BaseHeaderSize) + (0U << (shiftForWord())))));
								if (next3 != 0) {
									/* begin storePointer:ofFreeChunk:withValue: */
									fieldIndex2 = 1 /* freeChunkPrevIndex */;
									assert(isFreeObject(next3));
									assert(1);
									longAtput((next3 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), 0);
								}
							}
							else {
								/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
								assert(isFreeObject(prev));
								assert((next == 0)
								 || (isFreeObject(next)));
								longAtput((prev + BaseHeaderSize) + (0U << (shiftForWord())), next);
								if ((next != 0)
								 && (!0)) {
									/* begin storePointer:ofFreeChunk:withValue: */
									assert(isFreeObject(next));
									assert((prev == 0)
									 || (isFreeObject(prev)));
									longAtput((next + BaseHeaderSize) + (1U << (shiftForWord())), prev);
								}
							}
							freeChunkWithBytesat((index * 8 /* allocationUnit */) - totalBytes, (((byteAt(node + 7)) == (numSlotsMask())
	? node - BaseHeaderSize
	: node)) + totalBytes);
							chunk = node;
							goto l27;
						}
						prev = node;
						node = next;
					}
				}
			}
		}
	}
	child = GIV(freeLists)[0];
	node = (acceptedChunk = (acceptedNode = 0));
	while (child != 0) {
		/* begin assertValidFreeObject: */
		assert(assertInnerValidFreeObject(child));
		childBytes = bytesInObject(child);
		if (childBytes == totalBytes) {

			/* size match; try to remove from list at node. */
			node = child;
			while (1) {
				prev = node;
				/* begin fetchPointer:ofFreeChunk: */
				node = longAt((node + BaseHeaderSize) + (0U << (shiftForWord())));
				if (!(node != 0)) break;
				if (((segmentContainingObj(node))->containsPinned)) {
					/* begin assertValidFreeObject: */
					assert(assertInnerValidFreeObject(node));
					/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
					nextFreeChunk = longAt((node + BaseHeaderSize) + (0U << (shiftForWord())));
					/* begin storePointer:ofFreeChunk:withValue: */
					assert(isFreeObject(prev));
					assert((nextFreeChunk == 0)
					 || (isFreeObject(nextFreeChunk)));
					longAtput((prev + BaseHeaderSize) + (0U << (shiftForWord())), nextFreeChunk);
					if ((nextFreeChunk != 0)
					 && (!0)) {
						/* begin storePointer:ofFreeChunk:withValue: */
						assert(isFreeObject(nextFreeChunk));
						assert((prev == 0)
						 || (isFreeObject(prev)));
						longAtput((nextFreeChunk + BaseHeaderSize) + (1U << (shiftForWord())), prev);
					}
					chunk = ((byteAt(node + 7)) == (numSlotsMask())
						? node - BaseHeaderSize
						: node);
					goto l27;
				}
			}
			if (((segmentContainingObj(child))->containsPinned)) {
				/* begin fetchPointer:ofFreeChunk: */
				next = longAt((child + BaseHeaderSize) + (0U << (shiftForWord())));
				if (next == 0) {

					/* no list; remove the interior node */
					unlinkSolitaryFreeTreeNode(child);
				}
				else {

					/* list; replace node with it */
					inFreeTreeReplacewith(child, next);
				}
				chunk = ((byteAt(child + 7)) == (numSlotsMask())
					? child - BaseHeaderSize
					: child);
				goto l27;
			}
		}
		if (child != 0) {

			/* Note that because the minimum free size is 16 bytes (2 * allocationUnit), to
			   leave room for the forwarding pointer/next free link, we can only break chunks
			   that are at least 16 bytes larger, hence reject chunks < 2 * allocationUnit larger. */
			if (childBytes <= (totalBytes + 8 /* allocationUnit */)) {

				/* node too small; walk down the larger size of the tree */
				/* begin fetchPointer:ofFreeChunk: */
				child = longAt((child + BaseHeaderSize) + (4U << (shiftForWord())));
			}
			else {
				flag("we can do better here; preferentially choosing the lowest node. That would be a form of best-fit since we are trying to compact down");
				node = child;
				/* begin fetchPointer:ofFreeChunk: */
				child = longAt((node + BaseHeaderSize) + (3U << (shiftForWord())));
				if (acceptedNode == 0) {

					/* first search the list. */
					acceptedChunk = node;
					do {
						/* begin fetchPointer:ofFreeChunk: */
						acceptedChunk = longAt((acceptedChunk + BaseHeaderSize) + (0U << (shiftForWord())));
						if ((acceptedChunk != 0)
						 && (((segmentContainingObj(acceptedChunk))->containsPinned))) {
							acceptedNode = node;
						}
					} while((acceptedChunk != 0)
						 && (acceptedNode == 0));
					if ((acceptedNode == 0)
					 && (((segmentContainingObj(node))->containsPinned))) {
						acceptedNode = node;

						/* break out of loop now we have an acceptedNode */
						child = 0;
					}
				}
			}
		}
	}
	if (acceptedNode != 0) {
		if (acceptedChunk != 0) {
			assert((bytesInObject(acceptedChunk)) >= (totalBytes + (allocationUnit())));
			while (1) {
				/* begin fetchPointer:ofFreeChunk: */
				next = longAt((acceptedNode + BaseHeaderSize) + (0U << (shiftForWord())));
				if (!(next != acceptedChunk)) break;
				acceptedNode = next;
			}
			/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
			nextFreeChunk1 = longAt((acceptedChunk + BaseHeaderSize) + (0U << (shiftForWord())));
			/* begin storePointer:ofFreeChunk:withValue: */
			assert(isFreeObject(acceptedNode));
			assert((nextFreeChunk1 == 0)
			 || (isFreeObject(nextFreeChunk1)));
			longAtput((acceptedNode + BaseHeaderSize) + (0U << (shiftForWord())), nextFreeChunk1);
			if ((nextFreeChunk1 != 0)
			 && (!0)) {
				/* begin storePointer:ofFreeChunk:withValue: */
				assert(isFreeObject(nextFreeChunk1));
				assert((acceptedNode == 0)
				 || (isFreeObject(acceptedNode)));
				longAtput((nextFreeChunk1 + BaseHeaderSize) + (1U << (shiftForWord())), acceptedNode);
			}
			freeChunkWithBytesat((bytesInObject(acceptedChunk)) - totalBytes, (((byteAt(acceptedChunk + 7)) == (numSlotsMask())
	? acceptedChunk - BaseHeaderSize
	: acceptedChunk)) + totalBytes);
			chunk = ((byteAt(acceptedChunk + 7)) == (numSlotsMask())
				? acceptedChunk - BaseHeaderSize
				: acceptedChunk);
			goto l27;
		}
		/* begin fetchPointer:ofFreeChunk: */
		next = longAt((acceptedNode + BaseHeaderSize) + (0U << (shiftForWord())));
		if (next == 0) {

			/* no list; remove the interior node */
			unlinkSolitaryFreeTreeNode(acceptedNode);
		}
		else {

			/* list; replace node with it */
			inFreeTreeReplacewith(acceptedNode, next);
		}
		assert((bytesInObject(acceptedNode)) >= (totalBytes + (allocationUnit())));
		freeChunkWithBytesat((bytesInObject(acceptedNode)) - totalBytes, (((byteAt(acceptedNode + 7)) == (numSlotsMask())
	? acceptedNode - BaseHeaderSize
	: acceptedNode)) + totalBytes);
		chunk = ((byteAt(acceptedNode + 7)) == (numSlotsMask())
			? acceptedNode - BaseHeaderSize
			: acceptedNode);
		goto l27;
	}

	/* optimism was unfounded */
	GIV(totalFreeOldSpace) += totalBytes;
	chunk = null;
	l27:	/* end allocateOldSpaceChunkOfBytes:suchThat: */;
	if (!(chunk)) {
		chunk = allocateOldSpaceChunkOfBytes(totalBytes);
		if (!(chunk)) {
			return null;
		}
		((segmentContainingObj(chunk))->containsPinned = 1);
	}
	if (numSlots >= (numSlotsMask())) {

		/* for header parsing we put a saturated slot count in the prepended overflow size word */
		longAtput(chunk, numSlots + (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))));
		longAtput(chunk + BaseHeaderSize, (headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex)) | (1U << (pinnedBitShift())));
		/* begin checkFreeSpace: */
		assert(bitsSetInFreeSpaceMaskForAllFreeLists());
		assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
		if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) {
			runLeakCheckerForFreeSpace(GCModeFreeSpace);
		}
		return chunk + BaseHeaderSize;
	}
	longAtput(chunk, ((((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex) | (1U << (pinnedBitShift())));
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	return chunk;
}


/*	Answer the oop of a chunk of space in oldSpace with numSlots slots. The
	header will have been filled-in but not the contents. If no memory is
	available answer nil. */

	/* Spur64BitMemoryManager>>#allocateSlotsInOldSpace:bytes:format:classIndex: */
static sqInt NoDbgRegParms
allocateSlotsInOldSpacebytesformatclassIndex(sqInt numSlots, usqInt totalBytes, sqInt formatField, sqInt classIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt chunk;

	chunk = allocateOldSpaceChunkOfBytes(totalBytes);
	if (!(chunk)) {
		return null;
	}
	if (numSlots >= (numSlotsMask())) {

		/* for header parsing we put a saturated slot count in the prepended overflow size word */
		longAtput(chunk, numSlots + (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))));
		longAtput(chunk + BaseHeaderSize, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex));
		/* begin checkFreeSpace: */
		assert(bitsSetInFreeSpaceMaskForAllFreeLists());
		assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
		if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) {
			runLeakCheckerForFreeSpace(GCModeFreeSpace);
		}
		return chunk + BaseHeaderSize;
	}
	longAtput(chunk, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex);
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	return chunk;
}


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

	/* Spur64BitMemoryManager>>#byteSwapped: */
sqInt
byteSwapped(sqInt w)
{
	return SQ_SWAP_8_BYTES(w);
}


/*	Answer the total number of bytes in an object including header and
	possible overflow size header.
 */

	/* Spur64BitMemoryManager>>#bytesInObject: */
static usqInt NoDbgRegParms
bytesInObject(sqInt objOop)
{
    usqLong header;
    usqLong headerNumSlots;
    usqLong numSlots;

	flag("endianness");
	header = longAt(objOop);
	headerNumSlots = header >> (numSlotsFullShift());
	if (headerNumSlots == (numSlotsMask())) {
		numSlots = ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8;
	}
	else {
		numSlots = (headerNumSlots == 0
			? 1
			: headerNumSlots);
	}
	return (numSlots << (shiftForWord())) + ((headerNumSlots == (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize));
}


/*	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 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. */

	/* Spur64BitMemoryManager>>#changeClassOf:to: */
static sqInt NoDbgRegParms
changeClassOfto(sqInt rcvr, sqInt argClass)
{
    sqInt classFormat;
    sqInt classIndex;
    sqInt err;
    sqInt fixedFields;
    sqInt fmt;
    sqInt hash;
    sqInt instBytes;
    sqInt instFormat;
    usqInt instSlots;
    sqInt newFormat;
    usqInt numBytes;
    usqInt numSlots;

	instBytes = 0;
	instSlots = 0;
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		return PrimErrNoModification;
	}
	classFormat = ((longAt((argClass + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	classFormat = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask());

	/* Fail for inability to access classIndex before making contexts snapshot-safe. */
	instFormat = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
	if (((assert(addressCouldBeClassObj(argClass)),
	(classIndex = (((hash = (long32At(argClass + 4)) & (identityHashHalfWordMask()))) != 0
			? hash
			: (objCouldBeClassObj(argClass)
					? (((err = enterIntoClassTable(argClass))) != 0
							? -err
							: (/* begin rawHashBitsOf: */
								(long32At(argClass + 4)) & (identityHashHalfWordMask())))
					: -PrimErrBadReceiver))))) < 0) {
		return -classIndex;
	}
	if (classFormat <= 5 /* lastPointerFormat */) {
		if (instFormat > 5 /* lastPointerFormat */) {
			return PrimErrInappropriate;
		}
		if ((((instSlots = numSlotsOf(rcvr))) < fixedFields)
		 || ((instSlots > fixedFields)
		 && ((classFormat <= 1 /* nonIndexablePointerFormat */)
		 || (classFormat == 5 /* ephemeronFormat */)))) {
			return PrimErrBadReceiver;
		}
		if ((instFormat == (indexablePointersFormat()))
		 && (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
			makeContextSnapshotSafe(rcvr);
		}
		newFormat = classFormat;
	}
	else {

		/* Fail if the class's format is somehow invalid. */
		if (classFormat != (classFormatForInstanceFormat(classFormat))) {
			return PrimErrBadArgument;
		}
		/* begin numBytesOf: */
		fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
		/* begin numSlotsOf: */
		assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(rcvr + 7);
		numBytes = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
		numBytes = numBytes << (shiftForWord());
		if (fmt >= (firstByteFormat())) {

			/* bytes (the common case), including CompiledMethod */
			instBytes = numBytes - (fmt & 7);
			goto l4;
		}
		if (fmt <= (sixtyFourBitIndexableFormat())) {
			instBytes = numBytes;
			goto l4;
		}
		if (fmt >= (firstShortFormat())) {
			instBytes = numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1)));
			goto l4;
		}
		instBytes = numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2)));
	l4:	/* end numBytesOf: */;
		
		switch (classFormat) {
		case sixtyFourBitIndexableFormat():
			if (instBytes & 7) {
				return PrimErrBadReceiver;
			}
			newFormat = classFormat;
			break;
		case firstLongFormat():
			if (instBytes & 3) {
				return PrimErrBadReceiver;
			}
			newFormat = classFormat + ((2 - (((usqInt) instBytes) >> 2)) & 1);
			break;
		case firstShortFormat():
			if (instBytes & 1) {
				return PrimErrBadReceiver;
			}
			newFormat = classFormat + ((4 - (((usqInt) instBytes) >> 1)) & 3);
			break;
		case firstByteFormat():
			newFormat = classFormat + ((8 - instBytes) & 7);
			break;
		case firstCompiledMethodFormat():
			if (classFormat != (firstCompiledMethodFormat())) {
				return PrimErrInappropriate;
			}
			newFormat = instFormat;
			break;
		default:
			
			/* bits instances cannot be adopted by pointer-like classes... */
			return PrimErrInappropriate;

		}
	}
	/* begin set:classIndexTo:formatTo: */
	assert(((classIndex >= 0) && (classIndex <= (classIndexMask()))));
	assert(((newFormat >= 0) && (newFormat <= (formatMask()))));
	longAtput(rcvr, ((longAt(rcvr)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (((sqInt)((usqInt)(newFormat) << (formatShift()))))));
	assert((numBytesOf(rcvr)) == ((classFormat <= (lastPointerFormat())
		? instSlots * BytesPerOop
		: instBytes)));
	return 0;
}


/*	Answer the C double precision floating point value of the argument,
	or if it is not, answer 0. */

	/* Spur64BitMemoryManager>>#dbgFloatValueOf: */
static double NoDbgRegParms
dbgFloatValueOf(sqInt oop)
{
    usqLong bits;
    double result;
    usqLong rot;
    sqInt tagBits;
    double value;

	if (((tagBits = oop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(oop));
			rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			return value;
		}
	}
	else {
		if (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(oop + BaseHeaderSize, result);
			return result;
		}
	}
	return 0.0;
}


/*	Answer the default amount of memory to allocate for the eden space.
	The actual value can be set via vmParameterAt: and/or a preference in the
	ini file.
	The shootout tests seem to plateau at 5 or 6Mb.
	
	Originally, both the 32-bit and 64-bit versions used the same 4Mb default.
	Measuring the simulator on image start-up, the 64-bit system's eden at the
	same point in start-up
	(the first copyBits) is only 8% larger in bytes because it allocates 26%
	fewer objects.
	Some 21% of the objects in the 32-bit version's eden are large integers
	and floats that
	are representable as 64-bit immediates.
	
	But when running benchmarks such as the computer language shootout's
	binary trees,
	using the same amount of memory for the 64-bit system causes a significant
	slow-down and a lot of compactions. So we now use 4Mb for 32-bits and 7Mb
	for 64-bits. */

	/* Spur64BitMemoryManager>>#defaultEdenBytes */
static sqInt
defaultEdenBytes(void)
{
	return (7 * 1024) * 1024;
}

	/* Spur64BitMemoryManager>>#fetchClassTagOf: */
sqInt
fetchClassTagOf(sqInt oop)
{
    sqInt tagBits;

	return (((tagBits = oop & (tagMask()))) != 0
		? tagBits
		: (longAt(oop)) & (classIndexMask()));
}


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

	/* Spur64BitMemoryManager>>#fetchLong32:ofFloatObject: */
static sqInt NoDbgRegParms
fetchLong32ofFloatObject(sqInt fieldIndex, sqInt oop)
{
    usqLong bits;
    usqLong rot;

	if (!(oop & (smallFloatTag()))) {
		return long32At((oop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))));
	}
	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	return (((int *) ((&bits))))[fieldIndex];
}

	/* Spur64BitMemoryManager>>#floatObjectOf: */
sqInt
floatObjectOf(double aFloat)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt newFloatObj;
    usqInt newObj;
    usqInt numBytes;
    sqInt numSlots;
    sqInt objFormat;
    usqLong rawFloat;
    usqLong rot;

	rawFloat = 0;
	if (isSmallFloatValue(aFloat)) {
		/* begin smallFloatObjectOf: */
		assert(isSmallFloatValue(aFloat));
		memcpy((&rawFloat), (&aFloat), sizeof(rawFloat));
		/* begin rotateLeft: */
		rot = ((rawFloat >> 0x3F) & 1) + (rawFloat << 1);
		if (rot > 1) {

			/* a.k.a. ~= +/-0.0 */
			rot -= ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			assert(rot > 0);
		}
		return (rot << (numTagBits())) + (smallFloatTag());
	}
	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
	objFormat = firstLongFormat();
	numSlots = (sizeof(double)) / BytesPerOop;
	assert((numSlots >= 0)
	 && ((knownClassAtIndex(ClassFloatCompactIndex)) != GIV(nilObj)));
	assert(((objFormat < (firstByteFormat())
		? objFormat
		: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(ClassFloatCompactIndex))));
	/* begin allocateSmallNewSpaceSlots:format:classIndex: */
	assert(numSlots < (numSlotsMask()));
	newObj = GIV(freeStart);
	numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
			error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
			newFloatObj = 0;
			goto l2;
		}
	}
	long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + ClassFloatCompactIndex);
	GIV(freeStart) += numBytes;
	newFloatObj = newObj;
	l2:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
	storeFloatAtfrom(newFloatObj + BaseHeaderSize, aFloat);
	return newFloatObj;
}


/*	Answer the C double precision floating point value of the argument,
	or fail if it is not a Float, and answer 0.
	Note: May be called by translated primitive code. */

	/* Spur64BitMemoryManager>>#floatValueOf: */
double
floatValueOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong bits;
    double result;
    usqLong rot;
    sqInt tagBits;
    double value;

	if (((tagBits = oop & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(oop));
			rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			return value;
		}
	}
	else {
		if (((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(oop + BaseHeaderSize, result);
			return result;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	return 0.0;
}


/*	A negative header selects the alternate bytecode set. */

	/* Spur64BitMemoryManager>>#headerIndicatesAlternateBytecodeSet: */
sqInt
headerIndicatesAlternateBytecodeSet(sqInt methodHeader)
{
	return (((sqLong) methodHeader)) < 0;
}


/*	must have room for a header (single or double) plus the next free pointer */

	/* Spur64BitMemoryManager>>#initFreeChunkWithBytes:at: */
static sqInt NoDbgRegParms
initFreeChunkWithBytesat(usqLong numBytes, sqInt address)
{
    sqLong numSlots;

	assert(((numBytes % (allocationUnit())) == 0)
	 && (numBytes >= (BaseHeaderSize + BytesPerOop)));
	if (numBytes >= ((((sqInt)((usqInt)((numSlotsMask())) << (shiftForWord())))) + BaseHeaderSize)) {
		numSlots = ((usqInt) ((numBytes - BaseHeaderSize) - BaseHeaderSize)) >> (shiftForWord());
		longAtput(address, (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots);
		longAtput(address + 8, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift()))));
		return address + 8;
	}
	numSlots = ((usqInt) (numBytes - BaseHeaderSize)) >> (shiftForWord());
	assert(numSlots < (numSlotsMask()));
	longAtput(address, ((sqLong)((usqLong)(numSlots) << (numSlotsFullShift()))));
	return address;
}


/*	must have room for a double header */

	/* Spur64BitMemoryManager>>#initSegmentBridgeWithBytes:at: */
static void NoDbgRegParms
initSegmentBridgeWithBytesat(usqLong numBytes, sqInt address)
{
    sqLong numSlots;

	assert(((numBytes % (allocationUnit())) == 0)
	 && (numBytes >= (BaseHeaderSize + BaseHeaderSize)));
	numSlots = ((usqInt) ((numBytes - BaseHeaderSize) - BaseHeaderSize)) >> (shiftForWord());
	if (numSlots == 0) {

		/* short bridge for adjacent segments */
		longAtput(address, (((1U << (pinnedBitShift())) + (1ULL << (markedBitFullShift()))) + (((sqInt)((usqInt)((sixtyFourBitIndexableFormat())) << (formatShift()))))) + (segmentBridgePun()));
	}
	else {

		/* long bridge */
		longAtput(address, (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots);
		longAtput(address + BaseHeaderSize, ((((((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + (1U << (pinnedBitShift()))) + (1ULL << (markedBitFullShift()))) + (((sqInt)((usqInt)((sixtyFourBitIndexableFormat())) << (formatShift()))))) + (segmentBridgePun()));
	}
}


/*	Allocate an instance of a variable class, excepting CompiledMethod. */

	/* Spur64BitMemoryManager>>#instantiateClass:indexableSize: */
sqInt
instantiateClassindexableSize(sqInt classObj, usqInt nElements)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classFormat;
    sqInt classIndex;
    sqInt err;
    sqInt fillValue;
    sqInt hash;
    sqInt instSpec;
    sqInt newObj;
    usqInt newObj1;
    usqInt numBytes;
    usqInt numSlots;
    usqInt p;

	classFormat = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask());
	classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
	fillValue = 0;
	
	switch (instSpec) {
	case 2 /* arrayFormat */:
		numSlots = nElements;
		fillValue = GIV(nilObj);
		break;
	case indexablePointersFormat():
	case weakArrayFormat():
		numSlots = (classFormat & ((1U << (fixedFieldsFieldWidth())) - 1)) + nElements;
		fillValue = GIV(nilObj);
		break;
	case sixtyFourBitIndexableFormat():
		numSlots = nElements;
		break;
	case firstLongFormat():
		if ((classIndex == ClassFloatCompactIndex)
		 && (nElements != 2)) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadReceiver;
			return null;
		}
		numSlots = (nElements + 1) / 2;
		instSpec += nElements & 1;
		break;
	case firstShortFormat():
		numSlots = (nElements + 3) / 4;
		instSpec += (4 - nElements) & 3;
		break;
	case firstByteFormat():
		numSlots = (nElements + 7) / 8;
		instSpec += (8 - nElements) & 7;
		break;
	default:
		
		/* non-indexable */
		/* Some Squeak images include funky fixed subclasses of abstract variable
		   superclasses. e.g. DirectoryEntry as a subclass of ArrayedCollection.
		   The (Threaded)FFIPlugin expects to be able to instantiate ExternalData via
		   this method.
		   Hence allow fixed classes to be instantiated here iff nElements = 0. */
		if ((nElements != 0)
		 || (instSpec > 5 /* lastPointerFormat */)) {
			return null;
		}
		numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
		fillValue = GIV(nilObj);

	}
	if (classIndex == 0) {
		assert(addressCouldBeClassObj(classObj));
		classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0
			? hash
			: (objCouldBeClassObj(classObj)
					? (((err = enterIntoClassTable(classObj))) != 0
							? -err
							: (/* begin rawHashBitsOf: */
								(long32At(classObj + 4)) & (identityHashHalfWordMask())))
					: -PrimErrBadReceiver));
		if (classIndex < 0) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = -classIndex;
			return null;
		}
	}
	if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) {
		if (numSlots > (0x10000000000LL)) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrUnsupported;
			return null;
		}
		newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0
			? 8 /* allocationUnit */ + BaseHeaderSize
			: (numSlots << (shiftForWord())) + ((numSlots >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))), instSpec, classIndex);
	}
	else {
		/* begin allocateSlots:format:classIndex: */
		if (numSlots >= (numSlotsMask())) {
			if ((((usqInt) numSlots) >> 56) > 0) {
				newObj = null;
				goto l6;
			}
			newObj1 = GIV(freeStart) + BaseHeaderSize;
			numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop);
		}
		else {
			newObj1 = GIV(freeStart);
			numBytes = BaseHeaderSize + ((numSlots < 1
	? /* begin allocationUnit */ 8
	: numSlots * BytesPerOop));
		}
		if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
			if (!GIV(needGCFlag)) {
				/* begin scheduleScavenge */
				GIV(needGCFlag) = 1;
				forceInterruptCheck();
			}
			newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex);
			goto l6;
		}
		if (numSlots >= (numSlotsMask())) {

			/* for header parsing we put a saturated slot count in the prepended overflow size word */
			flag("endianness");
			longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots);
			longAtput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex));
		}
		else {
			longAtput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex);
		}
		assert((numBytes % (allocationUnit())) == 0);
		assert((newObj1 % (allocationUnit())) == 0);
		GIV(freeStart) += numBytes;
		newObj = newObj1;
	l6:	/* end allocateSlots:format:classIndex: */;
	}
	if (!(newObj == null)) {
		/* begin fillObj:numSlots:with: */
		assert(oopisLessThan(((newObj + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(newObj)));
		for (p = (((usqInt)(newObj + BaseHeaderSize))); p <= (((usqInt)(((newObj + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8 /* allocationUnit */) {
			longAtput(p, fillValue);
		}
	}
	return newObj;
}


/*	Convert the integer value, assumed to be in SmallInteger range, into a
	tagged SmallInteger object.
	In C, use a shift and an add to set the tag bit.
	In Smalltalk we have to work harder because the simulator works with
	strictly positive bit patterns. */

	/* Spur64BitMemoryManager>>#integerObjectOf: */
sqInt
integerObjectOf(sqInt value)
{
	return ((((usqInt)value)) << (numTagBits())) + 1;
}


/*	Translator produces 'oop >> 3' */

	/* Spur64BitMemoryManager>>#integerValueOf: */
sqInt
integerValueOf(sqInt oop)
{
	return ((((usqInt) oop >> 63)) == 1
		? ((((((-(numTagBits())) < 0) ? ((usqInt) oop >> -(-(numTagBits()))) : ((usqInt) oop << (-(numTagBits()))))) & 0x1FFFFFFFFFFFFFFFLL) - 0x1FFFFFFFFFFFFFFFLL) - 1
		: (((-(numTagBits())) < 0) ? ((usqInt) oop >> -(-(numTagBits()))) : ((usqInt) oop << (-(numTagBits())))));
}

	/* Spur64BitMemoryManager>>#isImmediateFloat: */
static sqInt NoDbgRegParms
isImmediateFloat(sqInt oop)
{
	return oop & (smallFloatTag());
}

	/* Spur64BitMemoryManager>>#isIntegerObject: */
sqInt
isIntegerObject(sqInt oop)
{
	return oop & (smallIntegerTag());
}


/*	Answer if the given value can be represented as a Smalltalk integer value.
	In 64-bits we use a 3 bit tag which leaves 61 bits for 2's complement
	signed integers. In C, use a shift add and mask to test if the top 4 bits
	are all the same.
	Since 16rFFFFFFFFFFFFFFFF >> 60 = 16rF the computation intValue >> 60 + 1
	bitAnd: 16rF
	maps in-range -ve values to 0 and in-range +ve values to 1. */

	/* Spur64BitMemoryManager>>#isIntegerValue: */
sqInt
isIntegerValue(sqInt intValue)
{
	return (((((usqInt) intValue) >> 60) + 1) & 15) <= 1;
}


/*	To have a prev pointer, which follows the next pointer, we need at least
	two slots.
 */

	/* Spur64BitMemoryManager>>#isLilliputianSize: */
static sqInt NoDbgRegParms
isLilliputianSize(sqInt chunkBytes)
{
	assert(chunkBytes >= (BaseHeaderSize + (allocationUnit())));
	return chunkBytes == (BaseHeaderSize + 8 /* allocationUnit */);
}

	/* Spur64BitMemoryManager>>#isMarked: */
sqInt
isMarked(sqInt objOop)
{
	return ((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0;
}

	/* Spur64BitMemoryManager>>#isNonIntegerObject: */
static sqInt NoDbgRegParms
isNonIntegerObject(sqInt oop)
{
	return (oop & (smallIntegerTag())) == 0;
}

	/* Spur64BitMemoryManager>>#isSmallFloatValue: */
static sqInt NoDbgRegParms
isSmallFloatValue(double aFloat)
{
    usqLong exponent;
    usqLong rawFloat;

	rawFloat = 0;
	memcpy((&rawFloat), (&aFloat), sizeof(rawFloat));
	exponent = (rawFloat >> (smallFloatMantissaBits())) & 0x7FF;
	return (exponent > (smallFloatExponentOffset())
		? exponent <= (0xFF + (smallFloatExponentOffset()))
		: ((rawFloat & ((1ULL << (smallFloatMantissaBits())) - 1)) == 0
				? exponent == 0
				: exponent == (smallFloatExponentOffset())));
}


/*	Answer the number of indexable units in the given object.
	For a CompiledMethod, the size of the method header (in bytes)
	should be subtracted from the result of this method. */

	/* Spur64BitMemoryManager>>#lengthOf:format: */
static sqInt NoDbgRegParms
lengthOfformat(sqInt objOop, sqInt fmt)
{
    usqInt numSlots;
    usqInt numSlots1;

	/* begin numSlotsOfAny: */
	numSlots1 = byteAt(objOop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		return numSlots;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		return (numSlots << (shiftForWord())) - (fmt & 7);
	}
	if (fmt >= (firstShortFormat())) {
		return (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
	}
	if (fmt >= (firstLongFormat())) {
		return (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		return numSlots;
	}
	return 0;
}


/*	Answer the maximum number of slots we are willing to attempt to allocate
	in an object.
	Must fit in 56-bits; c.f. bytesInObject: */

	/* Spur64BitMemoryManager>>#maxSlotsForAlloc */
static sqInt
maxSlotsForAlloc(void)
{
	return 0x10000000000LL;
}


/*	Answer the number of free lists. We use freeListsMask, a bitmap, to avoid
	reading empty list heads. This should fit in a machine word to end up in a
	register during free chunk allocation. */

	/* Spur64BitMemoryManager>>#numFreeLists */
static sqInt
numFreeLists(void)
{
	return 64;
}


/*	Reduce the number of indexable fields in objOop, a pointer object, to
	nSlots. Convert the
	unused residual to a free chunk. Without changes to
	numSlotsForShortening:toIndexableSize: this only works for arrayFormat and
	longFormat objects.
	Answer the number of bytes returned to free memory, which may be zero if
	no change
	was possible. */

	/* Spur64BitMemoryManager>>#shorten:toIndexableSize: */
sqInt
shortentoIndexableSize(sqInt objOop, sqInt indexableSize)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt bytesBefore;
    sqInt classIndex;
    sqInt classIndex1;
    sqInt classIndex2;
    sqInt copy;
    sqInt delta;
    sqInt format;
    sqInt formatField;
    sqInt freeChunk;
    sqInt i;
    usqInt newObj;
    usqInt numBytes;
    sqInt numSlots;

	
	switch ((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask())) {
	case 2 /* arrayFormat */:
		numSlots = indexableSize;

		break;
	case firstLongFormat():
	case (firstLongFormat()) + 1:
		numSlots = ((indexableSize * 4) + (BytesPerWord - 1)) / BytesPerWord;

		break;
	default:
		error("Case not found and no otherwise clause");
		numSlots = -1;
	}
	if (numSlots == (numSlotsOf(objOop))) {
		return 0;
	}
	bytesBefore = bytesInObject(objOop);
	delta = bytesBefore - ((numSlots == 0
	? 8 /* allocationUnit */ + BaseHeaderSize
	: (((sqInt)((usqInt)(numSlots) << (shiftForWord())))) + ((numSlots >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))));
	flag("this should update format for 32-bit indexable words; too lazy today.");
	if (delta == 0) {
		return 0;
	}
	if (delta <= 8 /* allocationUnit */) {
		/* begin allocateSlots:format:classIndex: */
		formatField = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
		classIndex1 = (longAt(objOop)) & (classIndexMask());
		if (numSlots >= (numSlotsMask())) {
			if ((((usqInt) numSlots) >> 56) > 0) {
				copy = null;
				goto l4;
			}
			newObj = GIV(freeStart) + BaseHeaderSize;
			numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop);
		}
		else {
			newObj = GIV(freeStart);
			numBytes = BaseHeaderSize + ((numSlots < 1
	? /* begin allocationUnit */ 8
	: numSlots * BytesPerOop));
		}
		if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
			if (!GIV(needGCFlag)) {
				/* begin scheduleScavenge */
				GIV(needGCFlag) = 1;
				forceInterruptCheck();
			}
			copy = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, classIndex1);
			goto l4;
		}
		if (numSlots >= (numSlotsMask())) {

			/* for header parsing we put a saturated slot count in the prepended overflow size word */
			flag("endianness");
			longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots);
			longAtput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex1));
		}
		else {
			longAtput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex1);
		}
		assert((numBytes % (allocationUnit())) == 0);
		assert((newObj % (allocationUnit())) == 0);
		GIV(freeStart) += numBytes;
		copy = newObj;
	l4:	/* end allocateSlots:format:classIndex: */;
		if (!(copy)) {
			error("shorten:toIndexableSize: attempted to shorten to allocationUnit!");
		}
		for (i = 0; i < numSlots; i += 1) {
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(copy)));
			longAtput((copy + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))));
		}
		if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) {
			remember(copy);
		}
		/* begin forward:to: */
		classIndex2 = isForwardedObjectClassIndexPun();
		assert(((classIndex2 >= 0) && (classIndex2 <= (classIndexMask()))));
		assert(((7 /* forwardedFormat */ >= 0) && (7 /* forwardedFormat */ <= (formatMask()))));
		longAtput(objOop, ((longAt(objOop)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex2 + (7U << (formatShift()))));
		
#    if IMMUTABILITY
		/* begin setIsImmutableOf:to: */
		longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1U << (immutableBitShift()))));
#    endif /* IMMUTABILITY */
		/* begin storePointer:ofForwarder:withValue: */
		assert(isForwarded(objOop));
		assert(!(isOopForwarded(copy)));
		if ((assert(isNonImmediate(objOop)),
		oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((copy & (tagMask())) == 0)
			 && (oopisLessThan(copy, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(objOop);
				}
			}
		}
		longAtput((objOop + BaseHeaderSize) + (0U << (shiftForWord())), copy);
		if ((byteAt(objOop + 7)) == 0) {
			byteAtput(objOop + 7, 1);
		}
		return 0;
	}
	if ((byteAt(objOop + 7)) == (numSlotsMask())) {
		/* begin rawOverflowSlotsOf:put: */
		longAtput(objOop - BaseHeaderSize, (((sqInt)((usqInt)((numSlotsMask())) << 56))) + numSlots);
		if (numSlots < (numSlotsMask())) {
			delta -= 8 /* allocationUnit */;
		}
	}
	else {
		assert(numSlots < (numSlotsMask()));
		byteAtput(objOop + 7, numSlots);
	}
	freeChunk = initFreeChunkWithBytesat(delta, addressAfter(objOop));
	assert((addressAfter(freeChunk)) <= GIV(endOfMemory));
	if (oopisGreaterThanOrEqualToandLessThan(objOop, GIV(oldSpaceStart), GIV(endOfMemory))) {
		GIV(totalFreeOldSpace) += delta;
		addToFreeListbytes(freeChunk, delta);
	}
	else {
		/* begin setClassIndexOf:to: */
		classIndex = sixtyFourBitLongsClassIndexPun();
		assert(((classIndex >= 0) && (classIndex <= (classIndexMask()))));
		longAtput(freeChunk, ((longAt(freeChunk)) & (~(usqIntptr_t)(classIndexMask()))) + classIndex);
		/* begin setFormatOf:to: */
		format = firstLongFormat();
		assert(((format >= 0) && (format <= (formatMask()))));
		longAtput(freeChunk, ((longAt(freeChunk)) & (~(usqIntptr_t)(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift())))));
	}
	return delta;
}


/*	Answer the C double precision floating point value of the argument, a
	SmallFloat. See section 61-bit Immediate Floats in the SpurMemoryManager
	class comment.
	msb lsb 
	Decode:				[8expsubset][52mantissa][1s][3tags] 
	shift away tags:		[ 000 ][8expsubset][52mantissa][1s] 
	add exponent offset:	[ 11 exponent ][52mantissa][1s] 
	rot sign:				[1s][ 11 exponent ][52mantissa] */

	/* Spur64BitMemoryManager>>#smallFloatValueOf: */
static double NoDbgRegParms
smallFloatValueOf(sqInt oop)
{
    usqLong bits;
    usqLong rot;
    double value;

	/* begin smallFloatBitsOf: */
	assert(isImmediateFloat(oop));
	rot = ((usqInt) (((usqInt)oop))) >> (numTagBits());
	if (rot > 1) {

		/* a.k.a. ~= +/-0.0 */
		rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
	}
	/* begin rotateRight: */
	rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
	bits = rot;
	memcpy((&value), (&bits), sizeof(value));
	return value;
}


/*	Answer the total number of bytes in an object without an overflow header,
	including header bytes.
 */

	/* Spur64BitMemoryManager>>#smallObjectBytesForSlots: */
usqInt
smallObjectBytesForSlots(sqInt numSlots)
{
	return BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
}

	/* Spur64BitMemoryManager>>#wordIndexableFormat */
static sqInt
wordIndexableFormat(void)
{
	return sixtyFourBitIndexableFormat();
}


/*	ephemeronCorpse is the corpse of an ephemeron that was copied and
	forwarded. Later on its surviving copy must be scanned to nil weak
	references. Thread the corpse onto the weakList. Later, the weakList can
	be followed, and
	the forwarding pointer followed to locate the survivor. */
/*	Should be too infrequent to lower icache density of copyAndForward: */

	/* SpurGenerationScavenger>>#addToEphemeronList: */
static void NoDbgRegParms NeverInline
addToEphemeronList(sqInt ephemeronCorpse)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ephemeronListOffset;

	assert(!(isScavengeSurvivor(keyOfEphemeron(followForwarded(ephemeronCorpse)))));
	ephemeronListOffset = (!(GIV(ephemeronList))
		? 0
		: GIV(ephemeronList));
	/* begin setCorpseOffsetOf:to: */
	assert(isYoung(ephemeronCorpse));
	assert(isForwarded(ephemeronCorpse));
	
	/* So we use the single assignment */
	long64Atput(ephemeronCorpse, headerForSlotshashformatclassIndex(byteAt(ephemeronCorpse + 7), ((usqInt) ephemeronListOffset) >> (formatFieldWidthShift()), ephemeronListOffset & (formatMask()), isForwardedObjectClassIndexPun()));
	GIV(ephemeronList) = (((usqInt) (ephemeronCorpse - GIV(newSpaceStart))) >> 3 /* shiftForAllocationUnit */) + 1;
	assert((firstCorpse(GIV(ephemeronList))) == ephemeronCorpse);
}


/*	weakCorpse is the corpse of a weak array that was copied and forwarded.
	Later on its surviving copy must be scanned to nil weak references.
	Thread the corpse onto the weakList. Later, the weakList can be followed,
	and the forwarding pointer followed to locate the survivor. */
/*	Should be too infrequent to lower icache density of copyAndForward: */

	/* SpurGenerationScavenger>>#addToWeakList: */
static void NoDbgRegParms NeverInline
addToWeakList(sqInt weakCorpse)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt weakListOffset;

	weakListOffset = (!(GIV(weakList))
		? 0
		: GIV(weakList));
	/* begin setCorpseOffsetOf:to: */
	assert(isYoung(weakCorpse));
	assert(isForwarded(weakCorpse));
	
	/* So we use the single assignment */
	long64Atput(weakCorpse, headerForSlotshashformatclassIndex(byteAt(weakCorpse + 7), ((usqInt) weakListOffset) >> (formatFieldWidthShift()), weakListOffset & (formatMask()), isForwardedObjectClassIndexPun()));
	GIV(weakList) = (((usqInt) (weakCorpse - GIV(newSpaceStart))) >> 3 /* shiftForAllocationUnit */) + 1;
	assert((firstCorpse(GIV(weakList))) == weakCorpse);
}

	/* SpurGenerationScavenger>>#allNewSpaceObjectsHaveZeroRTRefCount */
static sqInt
allNewSpaceObjectsHaveZeroRTRefCount(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevPrevObj;

	/* begin allNewSpaceObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & MaxRTRefCount) > 0) {
			return 0;
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & MaxRTRefCount) > 0) {
			return 0;
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	return 1;
}

	/* SpurGenerationScavenger>>#allWeakSurvivorsOnWeakList */
static sqInt
allWeakSurvivorsOnWeakList(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt followingWord;
    usqInt followingWordAddress;
    sqInt limit;
    usqInt numSlots;
    sqInt objOop;
    sqInt prevObj;
    sqInt prevPrevObj;

	/* begin allFutureSpaceEntitiesDo: */
	prevPrevObj = (prevObj = null);
	/* begin objectStartingAt: */
	address = (GIV(futureSpace).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(futureSurvivorStart);
	while (oopisLessThan(objOop, limit)) {
		if (isWeakFormat((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask()))) {
			if (!(isonWeaklingList(objOop, GIV(weakList)))) {
				return 0;
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	return 1;
}


/*	Some time in every scavenger's life there may come a time when someone
	writes code that stresses
	the remembered table. One might conclude that if the remembered table is
	full, then the right thing
	to do is simply to tenure everything, emptying the remembered table. Bt in
	some circumstances this
	can be counter-productive, and result in the same situation arising soon
	after tenuring everything.
	Instead, we can try and selectively prune the remembered table, tenuring
	only those objects that
	are referenced by many objects in the remembered table. That's what this
	algorithm does. It
	reference counts young objects referenced from the remembered set, and
	then sets a threshold
	used to tenure objects oft referenced from the remembered set, thereby
	allowing the remembered
	set to shrink, while not tenuring everything.
	
	Once in a network monitoring application in a galaxy not dissimilar from
	the one this code inhabits,
	a tree of nodes referring to large integers was in precisely this
	situation. The nodes were old, and
	the integers were in new space. Some of the nodes referred to shared
	numbers, some their own
	unique numbers. The numbers were updated frequently. Were new space simply
	tenured when the
	remembered table was full, the remembered table would soon fill up as new
	numbers were computed.
	Only by selectively pruning the remembered table of nodes that shared
	data, was a balance achieved
	whereby the remembered table population was kept small, and tenuring rates
	were low. */

	/* SpurGenerationScavenger>>#computeRefCountToShrinkRT */
static void NeverInline
computeRefCountToShrinkRT(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt count;
    sqInt elephant;
    sqInt entirePopulation;
    sqInt header;
    sqInt i;
    sqInt i1;
    sqInt j;
    sqInt j1;
    sqInt jLimiT;
    long population[MaxRTRefCount + 1];
    sqInt refCount;
    sqInt referent;
    sqInt referent1;

	memset(population, 0, (sizeof(long)) * (MaxRTRefCount + 1));
	assert(allNewSpaceObjectsHaveZeroRTRefCount());
	/* begin referenceCountRememberedReferents: */
	for (i1 = 0; i1 < GIV(rememberedSetSize); i1 += 1) {
		elephant = GIV(rememberedSet)[i1];
		if (((longAt(elephant)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(elephant));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent1 = longAt((elephant + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent1 & (tagMask())) == 0)
			 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			elephant = referent1;
			if (elephant & (tagMask())) {

				/* take care if elephant forwarded to an immediate */
				elephant = GIV(nilObj);
			}
		}
		for (j1 = 0, jLimiT = ((numPointerSlotsOf(elephant)) - 1); j1 <= jLimiT; j1 += 1) {
			referent = longAt((elephant + BaseHeaderSize) + (((sqInt)((usqInt)(j1) << (shiftForWord())))));
			if (((referent & (tagMask())) == 0)
			 && ((assert(isNonImmediate(referent)),
			(oopisLessThan(referent, GIV(newSpaceLimit)))
				 && (oopisGreaterThanOrEqualTo(referent, GIV(newSpaceStart)))))) {
				refCount = (((usqInt) (longAt(referent))) >> (rememberedBitShift())) & MaxRTRefCount;
				if (refCount < MaxRTRefCount) {
					if (refCount > 0) {
						population[refCount] = ((population[refCount]) - 1);
					}
					refCount += 1;
					/* begin rtRefCountOf:put: */
					assert(((refCount >= 0) && (refCount <= MaxRTRefCount)));
					header = longAt(referent);
					header = header & (~(usqIntptr_t)(7U << (rememberedBitShift())));
					header += ((sqInt)((usqInt)(refCount) << (rememberedBitShift())));
					longAtput(referent, header);
					population[refCount] = ((population[refCount]) + 1);
				}
			}
		}
	}
	/* begin setRefCountToShrinkRT: */
	assert((population[0]) == 0);
	entirePopulation = 0;
	for (j = 1; j <= MaxRTRefCount; j += 1) {
		entirePopulation += population[j];
	}
	count = 0;
	i = MaxRTRefCount + 1;
	while ((count < (entirePopulation / 2))
	 && (((i -= 1)) >= 0)) {
		count += population[i];
	}
	GIV(refCountToShrinkRT) = ((i < 0) ? 0 : i);
}


/*	A special version of copyAndForward: for objects in the mournQueue. If
	we're in the good times tenuring regime then copy to futureSpace,
	otherwise tenure.
	Also, don't repeat any of the ephemeron processing. */

	/* SpurGenerationScavenger>>#copyAndForwardMourner: */
static sqInt NoDbgRegParms
copyAndForwardMourner(sqInt mourner)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt bytesInObj;
    sqInt classIndex;
    sqInt format;
    sqInt header;
    sqInt newLocation;
    sqInt newStart;
    usqInt startOfSurvivor;
    sqInt tenure;

	assert((isInEden(mourner))
	 || (isInPastSpace(mourner)));
	bytesInObj = bytesInObject(mourner);
	format = (((usqInt) (longAt(mourner))) >> (formatShift())) & (formatMask());

	/* Allow Slang to inline. */
	tenure = !((GIV(tenureCriterion) == TenureByAge)
	 && (GIV(tenureThreshold) == 0));
	if (tenure
	 || ((GIV(futureSurvivorStart) + bytesInObj) > ((GIV(futureSpace).limit)))) {
		newLocation = copyToOldSpacebytesformat(mourner, bytesInObj, format);
	}
	else {
		/* begin copyToFutureSpace:bytes: */

		/* we hope writes are cheap... */
		GIV(statSurvivorCount) += 1;
		assert((GIV(futureSurvivorStart) + bytesInObj) <= ((GIV(futureSpace).limit)));
		startOfSurvivor = ((byteAt(mourner + 7)) == (numSlotsMask())
			? mourner - BaseHeaderSize
			: mourner);
		newStart = GIV(futureSurvivorStart);
		GIV(futureSurvivorStart) += bytesInObj;
		memcpy(((void *)newStart), ((void *)startOfSurvivor), bytesInObj);
		if (GIV(tenureCriterion) == TenureToShrinkRT) {
			/* begin rtRefCountOf:put: */
			assert(((0 >= 0) && (0 <= MaxRTRefCount)));
			header = longAt(newStart + (mourner - startOfSurvivor));
			header = header & (~(usqIntptr_t)(7U << (rememberedBitShift())));
			header += 0U << (rememberedBitShift());
			longAtput(newStart + (mourner - startOfSurvivor), header);
		}
		newLocation = newStart + (mourner - startOfSurvivor);
	}
	/* begin forwardSurvivor:to: */
	assert(isInNewSpace(mourner));
	assert((isInFutureSpace(newLocation))
	 || (isInOldSpace(newLocation)));
	assert(!(isOopForwarded(mourner)));
	longAtput((mourner + BaseHeaderSize) + (0U << (shiftForWord())), newLocation);
	/* begin set:classIndexTo:formatTo: */
	classIndex = isForwardedObjectClassIndexPun();
	assert(((classIndex >= 0) && (classIndex <= (classIndexMask()))));
	assert(((7 /* forwardedFormat */ >= 0) && (7 /* forwardedFormat */ <= (formatMask()))));
	longAtput(mourner, ((longAt(mourner)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift()))));
	if (format == (weakArrayFormat())) {
		addToWeakList(mourner);
	}
	return newLocation;
}


/*	copyAndForward: survivor copies a survivor object either to
	futureSurvivorSpace or, if it is to be promoted, to oldSpace.
	It leaves a forwarding pointer behind. If the object is weak
	then corpse is threaded onto the weakList for later treatment. */

	/* SpurGenerationScavenger>>#copyAndForward: */
static sqInt NoDbgRegParms
copyAndForward(sqInt survivor)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt bytesInObj;
    sqInt classIndex;
    sqInt format;
    sqInt header;
    sqInt newLocation;
    sqInt newStart;
    usqInt startOfSurvivor;
    sqInt tenure;

	assert((isInEden(survivor))
	 || (isInPastSpace(survivor)));
	bytesInObj = bytesInObject(survivor);
	format = (((usqInt) (longAt(survivor))) >> (formatShift())) & (formatMask());

	/* Allow Slang to inline. */
	
	switch (GIV(tenureCriterion)) {
	case TenureByAge:
		tenure = survivor < GIV(tenureThreshold);

		break;
	case TenureByClass:
		tenure = ((longAt(survivor)) & (classIndexMask())) == GIV(tenuringClassIndex);

		break;
	case TenureToShrinkRT:
		tenure = ((((usqInt) (longAt(survivor))) >> (rememberedBitShift())) & MaxRTRefCount) >= GIV(refCountToShrinkRT);

		break;
	default:
		tenure = 0;

	}
	if (tenure
	 || ((GIV(futureSurvivorStart) + bytesInObj) > ((GIV(futureSpace).limit)))) {
		newLocation = copyToOldSpacebytesformat(survivor, bytesInObj, format);
	}
	else {
		/* begin copyToFutureSpace:bytes: */

		/* we hope writes are cheap... */
		GIV(statSurvivorCount) += 1;
		assert((GIV(futureSurvivorStart) + bytesInObj) <= ((GIV(futureSpace).limit)));
		startOfSurvivor = ((byteAt(survivor + 7)) == (numSlotsMask())
			? survivor - BaseHeaderSize
			: survivor);
		newStart = GIV(futureSurvivorStart);
		GIV(futureSurvivorStart) += bytesInObj;
		memcpy(((void *)newStart), ((void *)startOfSurvivor), bytesInObj);
		if (GIV(tenureCriterion) == TenureToShrinkRT) {
			/* begin rtRefCountOf:put: */
			assert(((0 >= 0) && (0 <= MaxRTRefCount)));
			header = longAt(newStart + (survivor - startOfSurvivor));
			header = header & (~(usqIntptr_t)(7U << (rememberedBitShift())));
			header += 0U << (rememberedBitShift());
			longAtput(newStart + (survivor - startOfSurvivor), header);
		}
		newLocation = newStart + (survivor - startOfSurvivor);
	}
	/* begin forwardSurvivor:to: */
	assert(isInNewSpace(survivor));
	assert((isInFutureSpace(newLocation))
	 || (isInOldSpace(newLocation)));
	assert(!(isOopForwarded(survivor)));
	longAtput((survivor + BaseHeaderSize) + (0U << (shiftForWord())), newLocation);
	/* begin set:classIndexTo:formatTo: */
	classIndex = isForwardedObjectClassIndexPun();
	assert(((classIndex >= 0) && (classIndex <= (classIndexMask()))));
	assert(((7 /* forwardedFormat */ >= 0) && (7 /* forwardedFormat */ <= (formatMask()))));
	longAtput(survivor, ((longAt(survivor)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift()))));
	if (format == (weakArrayFormat())) {
		addToWeakList(survivor);
	}
	if ((format == 5 /* ephemeronFormat */)
	 && (!(isScavengeSurvivor((assert((isNonImmediate(newLocation))
		 && (isObjEphemeron(newLocation))),
	/* begin fetchPointer:ofObject: */
	longAt((newLocation + BaseHeaderSize) + (0U << (shiftForWord())))))))) {
		addToEphemeronList(survivor);
	}
	return newLocation;
}


/*	Copy survivor to oldSpace. Answer the new oop of the object. */
/*	Should be too infrequent to lower icache density of copyAndForward: */

	/* SpurGenerationScavenger>>#copyToOldSpace:bytes:format: */
static sqInt NoDbgRegParms NeverInline
copyToOldSpacebytesformat(sqInt survivor, sqInt bytesInObject, sqInt formatOfSurvivor)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt field;
    sqInt header;
    sqInt newOop;
    sqInt newStart;
    sqInt nTenures;
    sqInt p;
    usqInt startOfSurvivor;

	assert((formatOfSurvivor == (formatOf(survivor)))
	 && (((!(isMarked(survivor)))
	 || (GIV(tenureCriterion) == MarkOnTenure))
	 && ((GIV(tenureCriterion) == TenureToShrinkRT)
	 || ((!(isPinned(survivor)))
	 && (!(isRemembered(survivor)))))));
	nTenures = GIV(statTenures);
	startOfSurvivor = ((byteAt(survivor + 7)) == (numSlotsMask())
		? survivor - BaseHeaderSize
		: survivor);
	newStart = allocateOldSpaceChunkOfBytes(bytesInObject);
	if (!(newStart)) {
		growOldSpaceByAtLeast(0);
		newStart = allocateOldSpaceChunkOfBytes(bytesInObject);
		if (!(newStart)) {
			error("out of memory");
		}
	}
	memcpy(((void *)newStart), ((void *)startOfSurvivor), bytesInObject);
	newOop = newStart + (survivor - startOfSurvivor);
	if (GIV(tenureCriterion) >= (((TenureToShrinkRT < MarkOnTenure) ? TenureToShrinkRT : MarkOnTenure))) {
		if (GIV(tenureCriterion) == TenureToShrinkRT) {
			/* begin rtRefCountOf:put: */
			assert(((0 >= 0) && (0 <= MaxRTRefCount)));
			header = longAt(newOop);
			header = header & (~(usqIntptr_t)(7U << (rememberedBitShift())));
			header += 0U << (rememberedBitShift());
			longAtput(newOop, header);
		}
		if (GIV(tenureCriterion) == MarkOnTenure) {
			/* begin setIsMarkedOf:to: */
			assert(!(isFreeObject(newOop)));
			longAtput(newOop, (longAt(newOop)) | (1ULL << (markedBitFullShift())));
		}
	}
	GIV(statTenures) = nTenures + 1;
	if ((formatOfSurvivor <= 5 /* lastPointerFormat */)
	 || (formatOfSurvivor >= (firstCompiledMethodFormat()))) {

		/* A very quick and dirty scan to find young referents.  If we misidentify bytes
		   in a CompiledMethod as young we don't care; it's unlikely, and a subsequent
		   scan of the rt will filter the object out.  But it's good to filter here because
		   otherwise an attempt to shrink the RT may simply fill it up with new objects,
		   and here the data is likely in the cache. */
		for (p = BaseHeaderSize; p <= ((bytesInObject - (survivor - startOfSurvivor)) - BytesPerWord); p += BytesPerWord) {
			field = longAt(survivor + p);
			if (((field & (tagMask())) == 0)
			 && ((assert(isNonImmediate(field)),
			(oopisLessThan(field, GIV(newSpaceLimit)))
				 && (oopisGreaterThanOrEqualTo(field, GIV(newSpaceStart)))))) {
				remember(newOop);
				return newOop;
			}
		}
	}
	return newOop;
}

	/* SpurGenerationScavenger>>#firstCorpse: */
static usqInt NoDbgRegParms
firstCorpse(sqInt headOfCorpseList)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin corpseForCorpseOffset: */
	return (((sqInt)((usqInt)((headOfCorpseList - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart);
}

	/* SpurGenerationScavenger>>#growRememberedSet */
static void
growRememberedSet(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt *base;
    sqInt fudge;
    sqInt i;
    sqInt newObj;
    sqInt nSlots;
    sqInt nSlots1;
    sqInt nSlots2;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots2;
    sqInt obj;
    sqInt obj1;
    sqInt obj2;
    sqInt obj3;
    usqInt p;
    usqInt p1;
    usqInt p2;


	/* Don't ruin locality in remember: */
	/* begin fetchPointer:ofObject: */
	obj = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord())))));
	/* begin numSlotsOf: */
	assert((classIndexOf(obj)) > (isForwardedObjectClassIndexPun()));
	numSlots1 = byteAt(obj + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(obj - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	assert(numSlots >= 1024);
	/* begin allocatePinnedSlots: */
	nSlots2 = numSlots * 2;
	obj3 = allocateSlotsForPinningInOldSpacebytesformatclassIndex(nSlots2, (nSlots2 == 0
		? 8 /* allocationUnit */ + BaseHeaderSize
		: (((sqInt)((usqInt)(nSlots2) << (shiftForWord())))) + ((nSlots2 >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))), sixtyFourBitIndexableFormat(), sixtyFourBitLongsClassIndexPun());
	if (!(obj3 == null)) {
		/* begin fillObj:numSlots:with: */
		assert(oopisLessThan(((obj3 + BaseHeaderSize) + (nSlots2 * BytesPerOop)) - 1, addressAfter(obj3)));
		for (p2 = (((usqInt)(obj3 + BaseHeaderSize))); p2 <= (((usqInt)(((obj3 + BaseHeaderSize) + (nSlots2 * BytesPerOop)) - 1))); p2 += 8 /* allocationUnit */) {
			longAtput(p2, 0);
		}
	}
	newObj = obj3;
	if (!(newObj)) {
		/* begin allocatePinnedSlots: */
		nSlots1 = numSlots + 1024;
		obj2 = allocateSlotsForPinningInOldSpacebytesformatclassIndex(nSlots1, (nSlots1 == 0
			? 8 /* allocationUnit */ + BaseHeaderSize
			: (((sqInt)((usqInt)(nSlots1) << (shiftForWord())))) + ((nSlots1 >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))), sixtyFourBitIndexableFormat(), sixtyFourBitLongsClassIndexPun());
		if (!(obj2 == null)) {
			/* begin fillObj:numSlots:with: */
			assert(oopisLessThan(((obj2 + BaseHeaderSize) + (nSlots1 * BytesPerOop)) - 1, addressAfter(obj2)));
			for (p1 = (((usqInt)(obj2 + BaseHeaderSize))); p1 <= (((usqInt)(((obj2 + BaseHeaderSize) + (nSlots1 * BytesPerOop)) - 1))); p1 += 8 /* allocationUnit */) {
				longAtput(p1, 0);
			}
		}
		newObj = obj2;
		if (!(newObj)) {
			if (!(growOldSpaceByAtLeast(numSlots + 1024))) {
				error("could not grow remembered set");
			}
			/* begin allocatePinnedSlots: */
			nSlots = numSlots + 1024;
			obj1 = allocateSlotsForPinningInOldSpacebytesformatclassIndex(nSlots, (nSlots == 0
				? 8 /* allocationUnit */ + BaseHeaderSize
				: (((sqInt)((usqInt)(nSlots) << (shiftForWord())))) + ((nSlots >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))), sixtyFourBitIndexableFormat(), sixtyFourBitLongsClassIndexPun());
			if (!(obj1 == null)) {
				/* begin fillObj:numSlots:with: */
				assert(oopisLessThan(((obj1 + BaseHeaderSize) + (nSlots * BytesPerOop)) - 1, addressAfter(obj1)));
				for (p = (((usqInt)(obj1 + BaseHeaderSize))); p <= (((usqInt)(((obj1 + BaseHeaderSize) + (nSlots * BytesPerOop)) - 1))); p += 8 /* allocationUnit */) {
					longAtput(p, 0);
				}
			}
			newObj = obj1;
		}
	}
	/* begin rememberedSetObj: */
	assert(isOldObject(newObj));
	assert(!(isOopForwarded(GIV(hiddenRootsObj))));
	longAtput((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord())))), newObj);
	base = firstIndexableField(newObj);
	for (i = 0; i < GIV(rememberedSetSize); i += 1) {
		base[i] = (GIV(rememberedSet)[i]);
	}
	if (((((usqInt) (longAt(obj))) >> (markedBitFullShift())) & 1) != 0) {
		/* begin setIsMarkedOf:to: */
		assert(!(isFreeObject(newObj)));
		longAtput(newObj, (longAt(newObj)) | (1ULL << (markedBitFullShift())));
		/* begin setIsMarkedOf:to: */
		assert(!(isFreeObject(obj)));
		longAtput(obj, (longAt(obj)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
	}
	freeObject(obj);
	GIV(rememberedSet) = base;
	/* begin numSlotsOf: */
	assert((classIndexOf(newObj)) > (isForwardedObjectClassIndexPun()));
	numSlots2 = byteAt(newObj + 7);
	GIV(rememberedSetLimit) = (numSlots2 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(newObj - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots2);
	/* begin setRememberedSetRedZone */
	fudge = ((((GIV(eden).limit)) - ((GIV(eden).start))) / BytesPerWord) / 1024;
	GIV(rememberedSetRedZone) = ((((GIV(rememberedSetLimit) * 3) / 4) < fudge) ? fudge : ((GIV(rememberedSetLimit) * 3) / 4));
}

	/* SpurGenerationScavenger>>#isInRememberedSet: */
static sqInt NoDbgRegParms
isInRememberedSet(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	for (i = 0; i < GIV(rememberedSetSize); i += 1) {
		if ((GIV(rememberedSet)[i]) == objOop) {
			return 1;
		}
	}
	return 0;
}


/*	Answer whether the oop has survived a scavenge. This version is
	for processing weak survivors and must cope with the scavenge in
	freeUnmarkedObjectsAndSortAndCoalesceFreeSpaceForPigCompact. */

	/* SpurGenerationScavenger>>#isMaybeOldScavengeSurvivor: */
static sqInt NoDbgRegParms
isMaybeOldScavengeSurvivor(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt referent;
    sqInt target;

	if (oop & (tagMask())) {
		return 1;
	}
	if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(oop));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		target = referent;
		if (oop & (tagMask())) {
			return 1;
		}
	}
	else {
		target = oop;
	}
	return ((assert(isNonImmediate(target)),
	oopisGreaterThanOrEqualTo(target, GIV(oldSpaceStart)))
		? (GIV(tenureCriterion) != MarkOnTenure)
			 || (((((usqInt) (longAt(target))) >> (markedBitFullShift())) & 1) != 0)
		: oopisGreaterThanOrEqualToandLessThan(target, ((futureSpace()).start), futureSurvivorStart()));
}


/*	Answer whether the oop has survived a scavenge. This is equivalent to
	| target |
	(manager isImmediate: oop) ifTrue:
	[^true].
	target := (manager isForwarded: oop)
	ifTrue: [manager followForwarded: oop]
	ifFalse: [oop].
	^((manager isInEden: target)
	or: [(manager isInPastSpace: target)]) not */

	/* SpurGenerationScavenger>>#isScavengeSurvivor: */
static sqInt NoDbgRegParms
isScavengeSurvivor(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt referent;
    sqInt target;

	if (oop & (tagMask())) {
		return 1;
	}
	if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(oop));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		target = referent;
	}
	else {
		target = oop;
	}
	return (!(((target & (tagMask())) == 0)
	 && ((assert(isNonImmediate(target)),
	(oopisLessThan(target, GIV(newSpaceLimit)))
		 && (oopisGreaterThanOrEqualTo(target, GIV(newSpaceStart)))))))
	 || (oopisGreaterThanOrEqualToandLessThan(target, ((futureSpace()).start), futureSurvivorStart()));
}

	/* SpurGenerationScavenger>>#is:onWeaklingList: */
static sqInt NoDbgRegParms
isonWeaklingList(sqInt oop, sqInt listHead)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt corpse;
    sqInt listOffset;

	/* begin firstCorpse: */
	corpse = (((sqInt)((usqInt)((listHead - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart);
	while (corpse != null) {
		if (oop == (followForwarded(corpse))) {
			return 1;
		}
		/* begin nextCorpseOrNil: */
		assert(isYoung(corpse));
		listOffset = (((sqInt)((usqInt)(((long32At(corpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(corpse))) >> (formatShift())) & (formatMask()));
		corpse = (listOffset != 0
			? (/* begin corpseForCorpseOffset: */
				(((sqInt)((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart))
			: 0);
	}
	return 0;
}

	/* SpurGenerationScavenger>>#newSpaceCapacity */
static usqInt
newSpaceCapacity(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((GIV(eden).limit)) - (((((GIV(futureSpace).start)) < ((GIV(pastSpace).start))) ? ((GIV(futureSpace).start)) : ((GIV(pastSpace).start))));
}


/*	For assert checking only. */

	/* SpurGenerationScavenger>>#noUnfiredEphemeronsAtEndOfRememberedSet */
static sqInt
noUnfiredEphemeronsAtEndOfRememberedSet(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt referrer;

	for (i = GIV(numRememberedEphemerons); i < GIV(rememberedSetSize); i += 1) {
		referrer = GIV(rememberedSet)[i];
		if ((assert(isNonImmediate(referrer)),
		isEphemeronFormat((((usqInt) (longAt(referrer))) >> (formatShift())) & (formatMask())))) {
			if (!(isScavengeSurvivor((assert((isNonImmediate(referrer))
					 && (isObjEphemeron(referrer))),
				/* begin fetchPointer:ofObject: */
				longAt((referrer + BaseHeaderSize) + (0U << (shiftForWord()))))))) {
				return 0;
			}
		}
	}
	return 1;
}

	/* SpurGenerationScavenger>>#openScavengeLog */
void
openScavengeLog(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(scavengeLog) = fopen("scavenge.log", "a+");
}


/*	Print the objects in the remembered set. */

	/* SpurGenerationScavenger>>#printRememberedSet */
void
printRememberedSet(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	for (i = 0; i < GIV(rememberedSetSize); i += 1) {
		printNum(i);
		/* begin space */
		putchar(' ');
		shortPrintOop(GIV(rememberedSet)[i]);
	}
}


/*	There are ephemerons to be scavenged. Scavenge them and fire any whose
	keys are
	still in pastSpace and/or eden. The unscavenged ephemerons in this cycle
	can only be
	fired if all the unscavenged ephemerons in this cycle are firable, because
	references to ephemeron keys from unfired ephemerons should prevent the
	ephemerons with
	those keys from firing. So scavenge ephemerons with surviving keys, and
	only if none
	are found, fire ephemerons with unreferenced keys, and scavenge them. Read
	the class comment for a more in-depth description of the algorithm. */

	/* SpurGenerationScavenger>>#processEphemerons */
static void
processEphemerons(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ephemeron;
    sqInt ephemeron1;
    usqInt ephemeronCorpse;
    sqInt hasNewReferents;
    sqInt i;
    sqInt i1;
    sqInt key;
    sqInt key1;
    sqInt listOffset;
    sqInt oldCorpse;
    sqInt oldList;
    sqInt referent;
    sqInt referrer;
    sqInt unfiredEphemeronsScavenged;
    sqInt unfiredEphemeronsScavenged1;
    sqInt valuePointer;
    sqInt valuePointer1;

	/* begin scavengeUnfiredEphemeronsInRememberedSet */
	unfiredEphemeronsScavenged1 = 0;
	i1 = 0;
	while (i1 < GIV(numRememberedEphemerons)) {
		referrer = GIV(rememberedSet)[i1];
		assert(isEphemeron(referrer));
		if (isScavengeSurvivor((assert((isNonImmediate(referrer))
			 && (isObjEphemeron(referrer))),
		/* begin fetchPointer:ofObject: */
		longAt((referrer + BaseHeaderSize) + (0U << (shiftForWord())))))) {
			unfiredEphemeronsScavenged1 = 1;

			/* remove from unscanned ephemerons in set by swapping with last ephemeron */
			hasNewReferents = scavengeReferentsOf(referrer);
			GIV(numRememberedEphemerons) -= 1;
			GIV(rememberedSet)[i1] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]);
			if (hasNewReferents) {

				/* keep in set */
				GIV(rememberedSet)[GIV(numRememberedEphemerons)] = referrer;
			}
			else {

				/* remove from set by overwriting with next-to-be scanned */
				GIV(previousRememberedSetSize) -= 1;
				GIV(rememberedSetSize) -= 1;
				GIV(rememberedSet)[GIV(numRememberedEphemerons)] = (GIV(rememberedSet)[GIV(previousRememberedSetSize)]);
				GIV(rememberedSet)[GIV(previousRememberedSetSize)] = (GIV(rememberedSet)[GIV(rememberedSetSize)]);
				/* begin setIsRememberedOf:to: */
				longAtput(referrer, (longAt(referrer)) & (~(usqIntptr_t)(1U << (rememberedBitShift()))));
			}
		}
		else {
			i1 += 1;
		}
	}
	unfiredEphemeronsScavenged = unfiredEphemeronsScavenged1;
	if (scavengeUnfiredEphemeronsOnEphemeronList()) {
		unfiredEphemeronsScavenged = 1;
	}
	if (!unfiredEphemeronsScavenged) {
		/* begin fireEphemeronsInRememberedSet */
		assert(noUnfiredEphemeronsAtEndOfRememberedSet());
		i = 0;
		while (i < GIV(numRememberedEphemerons)) {
			ephemeron = GIV(rememberedSet)[i];
			assert(isEphemeron(ephemeron));
			assert((isNonImmediate(ephemeron))
			 && (isObjEphemeron(ephemeron)));
			/* begin fetchPointer:ofObject: */
			key = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())));
			if (!(isScavengeSurvivor(key))) {
				/* begin fireEphemeron: */
				queueMourner(ephemeron);
				/* begin setFormatOf:to: */
				assert(((1 /* nonIndexablePointerFormat */ >= 0) && (1 /* nonIndexablePointerFormat */ <= (formatMask()))));
				longAtput(ephemeron, ((longAt(ephemeron)) & (~(usqIntptr_t)(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (1U << (formatShift())));
				/* begin signalFinalization: */
				forceInterruptCheck();
				GIV(pendingFinalizationSignals) += 1;
				/* begin storePointerUnchecked:ofObject:withValue: */
				valuePointer = copyAndForward(key);
				assert(!(isOopForwarded(ephemeron)));
				longAtput((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer);
			}
			assert(!(((isScavengeSurvivor(key))
 && (isEphemeron(ephemeron)))));
			if (scavengeReferentsOf(ephemeron)) {

				/* keep in set */
				i += 1;
			}
			else {
				/* begin setIsRememberedOf:to: */
				longAtput(ephemeron, (longAt(ephemeron)) & (~(usqIntptr_t)(1U << (rememberedBitShift()))));
				GIV(numRememberedEphemerons) -= 1;
				GIV(previousRememberedSetSize) -= 1;

				/* First overwrite with last firable ephemeron (could be a noop if this is the last one).
				   Then overwrite last firable entry with next unscanned rememberedSet entry (could also be a noop).
				   Then overwrite next unscanned entry with last unscanned rememberedSet entry (could also be a noop). */
				GIV(rememberedSetSize) -= 1;
				GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]);
				GIV(rememberedSet)[GIV(numRememberedEphemerons)] = (GIV(rememberedSet)[GIV(previousRememberedSetSize)]);
				GIV(rememberedSet)[GIV(previousRememberedSetSize)] = (GIV(rememberedSet)[GIV(rememberedSetSize)]);
			}
		}
		GIV(numRememberedEphemerons) = 0;
		/* begin fireEphemeronsOnEphemeronList */
		if (!(GIV(ephemeronList))) {
			goto l10;
		}
		oldCorpse = null;
		/* begin corpseForCorpseOffset: */
		ephemeronCorpse = (((sqInt)((usqInt)((GIV(ephemeronList) - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart);
		oldList = GIV(ephemeronList);
		GIV(ephemeronList) = null;
		while (ephemeronCorpse != null) {
			assert((isYoung(ephemeronCorpse))
			 && (isForwarded(ephemeronCorpse)));
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(ephemeronCorpse));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((ephemeronCorpse + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent & (tagMask())) == 0)
			 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			ephemeron1 = referent;
			assert((isNonImmediate(ephemeron1))
			 && (isMaybeFiredEphemeron(ephemeron1)));
			/* begin fetchPointer:ofObject: */
			key1 = longAt((ephemeron1 + BaseHeaderSize) + (0U << (shiftForWord())));
			if (!(isScavengeSurvivor(key1))) {
				/* begin fireEphemeron: */
				queueMourner(ephemeron1);
				/* begin setFormatOf:to: */
				assert(((1 /* nonIndexablePointerFormat */ >= 0) && (1 /* nonIndexablePointerFormat */ <= (formatMask()))));
				longAtput(ephemeron1, ((longAt(ephemeron1)) & (~(usqIntptr_t)(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (1U << (formatShift())));
				/* begin signalFinalization: */
				forceInterruptCheck();
				GIV(pendingFinalizationSignals) += 1;
				/* begin storePointerUnchecked:ofObject:withValue: */
				valuePointer1 = copyAndForward(key1);
				assert(!(isOopForwarded(ephemeron1)));
				longAtput((ephemeron1 + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer1);
			}
			assert(!(((isScavengeSurvivor(key1))
 && (isEphemeron(ephemeron1)))));
			((void) (scavengeReferentsOf(ephemeron1)));
			oldCorpse = ephemeronCorpse;
			/* begin nextCorpseOrNil: */
			assert(isYoung(ephemeronCorpse));
			listOffset = (((sqInt)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask()));
			ephemeronCorpse = (listOffset != 0
				? (/* begin corpseForCorpseOffset: */
					(((sqInt)((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart))
				: 0);
		}
	l10:	/* end fireEphemeronsOnEphemeronList */;
	}
}


/*	Go through the remembered set and the weak list, nilling references to
	any objects that didn't survive the scavenge. Read the class comment
	for a more in-depth description of the algorithm. */

	/* SpurGenerationScavenger>>#processWeaklings */
static void
processWeaklings(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt listOffset;
    sqInt referent;
    sqInt rootObj;
    usqInt weakCorpse;
    sqInt weakObj;

	assert(allWeakSurvivorsOnWeakList());
	i = 0;
	while (i < GIV(rememberedSetSize)) {
		rootObj = GIV(rememberedSet)[i];
		if (isWeakFormat((((usqInt) (longAt(rootObj))) >> (formatShift())) & (formatMask()))) {

			/* If no more referents, remove by overwriting with the last element in the set. */
			if (processWeakSurvivor(rootObj)) {
				i += 1;
			}
			else {
				/* begin setIsRememberedOf:to: */
				longAtput(rootObj, (longAt(rootObj)) & (~(usqIntptr_t)(1U << (rememberedBitShift()))));
				if ((i + 1) < GIV(rememberedSetSize)) {
					GIV(rememberedSet)[i] = (GIV(rememberedSet)[GIV(rememberedSetSize) - 1]);
				}
				GIV(rememberedSetSize) -= 1;
			}
		}
		else {
			i += 1;
		}
	}
	if (!(GIV(weakList) == null)) {
		/* begin firstCorpse: */
		weakCorpse = (((sqInt)((usqInt)((GIV(weakList) - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart);
		while (weakCorpse != null) {
			assert(isForwarded(weakCorpse));
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(weakCorpse));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((weakCorpse + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent & (tagMask())) == 0)
			 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			weakObj = referent;
			if ((processWeakSurvivor(weakObj))
			 && (((assert(isNonImmediate(weakObj)),
			oopisGreaterThanOrEqualTo(weakObj, GIV(oldSpaceStart))))
			 && (!(((((usqInt) (longAt(weakObj))) >> (rememberedBitShift())) & 1) != 0)))) {
				remember(weakObj);
			}
			/* begin nextCorpseOrNil: */
			assert(isYoung(weakCorpse));
			listOffset = (((sqInt)((usqInt)(((long32At(weakCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(weakCorpse))) >> (formatShift())) & (formatMask()));
			weakCorpse = (listOffset != 0
				? (/* begin corpseForCorpseOffset: */
					(((sqInt)((usqInt)((listOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart))
				: 0);
		}
		GIV(weakList) = null;
	}
}


/*	Process a weak survivor on the weakList. Those of its fields
	which have not survived the scavenge should be nilled, and if any
	are, the coInterpreter should be informed via fireFinalization:.
	Answer if the weakObj has any young referents. */

	/* SpurGenerationScavenger>>#processWeakSurvivor: */
static sqInt NoDbgRegParms
processWeakSurvivor(sqInt weakObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classFormat;
    sqInt classPointer;
    sqInt hasYoungReferents;
    sqInt i;
    sqInt iLimiT;
    sqInt numStrongSlots;
    sqInt referent;
    sqInt referent1;
    sqInt weakObjShouldMourn;


	/* N.B. generateToByDoLimitExpression:negative:on: guards against (unsigned)0 - 1 going +ve */
	weakObjShouldMourn = (hasYoungReferents = 0);
	/* begin fixedFieldsOfClassFormat: */
	classPointer = fetchClassOfNonImm(weakObj);
	classFormat = ((longAt((classPointer + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	numStrongSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	for (i = 0; i < numStrongSlots; i += 1) {
		referent = longAt((weakObj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if (((referent & (tagMask())) == 0)
		 && ((assert(isNonImmediate(referent)),
		oopisLessThan(referent, GIV(newSpaceLimit))))) {
			hasYoungReferents = 1;
		}
	}
	for (i = numStrongSlots, iLimiT = ((numSlotsOf(weakObj)) - 1); i <= iLimiT; i += 1) {

		/* Referent could be forwarded due to scavenging or a become:, don't assume. */
		referent = longAt((weakObj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if ((referent & (tagMask())) == 0) {
			if (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(referent));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent1 = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent1 & (tagMask())) == 0)
				 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				referent = referent1;
				assert((isReallyYoungObject(weakObj))
				 || (isRemembered(weakObj)));
				assert(!(isOopForwarded(weakObj)));
				longAtput((weakObj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), referent);
			}
			if (isMaybeOldScavengeSurvivor(referent)) {
				if ((assert(isNonImmediate(referent)),
				oopisLessThan(referent, GIV(newSpaceLimit)))) {
					hasYoungReferents = 1;
				}
			}
			else {
				weakObjShouldMourn = 1;
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(weakObj)));
				longAtput((weakObj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), GIV(nilObj));
			}
		}
	}
	if (weakObjShouldMourn) {
		/* begin fireFinalization: */
		if (GIV(newFinalization)) {
			queueMourner(weakObj);
		}
		/* begin signalFinalization: */
		forceInterruptCheck();
		GIV(pendingFinalizationSignals) += 1;
	}
	return hasYoungReferents;
}


/*	Add the argument to the remembered set and set its isRemembered bit to
	true. Answer the argument for the benefit of the Cogit. */

	/* SpurGenerationScavenger>>#remember: */
sqInt
remember(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(isNonImmediate(objOop));
	assert(!((isYoungObject(objOop))));
	assert(!((isRemembered(objOop))));
	assert(!((isInRememberedSet(objOop))));
	/* begin setIsRememberedOf:to: */
	longAtput(objOop, (longAt(objOop)) | (1U << (rememberedBitShift())));
	if (GIV(rememberedSetSize) >= GIV(rememberedSetLimit)) {
		growRememberedSet();
	}
	GIV(rememberedSet)[GIV(rememberedSetSize)] = objOop;
	if (((GIV(rememberedSetSize) += 1)) >= GIV(rememberedSetRedZone)) {
		/* begin scheduleScavenge */
		GIV(needGCFlag) = 1;
		forceInterruptCheck();
	}
	return objOop;
}


/*	scavengeFutureSurvivorSpaceStartingAt: does a depth-first traversal of the
	new objects starting at the one at initialAddress in futureSurvivorSpace. */

	/* SpurGenerationScavenger>>#scavengeFutureSurvivorSpaceStartingAt: */
static void NoDbgRegParms
scavengeFutureSurvivorSpaceStartingAt(sqInt initialAddress)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt numSlots;
    sqInt obj;
    usqInt ptr;

	ptr = initialAddress;
	while (ptr < GIV(futureSurvivorStart)) {
		/* begin objectStartingAt: */
		numSlots = byteAt(ptr + 7);
		obj = (numSlots == (numSlotsMask())
			? ptr + BaseHeaderSize
			: ptr);
		ptr = addressAfter(obj);
		((void) (scavengeReferentsOf(obj)));
	}
}


/*	This is the inner loop of the main routine, scavenge. It first scavenges
	the new objects immediately
	reachable from old ones. Then it scavenges those that are transitively
	reachable. If this results in a
	promotion, the promotee gets remembered, and it first scavenges objects
	adjacent to the promotee,
	then scavenges the ones reachable from the promoted. This loop continues
	until no more reachable
	objects are left. At that point, pastSurvivorSpace is exchanged with
	futureSurvivorSpace. 
	Notice that each pointer in a live object is inspected once and only once.
	The previousRememberedSetSize
	and previousFutureSurvivorSpaceLimit variables ensure that no object is
	scanned twice, as well as
	detecting closure. If this were not true, some pointers might get
	forwarded twice.
	
	An extension of the algorithm presented in David's original paper is to
	handle weak arrays and ephemerons.
	Weak arrays should not have their weak referents scavenged unless there
	are strong references to them.
	Ephemerons should fire if their key is not reachable other than from
	ephemerons and weak arrays.
	Handle this by maintaining a list for weak arrays and a list for
	ephemerons, which allow scavenging these
	objects once all other objects in new space have been scavenged, hence
	allowing the scavenger to
	detect which referents in new space of weak arrays are dead and of
	ephemeron keys are only live due to
	ephemerons. Read the class comment for a more in-depth description of the
	algorithm.  */

	/* SpurGenerationScavenger>>#scavengeLoop */
static void
scavengeLoop(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstTime;
    sqInt i;
    sqInt previousFutureSurvivorStart;
    StackPage *thePage;

	assert(GIV(futureSurvivorStart) == ((GIV(futureSpace).start)));
	GIV(weakList) = (GIV(ephemeronList) = null);
	GIV(numRememberedEphemerons) = 0;
	firstTime = 1;
	GIV(previousRememberedSetSize) = 0;
	previousFutureSurvivorStart = GIV(futureSurvivorStart);
	/* begin initStackPageGC */
	if (GIV(stackPage) != 0) {
		/* begin externalWriteBackHeadFramePointers */
		assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
		assert(GIV(stackPage) == (mostRecentlyUsedPage()));
		assert(!((isFree(GIV(stackPage)))));
		/* begin setHeadFP:andSP:inPage: */
		assert(GIV(stackPointer) < GIV(framePointer));
		assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
		assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
		(GIV(stackPage)->headFP = GIV(framePointer));
		(GIV(stackPage)->headSP = GIV(stackPointer));
		assert(pageListIsWellFormed());
	}
	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		(thePage->trace = StackPageUnreached);
	}
	while(1) {
		scavengeRememberedSetStartingAt(GIV(previousRememberedSetSize));
		GIV(previousRememberedSetSize) = GIV(rememberedSetSize);
		if (firstTime) {
			mapInterpreterOops();
			mapMournQueue();
			mapExtraRoots();
			firstTime = 0;
		}
		if ((GIV(previousRememberedSetSize) == GIV(rememberedSetSize))
		 && ((previousFutureSurvivorStart == GIV(futureSurvivorStart))
		 && ((GIV(numRememberedEphemerons) == 0)
		 && (GIV(ephemeronList) == null)))) {
			return;
		}
		scavengeFutureSurvivorSpaceStartingAt(previousFutureSurvivorStart);

		/* no more roots created to scavenge... */
		previousFutureSurvivorStart = GIV(futureSurvivorStart);
		if (GIV(previousRememberedSetSize) == GIV(rememberedSetSize)) {
			if ((GIV(numRememberedEphemerons) == 0)
			 && (GIV(ephemeronList) == null)) {
				return;
			}
			processEphemerons();
		}
	}
}


/*	scavengeReferentsOf: referrer inspects all the pointers in referrer. If
	any are new objects, it has them moved to FutureSurvivorSpace, and
	answers truth. If there are no new referents, it answers falsity. To
	handle weak arrays, if the referrer is weak only scavenge strong slots and
	answer true so that it won't be removed from the remembered set until
	later.  */
/*	forwarding objects should be followed by callers,
	unless the forwarder is a root in the remembered table. */

	/* SpurGenerationScavenger>>#scavengeReferentsOf: */
static sqInt NoDbgRegParms
scavengeReferentsOf(sqInt referrer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classFormat;
    sqInt contextSize;
    sqInt fmt;
    sqInt foundNewReferentOrIsWeakling;
    sqInt header;
    sqInt header1;
    sqInt i;
    sqInt newLocation;
    sqInt numLiterals;
    sqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots2;
    sqInt objOop1;
    sqInt referent;
    sqInt referent1;
    sqInt sp;

	assert((!(isForwarded(referrer)))
	 || (isRemembered(referrer)));
	assert((!(isEphemeron(referrer)))
	 || ((isScavengeSurvivor(keyOfEphemeron(referrer)))
	 || (isonWeaklingList(referrer, GIV(ephemeronList)))));
	fmt = (((usqInt) (longAt(referrer))) >> (formatShift())) & (formatMask());
	foundNewReferentOrIsWeakling = fmt == (weakArrayFormat());
	/* begin numStrongSlotsOf:format:ephemeronInactiveIf: */
	if (fmt <= 5 /* lastPointerFormat */) {
		/* begin numSlotsOf: */
		assert((classIndexOf(referrer)) > (isForwardedObjectClassIndexPun()));
		numSlots1 = byteAt(referrer + 7);
		numSlots2 = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(referrer - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		if (fmt <= 2 /* arrayFormat */) {
			numSlots = numSlots2;
			goto l8;
		}
		if (fmt == (indexablePointersFormat())) {
			if (((longAt(referrer)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
				setTraceFlagOnContextsFramesPageIfNeeded(referrer);
				/* begin fetchStackPointerOf: */
				sp = longAt((referrer + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
				if (!((((sp) & 7) == 1))) {
					contextSize = 0;
					goto l5;
				}
				assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(referrer)));
				contextSize = (sp >> 3);
	l5:	/* end fetchStackPointerOf: */;
				numSlots = CtxtTempFrameStart + contextSize;
				goto l8;
			}
			numSlots = numSlots2;
			goto l8;
		}
		if (fmt == (weakArrayFormat())) {
			/* begin fixedFieldsOfClass: */
			objOop1 = fetchClassOfNonImm(referrer);
			/* begin fixedFieldsOfClassFormat: */
			classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
			numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
			goto l8;
		}
		assert(fmt == (ephemeronFormat()));
		numSlots = (isScavengeSurvivor((keyOfEphemeron(referrer)))
			? numSlots2
			: 0);
		goto l8;
	}
	if (fmt == 7 /* forwardedFormat */) {
		numSlots = 1;
		goto l8;
	}
	if (fmt < (firstCompiledMethodFormat())) {
		numSlots = 0;
		goto l8;
	}
	/* begin methodHeaderOf: */
	assert(isCompiledMethod(referrer));
	header1 = longAt((referrer + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	assert((((header) & 7) == 1));
	numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
	numSlots = numLiterals + LiteralStart;
	l8:	/* end numStrongSlotsOf:format:ephemeronInactiveIf: */;
	for (i = 0; i < numSlots; i += 1) {
		referent = longAt((referrer + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if ((referent & (tagMask())) == 0) {

			/* a forwarding pointer could be because of become: or scavenging. */
			if (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(referent));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent1 = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent1 & (tagMask())) == 0)
				 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				referent = referent1;
			}
			if ((assert(isNonImmediate(referent)),
			(oopisLessThan(referent, GIV(newSpaceLimit)))
				 && (oopisGreaterThanOrEqualTo(referent, GIV(newSpaceStart))))) {

				/* if target is already in future space forwarding pointer was due to a become:. */
				if (oopisGreaterThanOrEqualToandLessThan(referent, ((futureSpace()).start), futureSurvivorStart())) {
					newLocation = referent;
					foundNewReferentOrIsWeakling = 1;
				}
				else {
					newLocation = copyAndForward(referent);
					if (((newLocation & (tagMask())) == 0)
					 && (oopisLessThan(newLocation, GIV(newSpaceLimit)))) {
						foundNewReferentOrIsWeakling = 1;
					}
				}
				longAtput((referrer + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), newLocation);
			}
			else {
				longAtput((referrer + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), referent);
			}
		}
	}
	return foundNewReferentOrIsWeakling;
}


/*	scavengeRememberedSetStartingAt: n traverses objects in the remembered
	set starting at the nth one. If the object does not refer to any new
	objects, it
	is removed from the set. Otherwise, its new referents are scavenged. Defer
	scavenging ephemerons until after a complete scavenge has been performed,
	so that triggered ephemerons can be fired. Move them to the front of the
	set and count them in numRememberedEphemerons for later scanning. */

	/* SpurGenerationScavenger>>#scavengeRememberedSetStartingAt: */
static void NoDbgRegParms
scavengeRememberedSetStartingAt(sqInt n)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt destIndex;
    sqInt format;
    sqInt referrer;
    sqInt sourceIndex;

	sourceIndex = (destIndex = n);
	while (sourceIndex < GIV(rememberedSetSize)) {

		/* *Don't* follow forwarding pointers here. oldSpace objects may refer
		   to these roots, and so they can't be removed in the scavenge. */

		/* Any potential firing ephemerons should not be scanned yet.
		   Move any to the front of the set to save time in later scanning. */
		referrer = GIV(rememberedSet)[sourceIndex];
		if (((assert(isNonImmediate(referrer)),
		/* begin isEphemeronFormat: */
		(format = (((usqInt) (longAt(referrer))) >> (formatShift())) & (formatMask())),
		format == 5 /* ephemeronFormat */))
		 && (!(isScavengeSurvivor((assert((isNonImmediate(referrer))
			 && (isObjEphemeron(referrer))),
		/* begin fetchPointer:ofObject: */
		longAt((referrer + BaseHeaderSize) + (0U << (shiftForWord())))))))) {
			assert(destIndex >= GIV(numRememberedEphemerons));
			GIV(rememberedSet)[destIndex] = (GIV(rememberedSet)[GIV(numRememberedEphemerons)]);
			GIV(rememberedSet)[GIV(numRememberedEphemerons)] = referrer;
			GIV(numRememberedEphemerons) += 1;
			destIndex += 1;
		}
		else {
			if (scavengeReferentsOf(referrer)) {
				GIV(rememberedSet)[destIndex] = referrer;
				destIndex += 1;
			}
			else {
				/* begin setIsRememberedOf:to: */
				longAtput(referrer, (longAt(referrer)) & (~(usqIntptr_t)(1U << (rememberedBitShift()))));
			}
		}
		sourceIndex += 1;
	}
	GIV(rememberedSetSize) = destIndex;
	assert(noUnfiredEphemeronsAtEndOfRememberedSet());
}


/*	(Slang flattens so need unique selectors) */

	/* SpurGenerationScavenger>>#scavengerTenuringThreshold */
static float
scavengerTenuringThreshold(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (GIV(tenureThreshold) >= ((GIV(pastSpace).start))
		? (((double) (GIV(tenureThreshold) - ((GIV(pastSpace).start))) )) / (((GIV(pastSpace).limit)) - ((GIV(pastSpace).start)))
		: 0);
}


/*	There may be ephemerons to be scavenged on the ephemeronList.
	Scavenge any with unfired (live) keys, removing them from the
	list, and answer if any with unfired keys were found. */

	/* SpurGenerationScavenger>>#scavengeUnfiredEphemeronsOnEphemeronList */
static sqInt
scavengeUnfiredEphemeronsOnEphemeronList(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt corpseOffset;
    sqInt ephemeron;
    usqInt ephemeronCorpse;
    sqInt nextCorpseOffset;
    usqInt previousCorpse;
    sqInt referent;
    sqInt unfiredEphemeronsScavenged;

	previousCorpse = 0;
	if (!(GIV(ephemeronList))) {
		return 0;
	}
	unfiredEphemeronsScavenged = 0;
	corpseOffset = GIV(ephemeronList);
	while (corpseOffset != 0) {
		/* begin corpseForCorpseOffset: */
		ephemeronCorpse = (((sqInt)((usqInt)((corpseOffset - 1)) << 3 /* shiftForAllocationUnit */))) + GIV(newSpaceStart);
		assert(isForwarded(ephemeronCorpse));
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(ephemeronCorpse));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((ephemeronCorpse + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		ephemeron = referent;
		nextCorpseOffset = (((sqInt)((usqInt)(((long32At(ephemeronCorpse + 4)) & (identityHashHalfWordMask()))) << (formatFieldWidthShift())))) + ((((usqInt) (longAt(ephemeronCorpse))) >> (formatShift())) & (formatMask()));
		if (isScavengeSurvivor((assert((isNonImmediate(ephemeron))
			 && (isObjEphemeron(ephemeron))),
		/* begin fetchPointer:ofObject: */
		longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())))))) {
			if (corpseOffset == GIV(ephemeronList)) {
				GIV(ephemeronList) = (nextCorpseOffset != 0
					? nextCorpseOffset
					: 0);
			}
			else {
				/* begin setCorpseOffsetOf:to: */
				assert(isYoung(previousCorpse));
				assert(isForwarded(previousCorpse));
				
				/* So we use the single assignment */
				long64Atput(previousCorpse, headerForSlotshashformatclassIndex(byteAt(previousCorpse + 7), ((usqInt) nextCorpseOffset) >> (formatFieldWidthShift()), nextCorpseOffset & (formatMask()), isForwardedObjectClassIndexPun()));
			}
			unfiredEphemeronsScavenged = 1;
			((void) (scavengeReferentsOf(ephemeron)));
		}
		else {
			previousCorpse = ephemeronCorpse;
		}
		corpseOffset = nextCorpseOffset;
	}
	return unfiredEphemeronsScavenged;
}


/*	Output the entire record. */

	/* SpurGenerationScavenger>>#writeScavengeLog */
static void NeverInline
writeScavengeLog(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    static char *policyNames[] = {"", "by age", "by class", "to shrink rt", "don't tenure", "mark on tenure"};

	fprintf(GIV(scavengeLog), "scavenge %" PRIdSQINT " eden bytes: 0x%" PRIxSQINT "/%" PRIdSQINT " past bytes: 0x%" PRIxSQINT "/%" PRIdSQINT "\n\trem set: %" PRIdSQINT " redzone: %" PRIdSQINT " size: %" PRIdSQINT "\n", GIV(statScavenges), (GIV(scavengeLogRecord).sEdenBytes), (GIV(scavengeLogRecord).sEdenBytes), (GIV(scavengeLogRecord).sPastBytes), (GIV(scavengeLogRecord).sPastBytes), (GIV(scavengeLogRecord).sRememberedSetSize), (GIV(scavengeLogRecord).sRememberedSetRedZone), (GIV(scavengeLogRecord).sRememberedSetLimit));
	fprintf(GIV(scavengeLog), (((GIV(scavengeLogRecord).tTenureCriterion)) == TenureToShrinkRT
		? "\ttenure below 0x%" PRIxSQINT "/%" PRIdSQINT " %s refct %" PRIdSQINT "\n"
		: "\ttenure below 0x%" PRIxSQINT "/%" PRIdSQINT " %s\n"), (GIV(scavengeLogRecord).tTenureThreshold), (GIV(scavengeLogRecord).tTenureThreshold), policyNames[(GIV(scavengeLogRecord).tTenureCriterion)], (GIV(scavengeLogRecord).tRefCountToShrinkRT));
	fprintf(GIV(scavengeLog), "\tsurvivor bytes: 0x%" PRIxSQINT "/%" PRIdSQINT " rem set: %" PRIdSQINT " tenured: %" PRIdSQINT " usecs: %" PRIdSQINT "\n", (GIV(scavengeLogRecord).eSurvivorBytes), (GIV(scavengeLogRecord).eSurvivorBytes), (GIV(scavengeLogRecord).eRememberedSetSize), ((GIV(scavengeLogRecord).eStatTenures)) - ((GIV(scavengeLogRecord).sStatTenures)), GIV(statSGCDeltaUsecs));
	fflush(GIV(scavengeLog));
}


/*	Answer the accessible object following the given object or 
	free chunk in the heap. Return nil when heap is exhausted.
	This is for primitiveNextObject subsequent to primtiiveSomeObject.
	It also tries to handle more general use by ordering objects as
	eden
	past
	old
	but this is tricky becaus ethe order in memory is
	past
	eden
	old */

	/* SpurMemoryManager>>#accessibleObjectAfter: */
static sqInt NoDbgRegParms
accessibleObjectAfter(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt numSlots;
    sqInt objAfter;

	objAfter = objOop;
	if (oopisLessThan(objAfter, GIV(nilObj))) {

		/* object in new space */
		assert((isInEden(objOop))
		 || (isInPastSpace(objOop)));
		if (oopisGreaterThan(objAfter, GIV(pastSpaceStart))) {

			/* Obj is in eden.  Answer next normal object in eden, if there is one. */
			while (1) {
				/* begin objectAfter:limit: */
				followingWordAddress = addressAfter(objAfter);
				if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) {
					objAfter = GIV(freeStart);
					goto l1;
				}
				flag("endianness");
				followingWord = longAt(followingWordAddress);
				objAfter = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
					? followingWordAddress + BaseHeaderSize
					: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
				if (!(oopisLessThan(objAfter, GIV(freeStart)))) break;
				if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) {
					return objAfter;
				}
			}
			if (GIV(pastSpaceStart) <= (((pastSpace()).start))) {
				return GIV(nilObj);
			}
			/* begin objectStartingAt: */
			address = ((pastSpace()).start);
			numSlots = byteAt(address + 7);
			objAfter = (numSlots == (numSlotsMask())
				? address + BaseHeaderSize
				: address);
			if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) {
				return objAfter;
			}
		}
		while (1) {
			/* begin objectAfter:limit: */
			followingWordAddress1 = addressAfter(objAfter);
			if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) {
				objAfter = GIV(pastSpaceStart);
				goto l3;
			}
			flag("endianness");
			followingWord1 = longAt(followingWordAddress1);
			objAfter = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress1 + BaseHeaderSize
				: followingWordAddress1);
	l3:	/* end objectAfter:limit: */;
			if (!(oopisLessThan(objAfter, GIV(pastSpaceStart)))) break;
			if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) {
				return objAfter;
			}
		}
		return GIV(nilObj);
	}
	while(1) {
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objAfter);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objAfter = GIV(endOfMemory);
			goto l4;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objAfter = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l4:	/* end objectAfter:limit: */;
		if (objAfter == GIV(endOfMemory)) {
			return null;
		}
		if (((longAt(objAfter)) & (classIndexMask())) > (lastClassIndexPun())) {
			return objAfter;
		}
	}
	return 0;
}


/*	Answer whether an ephemeron is active (has an unmarked
	key) and was pushed on the unscanned ephemerons stack. */

	/* SpurMemoryManager>>#activeAndDeferredScan: */
static sqInt NoDbgRegParms NeverInline
activeAndDeferredScan(sqInt anEphemeron)
{
    sqInt key;

	assert(isEphemeron(anEphemeron));
	if ((isImmediate((assert((isNonImmediate(anEphemeron))
		 && (isObjEphemeron(anEphemeron))),
	/* begin fetchPointer:ofObject: */
	(key = longAt((anEphemeron + BaseHeaderSize) + (0U << (shiftForWord())))))))
	 || (((((usqInt) (longAt(key))) >> (markedBitFullShift())) & 1) != 0)) {
		return 0;
	}
	return pushOnUnscannedEphemeronsStack(anEphemeron);
}


/*	Add a freeChunk sub tree back into the large free chunk tree.
	This is for allocateOldSpaceChunkOf[Exactly]Bytes:[suchThat:]. */
/*	N.B. *can't* use numSlotsOfAny: because of rounding up of odd slots
	and/or step in size at 1032 bytes in 32-bits or 2048 bytes in 64-bits. */

	/* SpurMemoryManager>>#addFreeSubTree: */
static void NoDbgRegParms
addFreeSubTree(sqInt freeTree)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt bytesInArg;
    usqInt bytesInNode;
    sqInt subNode;
    sqInt treeNode;

	assert(isFreeObject(freeTree));
	bytesInArg = bytesInObject(freeTree);
	assert(bytesInArg >= ((numFreeLists()) * (allocationUnit())));
	treeNode = GIV(freeLists)[0];
	assert(treeNode != 0);
	while(1) {

		/* check for overlap; could write this as self oop: (self objectAfter: freeChunk) isLessThanOrEqualTo: child...
		   but that relies on headers being correct, etc.  So keep it clumsy... */
		bytesInNode = bytesInObject(treeNode);
		assert((oopisLessThanOrEqualTo((freeTree + bytesInArg) - BaseHeaderSize, treeNode))
		 || (oopisGreaterThanOrEqualTo(freeTree, (treeNode + bytesInNode) - BaseHeaderSize)));
		assert(bytesInNode >= ((numFreeLists()) * (allocationUnit())));
		assert(bytesInArg != bytesInNode);
		if (bytesInNode > bytesInArg) {
			/* begin fetchPointer:ofFreeChunk: */
			subNode = longAt((treeNode + BaseHeaderSize) + (3U << (shiftForWord())));
			if (subNode == 0) {
				/* begin storePointer:ofFreeChunk:withValue: */
				assert(isFreeObject(treeNode));
				assert((freeTree == 0)
				 || (isFreeObject(freeTree)));
				longAtput((treeNode + BaseHeaderSize) + (3U << (shiftForWord())), freeTree);
				/* begin storePointer:ofFreeChunk:withValue: */
				assert(isFreeObject(freeTree));
				assert((treeNode == 0)
				 || (isFreeObject(treeNode)));
				longAtput((freeTree + BaseHeaderSize) + (2U << (shiftForWord())), treeNode);
				return;
			}
		}
		else {
			/* begin fetchPointer:ofFreeChunk: */
			subNode = longAt((treeNode + BaseHeaderSize) + (4U << (shiftForWord())));
			if (subNode == 0) {
				/* begin storePointer:ofFreeChunk:withValue: */
				assert(isFreeObject(treeNode));
				assert((freeTree == 0)
				 || (isFreeObject(freeTree)));
				longAtput((treeNode + BaseHeaderSize) + (4U << (shiftForWord())), freeTree);
				/* begin storePointer:ofFreeChunk:withValue: */
				assert(isFreeObject(freeTree));
				assert((treeNode == 0)
				 || (isFreeObject(treeNode)));
				longAtput((freeTree + BaseHeaderSize) + (2U << (shiftForWord())), treeNode);
				return;
			}
		}
		treeNode = subNode;
	}
}


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

	/* SpurMemoryManager>>#addGCRoot: */
sqInt
addGCRoot(sqInt *varLoc)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (GIV(extraRootCount) >= ExtraRootsSize) {
		return 0;
	}
	GIV(extraRoots)[(GIV(extraRootCount) += 1)] = varLoc;
	return 1;
}

	/* SpurMemoryManager>>#addressCouldBeObj: */
sqInt
addressCouldBeObj(sqInt address)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((address & (BaseHeaderSize - 1)) == 0)
	 && ((oopisGreaterThanOrEqualToandLessThan(address, GIV(oldSpaceStart), GIV(endOfMemory)))
	 || ((oopisGreaterThanOrEqualToandLessThan(address, ((eden()).start), GIV(freeStart)))
	 || ((oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart)))
	 || ((GIV(gcPhaseInProgress) == ScavengeInProgress)
	 && (oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart()))))));
}


/*	Answer if address appears to be that of either an immediate or an object.
	For code disassembly and assertions. */

	/* SpurMemoryManager>>#addressCouldBeOop: */
sqInt
addressCouldBeOop(sqInt address)
{
	return (address & (tagMask()))
	 || (addressCouldBeObj(address));
}


/*	Add freeChunk to the relevant freeList.
	For the benefit of sortedFreeObject:, if freeChunk is large, answer the
	treeNode it
	is added to, if it is added to the next list of a freeTreeNode, otherwise
	answer 0. */
/*	coInterpreter transcript ensureCr. coInterpreter print: 'freeing '. self
	printFreeChunk: freeChunk.
 */

	/* SpurMemoryManager>>#addToFreeList:bytes: */
static sqInt NoDbgRegParms
addToFreeListbytes(sqInt freeChunk, sqInt chunkBytes)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt child;
    usqInt childBytes;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt index;
    sqInt nextFreeChunk;
    sqInt nextFreeChunk1;
    sqInt parent;

	assert(isFreeObject(freeChunk));
	assert(chunkBytes == (bytesInObject(freeChunk)));
	index = chunkBytes / 8 /* allocationUnit */;
	if (index < 64 /* numFreeLists */) {
		/* begin setNextFreeChunkOf:withValue:chunkBytes: */
		nextFreeChunk = GIV(freeLists)[index];
		/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
		assert(isFreeObject(freeChunk));
		assert((nextFreeChunk == 0)
		 || (isFreeObject(nextFreeChunk)));
		longAtput((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())), nextFreeChunk);
		if ((nextFreeChunk != 0)
		 && (!((assert(chunkBytes >= (BaseHeaderSize + (allocationUnit()))),
		chunkBytes == (BaseHeaderSize + 8 /* allocationUnit */))))) {
			/* begin storePointer:ofFreeChunk:withValue: */
			assert(isFreeObject(nextFreeChunk));
			assert((freeChunk == 0)
			 || (isFreeObject(freeChunk)));
			longAtput((nextFreeChunk + BaseHeaderSize) + (1U << (shiftForWord())), freeChunk);
		}
		if (!((assert(chunkBytes >= (BaseHeaderSize + (allocationUnit()))),
			chunkBytes == (BaseHeaderSize + 8 /* allocationUnit */)))) {
			/* begin storePointer:ofFreeChunk:withValue: */
			assert(isFreeObject(freeChunk));
			assert(1);
			longAtput((freeChunk + BaseHeaderSize) + (1U << (shiftForWord())), 0);
		}
		GIV(freeLists)[index] = freeChunk;
		GIV(freeListsMask) = GIV(freeListsMask) | (1ULL << index);
		return 0;
	}
	/* begin addToFreeTree:bytes: */
	assert(isFreeObject(freeChunk));
	assert(chunkBytes == (bytesInObject(freeChunk)));
	assert(chunkBytes >= ((numFreeLists()) * (allocationUnit())));
	/* begin storePointer:ofFreeChunk:withValue: */
	assert(isFreeObject(freeChunk));
	assert(1);
	longAtput((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())), 0);
	/* begin storePointer:ofFreeChunk:withValue: */
	assert(isFreeObject(freeChunk));
	assert(1);
	longAtput((freeChunk + BaseHeaderSize) + (1U << (shiftForWord())), 0);
	/* begin storePointer:ofFreeChunk:withValue: */
	assert(isFreeObject(freeChunk));
	assert(1);
	longAtput((freeChunk + BaseHeaderSize) + (2U << (shiftForWord())), 0);
	/* begin storePointer:ofFreeChunk:withValue: */
	assert(isFreeObject(freeChunk));
	assert(1);
	longAtput((freeChunk + BaseHeaderSize) + (3U << (shiftForWord())), 0);
	/* begin storePointer:ofFreeChunk:withValue: */
	assert(isFreeObject(freeChunk));
	assert(1);
	longAtput((freeChunk + BaseHeaderSize) + (4U << (shiftForWord())), 0);
	parent = 0;
	child = GIV(freeLists)[0];
	while (child != 0) {

		/* check for overlap; could write this as self oop: (self objectAfter: freeChunk) isLessThanOrEqualTo: child...
		   but that relies on headers being correct, etc.  So keep it clumsy... */
		childBytes = bytesInObject(child);
		assert((oopisLessThanOrEqualTo((freeChunk + chunkBytes) - BaseHeaderSize, child))
		 || (oopisGreaterThanOrEqualTo(freeChunk, (child + childBytes) - BaseHeaderSize)));
		if (childBytes == chunkBytes) {

			/* size match; add to list at node. */
			/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
			nextFreeChunk1 = longAt((child + BaseHeaderSize) + (0U << (shiftForWord())));
			/* begin storePointer:ofFreeChunk:withValue: */
			assert(isFreeObject(freeChunk));
			assert((nextFreeChunk1 == 0)
			 || (isFreeObject(nextFreeChunk1)));
			longAtput((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())), nextFreeChunk1);
			if ((nextFreeChunk1 != 0)
			 && (!0)) {
				/* begin storePointer:ofFreeChunk:withValue: */
				assert(isFreeObject(nextFreeChunk1));
				assert((freeChunk == 0)
				 || (isFreeObject(freeChunk)));
				longAtput((nextFreeChunk1 + BaseHeaderSize) + (1U << (shiftForWord())), freeChunk);
			}
			/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
			assert(isFreeObject(child));
			assert((freeChunk == 0)
			 || (isFreeObject(freeChunk)));
			longAtput((child + BaseHeaderSize) + (0U << (shiftForWord())), freeChunk);
			if ((freeChunk != 0)
			 && (!0)) {
				/* begin storePointer:ofFreeChunk:withValue: */
				assert(isFreeObject(freeChunk));
				assert((child == 0)
				 || (isFreeObject(child)));
				longAtput((freeChunk + BaseHeaderSize) + (1U << (shiftForWord())), child);
			}
			return child;
		}
		parent = child;
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex = (childBytes > chunkBytes
			? 3 /* freeChunkSmallerIndex */
			: 4 /* freeChunkLargerIndex */);
		child = longAt((child + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	}
	if (parent == 0) {
		assert((GIV(freeLists)[0]) == 0);
		GIV(freeLists)[0] = freeChunk;
		GIV(freeListsMask) = GIV(freeListsMask) | 1;
		return 0;
	}
	assert(GIV(freeListsMask) & 1);
	/* begin storePointer:ofFreeChunk:withValue: */
	assert(isFreeObject(freeChunk));
	assert((parent == 0)
	 || (isFreeObject(parent)));
	longAtput((freeChunk + BaseHeaderSize) + (2U << (shiftForWord())), parent);
	/* begin storePointer:ofFreeChunk:withValue: */
	fieldIndex1 = (childBytes > chunkBytes
		? 3 /* freeChunkSmallerIndex */
		: 4 /* freeChunkLargerIndex */);
	assert(isFreeObject(parent));
	assert((freeChunk == 0)
	 || (isFreeObject(freeChunk)));
	longAtput((parent + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), freeChunk);
	return 0;
}


/*	Attempt to answer an array of all objects, excluding those that may
	be garbage collected as a side effect of allocating the result array.
	If no memory is available answer the number of instances as a
	SmallInteger. Since objects are at least 16 bytes big, and the largest
	SmallInteger covers
	1/4 of the address space, the count can never overflow. */

	/* SpurMemoryManager>>#allInstancesOf: */
static sqInt NoDbgRegParms
allInstancesOf(sqInt aClass)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt actualIndex;
    sqInt address;
    sqInt address1;
    sqInt address11;
    sqInt address2;
    usqInt bytes;
    sqInt classIndex;
    sqInt classOrNil;
    sqInt count;
    sqInt count1;
    sqInt count2;
    sqInt expectedIndex;
    sqInt expectedIndex1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord11;
    sqInt followingWord2;
    sqInt followingWord21;
    sqInt followingWord3;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress11;
    usqInt followingWordAddress2;
    usqInt followingWordAddress21;
    usqInt followingWordAddress3;
    sqInt freeChunk;
    sqInt i;
    sqInt i1;
    sqInt index;
    sqInt j;
    sqInt jLimiT;
    usqInt limit;
    usqInt limit1;
    usqInt limit11;
    usqInt newObj;
    usqInt newObj1;
    usqInt numBytes;
    usqInt numBytes1;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop2;
    sqInt page;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevObj11;
    sqInt prevObj2;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt prevPrevObj11;
    sqInt prevPrevObj2;
    sqInt ptr;
    sqInt ptr1;
    sqInt ptr2;
    sqInt smallObj;
    sqInt start;

	classIndex = (long32At(aClass + 4)) & (identityHashHalfWordMask());
	if (classIndex == 0) {
		/* begin allocateSlots:format:classIndex: */
		newObj = GIV(freeStart);
		numBytes = BaseHeaderSize + (/* begin allocationUnit */ 8);
		if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
			if (!GIV(needGCFlag)) {
				/* begin scheduleScavenge */
				GIV(needGCFlag) = 1;
				forceInterruptCheck();
			}
			freeChunk = allocateSlotsInOldSpacebytesformatclassIndex(0, numBytes, 2 /* arrayFormat */, ClassArrayCompactIndex);
			goto l4;
		}
		longAtput(newObj, (((((usqLong) 0)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex);
		assert((numBytes % (allocationUnit())) == 0);
		assert((newObj % (allocationUnit())) == 0);
		GIV(freeStart) += numBytes;
		freeChunk = newObj;
	l4:	/* end allocateSlots:format:classIndex: */;
		return freeChunk;
	}
	
	/* N.B. Does /not/ update totalFreeOldSpace */
	freeChunk = allocateLargestFreeChunk();
	start = freeChunk + BaseHeaderSize;
	limit = addressAfter(freeChunk);
	if (isClassAtUniqueIndex(aClass)) {
		/* begin uniqueIndex:allInstancesInto:limit:resultsInto: */
		count1 = 0;
		ptr1 = start;
		/* begin allHeapEntitiesDo: */
		assert(isOldObject(GIV(nilObj)));
		prevPrevObj1 = (prevObj1 = null);
		objOop1 = GIV(nilObj);
		while (1) {
			assert((objOop1 % (allocationUnit())) == 0);
			if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
			assert((long64At(objOop1)) != 0);
			
			/* continue enumerating even if no room so as to unmark all objects. */
			if (((longAt(objOop1)) & (classIndexMask())) > (lastClassIndexPun())) {
				if (((longAt(objOop1)) & (classIndexMask())) == classIndex) {
					count1 += 1;
					if (ptr1 < limit) {
						longAtput(ptr1, objOop1);
						ptr1 += BytesPerOop;
					}
				}
			}
			else {
							}
			prevPrevObj1 = prevObj1;
			prevObj1 = objOop1;
			/* begin objectAfter:limit: */
			followingWordAddress2 = addressAfter(objOop1);
			if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
				objOop1 = GIV(endOfMemory);
				goto l7;
			}
			flag("endianness");
			followingWord2 = longAt(followingWordAddress2);
			objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress2 + BaseHeaderSize
				: followingWordAddress2);
	l7:	/* end objectAfter:limit: */;
		}
		/* begin allNewSpaceEntitiesDo: */

		/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
		   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
		prevPrevObj = (prevObj = null);
		assert((((pastSpace()).start)) < (((eden()).start)));
		/* begin objectStartingAt: */
		address = ((pastSpace()).start);
		numSlots = byteAt(address + 7);
		objOop = (numSlots == (numSlotsMask())
			? address + BaseHeaderSize
			: address);
		limit1 = GIV(pastSpaceStart);
		while (oopisLessThan(objOop, limit1)) {
			
			/* continue enumerating even if no room so as to unmark all objects. */
			if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) {
				if (((longAt(objOop)) & (classIndexMask())) == classIndex) {
					count1 += 1;
					if (ptr1 < limit) {
						longAtput(ptr1, objOop);
						ptr1 += BytesPerOop;
					}
				}
			}
			else {
							}
			prevPrevObj = prevObj;
			prevObj = objOop;
			/* begin objectAfter:limit: */
			followingWordAddress = addressAfter(objOop);
			if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) {
				objOop = limit1;
				goto l9;
			}
			flag("endianness");
			followingWord = longAt(followingWordAddress);
			objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress + BaseHeaderSize
				: followingWordAddress);
	l9:	/* end objectAfter:limit: */;
		}
		/* begin objectStartingAt: */
		address1 = ((eden()).start);
		numSlots1 = byteAt(address1 + 7);
		objOop = (numSlots1 == (numSlotsMask())
			? address1 + BaseHeaderSize
			: address1);
		while (oopisLessThan(objOop, GIV(freeStart))) {
			
			/* continue enumerating even if no room so as to unmark all objects. */
			if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) {
				if (((longAt(objOop)) & (classIndexMask())) == classIndex) {
					count1 += 1;
					if (ptr1 < limit) {
						longAtput(ptr1, objOop);
						ptr1 += BytesPerOop;
					}
				}
			}
			else {
							}
			prevPrevObj = prevObj;
			prevObj = objOop;
			/* begin objectAfter:limit: */
			followingWordAddress1 = addressAfter(objOop);
			if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
				objOop = GIV(freeStart);
				goto l11;
			}
			flag("endianness");
			followingWord1 = longAt(followingWordAddress1);
			objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress1 + BaseHeaderSize
				: followingWordAddress1);
	l11:	/* end objectAfter:limit: */;
		}
		count = count1;
		ptr = ptr1;
	}
	else {
		/* begin ambiguousClass:allInstancesInto:limit:resultsInto: */
		count2 = 0;
		ptr2 = start;
		expectedIndex = (long32At(aClass + 4)) & (identityHashHalfWordMask());
		/* begin allHeapEntitiesDo: */
		assert(isOldObject(GIV(nilObj)));
		prevPrevObj11 = (prevObj11 = null);
		objOop11 = GIV(nilObj);
		while (1) {
			assert((objOop11 % (allocationUnit())) == 0);
			if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
			assert((long64At(objOop11)) != 0);
			
			/* continue enumerating even if no room so as to unmark all objects and/or normalize class indices. */
			if (((longAt(objOop11)) & (classIndexMask())) > (lastClassIndexPun())) {
				actualIndex = (longAt(objOop11)) & (classIndexMask());
				if ((classOrNilAtIndex(actualIndex)) == aClass) {
					if (actualIndex != expectedIndex) {
						/* begin setClassIndexOf:to: */
						assert(((expectedIndex >= 0) && (expectedIndex <= (classIndexMask()))));
						longAtput(objOop11, ((longAt(objOop11)) & (~(usqIntptr_t)(classIndexMask()))) + expectedIndex);
					}
					count2 += 1;
					if (ptr2 < limit) {
						longAtput(ptr2, objOop11);
						ptr2 += BytesPerOop;
					}
				}
			}
			else {
							}
			prevPrevObj11 = prevObj11;
			prevObj11 = objOop11;
			/* begin objectAfter:limit: */
			followingWordAddress21 = addressAfter(objOop11);
			if (oopisGreaterThanOrEqualTo(followingWordAddress21, GIV(endOfMemory))) {
				objOop11 = GIV(endOfMemory);
				goto l12;
			}
			flag("endianness");
			followingWord21 = longAt(followingWordAddress21);
			objOop11 = ((((usqInt) followingWord21) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress21 + BaseHeaderSize
				: followingWordAddress21);
	l12:	/* end objectAfter:limit: */;
		}
		/* begin allNewSpaceEntitiesDo: */

		/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
		   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
		prevPrevObj2 = (prevObj2 = null);
		assert((((pastSpace()).start)) < (((eden()).start)));
		/* begin objectStartingAt: */
		address2 = ((pastSpace()).start);
		numSlots2 = byteAt(address2 + 7);
		objOop2 = (numSlots2 == (numSlotsMask())
			? address2 + BaseHeaderSize
			: address2);
		limit11 = GIV(pastSpaceStart);
		while (oopisLessThan(objOop2, limit11)) {
			
			/* continue enumerating even if no room so as to unmark all objects and/or normalize class indices. */
			if (((longAt(objOop2)) & (classIndexMask())) > (lastClassIndexPun())) {
				actualIndex = (longAt(objOop2)) & (classIndexMask());
				if ((classOrNilAtIndex(actualIndex)) == aClass) {
					if (actualIndex != expectedIndex) {
						/* begin setClassIndexOf:to: */
						assert(((expectedIndex >= 0) && (expectedIndex <= (classIndexMask()))));
						longAtput(objOop2, ((longAt(objOop2)) & (~(usqIntptr_t)(classIndexMask()))) + expectedIndex);
					}
					count2 += 1;
					if (ptr2 < limit) {
						longAtput(ptr2, objOop2);
						ptr2 += BytesPerOop;
					}
				}
			}
			else {
							}
			prevPrevObj2 = prevObj2;
			prevObj2 = objOop2;
			/* begin objectAfter:limit: */
			followingWordAddress3 = addressAfter(objOop2);
			if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit11)) {
				objOop2 = limit11;
				goto l14;
			}
			flag("endianness");
			followingWord3 = longAt(followingWordAddress3);
			objOop2 = ((((usqInt) followingWord3) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress3 + BaseHeaderSize
				: followingWordAddress3);
	l14:	/* end objectAfter:limit: */;
		}
		/* begin objectStartingAt: */
		address11 = ((eden()).start);
		numSlots11 = byteAt(address11 + 7);
		objOop2 = (numSlots11 == (numSlotsMask())
			? address11 + BaseHeaderSize
			: address11);
		while (oopisLessThan(objOop2, GIV(freeStart))) {
			
			/* continue enumerating even if no room so as to unmark all objects and/or normalize class indices. */
			if (((longAt(objOop2)) & (classIndexMask())) > (lastClassIndexPun())) {
				actualIndex = (longAt(objOop2)) & (classIndexMask());
				if ((classOrNilAtIndex(actualIndex)) == aClass) {
					if (actualIndex != expectedIndex) {
						/* begin setClassIndexOf:to: */
						assert(((expectedIndex >= 0) && (expectedIndex <= (classIndexMask()))));
						longAtput(objOop2, ((longAt(objOop2)) & (~(usqIntptr_t)(classIndexMask()))) + expectedIndex);
					}
					count2 += 1;
					if (ptr2 < limit) {
						longAtput(ptr2, objOop2);
						ptr2 += BytesPerOop;
					}
				}
			}
			else {
							}
			prevPrevObj2 = prevObj2;
			prevObj2 = objOop2;
			/* begin objectAfter:limit: */
			followingWordAddress11 = addressAfter(objOop2);
			if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(freeStart))) {
				objOop2 = GIV(freeStart);
				goto l16;
			}
			flag("endianness");
			followingWord11 = longAt(followingWordAddress11);
			objOop2 = ((((usqInt) followingWord11) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress11 + BaseHeaderSize
				: followingWordAddress11);
	l16:	/* end objectAfter:limit: */;
		}
		/* begin purgeDuplicateClassTableEntriesFor: */
		expectedIndex1 = (long32At(aClass + 4)) & (identityHashHalfWordMask());
		/* begin classTableEntriesDo: */
		for (i1 = 0; i1 < GIV(numClassTablePages); i1 += 1) {
			page = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
			for (j = 0, jLimiT = ((1U << (classTableMajorIndexShift())) - 1); j <= jLimiT; j += 1) {
				classOrNil = longAt((page + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))));
				if (classOrNil != GIV(nilObj)) {
					index = (((sqInt)((usqInt)(i1) << (classTableMajorIndexShift())))) + j;
					if ((classOrNil == aClass)
					 && ((index != expectedIndex1)
					 && (index > (lastClassIndexPun())))) {
						classAtIndexput(index, GIV(nilObj));
						if (index < GIV(classTableIndex)) {
							GIV(classTableIndex) = index;
						}
					}
				}
			}
		}
		assert(GIV(classTableIndex) >= (1U << (classTableMajorIndexShift())));
		count = count2;
		ptr = ptr2;
	}
	assert(isEmptyObjStack(GIV(markStack)));
	assert(isEmptyObjStack(GIV(weaklingStack)));
	if ((count > ((ptr - start) / BytesPerOop))
	 || ((limit != ptr)
	 && ((limit - ptr) <= 8 /* allocationUnit */))) {

		/* can't split a single word */
		freeObject(freeChunk);
		return (((usqInt)count << 3) | 1);
	}
	if (count < (numSlotsMask())) {
		/* begin allocateSlots:format:classIndex: */
		if (count >= (numSlotsMask())) {
			if ((((usqInt) count) >> 56) > 0) {
				smallObj = null;
				goto l6;
			}
			newObj1 = GIV(freeStart) + BaseHeaderSize;
			numBytes1 = (BaseHeaderSize + BaseHeaderSize) + (count * BytesPerOop);
		}
		else {
			newObj1 = GIV(freeStart);
			numBytes1 = BaseHeaderSize + ((count < 1
	? /* begin allocationUnit */ 8
	: count * BytesPerOop));
		}
		if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) {
			if (!GIV(needGCFlag)) {
				/* begin scheduleScavenge */
				GIV(needGCFlag) = 1;
				forceInterruptCheck();
			}
			smallObj = allocateSlotsInOldSpacebytesformatclassIndex(count, numBytes1, 2 /* arrayFormat */, ClassArrayCompactIndex);
			goto l6;
		}
		if (count >= (numSlotsMask())) {

			/* for header parsing we put a saturated slot count in the prepended overflow size word */
			flag("endianness");
			longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + count);
			longAtput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), 2 /* arrayFormat */, ClassArrayCompactIndex));
		}
		else {
			longAtput(newObj1, (((((usqLong) count)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex);
		}
		assert((numBytes1 % (allocationUnit())) == 0);
		assert((newObj1 % (allocationUnit())) == 0);
		GIV(freeStart) += numBytes1;
		smallObj = newObj1;
	l6:	/* end allocateSlots:format:classIndex: */;
		for (i = 0; i < count; i += 1) {
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(smallObj)));
			longAtput((smallObj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), longAt((freeChunk + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))));
		}
		freeChunkWithBytesat(bytesInObject(freeChunk), ((byteAt(freeChunk + 7)) == (numSlotsMask())
			? freeChunk - BaseHeaderSize
			: freeChunk));
		beRootIfOld(smallObj);
		/* begin checkFreeSpace: */
		assert(bitsSetInFreeSpaceMaskForAllFreeLists());
		assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
		if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) {
			runLeakCheckerForFreeSpace(GCModeFreeSpace);
		}
		return smallObj;
	}
	bytes = (BaseHeaderSize + BaseHeaderSize) + (count * BytesPerOop);
	start = ((byteAt(freeChunk + 7)) == (numSlotsMask())
		? freeChunk - BaseHeaderSize
		: freeChunk);
	freeChunkWithBytesat((limit - start) - bytes, start + bytes);
	GIV(totalFreeOldSpace) -= bytes;
	/* begin rawOverflowSlotsOf:put: */
	longAtput(freeChunk - BaseHeaderSize, (((sqInt)((usqInt)((numSlotsMask())) << 56))) + count);
	/* begin set:classIndexTo:formatTo: */
	assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask()))));
	assert(((2 /* arrayFormat */ >= 0) && (2 /* arrayFormat */ <= (formatMask()))));
	longAtput(freeChunk, ((longAt(freeChunk)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (2U << (formatShift()))));
	/* begin possibleRootStoreInto: */
	if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) {
		remember(freeChunk);
	}
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	runLeakCheckerFor(GCModeFull);
	return freeChunk;
}


/*	Attempt to answer an array of all objects, excluding those that may
	be garbage collected as a side effect of allocating the result array.
	If no memory is available answer the number of objects as a SmallInteger.
	Since objects are at least 16 bytes big, and the largest SmallInteger
	covers 1/4 of the address space, the count can never overflow. */

	/* SpurMemoryManager>>#allObjects */
static sqInt
allObjects(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    usqInt bytes;
    sqInt count;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt freeChunk;
    usqInt limit;
    usqInt limit1;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt ptr;
    sqInt start;

	
	/* N.B. Does /not/ update totalFreeOldSpace */
	freeChunk = allocateLargestFreeChunk();
	ptr = (start = freeChunk + BaseHeaderSize);
	limit = addressAfter(freeChunk);
	count = 0;
	/* begin allHeapEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		
		/* continue enumerating even if no room so as to unmark all objects. */
		if (((longAt(objOop1)) & (classIndexMask())) > (lastClassIndexPun())) {
			count += 1;
			if (ptr < limit) {
				longAtput(ptr, objOop1);
				ptr += BytesPerOop;
			}
		}
		else {
					}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit1 = GIV(pastSpaceStart);
	while (oopisLessThan(objOop, limit1)) {
		
		/* continue enumerating even if no room so as to unmark all objects. */
		if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) {
			count += 1;
			if (ptr < limit) {
				longAtput(ptr, objOop);
				ptr += BytesPerOop;
			}
		}
		else {
					}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) {
			objOop = limit1;
			goto l6;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l6:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop, GIV(freeStart))) {
		
		/* continue enumerating even if no room so as to unmark all objects. */
		if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) {
			count += 1;
			if (ptr < limit) {
				longAtput(ptr, objOop);
				ptr += BytesPerOop;
			}
		}
		else {
					}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	assert(isEmptyObjStack(GIV(markStack)));
	assert(isEmptyObjStack(GIV(weaklingStack)));
	assert(count >= (numSlotsMask()));
	if ((count > ((ptr - start) / BytesPerOop))
	 || ((limit != ptr)
	 && ((limit - ptr) <= 8 /* allocationUnit */))) {

		/* can't split a single word */
		freeChunkWithBytesat(bytesInObject(freeChunk), ((byteAt(freeChunk + 7)) == (numSlotsMask())
			? freeChunk - BaseHeaderSize
			: freeChunk));
		/* begin checkFreeSpace: */
		assert(bitsSetInFreeSpaceMaskForAllFreeLists());
		assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
		if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) {
			runLeakCheckerForFreeSpace(GCModeFreeSpace);
		}
		return (((usqInt)count << 3) | 1);
	}
	bytes = (BaseHeaderSize + BaseHeaderSize) + (count * BytesPerOop);
	start = ((byteAt(freeChunk + 7)) == (numSlotsMask())
		? freeChunk - BaseHeaderSize
		: freeChunk);
	freeChunkWithBytesat((limit - start) - bytes, start + bytes);
	GIV(totalFreeOldSpace) -= bytes;
	/* begin rawOverflowSlotsOf:put: */
	longAtput(freeChunk - BaseHeaderSize, (((sqInt)((usqInt)((numSlotsMask())) << 56))) + count);
	/* begin set:classIndexTo:formatTo: */
	assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask()))));
	assert(((2 /* arrayFormat */ >= 0) && (2 /* arrayFormat */ <= (formatMask()))));
	longAtput(freeChunk, ((longAt(freeChunk)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (ClassArrayCompactIndex + (2U << (formatShift()))));
	/* begin possibleRootStoreInto: */
	if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) {
		remember(freeChunk);
	}
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	runLeakCheckerFor(GCModeFull);
	return freeChunk;
}

	/* SpurMemoryManager>>#allObjectsUnmarked */
static sqInt
allObjectsUnmarked(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (markedBitFullShift())) & 1) != 0) {
			GIV(bogon) = objOop1;
			return 0;
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (markedBitFullShift())) & 1) != 0) {
			GIV(bogon) = objOop1;
			return 0;
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if (((((usqInt) (longAt(objOop11))) >> (markedBitFullShift())) & 1) != 0) {
				GIV(bogon) = objOop11;
				return 0;
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	return 1;
}

	/* SpurMemoryManager>>#allOldMarkedWeakObjectsOnWeaklingStack */
static sqInt
allOldMarkedWeakObjectsOnWeaklingStack(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt followingWord;
    usqInt followingWordAddress;
    sqInt objOop;
    sqInt prevObj;
    sqInt prevPrevObj;

	/* begin allOldSpaceEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj = (prevObj = null);
	objOop = GIV(nilObj);
	while (1) {
		assert((objOop % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break;
		assert((long64At(objOop)) != 0);
		if ((isWeakFormat((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask())))
		 && (((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0)) {
			if (!(isonObjStack(objOop, GIV(weaklingStack)))) {
				return 0;
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
			objOop = GIV(endOfMemory);
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	return 1;
}


/*	Answer the largest free chunk in the free lists. */
/*	would like to use ifNotNil: but the ^next inside the ^blah ifNotNil:
	confused Slang
 */

	/* SpurMemoryManager>>#allocateLargestFreeChunk */
static sqInt
allocateLargestFreeChunk(void)
{
    sqInt freeChunk;
    sqInt next;
    sqInt nextFreeChunk;

	freeChunk = findLargestFreeChunk();
	if (!(freeChunk)) {
		return null;
	}
	/* begin fetchPointer:ofFreeChunk: */
	next = longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())));
	if (next != 0) {
		assert((bytesInObject(freeChunk)) >= (numFreeLists()));
		/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
		nextFreeChunk = longAt((next + BaseHeaderSize) + (0U << (shiftForWord())));
		/* begin storePointer:ofFreeChunk:withValue: */
		assert(isFreeObject(freeChunk));
		assert((nextFreeChunk == 0)
		 || (isFreeObject(nextFreeChunk)));
		longAtput((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())), nextFreeChunk);
		if ((nextFreeChunk != 0)
		 && (!0)) {
			/* begin storePointer:ofFreeChunk:withValue: */
			assert(isFreeObject(nextFreeChunk));
			assert((freeChunk == 0)
			 || (isFreeObject(freeChunk)));
			longAtput((nextFreeChunk + BaseHeaderSize) + (1U << (shiftForWord())), freeChunk);
		}
		return next;
	}
	unlinkSolitaryFreeTreeNode(freeChunk);
	return freeChunk;
}


/*	Allocate an object with numSlots in newSpace. This is for the `ee'
	execution engine allocations,
	and must be satisfied. If no memory is available, abort. If the allocation
	pushes freeStart past
	scavengeThreshold and a scavenge is not already scheduled, schedule a
	scavenge.  */
/*	Object headers are 8 bytes in length if the slot size fits in the num
	slots field (max implies overflow),
	16 bytes otherwise (num slots in preceding word).
	Objects always have at least one slot, for the forwarding pointer,
	and are multiples of 8 bytes in length. */

	/* SpurMemoryManager>>#allocateNewSpaceSlots:format:classIndex: */
static sqInt NoDbgRegParms
allocateNewSpaceSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt newObj;
    usqInt numBytes;

	if (numSlots >= (numSlotsMask())) {
		if (numSlots > 0xFFFFFFFFU) {
			return null;
		}
		newObj = GIV(freeStart) + BaseHeaderSize;
		numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop);
	}
	else {
		newObj = GIV(freeStart);
		numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
	}
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
			error("no room in eden for allocateNewSpaceSlots:format:classIndex:");
			return 0;
		}
	}
	if (numSlots >= (numSlotsMask())) {

		/* for header parsing we put a saturated slot count in the prepended overflow size word */
		flag("endianness");
		longAtput(GIV(freeStart), numSlots);
		longAtput(GIV(freeStart) + 4, ((sqInt)((usqInt)((numSlotsMask())) << (numSlotsHalfShift()))));
		long64Atput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex));
	}
	else {
		long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex);
	}
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	GIV(freeStart) += numBytes;
	return newObj;
}


/*	Answer a chunk of oldSpace from the free lists, if available,
	otherwise answer nil. Break up a larger chunk if one of the
	exact size does not exist. N.B. the chunk is simply a pointer, it
	has no valid header. The caller *must* fill in the header correctly. */
/*	for debugging: */
/*	totalFreeOldSpace := self totalFreeListBytes */

	/* SpurMemoryManager>>#allocateOldSpaceChunkOfBytes: */
static sqInt NoDbgRegParms
allocateOldSpaceChunkOfBytes(usqInt chunkBytes)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt child;
    usqInt childBytes;
    sqInt chunk;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt fieldIndex2;
    usqInt index;
    usqInt initialIndex;
    sqInt next;
    sqInt next1;
    sqInt next2;
    sqInt nextFreeChunk;
    sqInt nextFreeChunk1;
    usqInt nodeBytes;
    sqInt parent;

	nodeBytes = 0;

	/* be optimistic (& don't wait for the write) */
	GIV(totalFreeOldSpace) -= chunkBytes;
	initialIndex = chunkBytes / 8 /* allocationUnit */;
	if ((initialIndex < 64 /* numFreeLists */)
	 && ((1ULL << initialIndex) <= GIV(freeListsMask))) {
		if (GIV(freeListsMask) & (1ULL << initialIndex)) {
			if (((chunk = GIV(freeLists)[initialIndex])) != 0) {
				assert(chunk == (startOfObject(chunk)));
				/* begin assertValidFreeObject: */
				assert(assertInnerValidFreeObject(chunk));
				/* begin unlinkFreeChunk:atIndex:isLilliputianSize: */
				assert(((bytesInObject(chunk)) == (initialIndex * (allocationUnit())))
				 && ((initialIndex > 1)
				 && ((startOfObject(chunk)) == chunk)));
				GIV(freeLists)[initialIndex] = ((next = longAt((chunk + BaseHeaderSize) + (0U << (shiftForWord())))));
				if ((!((assert(chunkBytes >= (BaseHeaderSize + (allocationUnit()))),
				chunkBytes == (BaseHeaderSize + 8 /* allocationUnit */))))
				 && (next != 0)) {
					/* begin storePointer:ofFreeChunk:withValue: */
					fieldIndex = 1 /* freeChunkPrevIndex */;
					assert(isFreeObject(next));
					assert(1);
					longAtput((next + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), 0);
				}
				return chunk;
			}
			GIV(freeListsMask) -= 1ULL << initialIndex;
		}
		index = initialIndex;
		while ((((index += index)) < 64 /* numFreeLists */)
		 && ((1ULL << index) <= GIV(freeListsMask))) {
			if (GIV(freeListsMask) & (1ULL << index)) {
				if (((chunk = GIV(freeLists)[index])) != 0) {
					assert(chunk == (startOfObject(chunk)));
					/* begin assertValidFreeObject: */
					assert(assertInnerValidFreeObject(chunk));
					/* begin unlinkFreeChunk:atIndex:isLilliputianSize: */
					assert(((bytesInObject(chunk)) == (index * (allocationUnit())))
					 && ((index > 1)
					 && ((startOfObject(chunk)) == chunk)));
					GIV(freeLists)[index] = ((next1 = longAt((chunk + BaseHeaderSize) + (0U << (shiftForWord())))));
					if (next1 != 0) {
						/* begin storePointer:ofFreeChunk:withValue: */
						fieldIndex1 = 1 /* freeChunkPrevIndex */;
						assert(isFreeObject(next1));
						assert(1);
						longAtput((next1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), 0);
					}
					assert((bytesInObject(chunk)) == (index * (allocationUnit())));
					freeChunkWithBytesat((index * 8 /* allocationUnit */) - chunkBytes, (((byteAt(chunk + 7)) == (numSlotsMask())
	? chunk - BaseHeaderSize
	: chunk)) + chunkBytes);
					return chunk;
				}
				GIV(freeListsMask) -= 1ULL << index;
			}
		}
		index = initialIndex + 1;
		while ((((index += 1)) < 64 /* numFreeLists */)
		 && ((1ULL << index) <= GIV(freeListsMask))) {
			if (GIV(freeListsMask) & (1ULL << index)) {
				if (((chunk = GIV(freeLists)[index])) != 0) {
					assert(chunk == (startOfObject(chunk)));
					/* begin assertValidFreeObject: */
					assert(assertInnerValidFreeObject(chunk));
					/* begin unlinkFreeChunk:atIndex:isLilliputianSize: */
					assert(((bytesInObject(chunk)) == (index * (allocationUnit())))
					 && ((index > 1)
					 && ((startOfObject(chunk)) == chunk)));
					GIV(freeLists)[index] = ((next2 = longAt((chunk + BaseHeaderSize) + (0U << (shiftForWord())))));
					if (next2 != 0) {
						/* begin storePointer:ofFreeChunk:withValue: */
						fieldIndex2 = 1 /* freeChunkPrevIndex */;
						assert(isFreeObject(next2));
						assert(1);
						longAtput((next2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), 0);
					}
					assert((bytesInObject(chunk)) == (index * (allocationUnit())));
					freeChunkWithBytesat((index * 8 /* allocationUnit */) - chunkBytes, (((byteAt(chunk + 7)) == (numSlotsMask())
	? chunk - BaseHeaderSize
	: chunk)) + chunkBytes);
					return chunk;
				}
				GIV(freeListsMask) -= 1ULL << index;
			}
		}
	}
	parent = 0;
	child = GIV(freeLists)[0];
	while (child != 0) {
		/* begin assertValidFreeObject: */
		assert(assertInnerValidFreeObject(child));
		childBytes = bytesInObject(child);
		if (childBytes == chunkBytes) {

			/* size match; try to remove from list at node. */
			/* begin fetchPointer:ofFreeChunk: */
			chunk = longAt((child + BaseHeaderSize) + (0U << (shiftForWord())));
			if (chunk != 0) {
				/* begin assertValidFreeObject: */
				assert(assertInnerValidFreeObject(chunk));
				/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
				nextFreeChunk = longAt((chunk + BaseHeaderSize) + (0U << (shiftForWord())));
				/* begin storePointer:ofFreeChunk:withValue: */
				assert(isFreeObject(child));
				assert((nextFreeChunk == 0)
				 || (isFreeObject(nextFreeChunk)));
				longAtput((child + BaseHeaderSize) + (0U << (shiftForWord())), nextFreeChunk);
				if ((nextFreeChunk != 0)
				 && (!0)) {
					/* begin storePointer:ofFreeChunk:withValue: */
					assert(isFreeObject(nextFreeChunk));
					assert((child == 0)
					 || (isFreeObject(child)));
					longAtput((nextFreeChunk + BaseHeaderSize) + (1U << (shiftForWord())), child);
				}
				return ((byteAt(chunk + 7)) == (numSlotsMask())
					? chunk - BaseHeaderSize
					: chunk);
			}
			nodeBytes = childBytes;
			parent = child;

			/* break out of loop to remove interior node */
			child = 0;
		}
		else {

			/* Note that because the minimum free size is 16 bytes (2 * allocationUnit), to
			   leave room for the forwarding pointer/next free link, we can only break chunks
			   that are at least 16 bytes larger, hence reject chunks < 2 * allocationUnit larger. */
			if (childBytes <= (chunkBytes + 8 /* allocationUnit */)) {

				/* node too small; walk down the larger size of the tree */
				/* begin fetchPointer:ofFreeChunk: */
				child = longAt((child + BaseHeaderSize) + (4U << (shiftForWord())));
			}
			else {

				/* parent will be smallest node >= chunkBytes + allocationUnit */
				parent = child;
				nodeBytes = childBytes;
				/* begin fetchPointer:ofFreeChunk: */
				child = longAt((child + BaseHeaderSize) + (3U << (shiftForWord())));
			}
		}
	}
	if (parent == 0) {

		/* optimism was unfounded */
		GIV(totalFreeOldSpace) += chunkBytes;
		return null;
	}
	assert((nodeBytes == chunkBytes)
	 || (nodeBytes >= (chunkBytes + (2 * (allocationUnit())))));
	assert((bytesInObject(parent)) == nodeBytes);
	/* begin fetchPointer:ofFreeChunk: */
	chunk = longAt((parent + BaseHeaderSize) + (0U << (shiftForWord())));
	if (chunk != 0) {
		assert((chunkBytes == nodeBytes)
		 || ((chunkBytes + (allocationUnit())) < nodeBytes));
		/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
		nextFreeChunk1 = longAt((chunk + BaseHeaderSize) + (0U << (shiftForWord())));
		/* begin storePointer:ofFreeChunk:withValue: */
		assert(isFreeObject(parent));
		assert((nextFreeChunk1 == 0)
		 || (isFreeObject(nextFreeChunk1)));
		longAtput((parent + BaseHeaderSize) + (0U << (shiftForWord())), nextFreeChunk1);
		if ((nextFreeChunk1 != 0)
		 && (!0)) {
			/* begin storePointer:ofFreeChunk:withValue: */
			assert(isFreeObject(nextFreeChunk1));
			assert((parent == 0)
			 || (isFreeObject(parent)));
			longAtput((nextFreeChunk1 + BaseHeaderSize) + (1U << (shiftForWord())), parent);
		}
		if (chunkBytes != nodeBytes) {
			freeChunkWithBytesat(nodeBytes - chunkBytes, (((byteAt(chunk + 7)) == (numSlotsMask())
	? chunk - BaseHeaderSize
	: chunk)) + chunkBytes);
		}
		return ((byteAt(chunk + 7)) == (numSlotsMask())
			? chunk - BaseHeaderSize
			: chunk);
	}
	chunk = parent;
	unlinkSolitaryFreeTreeNode(chunk);
	if (chunkBytes != nodeBytes) {
		freeChunkWithBytesat(nodeBytes - chunkBytes, (((byteAt(chunk + 7)) == (numSlotsMask())
	? chunk - BaseHeaderSize
	: chunk)) + chunkBytes);
	}
	return ((byteAt(chunk + 7)) == (numSlotsMask())
		? chunk - BaseHeaderSize
		: chunk);
}

	/* SpurMemoryManager>>#allocatePinnedSlots: */
sqInt
allocatePinnedSlots(sqInt nSlots)
{
    sqInt obj;
    usqInt p;

	obj = allocateSlotsForPinningInOldSpacebytesformatclassIndex(nSlots, (nSlots == 0
		? 8 /* allocationUnit */ + BaseHeaderSize
		: (((sqInt)((usqInt)(nSlots) << (shiftForWord())))) + ((nSlots >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))), sixtyFourBitIndexableFormat(), sixtyFourBitLongsClassIndexPun());
	if (!(obj == null)) {
		/* begin fillObj:numSlots:with: */
		assert(oopisLessThan(((obj + BaseHeaderSize) + (nSlots * BytesPerOop)) - 1, addressAfter(obj)));
		for (p = (((usqInt)(obj + BaseHeaderSize))); p <= (((usqInt)(((obj + BaseHeaderSize) + (nSlots * BytesPerOop)) - 1))); p += 8 /* allocationUnit */) {
			longAtput(p, 0);
		}
	}
	return obj;
}


/*	All objects are a multiple of 8 bytes in length */

	/* SpurMemoryManager>>#allocationUnit */
static sqInt
allocationUnit(void)
{
	return 8;
}


/*	N.B. generateToByDoLimitExpression:negative:on: guards against (unsigned)0
	- 1 going +ve
 */

	/* SpurMemoryManager>>#allStrongSlotsOfWeaklingAreMarked: */
static sqInt NoDbgRegParms
allStrongSlotsOfWeaklingAreMarked(sqInt aWeakling)
{
    sqInt classFormat;
    sqInt i;
    sqInt iLimiT;
    sqInt objOop;
    sqInt referent;

	for (i = 0, iLimiT = (((assert((formatOf(aWeakling)) == (weakArrayFormat())),
/* begin fixedFieldsOfClass: */
(objOop = fetchClassOfNonImm(aWeakling)),
/* begin fixedFieldsOfClassFormat: */
(classFormat = ((longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)),
classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += 1) {
		referent = longAt((aWeakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if ((referent & (tagMask())) == 0) {
			if (!(((((usqInt) (longAt(referent))) >> (markedBitFullShift())) & 1) != 0)) {
				return 0;
			}
		}
	}
	return 1;
}

	/* SpurMemoryManager>>#allUnscannedEphemeronsAreActive */
static sqInt
allUnscannedEphemeronsAreActive(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt key;
    sqInt p;

	for (p = ((GIV(unscannedEphemerons).start)); p <= (((GIV(unscannedEphemerons).top)) - BytesPerOop); p += BytesPerOop) {
		assert((isNonImmediate(longAt(p)))
		 && (isMaybeFiredEphemeron(longAt(p))));
		/* begin fetchPointer:ofObject: */
		key = longAt(((longAt(p)) + BaseHeaderSize) + (0U << (shiftForWord())));
		if ((key & (tagMask()))
		 || (((((usqInt) (longAt(key))) >> (markedBitFullShift())) & 1) != 0)) {
			return 0;
		}
	}
	return 1;
}

	/* SpurMemoryManager>>#arrayFormat */
sqInt
arrayFormat(void)
{
	return 2;
}


/*	we don't want to inline so we can nest that in an assertion with the
	return true so the production VM does not generate any code here, while in
	simulation, the code breaks on the assertion we want to.
 */

	/* SpurMemoryManager>>#assertInnerValidFreeObject: */
static sqInt NoDbgRegParms NeverInline
assertInnerValidFreeObject(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt cameFrom;
    sqInt chunk;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt fieldIndex2;
    usqInt index;
    sqInt largeChild;
    sqInt smallChild;
    sqInt treeNode;

	assert(oopisLessThanOrEqualTo(addressAfter(objOop), GIV(endOfMemory)));
	/* begin fetchPointer:ofFreeChunk: */
	chunk = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
	assert((chunk == 0)
	 || (isFreeOop(chunk)));
	if (!(isLilliputianSize(bytesInObject(objOop)))) {

		/* double linkedlist assertions */
		/* begin fetchPointer:ofFreeChunk: */
		chunk = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
		if (!(chunk == 0)) {
			assert(isFreeOop(chunk));
			assert(objOop == (fetchPointerofFreeChunk(freeChunkPrevIndex(), chunk)));
		}
		/* begin fetchPointer:ofFreeChunk: */
		chunk = longAt((objOop + BaseHeaderSize) + (1U << (shiftForWord())));
		index = (bytesInObject(objOop)) / 8 /* allocationUnit */;
		if ((index < 64 /* numFreeLists */)
		 && ((1ULL << index) <= GIV(freeListsMask))) {
			if ((GIV(freeLists)[index]) == objOop) {
				assert(chunk == 0);
			}
		}
		else {
			/* begin freeTreeNodesDo: */
			treeNode = GIV(freeLists)[0];
			if (treeNode == 0) {
				goto l4;
			}
			cameFrom = -1;
			do {
				assert((bytesInObject(treeNode)) >= ((numFreeLists()) * (allocationUnit())));
				/* begin fetchPointer:ofFreeChunk: */
				fieldIndex1 = 3 /* freeChunkSmallerIndex */;
				smallChild = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
				/* begin fetchPointer:ofFreeChunk: */
				fieldIndex2 = 4 /* freeChunkLargerIndex */;
				largeChild = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))));
				assert((smallChild == 0)
				 || (treeNode == (fetchPointerofFreeChunk(freeChunkParentIndex(), smallChild))));
				assert((largeChild == 0)
				 || (treeNode == (fetchPointerofFreeChunk(freeChunkParentIndex(), largeChild))));
				if (((smallChild == 0)
				 && (largeChild == 0))
				 || ((largeChild == 0
					? cameFrom == smallChild
					: cameFrom == largeChild))) {

					/* and since we've applied we must move on up */
					if (treeNode == objOop) {
						assert(chunk == 0);
					}
					treeNode = treeNode;
					cameFrom = treeNode;
					/* begin fetchPointer:ofFreeChunk: */
					fieldIndex = 2 /* freeChunkParentIndex */;
					treeNode = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
				}
				else {
					if ((smallChild != 0)
					 && (cameFrom != smallChild)) {
						treeNode = smallChild;
					}
					else {
						assert(largeChild != 0);
						treeNode = largeChild;
					}
					cameFrom = -1;
				}
			} while(treeNode != 0);
	l4:	/* end freeTreeNodesDo: */;
		}
		if (!(chunk == 0)) {
			assert(isFreeOop(chunk));
			assert(objOop == (fetchPointerofFreeChunk(freeChunkNextIndex(), chunk)));
		}
	}
	if ((bytesInObject(objOop)) >= (64 /* numFreeLists */ * 8 /* allocationUnit */)) {

		/* Tree assertions */
		/* begin fetchPointer:ofFreeChunk: */
		chunk = longAt((objOop + BaseHeaderSize) + (2U << (shiftForWord())));
		assert((chunk == 0)
		 || ((isFreeOop(chunk))
		 && (isLargeFreeObject(chunk))));
		/* begin fetchPointer:ofFreeChunk: */
		chunk = longAt((objOop + BaseHeaderSize) + (3U << (shiftForWord())));
		assert((chunk == 0)
		 || ((isFreeOop(chunk))
		 && (isLargeFreeObject(chunk))));
		/* begin fetchPointer:ofFreeChunk: */
		chunk = longAt((objOop + BaseHeaderSize) + (4U << (shiftForWord())));
		assert((chunk == 0)
		 || ((isFreeOop(chunk))
		 && (isLargeFreeObject(chunk))));
	}
	return 1;
}


/*	Answer the appropriate become effect flags for objOop, or 0 if none.
	The effect flags determine how much work is done after the become
	in following forwarding pointers, voiding method caches, etc. */

	/* SpurMemoryManager>>#becomeEffectFlagsFor: */
static sqInt NoDbgRegParms
becomeEffectFlagsFor(sqInt objOop)
{
    sqInt hash;

	return (((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */
		? ((((hash = (long32At(objOop + 4)) & (identityHashHalfWordMask()))) != 0)
			 && ((classAtIndex(hash)) == objOop)
				? BecamePointerObjectFlag + BecameActiveClassFlag
				: BecamePointerObjectFlag)
		: (((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())
				? BecameCompiledMethodFlag
				: 0));
}

	/* SpurMemoryManager>>#become:with: */
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. 
	Answers PrimNoErr if the primitive succeeds, otherwise a relevant error
	code. 
 */
/*	Implementation: Uses lazy forwarding to defer updating references until
	message send.
 */

	/* SpurMemoryManager>>#become:with:twoWay:copyHash: */
static sqInt NoDbgRegParms
becomewithtwoWaycopyHash(sqInt array1, sqInt array2, sqInt twoWayFlag, sqInt copyHashFlag)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt contextSize;
    sqInt ec;
    sqInt effectsFlags;
    sqInt fieldOffset;
    sqInt fmt;
    sqInt hash;
    sqInt header;
    sqInt header1;
    sqInt i;
    sqInt i1;
    sqInt iLimiT;
    sqInt iLimiT1;
    sqInt newObj1;
    sqInt newObj2;
    sqInt o1ClassIndex;
    sqInt o2ClassIndex;
    sqInt obj1;
    sqInt obj11;
    sqInt obj2;
    sqInt obj21;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop2;
    sqInt objOop21;
    sqInt objOop3;
    sqInt objOop4;
    sqInt oop1;
    sqInt oop2;
    sqInt referent;
    sqInt referent1;
    sqInt referent11;
    sqInt referent2;
    sqInt referent3;
    sqInt size;
    sqInt sp;

	assert(GIV(becomeEffectsFlags) == 0);
	runLeakCheckerFor(GCModeBecome);
	if (!(((array1 & (tagMask())) == 0)
		 && (((((usqInt) (longAt(array1))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))) {
		return PrimErrBadReceiver;
	}
	if (!((((array2 & (tagMask())) == 0)
		 && (((((usqInt) (longAt(array2))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && ((numSlotsOf(array1)) == (numSlotsOf(array2))))) {
		return PrimErrBadArgument;
	}
	/* begin containsOnlyValidBecomeObjects:and:twoWay:copyHash: */
	fmt = (((usqInt) (longAt(array1))) >> (formatShift())) & (formatMask());
	assert(fmt != (forwardedFormat()));
	if (fmt <= 5 /* lastPointerFormat */) {
		if ((fmt == (indexablePointersFormat()))
		 && (((longAt(array1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

			/* contexts end at the stack pointer */
			/* begin fetchStackPointerOf: */
			sp = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
			if (!((((sp) & 7) == 1))) {
				contextSize = 0;
				goto l39;
			}
			assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(array1)));
			contextSize = (sp >> 3);
	l39:	/* end fetchStackPointerOf: */;
			fieldOffset = (((CtxtTempFrameStart - 1) + contextSize) * BytesPerOop) + BaseHeaderSize;
			goto l34;
		}
		fieldOffset = (((numSlotsOf(array1)) - 1) * BytesPerOop) + BaseHeaderSize;
		goto l34;
	}
	if (fmt < (firstCompiledMethodFormat())) {
		fieldOffset = 0;
		goto l34;
	}
	/* begin methodHeaderOf: */
	assert(isCompiledMethod(array1));
	header1 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	fieldOffset = (((((assert((((header) & 7) == 1)),
((header >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1) * BytesPerOop) + BaseHeaderSize;
	l34:	/* end lastPointerOf: */;

	/* array1 is known to be the same size as array2 */
	effectsFlags = (size = 0);
	while (fieldOffset >= BaseHeaderSize) {
		oop1 = longAt(array1 + fieldOffset);
		if (((oop1 & (tagMask())) == 0)
		 && (((longAt(oop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(oop1));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent3 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent3 & (tagMask())) == 0)
			 && (((longAt(referent3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			oop1 = referent3;
			longAtput(array1 + fieldOffset, oop1);
		}
		/* begin ifOopInvalidForBecome:errorCodeInto: */
		if (oop1 & (tagMask())) {
			ec = PrimErrInappropriate;
			goto l40;
			goto l38;
		}
		if (((((usqInt) (longAt(oop1))) >> (pinnedBitShift())) & 1) != 0) {
			ec = PrimErrObjectIsPinned;
			goto l40;
			goto l38;
		}
		if (
#    if IMMUTABILITY
			(/* begin isImmutable: */
					((((usqInt) (longAt(oop1))) >> (immutableBitShift())) & 1) != 0)
#    else /* IMMUTABILITY */
			0
#    endif /* IMMUTABILITY */
			) {
			ec = PrimErrNoModification;
			goto l40;
			goto l38;
		}
	l38:	/* end ifOopInvalidForBecome:errorCodeInto: */;
		effectsFlags = effectsFlags | (becomeEffectFlagsFor(oop1));
		oop2 = longAt(array2 + fieldOffset);
		if (((oop2 & (tagMask())) == 0)
		 && (((longAt(oop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(oop2));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent11 = longAt((oop2 + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent11 & (tagMask())) == 0)
			 && (((longAt(referent11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			oop2 = referent11;
			longAtput(array2 + fieldOffset, oop2);
		}
		if (twoWayFlag) {
			/* begin ifOopInvalidForBecome:errorCodeInto: */
			if (oop2 & (tagMask())) {
				ec = PrimErrInappropriate;
				goto l40;
				goto l35;
			}
			if (((((usqInt) (longAt(oop2))) >> (pinnedBitShift())) & 1) != 0) {
				ec = PrimErrObjectIsPinned;
				goto l40;
				goto l35;
			}
			if (
#      if IMMUTABILITY
				(/* begin isImmutable: */
							((((usqInt) (longAt(oop2))) >> (immutableBitShift())) & 1) != 0)
#      else /* IMMUTABILITY */
				0
#      endif /* IMMUTABILITY */
				) {
				ec = PrimErrNoModification;
				goto l40;
				goto l35;
			}
	l35:	/* end ifOopInvalidForBecome:errorCodeInto: */;
			size = (size + (bytesInObject(oop1))) + (bytesInObject(oop2));
			effectsFlags = effectsFlags | (becomeEffectFlagsFor(oop2));
		}
		else {
			if (copyHashFlag
			 && ((oop2 & (tagMask()))
			 || (((((usqInt) (longAt(oop2))) >> (immutableBitShift())) & 1) != 0))) {
				ec = PrimErrInappropriate;
				goto l40;
			}
		}
		fieldOffset -= BytesPerOop;
	}
	if (size >= (GIV(totalFreeOldSpace) + (GIV(scavengeThreshold) - GIV(freeStart)))) {
		ec = PrimErrNoMemory;
		goto l40;
	}
	GIV(becomeEffectsFlags) = effectsFlags;
	ec = 0;
	l40:	/* end containsOnlyValidBecomeObjects:and:twoWay:copyHash: */;
	if (ec != 0) {
		GIV(becomeEffectsFlags) = 0;
		return ec;
	}
	/* begin preBecomeAction */
	if (GIV(stackPage) != 0) {
		/* begin externalWriteBackHeadFramePointers */
		assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
		assert(GIV(stackPage) == (mostRecentlyUsedPage()));
		assert(!((isFree(GIV(stackPage)))));
		/* begin setHeadFP:andSP:inPage: */
		assert(GIV(stackPointer) < GIV(framePointer));
		assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
		assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
		(GIV(stackPage)->headFP = GIV(framePointer));
		(GIV(stackPage)->headSP = GIV(stackPointer));
		assert(pageListIsWellFormed());
	}
	GIV(gcMode) = GCModeBecome;
	if (twoWayFlag) {
		/* begin innerBecomeObjectsIn:and:copyHash: */
		for (i = 0, iLimiT = ((numSlotsOf(array1)) - 1); i <= iLimiT; i += 1) {

			/* At first blush it would appear unnecessary to use followField: here since
			   the validation in become:with:twoWay:copyHash: follows forwarders.  But
			   there's nothing to ensure all elements of each array are unique and don't
			   appear in the other array.  So the enumeration could encounter an object
			   already becommed earlier in the same enumeration. */
			/* begin followField:ofObject: */
			objOop2 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
			if (((objOop2 & (tagMask())) == 0)
			 && (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop2 = fixFollowedFieldofObjectwithInitialValue(i, array1, objOop2);
			}
			obj1 = objOop2;
			/* begin followField:ofObject: */
			objOop3 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
			if (((objOop3 & (tagMask())) == 0)
			 && (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop3 = fixFollowedFieldofObjectwithInitialValue(i, array2, objOop3);
			}
			obj2 = objOop3;
			if (obj1 != obj2) {
				/* begin doBecome:and:copyHash: */
				o1ClassIndex = (long32At(obj1 + 4)) & (identityHashHalfWordMask());
				if ((o1ClassIndex != 0)
				 && ((classAtIndex(o1ClassIndex)) != obj1)) {
					o1ClassIndex = 0;
				}
				o2ClassIndex = (long32At(obj2 + 4)) & (identityHashHalfWordMask());
				if ((o2ClassIndex != 0)
				 && ((classAtIndex(o2ClassIndex)) != obj2)) {
					o2ClassIndex = 0;
				}
				if (((numSlotsOf(obj1)) == (numSlotsOf(obj2)))
				 && ((o1ClassIndex == 0)
				 && (o2ClassIndex == 0))) {
					inPlaceBecomeandcopyHashFlag(obj1, obj2, copyHashFlag);
					goto l15;
				}
				outOfPlaceBecomeandcopyHashFlag(obj1, obj2, copyHashFlag);
				if (copyHashFlag) {
					goto l15;
				}
				if (o1ClassIndex != 0) {
					if (o2ClassIndex != 0) {
						classAtIndexput(o1ClassIndex, obj2);
						classAtIndexput(o2ClassIndex, obj1);
					}
					else {

						/* o2 wasn't in the table; set its hash */
						/* begin followForwarded: */
						assert(isUnambiguouslyForwarder(obj1));
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent2 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord())));
						while (((referent2 & (tagMask())) == 0)
						 && (((longAt(referent2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
							/* begin fetchPointer:ofMaybeForwardedObject: */
							referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord())));
						}
						newObj2 = referent2;
						assert((rawHashBitsOf(newObj2)) == 0);
						/* begin setHashBitsOf:to: */
						assert(((o1ClassIndex >= 0) && (o1ClassIndex <= (identityHashHalfWordMask()))));
						long32Atput(newObj2 + 4, ((((long32At(newObj2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + o1ClassIndex);
					}
				}
				else {
					if (o2ClassIndex != 0) {

						/* o1 wasn't in the table; set its hash */
						/* begin followForwarded: */
						assert(isUnambiguouslyForwarder(obj2));
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent1 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord())));
						while (((referent1 & (tagMask())) == 0)
						 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
							/* begin fetchPointer:ofMaybeForwardedObject: */
							referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
						}
						newObj1 = referent1;
						assert((rawHashBitsOf(newObj1)) == 0);
						/* begin setHashBitsOf:to: */
						assert(((o2ClassIndex >= 0) && (o2ClassIndex <= (identityHashHalfWordMask()))));
						long32Atput(newObj1 + 4, ((((long32At(newObj1 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + o2ClassIndex);
					}
				}
	l15:	/* end doBecome:and:copyHash: */;
				/* begin followField:ofObject: */
				objOop = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
				if (((objOop & (tagMask())) == 0)
				 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop = fixFollowedFieldofObjectwithInitialValue(i, array1, objOop);
				}
				/* begin followField:ofObject: */
				objOop1 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
				if (((objOop1 & (tagMask())) == 0)
				 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop1 = fixFollowedFieldofObjectwithInitialValue(i, array2, objOop1);
				}
			}
		}
	}
	else {
		/* begin innerBecomeObjectsIn:to:copyHash: */
		for (i1 = 0, iLimiT1 = ((numSlotsOf(array1)) - 1); i1 <= iLimiT1; i1 += 1) {

			/* At first blush it would appear unnecessary to use followField: here since
			   the validation in become:with:twoWay:copyHash: follows forwarders.  But
			   there's nothing to ensure all elements of each array is unique and doesn't
			   appear in the other array.  So the enumeration could encounter an object
			   already becommed earlier in the same enumeration. */
			/* begin followField:ofObject: */
			objOop11 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
			if (((objOop11 & (tagMask())) == 0)
			 && (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop11 = fixFollowedFieldofObjectwithInitialValue(i1, array1, objOop11);
			}
			obj11 = objOop11;
			/* begin followField:ofObject: */
			objOop21 = longAt((array2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
			if (((objOop21 & (tagMask())) == 0)
			 && (((longAt(objOop21)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop21 = fixFollowedFieldofObjectwithInitialValue(i1, array2, objOop21);
			}
			obj21 = objOop21;
			if (obj11 != obj21) {
				/* begin doBecome:to:copyHash: */
				classIndex = isForwardedObjectClassIndexPun();
				assert(((classIndex >= 0) && (classIndex <= (classIndexMask()))));
				assert(((7 /* forwardedFormat */ >= 0) && (7 /* forwardedFormat */ <= (formatMask()))));
				longAtput(obj11, ((longAt(obj11)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift()))));
				
#        if IMMUTABILITY
				/* begin setIsImmutableOf:to: */
				longAtput(obj11, (longAt(obj11)) & (~(usqIntptr_t)(1U << (immutableBitShift()))));
#        endif /* IMMUTABILITY */
				/* begin storePointer:ofForwarder:withValue: */
				assert(isForwarded(obj11));
				assert(!(isOopForwarded(obj21)));
				if ((assert(isNonImmediate(obj11)),
				oopisGreaterThanOrEqualTo(obj11, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((obj21 & (tagMask())) == 0)
					 && (oopisLessThan(obj21, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(obj11))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(obj11);
						}
					}
				}
				longAtput((obj11 + BaseHeaderSize) + (0U << (shiftForWord())), obj21);
				if ((byteAt(obj11 + 7)) == 0) {
					byteAtput(obj11 + 7, 1);
				}
				if (copyHashFlag) {
					/* begin setHashBitsOf:to: */
					hash = (long32At(obj11 + 4)) & (identityHashHalfWordMask());
					assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
					long32Atput(obj21 + 4, ((((long32At(obj21 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash);
				}
				if (((assert(isNonImmediate(obj11)),
				oopisGreaterThanOrEqualTo(obj11, GIV(oldSpaceStart))))
				 && (((obj21 & (tagMask())) == 0)
				 && (oopisLessThan(obj21, GIV(newSpaceLimit))))) {
					GIV(becomeEffectsFlags) = GIV(becomeEffectsFlags) | OldBecameNewFlag;
				}
				assert(!((isOopForwarded(obj21))));
				/* begin followField:ofObject: */
				objOop4 = longAt((array1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
				if (((objOop4 & (tagMask())) == 0)
				 && (((longAt(objOop4)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop4 = fixFollowedFieldofObjectwithInitialValue(i1, array1, objOop4);
				}
				assert(!(isOopForwarded(obj21)));
			}
		}
	}
	/* begin followSpecialObjectsOop */
	if (((longAt(GIV(specialObjectsOop))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(GIV(specialObjectsOop)));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		GIV(specialObjectsOop) = referent;
	}
	followForwardedObjectFieldstoDepth(GIV(specialObjectsOop), 0);
	/* begin postBecomeAction: */
	spurPostBecomeAction(GIV(becomeEffectsFlags));
	if (GIV(becomeEffectsFlags) & OldBecameNewFlag) {
		addAllToYoungReferrers();
	}
	cogitPostGCAction(GIV(gcMode));
	/* begin nilUncoggableMethods */
	GIV(lastCoggableInterpretedBlockMethod) = (GIV(lastUncoggableInterpretedBlockMethod) = null);
	GIV(gcMode) = 0;
	postBecomeScanClassTable(GIV(becomeEffectsFlags));
	GIV(becomeEffectsFlags) = 0;
	assert(validClassTableHashes());
	runLeakCheckerFor(GCModeBecome);
	return PrimNoErr;
}


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

	/* SpurMemoryManager>>#beRootIfOld: */
void
beRootIfOld(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if ((assert(isNonImmediate(oop)),
	oopisGreaterThanOrEqualTo(oop, GIV(oldSpaceStart)))) {

		/* No, oop is an old object */
		/* begin possibleRootStoreInto: */
		if (!(((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0)) {
			remember(oop);
		}
	}
}

	/* SpurMemoryManager>>#bitsSetInFreeSpaceMaskForAllFreeLists */
static sqInt
bitsSetInFreeSpaceMaskForAllFreeLists(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt iLimiT;

	for (i = 0, iLimiT = (64 /* numFreeLists */ - 1); i <= iLimiT; i += 1) {
		if (((GIV(freeLists)[i]) != 0)
		 && (((1ULL << i) & GIV(freeListsMask)) == 0)) {
			return 0;
		}
	}
	return 1;
}

	/* SpurMemoryManager>>#bridgeSize */
static sqInt
bridgeSize(void)
{
	return 2 * BaseHeaderSize;
}

	/* SpurMemoryManager>>#byteFormatMask */
static sqInt
byteFormatMask(void)
{
	return 24;
}

	/* SpurMemoryManager>>#byteSizeOf: */
sqInt
byteSizeOf(sqInt oop)
{
    sqInt fmt;
    usqInt numBytes;
    usqInt numSlots;

	if (oop & (tagMask())) {
		return 0;
	}
	/* begin numBytesOf: */
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOf: */
	assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(oop + 7);
	numBytes = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	numBytes = numBytes << (shiftForWord());
	if (fmt >= (firstByteFormat())) {

		/* bytes (the common case), including CompiledMethod */
		return numBytes - (fmt & 7);
	}
	if (fmt <= (sixtyFourBitIndexableFormat())) {
		return numBytes;
	}
	if (fmt >= (firstShortFormat())) {
		return numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1)));
	}
	return numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2)));
}

	/* SpurMemoryManager>>#characterObjectOf: */
sqInt
characterObjectOf(sqInt characterCode)
{
	return (((sqInt)((usqInt)(characterCode) << (numTagBits())))) + (characterTag());
}

	/* SpurMemoryManager>>#characterTable */
void
characterTable(void)
{
	error("shouldNotImplement");
}


/*	Immediate characters are unsigned */

	/* SpurMemoryManager>>#characterValueOf: */
usqInt
characterValueOf(sqInt oop)
{
	return ((usqInt) (((usqInt)oop))) >> (numTagBits());
}

	/* SpurMemoryManager>>#cheapAddressCouldBeInHeap: */
static sqInt NoDbgRegParms
cheapAddressCouldBeInHeap(sqInt address)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((address & (BytesPerWord - 1)) == 0)
	 && ((oopisGreaterThanOrEqualTo(address, GIV(newSpaceStart)))
	 && (oopisLessThan(address, GIV(endOfMemory))));
}


/*	Assumes zero-based array indexing. */

	/* SpurMemoryManager>>#checkedLongAt: */
sqInt
checkedLongAt(sqInt byteAddress)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!(isInMemory(byteAddress))) {
		warning("checkedLongAt bad address");
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	return longAt(byteAddress);
}


/*	Perform an integrity/leak check using the heapMap. Assume
	clearLeakMapAndMapAccessibleFreeSpace has set a bit at each free chunk's
	header. Scan all objects in the heap checking that no pointer points
	to a free chunk and that all free chunks that refer to others refer to
	marked chunks. Answer if all checks pass. */

	/* SpurMemoryManager>>#checkHeapFreeSpaceIntegrity */
static sqInt
checkHeapFreeSpaceIntegrity(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt fi;
    sqInt fieldOop;
    sqInt fiLimiT;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt i;
    sqInt iLimiT;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt ok;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    usqInt total;

	ok = 1;
	total = 0;
	for (i = 0, iLimiT = (64 /* numFreeLists */ - 1); i <= iLimiT; i += 1) {
		if ((GIV(freeLists)[i]) != 0) {
			if ((heapMapAtWord(pointerForOop(GIV(freeLists)[i]))) == 0) {
				print("leak in free list ");
				printNum(i);
				print(" to non-free ");
				printHex(GIV(freeLists)[i]);
				/* begin cr */
				printf("\n");
				ok = 0;
			}
		}
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop, limit)) {
		if (((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
			print("young object ");
			printHex(objOop);
			print(" is free");
			/* begin cr */
			printf("\n");
			ok = 0;
		}
		else {
			for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop)) - 1); fi <= fiLimiT; fi += 1) {
				fieldOop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord())))));
				if ((fieldOop & (tagMask())) == 0) {
					if ((heapMapAtWord(pointerForOop(fieldOop))) != 0) {
						print("object leak in ");
						printHex(objOop);
						print(" @ ");
						printNum(fi);
						print(" = ");
						printHex(fieldOop);
						print(" is free");
						/* begin cr */
						printf("\n");
						ok = 0;
					}
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop = limit;
			goto l5;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l5:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop, GIV(freeStart))) {
		if (((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
			print("young object ");
			printHex(objOop);
			print(" is free");
			/* begin cr */
			printf("\n");
			ok = 0;
		}
		else {
			for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop)) - 1); fi <= fiLimiT; fi += 1) {
				fieldOop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord())))));
				if ((fieldOop & (tagMask())) == 0) {
					if ((heapMapAtWord(pointerForOop(fieldOop))) != 0) {
						print("object leak in ");
						printHex(objOop);
						print(" @ ");
						printNum(fi);
						print(" = ");
						printHex(fieldOop);
						print(" is free");
						/* begin cr */
						printf("\n");
						ok = 0;
					}
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop = GIV(freeStart);
			goto l6;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l6:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (((longAt(objOop1)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
			if ((heapMapAtWord(pointerForOop(objOop1))) == 0) {
				print("leak in free chunk ");
				printHex(objOop1);
				print(" is unmapped?! ");
				/* begin cr */
				printf("\n");
				ok = 0;
			}
			/* begin fetchPointer:ofFreeChunk: */
			fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord())));
			if ((fieldOop != 0)
			 && ((heapMapAtWord(pointerForOop(fieldOop))) == 0)) {
				print("leak in free chunk ");
				printHex(objOop1);
				print(" @ 0 = ");
				printHex(fieldOop);
				print(" is unmapped");
				/* begin cr */
				printf("\n");
				ok = 0;
			}
			if (!(isLilliputianSize(bytesInObject(objOop1)))) {
				/* begin fetchPointer:ofFreeChunk: */
				fieldOop = longAt((objOop1 + BaseHeaderSize) + (1U << (shiftForWord())));
				if ((fieldOop != 0)
				 && ((heapMapAtWord(pointerForOop(fieldOop))) == 0)) {
					print("leak in free chunk ");
					printHex(objOop1);
					print(" @ 0 = ");
					printHex(fieldOop);
					print(" is unmapped");
					/* begin cr */
					printf("\n");
					ok = 0;
				}
			}
			if ((bytesInObject(objOop1)) >= (64 /* numFreeLists */ * 8 /* allocationUnit */)) {
				for (fi = 2 /* freeChunkParentIndex */, fiLimiT = 4 /* freeChunkLargerIndex */; fi <= fiLimiT; fi += 1) {
					fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord())))));
					if ((fieldOop != 0)
					 && ((heapMapAtWord(pointerForOop(fieldOop))) == 0)) {
						print("leak in free chunk ");
						printHex(objOop1);
						print(" @ ");
						printNum(fi);
						print(" = ");
						printHex(fieldOop);
						print(" is unmapped");
						/* begin cr */
						printf("\n");
						ok = 0;
					}
				}
			}
			total += bytesInObject(objOop1);
		}
		else {
			for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) {
				if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					assert(fi == 0);
					fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord())))));
				}
				else {

					/* We keep #fetchPointer:ofObject: API here for assertions */
					fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord())))));
				}
				if ((fieldOop & (tagMask())) == 0) {
					if ((heapMapAtWord(pointerForOop(fieldOop))) != 0) {
						print("object leak in ");
						printHex(objOop1);
						print(" @ ");
						printNum(fi);
						print(" = ");
						printHex(fieldOop);
						print(" is free");
						/* begin cr */
						printf("\n");
						ok = 0;
					}
				}
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l7;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l7:	/* end objectAfter:limit: */;
	}
	if (total != GIV(totalFreeOldSpace)) {
		print("incorrect totalFreeOldSpace; expected ");
		printNum(GIV(totalFreeOldSpace));
		print(" found ");
		printNum(total);
		/* begin cr */
		printf("\n");
		ok = 0;
	}
	return ok;
}


/*	Perform an integrity/leak check using the heapMap. Assume
	clearLeakMapAndMapAccessibleObjects has set a bit at each (non-free)
	object's header. Scan all objects in the heap checking that every
	pointer points to a header. Scan the rememberedSet, remapBuffer and
	extraRootTable checking
	that every entry is a pointer to a header. Check that the number of roots
	is correct and that all
	rememberedSet entries have their isRemembered: flag set. Answer if all
	checks pass. */

	/* SpurMemoryManager>>#checkHeapIntegrity:classIndicesShouldBeValid: */
static sqInt NoDbgRegParms
checkHeapIntegrityclassIndicesShouldBeValid(sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt classIndex;
    sqInt classIndex1;
    sqInt classIndex2;
    sqInt classIndex3;
    sqInt classOop;
    sqInt classTablePage;
    sqInt classTablePage1;
    sqInt classTablePage2;
    sqInt containsYoung;
    sqInt fi;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt fieldIndex11;
    sqInt fieldIndex12;
    sqInt fieldIndex2;
    sqInt fieldIndex3;
    sqInt fieldOop;
    sqInt fiLimiT;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt i;
    sqInt i1;
    sqInt i2;
    sqInt iLimiT;
    usqInt limit;
    sqInt numOnThisPage;
    sqInt numRememberedObjectsInHeap;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt obj;
    sqInt objOop;
    sqInt objOop1;
    sqInt objStackPage;
    sqInt ok;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt ri;

	ok = 1;
	numRememberedObjectsInHeap = 0;
	for (i = 0, iLimiT = (64 /* numFreeLists */ - 1); i <= iLimiT; i += 1) {
		if ((GIV(freeLists)[i]) != 0) {
			if ((heapMapAtWord(pointerForOop(GIV(freeLists)[i]))) != 0) {
				print("leak in free list ");
				printNum(i);
				print(" to non-free ");
				printHex(GIV(freeLists)[i]);
				/* begin cr */
				printf("\n");
				ok = 0;
			}
		}
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop, limit)) {
		if (((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
			print("young object ");
			printHex(objOop);
			print(" is free");
			/* begin cr */
			printf("\n");
			ok = 0;
		}
		else {
			if (!((!(((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0))
				 && (excludeUnmarkedObjs))) {
				if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) {
					print("young object ");
					printHex(objOop);
					print(" is remembered");
					/* begin cr */
					printf("\n");
					ok = 0;
				}
			}
			if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				fieldOop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
				if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) {
					print("object leak in forwarder ");
					printHex(objOop);
					print(" to unmapped ");
					printHex(fieldOop);
					/* begin cr */
					printf("\n");
					ok = 0;
				}
			}
			else {
				/* begin classOrNilAtIndex: */
				classIndex1 = (classIndex = (longAt(objOop)) & (classIndexMask()));
				assert((classIndex1 <= (tagMask()))
				 || (classIndex1 >= (arrayClassIndexPun())));
				/* begin fetchPointer:ofObject: */
				fieldIndex = ((usqInt) classIndex1) >> (classTableMajorIndexShift());
				classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
				if (classTablePage == GIV(nilObj)) {
					classOop = GIV(nilObj);
					goto l17;
				}
				/* begin fetchPointer:ofObject: */
				fieldIndex1 = classIndex1 & ((1U << (classTableMajorIndexShift())) - 1);
				classOop = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	l17:	/* end classOrNilAtIndex: */;
				if (classIndicesShouldBeValid
				 && ((classOop == GIV(nilObj))
				 && (!(((longAt(objOop)) & (classIndexMask())) <= (lastClassIndexPun()))))) {
					print("object leak in ");
					printHex(objOop);
					print(" invalid class index ");
					printHex(classIndex);
					print(" -> ");
					print((classOop == null
						? "nil"
						: "nilObj"));
					/* begin cr */
					printf("\n");
					ok = 0;
				}
				for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop)) - 1); fi <= fiLimiT; fi += 1) {
					fieldOop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord())))));
					if ((fieldOop & (tagMask())) == 0) {
						if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) {
							print("object leak in ");
							printHex(objOop);
							print(" @ ");
							printNum(fi);
							print(" = ");
							printHex(fieldOop);
							/* begin cr */
							printf("\n");
							ok = 0;
						}
					}
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop = limit;
			goto l5;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l5:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop, GIV(freeStart))) {
		if (((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
			print("young object ");
			printHex(objOop);
			print(" is free");
			/* begin cr */
			printf("\n");
			ok = 0;
		}
		else {
			if (!((!(((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0))
				 && (excludeUnmarkedObjs))) {
				if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) {
					print("young object ");
					printHex(objOop);
					print(" is remembered");
					/* begin cr */
					printf("\n");
					ok = 0;
				}
			}
			if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				fieldOop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
				if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) {
					print("object leak in forwarder ");
					printHex(objOop);
					print(" to unmapped ");
					printHex(fieldOop);
					/* begin cr */
					printf("\n");
					ok = 0;
				}
			}
			else {
				/* begin classOrNilAtIndex: */
				classIndex2 = (classIndex = (longAt(objOop)) & (classIndexMask()));
				assert((classIndex2 <= (tagMask()))
				 || (classIndex2 >= (arrayClassIndexPun())));
				/* begin fetchPointer:ofObject: */
				fieldIndex2 = ((usqInt) classIndex2) >> (classTableMajorIndexShift());
				classTablePage1 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))));
				if (classTablePage1 == GIV(nilObj)) {
					classOop = GIV(nilObj);
					goto l18;
				}
				/* begin fetchPointer:ofObject: */
				fieldIndex11 = classIndex2 & ((1U << (classTableMajorIndexShift())) - 1);
				classOop = longAt((classTablePage1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex11) << (shiftForWord())))));
	l18:	/* end classOrNilAtIndex: */;
				if (classIndicesShouldBeValid
				 && ((classOop == GIV(nilObj))
				 && (!(((longAt(objOop)) & (classIndexMask())) <= (lastClassIndexPun()))))) {
					print("object leak in ");
					printHex(objOop);
					print(" invalid class index ");
					printHex(classIndex);
					print(" -> ");
					print((classOop == null
						? "nil"
						: "nilObj"));
					/* begin cr */
					printf("\n");
					ok = 0;
				}
				for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop)) - 1); fi <= fiLimiT; fi += 1) {
					fieldOop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord())))));
					if ((fieldOop & (tagMask())) == 0) {
						if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) {
							print("object leak in ");
							printHex(objOop);
							print(" @ ");
							printNum(fi);
							print(" = ");
							printHex(fieldOop);
							/* begin cr */
							printf("\n");
							ok = 0;
						}
					}
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop = GIV(freeStart);
			goto l6;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l6:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (((longAt(objOop1)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
			if ((heapMapAtWord(pointerForOop(objOop1))) != 0) {
				print("leak in free chunk ");
				printHex(objOop1);
				print(" is mapped?! ");
				/* begin cr */
				printf("\n");
				ok = 0;
			}
			/* begin fetchPointer:ofFreeChunk: */
			fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord())));
			if ((fieldOop != 0)
			 && ((heapMapAtWord(pointerForOop(objOop1))) != 0)) {
				print("leak in free chunk ");
				printHex(objOop1);
				print(" @ 0 = ");
				printHex(fieldOop);
				print(" is mapped");
				/* begin cr */
				printf("\n");
				ok = 0;
			}
			if (!(isLilliputianSize(bytesInObject(objOop1)))) {
				/* begin fetchPointer:ofFreeChunk: */
				fieldOop = longAt((objOop1 + BaseHeaderSize) + (1U << (shiftForWord())));
				if ((fieldOop != 0)
				 && ((heapMapAtWord(pointerForOop(fieldOop))) == 0)) {
					print("leak in free chunk ");
					printHex(objOop1);
					print(" @ 0 = ");
					printHex(fieldOop);
					print(" is unmapped");
					/* begin cr */
					printf("\n");
					ok = 0;
				}
			}
			if ((bytesInObject(objOop1)) >= (64 /* numFreeLists */ * 8 /* allocationUnit */)) {
				for (fi = 2 /* freeChunkParentIndex */, fiLimiT = 4 /* freeChunkLargerIndex */; fi <= fiLimiT; fi += 1) {
					fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord())))));
					if ((fieldOop != 0)
					 && ((heapMapAtWord(pointerForOop(objOop1))) != 0)) {
						print("leak in free chunk ");
						printHex(objOop1);
						print(" @ ");
						printNum(fi);
						print(" = ");
						printHex(fieldOop);
						print(" is mapped");
						/* begin cr */
						printf("\n");
						ok = 0;
					}
				}
			}
		}
		else {
			if (!(excludeUnmarkedObjs
				 && (!(((((usqInt) (longAt(objOop1))) >> (markedBitFullShift())) & 1) != 0)))) {
				containsYoung = 0;
				if (((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0) {
					numRememberedObjectsInHeap += 1;
					if (!(isInRememberedSet(objOop1))) {
						print("remembered object ");
						printHex(objOop1);
						print(" is not in remembered table");
						/* begin cr */
						printf("\n");
						ok = 0;
					}
				}
				if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					fieldOop = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord())));
					if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) {
						print("object leak in forwarder ");
						printHex(objOop1);
						print(" to unmapped ");
						printHex(fieldOop);
						/* begin cr */
						printf("\n");
						ok = 0;
					}
					if (((fieldOop & (tagMask())) == 0)
					 && ((assert(isNonImmediate(fieldOop)),
					(oopisLessThan(fieldOop, GIV(newSpaceLimit)))
						 && (oopisGreaterThanOrEqualTo(fieldOop, GIV(newSpaceStart)))))) {
						containsYoung = 1;
					}
				}
				else {
					/* begin classOrNilAtIndex: */
					classIndex3 = (classIndex = (longAt(objOop1)) & (classIndexMask()));
					assert((classIndex3 <= (tagMask()))
					 || (classIndex3 >= (arrayClassIndexPun())));
					/* begin fetchPointer:ofObject: */
					fieldIndex3 = ((usqInt) classIndex3) >> (classTableMajorIndexShift());
					classTablePage2 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord())))));
					if (classTablePage2 == GIV(nilObj)) {
						classOop = GIV(nilObj);
						goto l19;
					}
					/* begin fetchPointer:ofObject: */
					fieldIndex12 = classIndex3 & ((1U << (classTableMajorIndexShift())) - 1);
					classOop = longAt((classTablePage2 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex12) << (shiftForWord())))));
	l19:	/* end classOrNilAtIndex: */;
					if (classIndicesShouldBeValid
					 && ((classOop == GIV(nilObj))
					 && (classIndex > (lastClassIndexPun())))) {
						print("object leak in ");
						printHex(objOop1);
						print(" invalid class index ");
						printHex(classIndex);
						print(" -> ");
						print((classOop == null
							? "nil"
							: "nilObj"));
						/* begin cr */
						printf("\n");
						ok = 0;
					}
					for (fi = 0, fiLimiT = ((numPointerSlotsOf(objOop1)) - 1); fi <= fiLimiT; fi += 1) {
						fieldOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(fi) << (shiftForWord())))));
						if ((fieldOop & (tagMask())) == 0) {
							if ((heapMapAtWord(pointerForOop(fieldOop))) == 0) {
								print("object leak in ");
								printHex(objOop1);
								print(" @ ");
								printNum(fi);
								print(" = ");
								printHex(fieldOop);
								/* begin cr */
								printf("\n");
								ok = 0;
							}
							if (((fieldOop & (tagMask())) == 0)
							 && ((assert(isNonImmediate(fieldOop)),
							(oopisLessThan(fieldOop, GIV(newSpaceLimit)))
								 && (oopisGreaterThanOrEqualTo(fieldOop, GIV(newSpaceStart)))))) {
								containsYoung = 1;
							}
						}
					}
				}
				if (containsYoung) {
					if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) {
						print("unremembered object ");
						printHex(objOop1);
						print(" contains young oop(s)");
						/* begin cr */
						printf("\n");
						ok = 0;
					}
				}
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l16;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l16:	/* end objectAfter:limit: */;
	}
	if (numRememberedObjectsInHeap != (rememberedSetSize())) {
		print("root count mismatch. #heap roots ");
		printNum(numRememberedObjectsInHeap);
		print("; #roots ");
		printNum(rememberedSetSize());
		/* begin cr */
		printf("\n");
		flag("no support for remembered set overflow yet");
	}
	/* begin rememberedSetWithIndexDo: */
	for (i1 = 0; i1 < GIV(rememberedSetSize); i1 += 1) {
		obj = GIV(rememberedSet)[i1];
		if ((obj & (BytesPerWord - 1)) != 0) {
			print("misaligned oop in remembered set @ ");
			printNum(i1);
			print(" = ");
			printHex(obj);
			/* begin cr */
			printf("\n");
			ok = 0;
		}
		else {
			if ((heapMapAtWord(pointerForOop(obj))) == 0) {
				print("object leak in remembered set @ ");
				printNum(i1);
				print(" = ");
				printHex(obj);
				/* begin cr */
				printf("\n");
				ok = 0;
			}
			else {
				if (((obj & (tagMask())) == 0)
				 && (oopisLessThan(obj, GIV(newSpaceLimit)))) {
					print("non-root in remembered set @ ");
					printNum(i1);
					print(" = ");
					printHex(obj);
					/* begin cr */
					printf("\n");
					ok = 0;
				}
			}
		}
	}
	/* begin objStack:do: */
	if (GIV(mournQueue) == GIV(nilObj)) {
		goto l9;
	}
	eassert(isValidObjStack(GIV(mournQueue)));
	objStackPage = GIV(mournQueue);
	while (objStackPage != 0) {
		/* begin fetchPointer:ofObject: */
		numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
		for (i2 = ((numOnThisPage + ObjStackFixedSlots) - 1); i2 >= ObjStackFixedSlots; i2 += -1) {
			obj = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord())))));
			if ((obj & (BytesPerWord - 1)) != 0) {
				print("misaligned oop in mournQueue @ ");
				printNum(i2);
				print(" in ");
				printHex(objStackPage);
				print(" = ");
				printHex(obj);
				/* begin cr */
				printf("\n");
				ok = 0;
			}
			else {
				if (!(excludeUnmarkedObjs
					 && (!(((((usqInt) (longAt(obj))) >> (markedBitFullShift())) & 1) != 0)))) {
					if ((heapMapAtWord(pointerForOop(obj))) == 0) {
						print("object leak in mournQueue @ ");
						printNum(i2);
						print(" in ");
						printHex(objStackPage);
						print(" = ");
						printHex(obj);
						/* begin cr */
						printf("\n");
						ok = 0;
					}
				}
			}
		}
		/* begin fetchPointer:ofObject: */
		objStackPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
	}
	l9:	/* end objStack:do: */;
	for (ri = 1; ri <= GIV(remapBufferCount); ri += 1) {
		obj = GIV(remapBuffer)[ri];
		if ((obj & (BytesPerWord - 1)) != 0) {
			print("misaligned remapRoot @ ");
			printNum(ri);
			print(" = ");
			printHex(obj);
			/* begin cr */
			printf("\n");
			ok = 0;
		}
		else {
			if ((heapMapAtWord(pointerForOop(obj))) == 0) {
				print("object leak in remapRoots @ ");
				printNum(ri);
				print(" = ");
				printHex(obj);
				/* begin cr */
				printf("\n");
				ok = 0;
			}
		}
	}
	for (ri = 1; ri <= GIV(extraRootCount); ri += 1) {
		obj = (GIV(extraRoots)[ri])[0];
		if ((obj & (BytesPerWord - 1)) != 0) {
			print("misaligned extraRoot @ ");
			printNum(ri);
			print(" => ");
			printHex(obj);
			/* begin cr */
			printf("\n");
			ok = 0;
		}
		else {
			if ((heapMapAtWord(pointerForOop(obj))) == 0) {
				print("object leak in extraRoots @ ");
				printNum(ri);
				print(" => ");
				printHex(obj);
				/* begin cr */
				printf("\n");
				ok = 0;
			}
		}
	}
	return ok;
}


/*	Verify that the given oop is legitimate. Check address, header, and size
	but not class.
	Answer true if OK. Otherwise print reason and answer false. */

	/* SpurMemoryManager>>#checkOkayOop: */
sqInt
checkOkayOop(usqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt fmt;
    usqLong unusedBits;
    sqInt unusedBitsInYoungObjects;


	/* address and size checks */
	if (oop & (tagMask())) {
		return 1;
	}
	if (!(addressCouldBeObj(oop))) {
		print("oop ");
		printHex(oop);
		print(" is not a valid address");
		return 0;
	}
	if (!(oopisLessThanOrEqualTo(addressAfter(oop), GIV(endOfMemory)))) {
		print("oop ");
		printHex(oop);
		print(" size would make it extend beyond the end of memory");
		return 0;
	}
	if (!(((classIndex = (longAt(oop)) & (classIndexMask()))) >= (firstClassIndexPun()))) {
		print("oop ");
		printHex(oop);
		print(" is a free chunk, or bridge, not an object");
		return 0;
	}
	if (((byteAt(oop + 7)) == (numSlotsMask()))
	 && ((byteAt((oop - BaseHeaderSize) + 7)) != (numSlotsMask()))) {
		print("oop ");
		printHex(oop);
		print(" header has overflow header word, but overflow word does not have a saturated numSlots field");
		return 0;
	}
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	if ((fmt == 6) || (fmt == 8)) {
		print("oop ");
		printHex(oop);
		print(" has an unknown format type");
		return 0;
	}
	if ((fmt == 7 /* forwardedFormat */) != (classIndex == (isForwardedObjectClassIndexPun()))) {
		print("oop ");
		printHex(oop);
		print(" has mis-matched format/classIndex fields; only one of them is the isForwarded value");
		return 0;
	}
	unusedBits = (1U << 22 /* classIndexFieldWidth */) | (1ULL << (22 /* identityHashFieldWidth */ + 32));
	if (((long64At(oop)) & unusedBits) != 0) {
		print("oop ");
		printHex(oop);
		print(" has some unused header bits set; should be zero");
		return 0;
	}
	unusedBitsInYoungObjects = (1U << (greyBitShift())) | ((1U << (pinnedBitShift())) | (1U << (rememberedBitShift())));
	if (((longAt(oop)) & unusedBitsInYoungObjects) != 0) {
		print("oop ");
		printHex(oop);
		print(" has some header bits unused in young objects set; should be zero");
		return 0;
	}
	return 1;
}


/*	Attempt to verify that the given obj 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. If OK answer true. If not, print reason and answer false. */

	/* SpurMemoryManager>>#checkOopHasOkayClass: */
sqInt
checkOopHasOkayClass(usqInt obj)
{
    usqInt objClass;
    sqInt objFormat;

	if (!(checkOkayOop(obj))) {
		return 0;
	}
	objClass = ((usqInt) (fetchClassOfNonImm(obj)));
	if (objClass & (tagMask())) {
		print("obj ");
		printHex(obj);
		print(" an immediate is not a valid class or behavior");
		/* begin cr */
		printf("\n");
		return 0;
	}
	if (!(okayOop(objClass))) {
		print("obj ");
		printHex(obj);
		print(" class obj is not ok");
		/* begin cr */
		printf("\n");
		return 0;
	}
	if (!((((((usqInt) (longAt(objClass))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
		 && ((numSlotsOf(objClass)) >= 3))) {
		print("obj ");
		printHex(obj);
		print(" a class (behavior) must be a pointers object of size >= 3");
		/* begin cr */
		printf("\n");
		return 0;
	}
	if (((obj & (tagMask())) == 0)
	 && (((((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))) {
		objFormat = ((((((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask())) | 7) - 7);
	}
	else {
		objFormat = (((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask());
	}
	if ((instSpecOfClassFormat(((longAt((objClass + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3))) != objFormat) {
		print("obj ");
		printHex(obj);
		print(" and its class (behavior) formats differ");
		/* begin cr */
		printf("\n");
		return 0;
	}
	return 1;
}

	/* SpurMemoryManager>>#checkOopIntegrity:named: */
static sqInt NoDbgRegParms
checkOopIntegritynamed(sqInt obj, char *name)
{
	if ((heapMapAtWord(pointerForOop(obj))) != 0) {
		return 1;
	}
	print(name);
	print(" leak ");
	printHex(obj);
	/* begin cr */
	printf("\n");
	return 0;
}

	/* SpurMemoryManager>>#checkOopIntegrity:named:index: */
static sqInt NoDbgRegParms
checkOopIntegritynamedindex(sqInt obj, char *name, sqInt i)
{
	if ((heapMapAtWord(pointerForOop(obj))) != 0) {
		return 1;
	}
	print(name);
	print(" leak @ ");
	printNum(i);
	print(" = ");
	printHex(obj);
	/* begin cr */
	printf("\n");
	return 0;
}

	/* SpurMemoryManager>>#classAlien */
sqInt
classAlien(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassAlien) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classArray */
sqInt
classArray(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassArray) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classAtIndex: */
sqInt
classAtIndex(sqInt classIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classTablePage;
    sqInt fieldIndex;
    sqInt fieldIndex1;

	assert((classIndex >= 0)
	 && ((classIndex <= (tagMask()))
	 || ((classIndex >= (arrayClassIndexPun()))
	 && (classIndex <= (classIndexMask())))));
	/* begin fetchPointer:ofObject: */
	fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift());
	classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (classTablePage == GIV(nilObj)) {
		return null;
	}
	/* begin fetchPointer:ofObject: */
	fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1);
	return longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
}


/*	for become & GC of classes */

	/* SpurMemoryManager>>#classAtIndex:put: */
static sqInt NoDbgRegParms
classAtIndexput(sqInt classIndex, sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classTablePage;
    sqInt fieldIndex;
    sqInt fieldIndex1;

	assert((classIndex <= (tagMask()))
	 || (classIndex >= (arrayClassIndexPun())));
	assert((objOop == GIV(nilObj))
	 || ((((rawHashBitsOf(objOop)) == classIndex)
	 || ((classAtIndex(rawHashBitsOf(objOop))) == objOop))
	 && (objCouldBeClassObj(objOop))));
	/* begin fetchPointer:ofObject: */
	fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift());
	classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (classTablePage == GIV(nilObj)) {
		error("attempt to add class to empty page");
	}
	/* begin storePointer:ofObject:withValue: */
	fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1);
	assert(!(isForwarded(classTablePage)));
	if ((assert(isNonImmediate(classTablePage)),
	oopisGreaterThanOrEqualTo(classTablePage, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((objOop & (tagMask())) == 0)
		 && (oopisLessThan(objOop, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(classTablePage))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(classTablePage);
			}
		}
	}
	return longAtput((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), objOop);
}

	/* SpurMemoryManager>>#classBitmap */
sqInt
classBitmap(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassBitmap) << (shiftForWord())))));
}


/*	a.k.a. self fetchPointer: ClassByteArrayCompactIndex ofObject:
	classTableFirstPage 
 */

	/* SpurMemoryManager>>#classByteArray */
sqInt
classByteArray(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassByteArray) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classCharacter */
sqInt
classCharacter(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassCharacter) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classExternalAddress */
sqInt
classExternalAddress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassExternalAddress) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classExternalData */
sqInt
classExternalData(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassExternalData) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classExternalFunction */
sqInt
classExternalFunction(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassExternalFunction) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classExternalLibrary */
sqInt
classExternalLibrary(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassExternalLibrary) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classExternalStructure */
sqInt
classExternalStructure(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassExternalStructure) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classFloat */
sqInt
classFloat(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassFloat) << (shiftForWord())))));
}


/*	Clear any odd bits from the format so that it matches its class's format */

	/* SpurMemoryManager>>#classFormatForInstanceFormat: */
static sqInt NoDbgRegParms
classFormatForInstanceFormat(sqInt aFormat)
{
	if (aFormat < (firstLongFormat())) {
		return aFormat;
	}
	if (aFormat >= (firstByteFormat())) {
		return aFormat & -8;
	}
	return (aFormat >= (firstShortFormat())
		? aFormat & -4
		: aFormat & -2);
}


/*	22-bit class mask => ~ 4M classes */

	/* SpurMemoryManager>>#classIndexFieldWidth */
static sqInt
classIndexFieldWidth(void)
{
	return 22;
}


/*	Answer objOop's classIndex from the object header.
	A note on performance:
	This routine uses longAt:, which does a 32-bit load on the 32-bit system,
	and a 64-bit load
	on the 64-bit system. Since the only 64-bit implementation(s) is/are
	little-endian, and
	since all of isGrey,isPinned,isRemembered,format,isUmmutable and
	classIndex fit within
	the least significant 32-bits we could use long32At: to access these, in
	the hope that the
	32-bit access will be quicker on 64-bits by virtue of fetching half the
	bits. But experiments
	show that doing this does not produce any increase; at least any signal is
	lost in the noise. */

	/* SpurMemoryManager>>#classIndexOf: */
sqInt
classIndexOf(sqInt objOop)
{
	return (longAt(objOop)) & (classIndexMask());
}

	/* SpurMemoryManager>>#classLargeNegativeInteger */
sqInt
classLargeNegativeInteger(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (assert(((ClassLargeNegativeIntegerCompactIndex >= 1) && (ClassLargeNegativeIntegerCompactIndex <= (classTablePageSize())))),
		/* begin fetchPointer:ofObject: */
		longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassLargeNegativeIntegerCompactIndex) << (shiftForWord()))))));
}

	/* SpurMemoryManager>>#classLargePositiveInteger */
sqInt
classLargePositiveInteger(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (assert(((ClassLargePositiveIntegerCompactIndex >= 1) && (ClassLargePositiveIntegerCompactIndex <= (classTablePageSize())))),
		/* begin fetchPointer:ofObject: */
		longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassLargePositiveIntegerCompactIndex) << (shiftForWord()))))));
}

	/* SpurMemoryManager>>#classOrNilAtIndex: */
sqInt
classOrNilAtIndex(sqInt classIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classTablePage;
    sqInt fieldIndex;
    sqInt fieldIndex1;

	assert((classIndex <= (tagMask()))
	 || (classIndex >= (arrayClassIndexPun())));
	/* begin fetchPointer:ofObject: */
	fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift());
	classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (classTablePage == GIV(nilObj)) {
		return GIV(nilObj);
	}
	/* begin fetchPointer:ofObject: */
	fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1);
	return longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classPoint */
sqInt
classPoint(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classSemaphore */
sqInt
classSemaphore(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classSmallInteger */
sqInt
classSmallInteger(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSmallInteger) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#classString */
sqInt
classString(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassByteString) << (shiftForWord())))));
}


/*	1024 entries per page (2^10); 22 bit classIndex implies 2^12 pages */
/*	self basicNew classTableMinorIndexMask */

	/* SpurMemoryManager>>#classTableMinorIndexMask */
sqInt
classTableMinorIndexMask(void)
{
	return (1U << (classTableMajorIndexShift())) - 1;
}


/*	1024 entries per page (2^10); 22 bit classIndex implies 2^12 pages */
/*	self basicNew classTablePageSize */

	/* SpurMemoryManager>>#classTablePageSize */
sqInt
classTablePageSize(void)
{
	return 1U << (classTableMajorIndexShift());
}


/*	For Cogit & bootstrap */

	/* SpurMemoryManager>>#classTableRootObj */
sqInt
classTableRootObj(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(hiddenRootsObj);
}


/*	Answer the number of slots for class table pages in the hidden root
	object. 
 */

	/* SpurMemoryManager>>#classTableRootSlots */
static sqInt
classTableRootSlots(void)
{
	return 1U << (22 /* classIndexFieldWidth */ - (classTableMajorIndexShift()));
}


/*	Answer the classObj's identityHash to use as a tag in the first-level
	method lookup cache.
 */

	/* SpurMemoryManager>>#classTagForClass: */
sqInt
classTagForClass(sqInt classObj)
{
    sqInt err;
    sqInt hash;

	return (assert(addressCouldBeClassObj(classObj)),
		(((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0
				? hash
				: (objCouldBeClassObj(classObj)
						? (((err = enterIntoClassTable(classObj))) != 0
								? -err
								: (/* begin rawHashBitsOf: */
									(long32At(classObj + 4)) & (identityHashHalfWordMask())))
						: -PrimErrBadReceiver)));
}

	/* SpurMemoryManager>>#classUnsafeAlien */
sqInt
classUnsafeAlien(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassUnsafeAlien) << (shiftForWord())))));
}


/*	Perform an integrity/leak check using the heapMap. Set a bit at each free
	chunk's header. */

	/* SpurMemoryManager>>#clearLeakMapAndMapAccessibleFreeSpace */
static void
clearLeakMapAndMapAccessibleFreeSpace(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt followingWord;
    usqInt followingWordAddress;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevPrevObj;

	clearHeapMap();
	/* begin allOldSpaceEntitiesFrom:do: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj = (prevObj = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (((longAt(objOop1)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
			heapMapAtWordPut(pointerForOop(objOop1), 1);
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	}

	/* SpurMemoryManager>>#cloneInOldSpace:forPinning: */
static sqInt NoDbgRegParms
cloneInOldSpaceforPinning(sqInt objOop, sqInt forPinning)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt cogMethodOrMethodHeader;
    sqInt fmt;
    sqInt hash;
    sqInt hasYoung;
    sqInt i;
    sqInt newObj;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt oop;
    sqInt rawHeader;
    sqInt referent;

	/* begin numSlotsOf: */
	assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
	numSlots1 = byteAt(objOop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	if (forPinning) {
		newObj = allocateSlotsForPinningInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0
			? 8 /* allocationUnit */ + BaseHeaderSize
			: (numSlots << (shiftForWord())) + ((numSlots >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))), fmt, (longAt(objOop)) & (classIndexMask()));
	}
	else {
		newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0
			? 8 /* allocationUnit */ + BaseHeaderSize
			: (numSlots << (shiftForWord())) + ((numSlots >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))), fmt, (longAt(objOop)) & (classIndexMask()));
	}
	if (!(newObj)) {
		return 0;
	}
	if (fmt <= 5 /* lastPointerFormat */) {
		hasYoung = 0;
		for (i = 0; i < numSlots; i += 1) {
			oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
			if (((oop & (tagMask())) == 0)
			 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(oop));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent & (tagMask())) == 0)
				 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				oop = referent;
			}
			if (((oop & (tagMask())) == 0)
			 && ((assert(isNonImmediate(oop)),
			oopisLessThan(oop, GIV(newSpaceLimit))))) {
				hasYoung = 1;
			}
			assert(!(isOopForwarded(newObj)));
			longAtput((newObj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), oop);
		}
		if (hasYoung) {
			remember(newObj);
		}
	}
	else {
		for (i = 0; i < numSlots; i += 1) {
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(newObj)));
			longAtput((newObj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))));
		}
		if (fmt >= (firstCompiledMethodFormat())) {
			/* begin maybeFixClonedCompiledMethod: */
			assert(isOopCompiledMethod(newObj));
			/* begin fetchPointer:ofObject: */
			rawHeader = longAt((newObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
			if ((assert(((((rawHeader) & 7) == 1))
				 || (((((usqInt)rawHeader)) < (startOfMemory()))
				 && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))),
			(rawHeader & (smallIntegerTag())) == 0)) {
				/* begin rawHeaderOf:put: */
				cogMethodOrMethodHeader = ((((CogMethod *) rawHeader))->methodHeader);
				assert(isCompiledMethodHeader(headerWhileForwardingOf(newObj)));
				assert(!(isOopForwarded(newObj)));
				longAtput((newObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))), cogMethodOrMethodHeader);
			}
			if (((assert(isNonImmediate(objOop)),
			oopisLessThan(objOop, GIV(newSpaceLimit))))
			 || (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(newObj);
			}
		}
	}
	if (((hash = (long32At(objOop + 4)) & (identityHashHalfWordMask()))) != 0) {
		/* begin setHashBitsOf:to: */
		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
		long32Atput(newObj + 4, ((((long32At(newObj + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash);
	}
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		/* begin setIsImmutableOf:to: */
		longAtput(newObj, (longAt(newObj)) | (1U << (immutableBitShift())));
	}
	return newObj;
}

	/* SpurMemoryManager>>#clone: */
sqInt
clone(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt classIndex1;
    sqInt cogMethodOrMethodHeader;
    sqInt fmt;
    sqInt hasYoung;
    sqInt i;
    sqInt newObj;
    usqInt newObj1;
    usqInt numBytes;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt oop;
    sqInt rawHeader;
    sqInt referent;

	/* begin numSlotsOf: */
	assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
	numSlots1 = byteAt(objOop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	if (numSlots > ((1U << (fixedFieldsFieldWidth())) - 1)) {
		/* begin allocateSlotsInOldSpace:format:classIndex: */
		classIndex = (longAt(objOop)) & (classIndexMask());
		newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0
			? 8 /* allocationUnit */ + BaseHeaderSize
			: (numSlots << (shiftForWord())) + ((numSlots >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))), fmt, classIndex);
	}
	else {
		/* begin allocateSlots:format:classIndex: */
		classIndex1 = (longAt(objOop)) & (classIndexMask());
		if (numSlots >= (numSlotsMask())) {
			if ((((usqInt) numSlots) >> 56) > 0) {
				newObj = null;
				goto l5;
			}
			newObj1 = GIV(freeStart) + BaseHeaderSize;
			numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop);
		}
		else {
			newObj1 = GIV(freeStart);
			numBytes = BaseHeaderSize + ((numSlots < 1
	? /* begin allocationUnit */ 8
	: numSlots * BytesPerOop));
		}
		if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
			if (!GIV(needGCFlag)) {
				/* begin scheduleScavenge */
				GIV(needGCFlag) = 1;
				forceInterruptCheck();
			}
			newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, fmt, classIndex1);
			goto l5;
		}
		if (numSlots >= (numSlotsMask())) {

			/* for header parsing we put a saturated slot count in the prepended overflow size word */
			flag("endianness");
			longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots);
			longAtput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), fmt, classIndex1));
		}
		else {
			longAtput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(fmt) << (formatShift()))))) + classIndex1);
		}
		assert((numBytes % (allocationUnit())) == 0);
		assert((newObj1 % (allocationUnit())) == 0);
		GIV(freeStart) += numBytes;
		newObj = newObj1;
	l5:	/* end allocateSlots:format:classIndex: */;
	}
	if (!(newObj)) {
		return 0;
	}
	if (fmt <= 5 /* lastPointerFormat */) {
		hasYoung = 0;
		for (i = 0; i < numSlots; i += 1) {
			oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
			if ((oop & (tagMask())) == 0) {
				if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					/* begin followForwarded: */
					assert(isUnambiguouslyForwarder(oop));
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
					while (((referent & (tagMask())) == 0)
					 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
					}
					oop = referent;
				}
				if (((oop & (tagMask())) == 0)
				 && ((assert(isNonImmediate(oop)),
				oopisLessThan(oop, GIV(newSpaceLimit))))) {
					hasYoung = 1;
				}
			}
			assert(!(isOopForwarded(newObj)));
			longAtput((newObj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), oop);
		}
		if (hasYoung
		 && (!((assert(isNonImmediate(newObj)),
		oopisLessThan(newObj, GIV(newSpaceLimit)))))) {
			remember(newObj);
		}
	}
	else {
		for (i = 0; i < numSlots; i += 1) {
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(newObj)));
			longAtput((newObj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))));
		}
		if (fmt >= (firstCompiledMethodFormat())) {
			/* begin maybeFixClonedCompiledMethod: */
			assert(isOopCompiledMethod(newObj));
			/* begin fetchPointer:ofObject: */
			rawHeader = longAt((newObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
			if ((assert(((((rawHeader) & 7) == 1))
				 || (((((usqInt)rawHeader)) < (startOfMemory()))
				 && ((((usqInt)rawHeader)) >= (minCogMethodAddress())))),
			(rawHeader & (smallIntegerTag())) == 0)) {
				/* begin rawHeaderOf:put: */
				cogMethodOrMethodHeader = ((((CogMethod *) rawHeader))->methodHeader);
				assert(isCompiledMethodHeader(headerWhileForwardingOf(newObj)));
				assert(!(isOopForwarded(newObj)));
				longAtput((newObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))), cogMethodOrMethodHeader);
			}
			if (((assert(isNonImmediate(newObj)),
			oopisGreaterThanOrEqualTo(newObj, GIV(oldSpaceStart))))
			 && (((assert(isNonImmediate(objOop)),
			oopisLessThan(objOop, GIV(newSpaceLimit))))
			 || (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0))) {
				remember(newObj);
			}
		}
	}
	return newObj;
}

	/* SpurMemoryManager>>#compactClassIndexOf: */
sqInt
compactClassIndexOf(sqInt objOop)
{
	/* begin classIndexOf: */
	return (longAt(objOop)) & (classIndexMask());
}


/*	This is part of storeImageSegmentInto:outPointers:roots:.
	Copy objOop into the segment beginning at segAddr, and forward it to the
	copy, saving its first field in savedFirstField, and setting its marked
	bit to indicate it has
	been copied. If it is a class in the class table, set the copy's hash to 0
	for reassignment
	on load, and mark it as a class by setting its isRemembered bit.
	Answer the next segmentAddr if successful. Answer an appropriate error
	code if not */
/*	Copy the object... */

	/* SpurMemoryManager>>#copyObj:toAddr:stopAt:savedFirstFields:index: */
static sqInt NoDbgRegParms
copyObjtoAddrstopAtsavedFirstFieldsindex(sqInt objOop, sqInt segAddr, sqInt endSeg, sqInt savedFirstFields, sqInt i)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt bodySize;
    sqInt contextSize;
    sqInt contextSize1;
    sqInt copy;
    sqInt fmt;
    sqInt hash;
    sqInt header;
    sqInt header1;
    sqInt i1;
    sqInt iLimiT;
    sqInt methodHeader;
    sqInt numLiterals;
    sqInt numMediatedSlots;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt oop;
    sqInt sp;

	assert(!((isCopiedIntoSegment(objOop))));
	bodySize = bytesInObject(objOop);
	if (oopisGreaterThanOrEqualTo(segAddr + bodySize, endSeg)) {
		return PrimErrWritePastObject;
	}
	memcpy(((void *)segAddr), ((void *)(((byteAt(objOop + 7)) == (numSlotsMask())
	? objOop - BaseHeaderSize
	: objOop))), bodySize);
	/* begin objectStartingAt: */
	numSlots = byteAt(segAddr + 7);
	copy = (numSlots == (numSlotsMask())
		? segAddr + BaseHeaderSize
		: segAddr);
	/* begin setIsRememberedOf:to: */
	longAtput(copy, (longAt(copy)) & (~(usqIntptr_t)(1U << (rememberedBitShift()))));
	/* begin setIsMarkedOf:to: */
	assert(!(isFreeObject(copy)));
	longAtput(copy, (longAt(copy)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
	/* begin ifAProxy:updateCopy: */
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		if (((((longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {

			/* Since the context is here via objectsReachableFromRoots: we know it cannot be divorced.
			   I'd like to assert coInterpreter checkIsStillMarriedContext: objOop currentFP: framePointer,
			   here but that requires access to framePointer. */
			/* begin numSlotsOfMarriedContext: */
			contextSize = stackPointerIndexForFrame(frameOfMarriedContext(objOop));
			numMediatedSlots = CtxtTempFrameStart + contextSize;
			for (i1 = 0; i1 < numMediatedSlots; i1 += 1) {
				oop = fetchPointerofMarriedContext(i1, objOop);
				assert(!(isOopForwarded(copy)));
				longAtput((copy + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), oop);
			}
		}
		else {
			/* begin numPointerSlotsOf: */
			fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
			if (fmt <= 5 /* lastPointerFormat */) {
				if ((fmt == (indexablePointersFormat()))
				 && (((longAt(objOop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

					/* contexts end at the stack pointer */
					/* begin fetchStackPointerOf: */
					sp = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
					if (!((((sp) & 7) == 1))) {
						contextSize1 = 0;
						goto l7;
					}
					assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop)));
					contextSize1 = (sp >> 3);
	l7:	/* end fetchStackPointerOf: */;
					numMediatedSlots = CtxtTempFrameStart + contextSize1;
					goto l5;
				}
				/* begin numSlotsOf: */
				assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
				numSlots1 = byteAt(objOop + 7);
				numMediatedSlots = (numSlots1 == (numSlotsMask())
					? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
					: numSlots1);
				goto l5;
			}
			if (fmt == 7 /* forwardedFormat */) {
				numMediatedSlots = 1;
				goto l5;
			}
			if (fmt < (firstCompiledMethodFormat())) {
				numMediatedSlots = 0;
				goto l5;
			}
			/* begin methodHeaderOf: */
			assert(isCompiledMethod(objOop));
			header1 = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
			if ((((header1) & 7) == 1)) {
				header = header1;
			}
			else {
				assert((((usqInt)header1)) < GIV(newSpaceStart));
				assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
				header = ((((CogMethod *) header1))->methodHeader);
			}
			assert((((header) & 7) == 1));
			numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
			numMediatedSlots = numLiterals + LiteralStart;
	l5:	/* end numPointerSlotsOf: */;
		}
		for (i1 = numMediatedSlots, iLimiT = ((numSlotsOf(objOop)) - 1); i1 <= iLimiT; i1 += 1) {
			assert(!(isOopForwarded(copy)));
			longAtput((copy + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), GIV(nilObj));
		}
	}
	if (((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
		methodHeader = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((assert(((((methodHeader) & 7) == 1))
			 || (((((usqInt)methodHeader)) < (startOfMemory()))
			 && ((((usqInt)methodHeader)) >= (minCogMethodAddress())))),
		(methodHeader & (smallIntegerTag())) == 0)) {
			assert(!(isOopForwarded(copy)));
			longAtput((copy + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))), ((((CogMethod *) methodHeader))->methodHeader));
		}
	}
	hash = (long32At(objOop + 4)) & (identityHashHalfWordMask());
	if ((hash > (lastClassIndexPun()))
	 && ((classOrNilAtIndex(hash)) == objOop)) {
		/* begin setHashBitsOf:to: */
		assert(((0 >= 0) && (0 <= (identityHashHalfWordMask()))));
		long32Atput(copy + 4, ((((long32At(copy + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))));
		/* begin setIsRememberedOf:to: */
		longAtput(copy, (longAt(copy)) | (1U << (rememberedBitShift())));
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(savedFirstFields)));
	longAtput((savedFirstFields + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))));
	assert(!(isOopForwarded(objOop)));
	longAtput((objOop + BaseHeaderSize) + (0U << (shiftForWord())), copy);
	/* begin markAsCopiedIntoSegment: */
	assert(!(isFreeObject(objOop)));
	longAtput(objOop, (longAt(objOop)) | (1ULL << (markedBitFullShift())));
	return segAddr + bodySize;
}


/*	print the count of marked and unmarked objects.
	In addition if 1 is set in printFlags, short-print marked objects,
	and/or if 2 is set, short-print unmarked obejcts. */

	/* SpurMemoryManager>>#countMarkedAndUnmarkdObjects: */
void
countMarkedAndUnmarkdObjects(sqInt printFlags)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    sqInt nm;
    sqInt nu;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	nm = (nu = 0);
	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (markedBitFullShift())) & 1) != 0) {
			nm += 1;
			if (printFlags & 1) {
				shortPrintOop(objOop1);
			}
		}
		else {
			nu += 1;
			if (printFlags & 2) {
				shortPrintOop(objOop1);
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (markedBitFullShift())) & 1) != 0) {
			nm += 1;
			if (printFlags & 1) {
				shortPrintOop(objOop1);
			}
		}
		else {
			nu += 1;
			if (printFlags & 2) {
				shortPrintOop(objOop1);
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if (((((usqInt) (longAt(objOop11))) >> (markedBitFullShift())) & 1) != 0) {
				nm += 1;
				if (printFlags & 1) {
					shortPrintOop(objOop11);
				}
			}
			else {
				nu += 1;
				if (printFlags & 2) {
					shortPrintOop(objOop11);
				}
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	print("n marked: ");
	printNum(nm);
	/* begin cr */
	printf("\n");
	print("n unmarked: ");
	printNum(nu);
	/* begin cr */
	printf("\n");
}


/*	Compute the current allocated bytes since last set.
	This is the cumulative total in statAllocatedBytes plus the allocation
	since the last scavenge. */
/*	Slang infers the type of the difference between two unsigned variables as
	signed. In this case we want it to be unsigned. */

	/* SpurMemoryManager>>#currentAllocatedBytes */
static usqLong
currentAllocatedBytes(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt use;

	use = (GIV(totalHeapSizeIncludingBridges) - (GIV(numSegments) * (2 * BaseHeaderSize))) - GIV(totalFreeOldSpace);
	return (GIV(statAllocatedBytes) + (GIV(freeStart) - (((eden()).start)))) + (use - GIV(oldSpaceUsePriorToScavenge));
}

	/* SpurMemoryManager>>#displayObject */
sqInt
displayObject(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheDisplay) << (shiftForWord())))));
}


/*	The inner shell for scavenge, abstrascted out so globalGarbageCollect can
	use it.
 */

	/* SpurMemoryManager>>#doScavenge: */
static void NoDbgRegParms
doScavenge(sqInt tenuringCriterion)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    SpurNewSpaceSpace *aNewSpace;
    float fractionSurvived;
    sqInt oldStart;
    sqInt p;
    SpurNewSpaceSpace temp;
    usqInt use;

	/* begin doAllocationAccountingForScavenge */
	use = (GIV(totalHeapSizeIncludingBridges) - (GIV(numSegments) * (2 * BaseHeaderSize))) - GIV(totalFreeOldSpace);
	GIV(statAllocatedBytes) = (GIV(statAllocatedBytes) + (GIV(freeStart) - (((eden()).start)))) + (use - GIV(oldSpaceUsePriorToScavenge));
	GIV(gcPhaseInProgress) = ScavengeInProgress;
	/* begin scavenge: */
	GIV(statSurvivorCount) = 0;
	GIV(tenureCriterion) = tenuringCriterion;
	/* begin logStartScavenge */
	(GIV(scavengeLogRecord).sEdenBytes = (freeStart()) - ((GIV(eden).start)));
	(GIV(scavengeLogRecord).sPastBytes = (pastSpaceStart()) - ((GIV(pastSpace).start)));
	(GIV(scavengeLogRecord).sRememberedSetSize = GIV(rememberedSetSize));
	(GIV(scavengeLogRecord).sRememberedSetRedZone = GIV(rememberedSetRedZone));
	(GIV(scavengeLogRecord).sRememberedSetLimit = GIV(rememberedSetLimit));
	(GIV(scavengeLogRecord).sStatTenures = GIV(statTenures));
	/* begin strategizeToLimitRememberedTable */
	if ((GIV(tenureCriterion) == TenureByAge)
	 && (GIV(rememberedSetSize) >= GIV(rememberedSetRedZone))) {
		GIV(tenureCriterion) = TenureToShrinkRT;
		computeRefCountToShrinkRT();
	}
	/* begin logTenuringPolicy */
	(GIV(scavengeLogRecord).tTenureCriterion = GIV(tenureCriterion));
	(GIV(scavengeLogRecord).tTenureThreshold = ((GIV(tenureCriterion) == TenureByAge)
	 && (GIV(tenureThreshold) > ((GIV(pastSpace).start)))
		? GIV(tenureThreshold) - ((GIV(pastSpace).start))
		: 0));
	(GIV(scavengeLogRecord).tRefCountToShrinkRT = GIV(refCountToShrinkRT));
	scavengeLoop();
	processWeaklings();
	/* begin computeTenuringThreshold */
	fractionSurvived = (((GIV(futureSpace).limit)) == ((GIV(futureSpace).start))
		? 0.0
		: (((double) (GIV(futureSurvivorStart) - ((GIV(futureSpace).start))) )) / (((GIV(futureSpace).limit)) - ((GIV(futureSpace).start))));
	GIV(tenureThreshold) = (fractionSurvived > 0.9
		? (round(((((GIV(pastSpace).limit)) - ((GIV(pastSpace).start))) * (1.0 - GIV(tenuringProportion))))) + ((GIV(pastSpace).start))
		: 0);
	/* begin exchangeSurvivorSpaces */
	temp = GIV(pastSpace);
	GIV(pastSpace) = GIV(futureSpace);
	GIV(futureSpace) = temp;
	/* begin logEndScavenge */
	(GIV(scavengeLogRecord).eSurvivorBytes = GIV(futureSurvivorStart) - ((GIV(pastSpace).start)));
	(GIV(scavengeLogRecord).eRememberedSetSize = GIV(rememberedSetSize));
	(GIV(scavengeLogRecord).eStatTenures = GIV(statTenures));
	/* begin initFutureSpaceStart */
	oldStart = GIV(futureSurvivorStart);
	GIV(futureSurvivorStart) = (GIV(futureSpace).start);
	GIV(pastSpaceStart) = oldStart;
	assert(oopisGreaterThanOrEqualToandLessThanOrEqualTo(GIV(pastSpaceStart), ((pastSpace()).start), ((pastSpace()).limit)));
	GIV(freeStart) = ((eden()).start);
	/* begin initSpaceForAllocationCheck:limit: */
	aNewSpace = ((SpurNewSpaceSpace *) ((&(eden()))));
	if (!(GIV(memory) == null)) {
		if (checkAllocFiller()) {
			for (p = ((aNewSpace->start)); p < GIV(scavengeThreshold); p += BytesPerWord) {
				longAtput(p, p);
			}
		}
	}
	GIV(gcPhaseInProgress) = 0;
	/* begin resetAllocationAccountingAfterGC */
	GIV(oldSpaceUsePriorToScavenge) = (GIV(totalHeapSizeIncludingBridges) - (GIV(numSegments) * (2 * BaseHeaderSize))) - GIV(totalFreeOldSpace);
}


/*	Instantiate an instance of a compact class. ee stands for execution engine
	and implies that this allocation will *NOT* cause a GC. N.B. the
	instantiated object
	IS NOT FILLED and must be completed before returning it to Smalltalk.
	Since this
	call is used in routines that do just that we are safe. Break this rule
	and die in GC.
	Result is guaranteed to be young. */

	/* SpurMemoryManager>>#eeInstantiateClassIndex:format:numSlots: */
sqInt
eeInstantiateClassIndexformatnumSlots(sqInt knownClassIndex, sqInt objFormat, sqInt numSlots)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert((numSlots >= 0)
	 && ((knownClassIndex != 0)
	 && ((knownClassAtIndex(knownClassIndex)) != GIV(nilObj))));
	assert(((objFormat < (firstByteFormat())
		? objFormat
		: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex))));
	return allocateNewSpaceSlotsformatclassIndex(numSlots, objFormat, knownClassIndex);
}


/*	Remove all the entries on the stack. Do so by setting Topx to 0
	on the first page, and adding all subsequent pages to the free list. */

	/* SpurMemoryManager>>#emptyObjStack: */
static void NoDbgRegParms
emptyObjStack(sqInt objStack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt nextNextPage;
    sqInt nextPage;

	if (objStack == GIV(nilObj)) {
		return;
	}
	eassert(isValidObjStack(objStack));
	/* begin storePointer:ofObjStack:withValue: */
	assert((formatOf(objStack)) == (wordIndexableFormat()));
	longAtput((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))), 0);
	nextPage = longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
	while (nextPage != 0) {
		nextNextPage = longAt((nextPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
		/* begin storePointer:ofObjStack:withValue: */
		assert((formatOf(nextPage)) == (wordIndexableFormat()));
		longAtput((nextPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))), longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord()))))));
		/* begin storePointer:ofObjStack:withValue: */
		assert((formatOf(nextPage)) == (wordIndexableFormat()));
		longAtput((nextPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))), 0);
		/* begin storePointer:ofObjStack:withValue: */
		assert((formatOf(objStack)) == (wordIndexableFormat()));
		longAtput((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))), nextPage);
		nextPage = nextNextPage;
	}
	/* begin storePointer:ofObjStack:withValue: */
	assert((formatOf(objStack)) == (wordIndexableFormat()));
	longAtput((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))), 0);
	eassert(isValidObjStack(objStack));
}


/*	An obj stack is a stack of objects stored in a hidden root slot, such as
	the markStack or the ephemeronQueue. It is a linked list of segments,
	with the hot end at the head of the list. It is a word object. The stack
	pointer is in ObjStackTopx and 0 means empty. The list goes through
	ObjStackNextx. We don't want to shrink objStacks, since they're used
	in GC and its good to keep their memory around. So unused pages
	created by popping emptying pages are kept on the ObjStackFreex list. */

	/* SpurMemoryManager>>#ensureRoomOnObjStackAt: */
static sqInt NoDbgRegParms
ensureRoomOnObjStackAt(sqInt objStackRootIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt classIndex1;
    sqInt formatField;
    sqInt formatField1;
    sqInt freeOrNewPage;
    sqInt stackOrNil;
    sqInt thang;

	stackOrNil = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(objStackRootIndex) << (shiftForWord())))));
	if ((stackOrNil == GIV(nilObj))
	 || ((longAt((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))))) >= ObjStackLimit)) {
		if (stackOrNil == GIV(nilObj)) {
			freeOrNewPage = 0;
		}
		else {
			freeOrNewPage = longAt((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))));
		}
		if (freeOrNewPage != 0) {

			/* the free page list is always on the new page. */
			/* begin storePointer:ofObjStack:withValue: */
			assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
			longAtput((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))), 0);
			assert((!GIV(marking))
			 || (isMarked(freeOrNewPage)));
		}
		else {
			/* begin allocateSlotsInOldSpace:format:classIndex: */
			formatField1 = sixtyFourBitIndexableFormat();
			classIndex1 = sixtyFourBitLongsClassIndexPun();
			freeOrNewPage = allocateSlotsInOldSpacebytesformatclassIndex(ObjStackPageSlots, (((sqInt)((usqInt)(ObjStackPageSlots) << (shiftForWord())))) + (BaseHeaderSize + BaseHeaderSize), formatField1, classIndex1);
			if (!(freeOrNewPage)) {

				/* Allocate a new segment an retry. This is very uncommon. But it happened to me (Clement). */
				growOldSpaceByAtLeast(ObjStackPageSlots);
				/* begin allocateSlotsInOldSpace:format:classIndex: */
				formatField = sixtyFourBitIndexableFormat();
				classIndex = sixtyFourBitLongsClassIndexPun();
				freeOrNewPage = allocateSlotsInOldSpacebytesformatclassIndex(ObjStackPageSlots, (((sqInt)((usqInt)(ObjStackPageSlots) << (shiftForWord())))) + (BaseHeaderSize + BaseHeaderSize), formatField, classIndex);
				if (!(freeOrNewPage)) {
					error("no memory to allocate or extend obj stack");
				}
			}
			/* begin storePointer:ofObjStack:withValue: */
			assert((formatOf(freeOrNewPage)) == (wordIndexableFormat()));
			longAtput((freeOrNewPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))), 0);
			if (GIV(marking)) {
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(freeOrNewPage)));
				longAtput(freeOrNewPage, (longAt(freeOrNewPage)) | (1ULL << (markedBitFullShift())));
			}
		}
		/* begin storePointer:ofObjStack:withValue: */
		assert((formatOf(freeOrNewPage)) == (wordIndexableFormat()));
		longAtput((freeOrNewPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackMyx) << (shiftForWord())))), objStackRootIndex);
		/* begin storePointer:ofObjStack:withValue: */
		thang = (stackOrNil == GIV(nilObj)
			? 0
			: stackOrNil);
		assert((formatOf(freeOrNewPage)) == (wordIndexableFormat()));
		longAtput((freeOrNewPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))), thang);
		/* begin storePointer:ofObjStack:withValue: */
		assert((formatOf(freeOrNewPage)) == (wordIndexableFormat()));
		longAtput((freeOrNewPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))), 0);
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(GIV(hiddenRootsObj))));
		if ((assert(isNonImmediate(GIV(hiddenRootsObj))),
		oopisGreaterThanOrEqualTo(GIV(hiddenRootsObj), GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((freeOrNewPage & (tagMask())) == 0)
			 && (oopisLessThan(freeOrNewPage, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(GIV(hiddenRootsObj)))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(GIV(hiddenRootsObj));
				}
			}
		}
		longAtput((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(objStackRootIndex) << (shiftForWord())))), freeOrNewPage);
		assert(isValidObjStackAt(objStackRootIndex));
		/* begin updateRootOfObjStackAt:with: */
		assert(!(isForwarded(GIV(hiddenRootsObj))));
		if ((assert(isNonImmediate(GIV(hiddenRootsObj))),
		oopisGreaterThanOrEqualTo(GIV(hiddenRootsObj), GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((freeOrNewPage & (tagMask())) == 0)
			 && (oopisLessThan(freeOrNewPage, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(GIV(hiddenRootsObj)))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(GIV(hiddenRootsObj));
				}
			}
		}
		longAtput((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(objStackRootIndex) << (shiftForWord())))), freeOrNewPage);
		
		switch (objStackRootIndex) {
		case MarkStackRootIndex:
			GIV(markStack) = freeOrNewPage;
			break;
		case WeaklingStackRootIndex:
			GIV(weaklingStack) = freeOrNewPage;
			break;
		case MournQueueRootIndex:
			GIV(mournQueue) = freeOrNewPage;
			break;
		default:
			error("Case not found and no otherwise clause");
		}
		stackOrNil = freeOrNewPage;
	}
	assert(isValidObjStackAt(objStackRootIndex));
	return stackOrNil;
}


/*	Enter aBehavior into the class table and answer 0. Otherwise answer a
	primitive failure code. */

	/* SpurMemoryManager>>#enterIntoClassTable: */
static sqInt NoDbgRegParms
enterIntoClassTable(sqInt aBehavior)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt hash;
    sqInt i;
    sqInt iLimiT;
    sqInt initialMajorIndex;
    sqInt majorIndex;
    sqInt minorIndex;
    sqInt numSlots;
    sqInt numSlots1;
    usqInt p;
    sqInt page;

	majorIndex = ((usqInt) GIV(classTableIndex)) >> (classTableMajorIndexShift());

	/* classTableIndex should never index the first page; it's reserved for known classes */
	initialMajorIndex = majorIndex;
	assert(initialMajorIndex > 0);
	minorIndex = GIV(classTableIndex) & ((1U << (classTableMajorIndexShift())) - 1);
	while(1) {
		page = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(majorIndex) << (shiftForWord())))));
		if (page == GIV(nilObj)) {
			/* begin allocateSlotsInOldSpace:format:classIndex: */
			numSlots = 1U << (classTableMajorIndexShift());
			classIndex = arrayClassIndexPun();
			page = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, (numSlots == 0
				? 8 /* allocationUnit */ + BaseHeaderSize
				: (((sqInt)((usqInt)(numSlots) << (shiftForWord())))) + ((numSlots >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize))), 2 /* arrayFormat */, classIndex);
			if (!(page)) {
				return PrimErrNoMemory;
			}
			/* begin fillObj:numSlots:with: */
			numSlots1 = 1U << (classTableMajorIndexShift());
			assert(oopisLessThan(((page + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1, addressAfter(page)));
			for (p = (((usqInt)(page + BaseHeaderSize))); p <= (((usqInt)(((page + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1))); p += 8 /* allocationUnit */) {
				longAtput(p, GIV(nilObj));
			}
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(GIV(hiddenRootsObj))));
			if ((assert(isNonImmediate(GIV(hiddenRootsObj))),
			oopisGreaterThanOrEqualTo(GIV(hiddenRootsObj), GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((page & (tagMask())) == 0)
				 && (oopisLessThan(page, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(GIV(hiddenRootsObj)))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(GIV(hiddenRootsObj));
					}
				}
			}
			longAtput((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(majorIndex) << (shiftForWord())))), page);
			GIV(numClassTablePages) += 1;
			minorIndex = 0;
		}
		for (i = minorIndex, iLimiT = ((1U << (classTableMajorIndexShift())) - 1); i <= iLimiT; i += 1) {
			if ((longAt((page + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))))) == GIV(nilObj)) {

				/* classTableIndex must never index the first page, which is reserved for classes known to the VM. */
				GIV(classTableIndex) = (((sqInt)((usqInt)(majorIndex) << (classTableMajorIndexShift())))) + i;
				assert(GIV(classTableIndex) >= (1U << (classTableMajorIndexShift())));
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(page)));
				if ((assert(isNonImmediate(page)),
				oopisGreaterThanOrEqualTo(page, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((aBehavior & (tagMask())) == 0)
					 && (oopisLessThan(aBehavior, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(page))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(page);
						}
					}
				}
				longAtput((page + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), aBehavior);
				/* begin setHashBitsOf:to: */
				hash = GIV(classTableIndex);
				assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
				long32Atput(aBehavior + 4, ((((long32At(aBehavior + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash);
				assert((classAtIndex(rawHashBitsOf(aBehavior))) == aBehavior);
				return 0;
			}
		}
		majorIndex = ((((majorIndex + 1) & (classIndexMask())) < 1) ? 1 : ((majorIndex + 1) & (classIndexMask())));
		if (majorIndex == initialMajorIndex) {

			/* wrapped; table full */
			return PrimErrLimitExceeded;
		}
	}
	return 0;
}

	/* SpurMemoryManager>>#ephemeronFormat */
static sqInt
ephemeronFormat(void)
{
	return 5;
}

	/* SpurMemoryManager>>#existInstancesInNewSpaceOf: */
static sqInt NoDbgRegParms
existInstancesInNewSpaceOf(sqInt classObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt classIndex;
    sqInt followingWord;
    sqInt followingWord1;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevPrevObj;

	classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
	/* begin allNewSpaceObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((longAt(objOop1)) & (classIndexMask())) == classIndex) {
			return 1;
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((longAt(objOop1)) & (classIndexMask())) == classIndex) {
			return 1;
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	return 0;
}


/*	Remove aBehavior from the class table. */

	/* SpurMemoryManager>>#expungeFromClassTable: */
static void NoDbgRegParms
expungeFromClassTable(sqInt aBehavior)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt classTablePage;
    sqInt majorIndex;
    sqInt minorIndex;

	assert(isInClassTable(aBehavior));
	classIndex = (long32At(aBehavior + 4)) & (identityHashHalfWordMask());
	majorIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift());
	minorIndex = classIndex & ((1U << (classTableMajorIndexShift())) - 1);
	classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(majorIndex) << (shiftForWord())))));
	assert(classTablePage != GIV(classTableFirstPage));
	assert((numSlotsOf(classTablePage)) == (classTablePageSize()));
	assert((fetchPointerofObject(minorIndex, classTablePage)) == aBehavior);
	assert(!(isOopForwarded(classTablePage)));
	longAtput((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(minorIndex) << (shiftForWord())))), GIV(nilObj));
	if (classIndex < GIV(classTableIndex)) {
		GIV(classTableIndex) = classIndex;
	}
	assert(GIV(classTableIndex) >= (1U << (classTableMajorIndexShift())));
}

	/* SpurMemoryManager>>#falseObject */
sqInt
falseObject(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(falseObj);
}

	/* SpurMemoryManager>>#fetchByte:ofObject: */
sqInt
fetchByteofObject(sqInt byteIndex, sqInt objOop)
{
	return byteAt((objOop + BaseHeaderSize) + byteIndex);
}

	/* SpurMemoryManager>>#fetchClassOfNonImm: */
static sqInt NoDbgRegParms NeverInline
fetchClassOfNonImm(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt classTablePage;
    sqInt fieldIndex;
    sqInt fieldIndex1;

	/* begin classIndexOf: */
	classIndex = (longAt(objOop)) & (classIndexMask());
	if (classIndex <= (classIsItselfClassIndexPun())) {
		if (classIndex == (classIsItselfClassIndexPun())) {
			return objOop;
		}
		if (classIndex == (isForwardedObjectClassIndexPun())) {
			return GIV(nilObj);
		}
	}
	assert(classIndex >= (arrayClassIndexPun()));
	/* begin classOrNilAtIndex: */
	assert((classIndex <= (tagMask()))
	 || (classIndex >= (arrayClassIndexPun())));
	/* begin fetchPointer:ofObject: */
	fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift());
	classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (classTablePage == GIV(nilObj)) {
		return GIV(nilObj);
	}
	/* begin fetchPointer:ofObject: */
	fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1);
	return longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#fetchClassOf: */
sqInt
fetchClassOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt tagBits;

	return (((tagBits = oop & (tagMask()))) != 0
		? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))
		: fetchClassOfNonImm(oop));
}


/*	In Spur an object's classIndex is the tag in all method caches. */

	/* SpurMemoryManager>>#fetchClassTagOfNonImm: */
static sqInt NoDbgRegParms
fetchClassTagOfNonImm(sqInt obj)
{
	/* begin classIndexOf: */
	return (longAt(obj)) & (classIndexMask());
}


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

	/* SpurMemoryManager>>#fetchLong32:ofObject: */
sqInt
fetchLong32ofObject(sqInt fieldIndex, sqInt oop)
{
	return long32At((oop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))));
}

	/* SpurMemoryManager>>#fetchPointer:ofFreeChunk: */
static sqInt NoDbgRegParms
fetchPointerofFreeChunk(sqInt fieldIndex, sqInt objOop)
{
	return longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#fetchPointer:ofObject: */
sqInt
fetchPointerofObject(sqInt fieldIndex, sqInt objOop)
{
	return longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
}


/*	Answer, but do not remove, the largest free chunk in the free lists. */

	/* SpurMemoryManager>>#findLargestFreeChunk */
static sqInt
findLargestFreeChunk(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt childNode;
    sqInt fieldIndex;
    sqInt treeNode;

	treeNode = GIV(freeLists)[0];
	if (treeNode == 0) {
		return null;
	}
	while (1) {
		/* begin assertValidFreeObject: */
		assert(assertInnerValidFreeObject(treeNode));
		assert((bytesInObject(treeNode)) >= ((numFreeLists()) * (allocationUnit())));
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex = 4 /* freeChunkLargerIndex */;
		childNode = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
		if (!(childNode != 0)) break;
		treeNode = childNode;
	}
	return treeNode;
}


/*	Print the oops of all string-like things that start with the same
	characters as aCString
 */

	/* SpurMemoryManager>>#findStringBeginningWith: */
void
findStringBeginningWith(char *aCString)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt cssz;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	cssz = strlen(aCString);
	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))
		 && (((lengthOfformat(objOop1, (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()))) >= cssz)
		 && ((strncmp(aCString, pointerForOop(objOop1 + BaseHeaderSize), cssz)) == 0))) {
			printHex(objOop1);
			/* begin space */
			putchar(' ');
			printNum(lengthOfformat(objOop1, (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())));
			/* begin space */
			putchar(' ');
			printOopShort(objOop1);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))
		 && (((lengthOfformat(objOop1, (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()))) >= cssz)
		 && ((strncmp(aCString, pointerForOop(objOop1 + BaseHeaderSize), cssz)) == 0))) {
			printHex(objOop1);
			/* begin space */
			putchar(' ');
			printNum(lengthOfformat(objOop1, (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())));
			/* begin space */
			putchar(' ');
			printOopShort(objOop1);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))
			 && (((lengthOfformat(objOop11, (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()))) >= cssz)
			 && ((strncmp(aCString, pointerForOop(objOop11 + BaseHeaderSize), cssz)) == 0))) {
				printHex(objOop11);
				/* begin space */
				putchar(' ');
				printNum(lengthOfformat(objOop11, (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())));
				/* begin space */
				putchar(' ');
				printOopShort(objOop11);
				/* begin cr */
				printf("\n");
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	}


/*	Print the oops of all string-like things that have the same characters as
	aCString 
 */

	/* SpurMemoryManager>>#findString: */
void
findString(char *aCString)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt cssz;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	cssz = strlen(aCString);
	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))
		 && (((lengthOfformat(objOop1, (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()))) == cssz)
		 && ((strncmp(aCString, pointerForOop(objOop1 + BaseHeaderSize), cssz)) == 0))) {
			printHex(objOop1);
			/* begin space */
			putchar(' ');
			printOopShort(objOop1);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))
		 && (((lengthOfformat(objOop1, (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask()))) == cssz)
		 && ((strncmp(aCString, pointerForOop(objOop1 + BaseHeaderSize), cssz)) == 0))) {
			printHex(objOop1);
			/* begin space */
			putchar(' ');
			printOopShort(objOop1);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))
			 && (((lengthOfformat(objOop11, (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask()))) == cssz)
			 && ((strncmp(aCString, pointerForOop(objOop11 + BaseHeaderSize), cssz)) == 0))) {
				printHex(objOop11);
				/* begin space */
				putchar(' ');
				printOopShort(objOop11);
				/* begin cr */
				printf("\n");
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	}

	/* SpurMemoryManager>>#firstAccessibleObject */
static sqInt
firstAccessibleObject(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt savedTenuringThreshold;

	assert(GIV(nilObj) == GIV(oldSpaceStart));
	/* begin flushNewSpace */
	savedTenuringThreshold = GIV(tenureThreshold);
	/* begin setRawTenuringThreshold: */
	GIV(tenureThreshold) = GIV(newSpaceLimit);
	scavengingGCTenuringIf(TenureByAge);
	/* begin setRawTenuringThreshold: */
	GIV(tenureThreshold) = savedTenuringThreshold;
	assert((rememberedSetSize()) == 0);
	assert(GIV(pastSpaceStart) == (((pastSpace()).start)));
	assert(GIV(freeStart) == (((eden()).start)));
	return GIV(nilObj);
}


/*	for the message send breakpoint; selectors can be immediates. */

	/* SpurMemoryManager>>#firstFixedFieldOfMaybeImmediate: */
static void * NoDbgRegParms
firstFixedFieldOfMaybeImmediate(sqInt oop)
{
	return (oop & (tagMask())
		? ((void *)oop)
		: (/* begin firstFixedField: */
			pointerForOop(oop + BaseHeaderSize)));
}

	/* SpurMemoryManager>>#firstFixedField: */
void *
firstFixedField(sqInt objOop)
{
	return pointerForOop(objOop + BaseHeaderSize);
}


/*	NOTE: overridden in various simulator subclasses to add coercion to
	CArray, so please duplicate any changes.
	There are only two important cases, both for objects with named inst vars,
	i.e. formats 2,3 & 5.
	The first indexable field for formats 2 & 5 is the slot count (by
	convention, even though that's off the end
	of the object). For 3 we must go to the class. */

	/* SpurMemoryManager>>#firstIndexableField: */
void *
firstIndexableField(sqInt objOop)
{
    sqInt classFormat;
    sqInt classPointer;
    sqInt fmt;

	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	if (fmt <= (weakArrayFormat())) {
		if (fmt == 2 /* arrayFormat */) {

			/* array starts at 0. */
			return pointerForOop(objOop + BaseHeaderSize);
		}
		if (fmt >= (indexablePointersFormat())) {

			/* indexable with inst vars; need to delve into the class format word */
			/* begin formatOfClass: */
			classPointer = fetchClassOfNonImm(objOop);
			classFormat = ((longAt((classPointer + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
			return pointerForOop((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) << (shiftForWord())))));
		}
		return 0;
	}
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 && (fmt < (firstCompiledMethodFormat()))) {
		return pointerForOop(objOop + BaseHeaderSize);
	}
	return 0;
}

	/* SpurMemoryManager>>#fixedFieldsOfClassFormatMask */
sqInt
fixedFieldsOfClassFormatMask(void)
{
	return (1U << (fixedFieldsFieldWidth())) - 1;
}

	/* SpurMemoryManager>>#fixedFieldsOfClassFormat: */
sqInt
fixedFieldsOfClassFormat(sqInt classFormat)
{
	return classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
}

	/* SpurMemoryManager>>#fixedFieldsOfClass: */
static sqInt NoDbgRegParms
fixedFieldsOfClass(sqInt objOop)
{
    sqInt classFormat;

	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	return classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
}

	/* SpurMemoryManager>>#fixedFieldsOf:format:length: */
static sqInt NoDbgRegParms
fixedFieldsOfformatlength(sqInt objOop, sqInt fmt, sqInt wordLength)
{
    sqInt class;
    sqInt classFormat;


	/* N.B. written to fall through to fetchClassOfNonImm: et al for forwarders
	   so as to trigger an assert fail. */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		return 0;
	}
	if (fmt < 2 /* arrayFormat */) {
		return wordLength;
	}
	class = fetchClassOfNonImm(objOop);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	return classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
}


/*	Private helper for followField:ofObject: to avoid code duplication for
	rare case.
 */

	/* SpurMemoryManager>>#fixFollowedField:ofObject:withInitialValue: */
static sqInt NoDbgRegParms NeverInline
fixFollowedFieldofObjectwithInitialValue(sqInt fieldIndex, sqInt anObject, sqInt initialValue)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objOop;

	assert(isOopForwarded(initialValue));
	objOop = initialValue;
	do {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		objOop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
	} while(((objOop & (tagMask())) == 0)
		 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0));
	/* begin storePointer:ofObject:withValue: */
	assert(!(isForwarded(anObject)));
	if ((assert(isNonImmediate(anObject)),
	oopisGreaterThanOrEqualTo(anObject, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((objOop & (tagMask())) == 0)
		 && (oopisLessThan(objOop, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(anObject))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(anObject);
			}
		}
	}
	longAtput((anObject + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), objOop);
	return objOop;
}


/*	Make sure the oop at fieldIndex in anObject is not forwarded (follow the
	forwarder there-in if so). Answer the (possibly followed) oop at
	fieldIndex.  */

	/* SpurMemoryManager>>#followField:ofObject: */
static sqInt NoDbgRegParms
followFieldofObject(sqInt fieldIndex, sqInt anObject)
{
    sqInt objOop;

	/* begin fetchPointer:ofObject: */
	objOop = longAt((anObject + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop = fixFollowedFieldofObjectwithInitialValue(fieldIndex, anObject, objOop);
	}
	return objOop;
}


/*	Follow pointers in the object to depth.
	Answer if any forwarders were found.
	How to avoid cyclic structures?? A temproary mark bit? */

	/* SpurMemoryManager>>#followForwardedObjectFields:toDepth: */
sqInt
followForwardedObjectFieldstoDepth(sqInt objOop, sqInt depth)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt found;
    sqInt i;
    sqInt iLimiT;
    sqInt oop;
    sqInt referent;

	found = 0;
	assert((isPointers(objOop))
	 || (isOopCompiledMethod(objOop)));
	for (i = 0, iLimiT = ((numPointerSlotsOf(objOop)) - 1); i <= iLimiT; i += 1) {
		/* begin fetchPointer:ofObject: */
		oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if ((oop & (tagMask())) == 0) {
			if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				found = 1;
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(oop));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent & (tagMask())) == 0)
				 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				oop = referent;
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(objOop)));
				if ((assert(isNonImmediate(objOop)),
				oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((oop & (tagMask())) == 0)
					 && (oopisLessThan(oop, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(objOop);
						}
					}
				}
				longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), oop);
			}
			if ((depth > 0)
			 && ((((oop & (tagMask())) == 0)
			 && (isAnyPointerFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))))
			 && (followForwardedObjectFieldstoDepth(oop, depth - 1)))) {
				found = 1;
			}
		}
	}
	return found;
}


/*	Follow a forwarding pointer. THis must be a loop because we cannot prevent
	forwarders to
	forwarders being created by lazy become. Consider the following example by
	Igor Stasenko:
	array := { a. b. c }.
	- array at: 1 points to &a. array at: 2 points to &b. array at: 3 points
	to &c
	a becomeForward: b
	- array at: 1 still points to &a. array at: 2 still points to &b. array
	at: 3 still points to &c
	b becomeForward: c.
	- array at: 1 still points to &a. array at: 2 still points to &b. array
	at: 3 still points to &c
	- when accessing array first one has to follow a forwarding chain:
	&a -> &b -> c */

	/* SpurMemoryManager>>#followForwarded: */
sqInt
followForwarded(sqInt objOop)
{
    sqInt referent;

	assert(isUnambiguouslyForwarder(objOop));
	/* begin fetchPointer:ofMaybeForwardedObject: */
	referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
	while (((referent & (tagMask())) == 0)
	 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	return referent;
}


/*	Make sure the obj at fieldIndex in anObject is not forwarded (follow the
	forwarder there-in if so). Answer the (possibly followed) obj at
	fieldIndex.  */

	/* SpurMemoryManager>>#followObjField:ofObject: */
static sqInt NoDbgRegParms
followObjFieldofObject(sqInt fieldIndex, sqInt anObject)
{
    sqInt objOop;

	/* begin fetchPointer:ofObject: */
	objOop = longAt((anObject + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	assert(isNonImmediate(objOop));
	if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		objOop = fixFollowedFieldofObjectwithInitialValue(fieldIndex, anObject, objOop);
	}
	return objOop;
}

	/* SpurMemoryManager>>#formatOfClass: */
sqInt
formatOfClass(sqInt classPointer)
{
	return ((longAt((classPointer + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
}


/*	0 = 0 sized objects (UndefinedObject True False et al)
	1 = non-indexable objects with inst vars (Point et al)
	2 = indexable objects with no inst vars (Array et al)
	3 = indexable objects with inst vars (MethodContext AdditionalMethodState
	et al)
	4 = weak indexable objects with inst vars (WeakArray et al)
	5 = weak non-indexable objects with inst vars (ephemerons) (Ephemeron)
	6 unused, reserved for exotic pointer objects?
	7 Forwarded Object, 1st field is pointer, rest of fields are ignored
	8 unused, reserved for exotic non-pointer objects?
	9 64-bit indexable
	10 - 11 32-bit indexable	(11 unused in 32 bits)
	12 - 15 16-bit indexable	(14 & 15 unused in 32-bits)
	16 - 23 byte indexable		(20-23 unused in 32-bits)
	24 - 31 compiled method	(28-31 unused in 32-bits) */
/*	A note on performance. Since the format field is, by design, aligned on a
	byte boundary
	in the fourth byte of the header we could access it via
	^(self byteAt: objOop + 3) bitAnd: self formatMask
	but al least on e.g. Core i7 x86-64 using the clang 6 compiler, this makes
	no difference,
	or at least any change is in the noise. */

	/* SpurMemoryManager>>#formatOf: */
static sqInt NoDbgRegParms
formatOf(sqInt objOop)
{
	return (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
}


/*	A special format used by the GC to follow only the first pointer. */

	/* SpurMemoryManager>>#forwardedFormat */
static sqInt
forwardedFormat(void)
{
	return 7;
}


/*	Answer if anObject is itself forwarded, or is a pointer object containing
	any references to forwarded objects.
 */

	/* SpurMemoryManager>>#forwardersIn: */
static sqInt NoDbgRegParms
forwardersIn(sqInt anObject)
{
    sqInt i;
    sqInt iLimiT;
    sqInt oop;

	if (((longAt(anObject)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		return 1;
	}
	for (i = 0, iLimiT = ((numPointerSlotsOf(anObject)) - 1); i <= iLimiT; i += 1) {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		oop = longAt((anObject + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if (((oop & (tagMask())) == 0)
		 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			return 1;
		}
	}
	return 0;
}


/*	for linking objecs on each free list, or, during pigCompact, doubly-
	linking the free objects in address order using the xor link hack. */

	/* SpurMemoryManager>>#freeChunkNextIndex */
static sqInt
freeChunkNextIndex(void)
{
	return 0;
}


/*	for organizing the tree of large free chunks. */

	/* SpurMemoryManager>>#freeChunkParentIndex */
static sqInt
freeChunkParentIndex(void)
{
	return 2;
}


/*	For linking objecs on each free list, doubly-linking the free objects.
	Free chunks of size 1 do not have a prev index. */

	/* SpurMemoryManager>>#freeChunkPrevIndex */
static sqInt
freeChunkPrevIndex(void)
{
	return 1;
}

	/* SpurMemoryManager>>#freeChunkWithBytes:at: */
static sqInt NoDbgRegParms
freeChunkWithBytesat(sqInt bytes, sqInt address)
{
    sqInt freeChunk;

	assert(isInOldSpace(address));
	assert((segmentContainingObj(address)) == (segmentContainingObj(address + bytes)));
	freeChunk = initFreeChunkWithBytesat(bytes, address);
	addToFreeListbytes(freeChunk, bytes);
	assert(freeChunk == (objectStartingAt(address)));
	return freeChunk;
}


/*	Free an object in oldSpace. Coalesce if possible to reduce fragmentation. */

	/* SpurMemoryManager>>#freeObject: */
sqInt
freeObject(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    usqInt bytes;
    usqInt chunkBytes;
    sqInt index;
    sqInt next;
    usqInt numSlots;
    usqInt start;

	assert(isInOldSpace(objOop));
	if (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0) {
		/* begin forgetObject: */
		assert(GIV(rememberedSetSize) > 0);
		assert(isRemembered(objOop));
		/* begin setIsRememberedOf:to: */
		longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1U << (rememberedBitShift()))));
		if (!(objOop == (GIV(rememberedSet)[GIV(rememberedSetSize) - 1]))) {
			index = 0;
			while (index < GIV(rememberedSetSize)) {
				if (objOop == (GIV(rememberedSet)[index])) {
					GIV(rememberedSet)[index] = (GIV(rememberedSet)[GIV(rememberedSetSize) - 1]);
					index = GIV(rememberedSetSize);
				}
				else {
					index += 1;
				}
			}
		}
		GIV(rememberedSetSize) -= 1;
		assert(GIV(rememberedSetSize) >= 0);
	}
	bytes = bytesInObject(objOop);
	start = ((byteAt(objOop + 7)) == (numSlotsMask())
		? objOop - BaseHeaderSize
		: objOop);
	/* begin objectStartingAt: */
	address = start + bytes;
	numSlots = byteAt(address + 7);
	next = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	if (((longAt(next)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
		/* begin detachFreeObject: */
		chunkBytes = bytesInObject(next);
		GIV(totalFreeOldSpace) -= chunkBytes;
		unlinkFreeChunkchunkBytes(next, chunkBytes);
		bytes += bytesInObject(next);
	}
	GIV(totalFreeOldSpace) += bytes;
	return freeChunkWithBytesat(bytes, start);
}


/*	Perform a full lazy compacting GC. Answer the size of the largest free
	chunk. 
 */
/*	for profiling */

	/* SpurMemoryManager>>#fullGC */
usqLong NeverInline
fullGC(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    usqLong compactionStartUsecs;
    usqLong gcMarkEndUsecs;
    sqInt i;
    sqInt index;
    usqInt numSlots;
    sqInt obj;
    sqInt objOop;
    sqInt segIndex;

	GIV(needGCFlag) = 0;
	GIV(gcStartUsecs) = ioUTCMicrosecondsNow();
	GIV(statMarkCount) = 0;
	preGCAction(GCModeFull);
	/* begin globalGarbageCollect */
	assert(validObjStacks());
	assert(isEmptyObjStack(GIV(markStack)));
	assert(isEmptyObjStack(GIV(weaklingStack)));
	markObjects(1);
	gcMarkEndUsecs = ioUTCMicrosecondsNow();
	/* begin forgetUnmarkedRememberedObjects */
	index = 0;
	while (index < GIV(rememberedSetSize)) {
		obj = GIV(rememberedSet)[index];
		if (((((usqInt) (longAt(obj))) >> (markedBitFullShift())) & 1) != 0) {
			index += 1;
		}
		else {

			/* unmarked; remove by overwriting with last element. */
			/* begin setIsRememberedOf:to: */
			longAtput(obj, (longAt(obj)) & (~(usqIntptr_t)(1U << (rememberedBitShift()))));
			GIV(rememberedSetSize) -= 1;
			GIV(rememberedSet)[index] = (GIV(rememberedSet)[GIV(rememberedSetSize)]);
		}
	}
	assert(GIV(rememberedSetSize) >= 0);
	doScavenge(MarkOnTenure);
	runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(GCModeFull, 1, 1);
	compactionStartUsecs = ioUTCMicrosecondsNow();
	/* begin prepareForGlobalSweep */
	GIV(sweepIndex) = 0;
	for (i = 0; i < GIV(numSegments); i += 1) {
		((GIV(segments)[i]).containsPinned = 0);
	}
	/* begin setIsMarkedOf:to: */
	segIndex = GIV(numSegments) - 1;
	/* begin objectStartingAt: */
	address = (((((&(GIV(segments)[segIndex])))->segSize)) + ((((&(GIV(segments)[segIndex])))->segStart))) - (2 * BaseHeaderSize);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	assert(!(isFreeObject(objOop)));
	longAtput(objOop, (longAt(objOop)) | (1ULL << (markedBitFullShift())));
	compact();
	/* begin attemptToShrink */
	if ((GIV(totalFreeOldSpace) > GIV(shrinkThreshold))
	 && ((GIV(totalFreeOldSpace) > GIV(growHeadroom))
	 && (shrinkObjectMemory((((GIV(totalFreeOldSpace) - GIV(growHeadroom)) < GIV(growHeadroom)) ? GIV(growHeadroom) : (GIV(totalFreeOldSpace) - GIV(growHeadroom))))))) {
		GIV(statShrinkMemory) += 1;
	}
	/* begin setHeapSizeAtPreviousGC */
	GIV(heapSizeAtPreviousGC) = (GIV(totalHeapSizeIncludingBridges) - (GIV(numSegments) * (2 * BaseHeaderSize))) - GIV(totalFreeOldSpace);
	/* begin resetAllocationAccountingAfterGC */
	GIV(oldSpaceUsePriorToScavenge) = (GIV(totalHeapSizeIncludingBridges) - (GIV(numSegments) * (2 * BaseHeaderSize))) - GIV(totalFreeOldSpace);
	assert(validObjStacks());
	assert(isEmptyObjStack(GIV(markStack)));
	assert(isEmptyObjStack(GIV(weaklingStack)));
	assert(allObjectsUnmarked());
	runLeakCheckerFor(GCModeFull);
	postGCAction(GCModeFull);
	GIV(statGCEndUsecs) = ioUTCMicrosecondsNow();
	/* begin updateFullGCStats */
	GIV(statFullGCs) += 1;
	GIV(statFullGCUsecs) += GIV(statGCEndUsecs) - GIV(gcStartUsecs);
	GIV(statCompactionUsecs) += GIV(statGCEndUsecs) - compactionStartUsecs;
	if (!(GIV(gcSweepEndUsecs) == 0)) {
		GIV(statSweepUsecs) += GIV(gcSweepEndUsecs) - compactionStartUsecs;
	}
	GIV(statMarkUsecs) += gcMarkEndUsecs - GIV(gcStartUsecs);
	return ((GIV(freeLists)[0]) != 0
		? bytesInObject(findLargestFreeChunk())
		: 0);
}

	/* SpurMemoryManager>>#getHeapGrowthToSizeGCRatio */
static float
getHeapGrowthToSizeGCRatio(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(heapGrowthToSizeGCRatio);
}

	/* SpurMemoryManager>>#goodContextSize: */
static sqInt NoDbgRegParms
goodContextSize(sqInt oop)
{
    usqInt numSlots;
    usqInt numSlots1;

	/* begin numSlotsOf: */
	assert((classIndexOf(oop)) > (isForwardedObjectClassIndexPun()));
	numSlots1 = byteAt(oop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	return (numSlots == SmallContextSlots)
	 || (numSlots == LargeContextSlots);
}


/*	Attempt to grow memory by at least minAmmount.
	Answer the size of the new segment, or nil if the attempt failed. */

	/* SpurMemoryManager>>#growOldSpaceByAtLeast: */
static sqInt NoDbgRegParms
growOldSpaceByAtLeast(sqInt minAmmount)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt ammount;
    sqInt bytes;
    sqInt headroom;
    sqInt i;
    sqInt interval;
    SpurSegmentInfo *segInfo;
    sqInt start;
    usqInt total;
    usqInt total1;


	/* statGrowMemory counts attempts, not successes. */

	/* we need to include overhead for a new object header plus the segment bridge. */
	GIV(statGrowMemory) += 1;

	/* round up to the nearest power of two. */
	ammount = minAmmount + ((BaseHeaderSize * 2) + (2 * BaseHeaderSize));

	/* and grow by at least growHeadroom. */
	ammount = 1ULL << (highBit(ammount - 1));

	/* Now apply the maxOldSpaceSize limit, if one is in effect. */
	ammount = ((ammount < GIV(growHeadroom)) ? GIV(growHeadroom) : ammount);
	if (maxOldSpaceSize > 0) {
		/* begin totalBytesInSegments */
		total1 = 0;
		for (i = 0; i < GIV(numSegments); i += 1) {
			total1 += ((GIV(segments)[i]).segSize);
		}
		assert(GIV(totalHeapSizeIncludingBridges) == total1);
		total = total1;
		if (total >= maxOldSpaceSize) {
			return null;
		}
		headroom = maxOldSpaceSize - total;
		if (headroom < ammount) {
			if (headroom < (minAmmount + ((BaseHeaderSize * 2) + (2 * BaseHeaderSize)))) {
				return null;
			}
			ammount = headroom;
		}
	}
	start = ioUTCMicrosecondsNow();
	return ((segInfo = addSegmentOfSize(ammount)),
		(!(segInfo == null)
				? (/* begin assimilateNewSegment: */
					((((segInfo->segSize)) + ((segInfo->segStart))) >= GIV(endOfMemory)
							? (GIV(freeOldSpaceStart) = (GIV(endOfMemory) = (((segInfo->segSize)) + ((segInfo->segStart))) - (2 * BaseHeaderSize)))
							: 0),
					sqMakeMemoryNotExecutableFromTo((segInfo->segStart), ((segInfo->segSize)) + ((segInfo->segStart))),
					/* begin addFreeChunkWithBytes:at: */
					(bytes = ((segInfo->segSize)) - (2 * BaseHeaderSize)),
					(address = (segInfo->segStart)),
					(GIV(totalFreeOldSpace) += bytes),
					freeChunkWithBytesat(bytes, address),
					assert((addressAfter(objectStartingAt((segInfo->segStart)))) == ((segLimit(segInfo)) - (bridgeSize()))),
					/* begin checkFreeSpace: */
					assert(bitsSetInFreeSpaceMaskForAllFreeLists()),
					assert(GIV(totalFreeOldSpace) == (totalFreeListBytes())),
					(((checkForLeaks & (GCModeFreeSpace | GCModeFreeSpace)) == (GCModeFreeSpace | GCModeFreeSpace))
							? runLeakCheckerForFreeSpace(GCModeFreeSpace)
							: 0),
					checkSegments(),
					(interval = (ioUTCMicrosecondsNow()) - start),
					(interval > GIV(statMaxAllocSegmentTime)
							? (GIV(statMaxAllocSegmentTime) = interval)
							: 0),
					(segInfo->segSize))
				: 0));
}


/*	The header format in LSB is
	MSB:	| 8: numSlots		| (on a byte boundary)
	| 2 bits				|	(msb,lsb = {isMarked,?})
	| 22: identityHash	| (on a word boundary)
	| 3 bits				|	(msb <-> lsb = {isGrey,isPinned,isRemembered}
	| 5: format			| (on a byte boundary)
	| 2 bits				|	(msb,lsb = {isImmutable,?})
	| 22: classIndex		| (on a word boundary) : LSB
	The remaining bits (7) are used for
	isImmutable	(bit 23)
	isRemembered	(bit 29)
	isPinned		(bit 30)
	isGrey			(bit 31)
	isMarked		(bit 55)
	leaving 2 unused bits, each next to a 22-bit field, allowing those fields
	to be
	expanded to 23 bits.. The three bit field { isGrey, isPinned, isRemembered
	} is for bits that are never set in young objects. This allows the
	remembered table to be pruned when full by using these bits as a reference
	count of
	newSpace objects from the remembered table. Objects with a high count
	should be tenured to prune the remembered table. */

	/* SpurMemoryManager>>#headerForSlots:format:classIndex: */
usqLong
headerForSlotsformatclassIndex(sqInt numSlots, sqInt formatField, sqInt classIndex)
{
	return (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex;
}


/*	The header format in LSB is
	MSB:	| 8: numSlots		| (on a byte boundary)
	| 2 bits				|	(msb,lsb = {isMarked,?})
	| 22: identityHash	| (on a word boundary)
	| 3 bits				|	(msb <-> lsb = {isGrey,isPinned,isRemembered}
	| 5: format			| (on a byte boundary)
	| 2 bits				|	(msb,lsb = {isImmutable,?})
	| 22: classIndex		| (on a word boundary) : LSB
	The remaining bits (7) are used for
	isImmutable	(bit 23)
	isRemembered	(bit 29)
	isPinned		(bit 30)
	isGrey			(bit 31)
	isMarked		(bit 55)
	leaving 2 unused bits, each next to a 22-bit field, allowing those fields
	to be
	expanded to 23 bits.. The three bit field { isGrey, isPinned, isRemembered
	} is for bits that are never set in young objects. This allows the
	remembered table to be pruned when full by using these bits as a reference
	count of
	newSpace objects from the remembered table. Objects with a high count
	should be tenured to prune the remembered table. */

	/* SpurMemoryManager>>#headerForSlots:hash:format:classIndex: */
static usqLong NoDbgRegParms
headerForSlotshashformatclassIndex(sqInt numSlots, sqInt hash, sqInt formatField, sqInt classIndex)
{
	return ((((((usqLong) numSlots)) << (numSlotsFullShift())) + ((((usqLong) hash)) << (identityHashFullWordShift()))) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex;
}


/*	Answer the number of extra root slots in the root of the hidden root
	object. 
 */

	/* SpurMemoryManager>>#hiddenRootSlots */
static sqInt
hiddenRootSlots(void)
{
	return 8;
}

	/* SpurMemoryManager>>#hiddenRootsObject */
static sqInt
hiddenRootsObject(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(hiddenRootsObj);
}


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

	/* SpurMemoryManager>>#imageSegmentVersion */
static sqInt
imageSegmentVersion(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    int wholeWord;


	/* first data word, 'does' */
	wholeWord = long32At((longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorDoesNotUnderstand) << (shiftForWord())))))) + BaseHeaderSize);
	return 68021 /* imageFormatVersion */ | (wholeWord & 0xFF000000U);
}


/*	mask the immutable bit in the base header word */

	/* SpurMemoryManager>>#immutableBitMask */
#if IMMUTABILITY
sqInt
immutableBitMask(void)
{
	return 1U << (immutableBitShift());
}
#endif /* IMMUTABILITY */

	/* SpurMemoryManager>>#incrementalGC */
void
incrementalGC(void)
{
	error("shouldNotImplement");
}

	/* SpurMemoryManager>>#indexOf:in: */
sqInt
indexOfin(sqInt anElement, sqInt anObject)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fmt;
    sqInt fmt1;
    sqInt i;
    usqInt numSlots;
    usqInt numSlots1;

	fmt = (((usqInt) (longAt(anObject))) >> (formatShift())) & (formatMask());
	if (fmt <= 5 /* lastPointerFormat */) {
		/* begin numSlotsOf: */
		assert((classIndexOf(anObject)) > (isForwardedObjectClassIndexPun()));
		numSlots1 = byteAt(anObject + 7);
		numSlots = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(anObject - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		for (i = 0; i <= numSlots; i += 1) {
			if (anElement == (longAt((anObject + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
				return i;
			}
		}
	}
	if (fmt >= (firstByteFormat())) {
		if (fmt >= (firstCompiledMethodFormat())) {
			/* begin primitiveFailFor: */
			return (GIV(primFailCode) = PrimErrUnsupported);
		}
		/* begin numBytesOfBytes: */
		fmt1 = (((usqInt) (longAt(anObject))) >> (formatShift())) & (formatMask());
		assert(fmt1 >= (firstByteFormat()));
		numSlots = ((numSlotsOf(anObject)) << (shiftForWord())) - (fmt1 & 7);
		for (i = 0; i <= numSlots; i += 1) {
			if (byteAt((anObject + BaseHeaderSize) + i)) {
				return i;
			}
		}
	}
	if (fmt >= (firstShortFormat())) {
		numSlots = ((usqInt) (numBytesOf(anObject))) >> 1;
		for (i = 0; i <= numSlots; i += 1) {
			if (anElement == (((unsigned short) (shortAt((anObject + BaseHeaderSize) + (((sqInt)((usqInt)(i) << 1)))))))) {
				return i;
			}
		}
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		numSlots = ((usqInt) (numBytesOf(anObject))) >> 3;
		for (i = 0; i <= numSlots; i += 1) {
			if (anElement == (long64At((anObject + BaseHeaderSize) + (((sqInt)((usqInt)(i) << 3)))))) {
				return i;
			}
		}
	}
	if (fmt >= (firstLongFormat())) {
		numSlots = ((usqInt) (numBytesOf(anObject))) >> 2;
		for (i = 0; i <= numSlots; i += 1) {
			if (anElement == (long32At((anObject + BaseHeaderSize) + (((sqInt)((usqInt)(i) << 2)))))) {
				return i;
			}
		}
	}
	return -1;
}


/*	Part of reorderReversedTreeList:. Switch treeNode with newNode in
	the tree, but do nothing to the list linked through freeChunkNextIndex. */

	/* SpurMemoryManager>>#inFreeTreeReplace:with: */
static void NoDbgRegParms
inFreeTreeReplacewith(sqInt treeNode, sqInt newNode)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fieldIndex;
    sqInt i;
    sqInt iLimiT;
    sqInt relative;

	/* begin storePointer:ofFreeChunk:withValue: */
	assert(isFreeObject(newNode));
	assert(1);
	longAtput((newNode + BaseHeaderSize) + (1U << (shiftForWord())), 0);
	for (i = 2 /* freeChunkParentIndex */, iLimiT = 4 /* freeChunkLargerIndex */; i <= iLimiT; i += 1) {
		/* begin fetchPointer:ofFreeChunk: */
		relative = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if (i == 2 /* freeChunkParentIndex */) {
			if (relative == 0) {

				/* update root to point to newNode */
				assert((GIV(freeLists)[0]) == treeNode);
				GIV(freeLists)[0] = newNode;
			}
			else {

				/* replace link from parent to treeNode with link to newNode. */
				/* begin storePointer:ofFreeChunk:withValue: */
				if (treeNode == (longAt((relative + BaseHeaderSize) + (3U << (shiftForWord()))))) {
					/* begin freeChunkSmallerIndex */
					fieldIndex = 3;
				}
				else {
					/* begin freeChunkLargerIndex */
					fieldIndex = 4;
				}
				assert(isFreeObject(relative));
				assert((newNode == 0)
				 || (isFreeObject(newNode)));
				longAtput((relative + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), newNode);
			}
		}
		else {
			if (relative != 0) {
				assert((fetchPointerofFreeChunk(freeChunkParentIndex(), relative)) == treeNode);
				/* begin storePointer:ofFreeChunk:withValue: */
				assert(isFreeObject(relative));
				assert((newNode == 0)
				 || (isFreeObject(newNode)));
				longAtput((relative + BaseHeaderSize) + (2U << (shiftForWord())), newNode);
			}
		}
		/* begin storePointer:ofFreeChunk:withValue: */
		assert(isFreeObject(newNode));
		assert((relative == 0)
		 || (isFreeObject(relative)));
		longAtput((newNode + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), relative);
		/* begin storePointer:ofFreeChunk:withValue: */
		assert(isFreeObject(treeNode));
		assert(1);
		longAtput((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), 0);
	}
}

	/* SpurMemoryManager>>#initialInstanceOf: */
static sqInt NoDbgRegParms
initialInstanceOf(sqInt classObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt classIndex;
    sqInt classIndex1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	classIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
	if (classIndex == 0) {
		return null;
	}
	/* begin flushNewSpaceInstancesOf: */
	classIndex1 = (long32At(classObj + 4)) & (identityHashHalfWordMask());
	if (classIndex1 == 0) {

		/* no instances; nothing to do */
		goto l1;
	}
	/* begin tenuringClassIndex: */
	GIV(tenuringClassIndex) = classIndex1;
	scavengingGCTenuringIf(TenureByClass);
	assert(!(existInstancesInNewSpaceOf(classObj)));
	l1:	/* end flushNewSpaceInstancesOf: */;
	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (classIndex == ((longAt(objOop1)) & (classIndexMask()))) {
			return objOop1;
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l6;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l6:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (classIndex == ((longAt(objOop1)) & (classIndexMask()))) {
			return objOop1;
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if (classIndex == ((longAt(objOop11)) & (classIndexMask()))) {
				return objOop11;
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	return null;
}

	/* SpurMemoryManager>>#initializeNewSpaceVariables */
static void NeverInline
initializeNewSpaceVariables(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    SpurNewSpaceSpace *aNewSpace;
    sqInt p;

	GIV(freeStart) = ((eden()).start);
	GIV(pastSpaceStart) = ((pastSpace()).start);
	GIV(scavengeThreshold) = ((((eden()).limit)) - ((((GIV(eden).limit)) - ((GIV(eden).start))) / 64)) - (interpreterAllocationReserveBytes());
	GIV(newSpaceStart) = (((((pastSpace()).start)) < (((futureSpace()).start))) ? (((pastSpace()).start)) : (((futureSpace()).start)));
	assert(GIV(newSpaceStart) < (((eden()).start)));
	/* begin initSpaceForAllocationCheck:limit: */
	aNewSpace = ((SpurNewSpaceSpace *) ((&(eden()))));
	if (!(GIV(memory) == null)) {
		if (checkAllocFiller()) {
			for (p = ((aNewSpace->start)); p < GIV(scavengeThreshold); p += BytesPerWord) {
				longAtput(p, p);
			}
		}
	}
}


/*	Initialize object memory variables at startup time. Assume endOfMemory at
	al are
	initialised by the image-reading code via
	setHeapBase:memoryLimit:endOfMemory:. endOfMemory is assumed to point to
	the end of the last object in the image.
	Assume: image reader also initializes the following variables:
	specialObjectsOop
	lastHash */
/*	Catch mis-initializations leading to bad translations to C */

	/* SpurMemoryManager>>#initializeObjectMemory: */
static void NoDbgRegParms
initializeObjectMemory(sqInt bytesToShift)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt anOop;
    sqInt cameFrom;
    usqInt chunkBytes;
    sqInt classIndex;
    sqInt classIndex1;
    sqInt classTableRoot;
    sqInt field;
    sqInt fieldAddr;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt fieldIndex2;
    sqInt fieldIndex3;
    sqInt fieldIndex4;
    sqInt fieldOop;
    sqInt firstObj;
    sqInt followingWord;
    usqInt followingWordAddress;
    sqInt format;
    sqInt freeChunk;
    sqInt freeListObj;
    usqInt freeOldStart;
    sqInt fudge;
    sqInt i;
    sqInt i1;
    sqInt i2;
    sqInt i3;
    sqInt iLimiT;
    sqInt iLimiT1;
    sqInt index;
    sqInt indexLimiT;
    sqInt largeChild;
    usqInt limit;
    sqInt min;
    sqInt nilObjPreSwizzle;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots2;
    usqInt numSlots3;
    sqInt obj;
    sqInt obj1;
    sqInt obj2;
    usqInt p;
    sqInt smallChild;
    sqInt treeNode;
    sqInt valuePointer;
    sqInt valuePointer2;

	assert(BaseHeaderSize == BaseHeaderSize);
	assert((((sqInt)((maxSlotsForAlloc()) * BytesPerWord))) > 0);
	initSegmentBridgeWithBytesat(2 * BaseHeaderSize, GIV(endOfMemory) - (2 * BaseHeaderSize));
	adjustSegmentSwizzlesBy(bytesToShift);
	/* begin adjustAllOopsBy: */
	assert(newSpaceIsEmpty());
	/* begin countNumClassPagesPreSwizzle: */
	numSlots2 = byteAt(GIV(oldSpaceStart) + 7);
	firstObj = (numSlots2 == (numSlotsMask())
		? GIV(oldSpaceStart) + BaseHeaderSize
		: GIV(oldSpaceStart));
	classTableRoot = noInlineObjectAfterlimit(noInlineObjectAfterlimit(noInlineObjectAfterlimit(noInlineObjectAfterlimit(firstObj, GIV(endOfMemory)), GIV(endOfMemory)), GIV(endOfMemory)), GIV(endOfMemory));
	nilObjPreSwizzle = GIV(oldSpaceStart) - bytesToShift;
	/* begin numSlotsOf: */
	assert((classIndexOf(classTableRoot)) > (isForwardedObjectClassIndexPun()));
	numSlots1 = byteAt(classTableRoot + 7);
	GIV(numClassTablePages) = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(classTableRoot - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	assert(GIV(numClassTablePages) == ((classTableRootSlots()) + (hiddenRootSlots())));
	for (i3 = 2; i3 < GIV(numClassTablePages); i3 += 1) {
		if ((longAt((classTableRoot + BaseHeaderSize) + (((sqInt)((usqInt)(i3) << (shiftForWord())))))) == nilObjPreSwizzle) {
			GIV(numClassTablePages) = i3;
			goto l11;
		}
	}
	l11:	/* end countNumClassPagesPreSwizzle: */;
	if ((bytesToShift != 0)
	 || ((numSegments()) > 1)) {
		/* begin objectStartingAt: */
		numSlots = byteAt(GIV(oldSpaceStart) + 7);
		obj = (numSlots == (numSlotsMask())
			? GIV(oldSpaceStart) + BaseHeaderSize
			: GIV(oldSpaceStart));
		while (oopisLessThan(obj, GIV(freeOldSpaceStart))) {
			classIndex1 = (longAt(obj)) & (classIndexMask());
			if (classIndex1 >= (isForwardedObjectClassIndexPun())) {
				/* begin swizzleFieldsOfObject: */
				fieldAddr = obj + (lastPointerOfWhileSwizzling(obj));
				while (oopisGreaterThanOrEqualTo(fieldAddr, obj + BaseHeaderSize)) {
					fieldOop = longAt(fieldAddr);
					if ((fieldOop & (tagMask())) == 0) {
						longAtput(fieldAddr, swizzleObj(fieldOop));
					}
					fieldAddr -= BytesPerOop;
				}
			}
			else {
				if (classIndex1 == (isFreeObjectClassIndexPun())) {
					/* begin swizzleFieldsOfFreeChunk: */
					fieldIndex3 = 0 /* freeChunkNextIndex */;
					field = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord())))));
					if (field != 0) {
						/* begin storePointerNoAssert:ofFreeChunk:withValue: */
						fieldIndex4 = 0 /* freeChunkNextIndex */;
						valuePointer = swizzleObj(field);
						longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex4) << (shiftForWord())))), valuePointer);
					}
					chunkBytes = bytesInObject(obj);
					if (chunkBytes >= (64 /* numFreeLists */ * 8 /* allocationUnit */)) {
						for (index = 2 /* freeChunkParentIndex */, indexLimiT = 4 /* freeChunkLargerIndex */; index <= indexLimiT; index += 1) {
							/* begin fetchPointer:ofFreeChunk: */
							field = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
							if (field != 0) {
								/* begin storePointerNoAssert:ofFreeChunk:withValue: */
								valuePointer2 = swizzleObj(field);
								longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))), valuePointer2);
							}
						}
					}
				}
			}
			/* begin objectAfter:limit: */
			followingWordAddress = addressAfter(obj);
			if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
				obj = GIV(endOfMemory);
				goto l14;
			}
			flag("endianness");
			followingWord = longAt(followingWordAddress);
			obj = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress + BaseHeaderSize
				: followingWordAddress);
	l14:	/* end objectAfter:limit: */;
		}
	}

	/* heavily used special objects */
	GIV(specialObjectsOop) = swizzleObj(GIV(specialObjectsOop));
	/* begin fetchPointer:ofObject: */
	GIV(nilObj) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(NilObject) << (shiftForWord())))));
	/* begin fetchPointer:ofObject: */
	GIV(falseObj) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(FalseObject) << (shiftForWord())))));
	/* begin fetchPointer:ofObject: */
	GIV(trueObj) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TrueObject) << (shiftForWord())))));
	assert(GIV(nilObj) == GIV(oldSpaceStart));
	assert(GIV(falseObj) == (oldSpaceObjectAfter(GIV(nilObj))));
	assert(GIV(trueObj) == (oldSpaceObjectAfter(GIV(falseObj))));
	freeListObj = oldSpaceObjectAfter(GIV(trueObj));
	/* begin setHiddenRootsObj: */
	anOop = oldSpaceObjectAfter(freeListObj);
	GIV(hiddenRootsObj) = anOop;
	assert(validClassTableRootPages());
	/* begin fetchPointer:ofObject: */
	GIV(classTableFirstPage) = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (0U << (shiftForWord())));
	assert(((numSlotsOf(GIV(classTableFirstPage))) - 1) == (classTableMinorIndexMask()));
	flag("remove at some stage");
	if (((longAt(GIV(classTableFirstPage))) & (classIndexMask())) != (arrayClassIndexPun())) {
		/* begin setClassIndexOf:to: */
		classIndex = arrayClassIndexPun();
		assert(((classIndex >= 0) && (classIndex <= (classIndexMask()))));
		longAtput(GIV(classTableFirstPage), ((longAt(GIV(classTableFirstPage))) & (~(usqIntptr_t)(classIndexMask()))) + classIndex);
	}
	/* begin classTableRootSlots */
	GIV(numClassTablePages) = 1U << (22 /* classIndexFieldWidth */ - (classTableMajorIndexShift()));
	for (i = 2; i < GIV(numClassTablePages); i += 1) {
		if ((longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))))) == GIV(nilObj)) {
			GIV(numClassTablePages) = i;
			GIV(classTableIndex) = ((sqInt)((usqInt)(((((GIV(numClassTablePages) - 1) < 1) ? 1 : (GIV(numClassTablePages) - 1)))) << (classTableMajorIndexShift())));
			goto l6;
		}
	}
	GIV(classTableIndex) = 1U << (classTableMajorIndexShift());
	l6:	/* end setHiddenRootsObj: */;
	GIV(markStack) = swizzleObjStackAt(MarkStackRootIndex);
	GIV(weaklingStack) = swizzleObjStackAt(WeaklingStackRootIndex);
	GIV(mournQueue) = swizzleObjStackAt(MournQueueRootIndex);
	assert(validObjStacks());
	assert(isEmptyObjStack(GIV(markStack)));
	assert(isEmptyObjStack(GIV(weaklingStack)));
	/* begin initializeFreeSpacePostLoad: */
	assert((numSlotsOf(freeListObj)) == (numFreeLists()));
	assert((formatOf(freeListObj)) == (wordIndexableFormat()));
	GIV(freeLists) = firstIndexableField(freeListObj);
	GIV(freeListsMask) = 0;
	for (i1 = 0, iLimiT = (64 /* numFreeLists */ - 1); i1 <= iLimiT; i1 += 1) {
		if ((GIV(freeLists)[i1]) != 0) {
			GIV(freeListsMask) = GIV(freeListsMask) | (1ULL << i1);
			GIV(freeLists)[i1] = (swizzleObj(GIV(freeLists)[i1]));
		}
	}
	collapseSegmentsPostSwizzle();
	/* begin updateFreeLists */
	min = 3;
	for (i2 = min, iLimiT1 = (64 /* numFreeLists */ - 1); i2 <= iLimiT1; i2 += 1) {
		updateListStartingAt(GIV(freeLists)[i2]);
	}
	/* begin freeTreeNodesDo: */
	treeNode = GIV(freeLists)[0];
	if (treeNode == 0) {
		goto l9;
	}
	cameFrom = -1;
	do {
		assert((bytesInObject(treeNode)) >= ((numFreeLists()) * (allocationUnit())));
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex1 = 3 /* freeChunkSmallerIndex */;
		smallChild = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex2 = 4 /* freeChunkLargerIndex */;
		largeChild = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))));
		assert((smallChild == 0)
		 || (treeNode == (fetchPointerofFreeChunk(freeChunkParentIndex(), smallChild))));
		assert((largeChild == 0)
		 || (treeNode == (fetchPointerofFreeChunk(freeChunkParentIndex(), largeChild))));
		if (((smallChild == 0)
		 && (largeChild == 0))
		 || ((largeChild == 0
			? cameFrom == smallChild
			: cameFrom == largeChild))) {

			/* and since we've applied we must move on up */
			updateListStartingAt(treeNode);
			treeNode = treeNode;
			cameFrom = treeNode;
			/* begin fetchPointer:ofFreeChunk: */
			fieldIndex = 2 /* freeChunkParentIndex */;
			treeNode = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
		}
		else {
			if ((smallChild != 0)
			 && (cameFrom != smallChild)) {
				treeNode = smallChild;
			}
			else {
				assert(largeChild != 0);
				treeNode = largeChild;
			}
			cameFrom = -1;
		}
	} while(treeNode != 0);
	l9:	/* end freeTreeNodesDo: */;
	/* begin computeFreeSpacePostSwizzle */
	GIV(totalFreeOldSpace) = totalFreeListBytes();
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	/* begin initializeOldSpaceFirstFree: */
	limit = GIV(endOfMemory) - (2 * BaseHeaderSize);
	if (limit > GIV(freeOldSpaceStart)) {
		GIV(totalFreeOldSpace) += limit - GIV(freeOldSpaceStart);
		freeOldStart = GIV(freeOldSpaceStart);
		while ((limit - freeOldStart) >= (1ULL << 32)) {
			freeChunk = freeChunkWithBytesat(1ULL << 32, freeOldStart);
			freeOldStart += 1ULL << 32;
			assert(freeOldStart == (addressAfter(freeChunk)));
		}
		if (freeOldStart < limit) {
			freeChunk = freeChunkWithBytesat(limit - freeOldStart, freeOldStart);
			assert((addressAfter(freeChunk)) == limit);
		}
	}
	GIV(endOfMemory) -= 2 * BaseHeaderSize;
	GIV(freeOldSpaceStart) = GIV(endOfMemory);
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeFreeSpace)) == (GCModeFreeSpace | GCModeFreeSpace))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	initializeNewSpaceVariables();
	/* begin initializeRememberedSet */
	obj2 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord())))));
	if (obj2 == GIV(nilObj)) {
		/* begin allocatePinnedSlots: */
		obj1 = allocateSlotsForPinningInOldSpacebytesformatclassIndex(1024, (1024U << (shiftForWord())) + (BaseHeaderSize + BaseHeaderSize), sixtyFourBitIndexableFormat(), sixtyFourBitLongsClassIndexPun());
		if (!(obj1 == null)) {
			/* begin fillObj:numSlots:with: */
			assert(oopisLessThan(((obj1 + BaseHeaderSize) + (1024 * BytesPerOop)) - 1, addressAfter(obj1)));
			for (p = (((usqInt)(obj1 + BaseHeaderSize))); p <= (((usqInt)(((obj1 + BaseHeaderSize) + (1024 * BytesPerOop)) - 1))); p += 8 /* allocationUnit */) {
				longAtput(p, 0);
			}
		}
		obj2 = obj1;
		/* begin rememberedSetObj: */
		assert(isOldObject(obj2));
		assert(!(isOopForwarded(GIV(hiddenRootsObj))));
		longAtput((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord())))), obj2);
	}
	else {

		/* The Spur32to64BitBootstrap failed to set the type of rememberedSetObj to 64-bit indexability.
		   This is unimportant except for simulation; rememberedSet is declared as sqInt *, but in to have
		   firstIndexableField: below answer a suitable type the format must be wordIndexableFormat. */
		/* begin setFormatOf:to: */
		format = sixtyFourBitIndexableFormat();
		assert(((format >= 0) && (format <= (formatMask()))));
		longAtput(obj2, ((longAt(obj2)) & (~(usqIntptr_t)(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (((sqInt)((usqInt)(format) << (formatShift())))));
	}
	assert((formatOf(obj2)) == (wordIndexableFormat()));
	assert(isPinned(obj2));
	GIV(rememberedSet) = firstIndexableField(obj2);
	GIV(rememberedSetSize) = 0;
	/* begin numSlotsOf: */
	assert((classIndexOf(obj2)) > (isForwardedObjectClassIndexPun()));
	numSlots3 = byteAt(obj2 + 7);
	GIV(rememberedSetLimit) = (numSlots3 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(obj2 - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots3);
	/* begin setRememberedSetRedZone */
	fudge = ((((GIV(eden).limit)) - ((GIV(eden).start))) / BytesPerWord) / 1024;
	GIV(rememberedSetRedZone) = ((((GIV(rememberedSetLimit) * 3) / 4) < fudge) ? fudge : ((GIV(rememberedSetLimit) * 3) / 4));
	checkSegments();
	/* begin biasForGC */
	GIV(biasForGC) = 1;

	/* headroom when growing */
	GIV(growHeadroom) = (16 * 1024) * 1024;

	/* free space before shrinking */
	GIV(shrinkThreshold) = (32 * 1024) * 1024;
	/* begin setHeapSizeAtPreviousGC */
	GIV(heapSizeAtPreviousGC) = (GIV(totalHeapSizeIncludingBridges) - (GIV(numSegments) * (2 * BaseHeaderSize))) - GIV(totalFreeOldSpace);
	/* begin resetAllocationAccountingAfterGC */
	GIV(oldSpaceUsePriorToScavenge) = (GIV(totalHeapSizeIncludingBridges) - (GIV(numSegments) * (2 * BaseHeaderSize))) - GIV(totalFreeOldSpace);
	GIV(heapGrowthToSizeGCRatio) = 0.333333;
}


/*	print free chunks in freeTree in order. */

	/* SpurMemoryManager>>#inOrderPrintFreeTree:printList: */
void
inOrderPrintFreeTreeprintList(sqInt freeChunk, sqInt printNextList)
{
    sqInt next;

	if (((next = longAt((freeChunk + BaseHeaderSize) + (3U << (shiftForWord()))))) != 0) {
		inOrderPrintFreeTreeprintList(next, printNextList);
	}
	printFreeChunkprintAsTreeNode(freeChunk, 1);
	if (printNextList) {
		next = freeChunk;
		while (((next = longAt((next + BaseHeaderSize) + (0U << (shiftForWord()))))) != 0) {
			/* begin tab */
			putchar('	');
			printFreeChunkprintAsTreeNode(next, 0);
		}
	}
	if (((next = longAt((freeChunk + BaseHeaderSize) + (4U << (shiftForWord()))))) != 0) {
		inOrderPrintFreeTreeprintList(next, printNextList);
	}
}


/*	in an effort to fix a compiler bug with two-way become post r3427 */
/*	Do become in place by swapping object contents. */

	/* SpurMemoryManager>>#inPlaceBecome:and:copyHashFlag: */
static void NoDbgRegParms NeverInline
inPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fmt;
    sqLong hashBits;
    sqLong header1;
    sqLong header2;
    sqInt i;
    sqInt iLimiT;
    sqInt o1HasYoung;
    sqInt o2HasYoung;
    sqLong remembered;
    sqInt temp1;
    sqInt temp2;

	assert((numSlotsOf(obj1)) == (numSlotsOf(obj2)));
	assert(((rawHashBitsOf(obj1)) == 0)
	 || ((classOrNilAtIndex(rawHashBitsOf(obj1))) != obj1));
	assert(((rawHashBitsOf(obj2)) == 0)
	 || ((classOrNilAtIndex(rawHashBitsOf(obj2))) != obj2));
	/* begin cleverSwapHeaders:and:copyHashFlag: */
	header1 = long64At(obj1);
	header2 = long64At(obj2);
	remembered = (header1 ^ header2) & (1U << (rememberedBitShift()));
	if (remembered != 0) {
		header1 = header1 ^ remembered;
		header2 = header2 ^ remembered;
	}
	if (!copyHashFlag) {
		hashBits = (header1 ^ header2) & 0x3FFFFF00000000LL /* identityHashFullWordMask */;
		if (hashBits != 0) {
			header1 = header1 ^ hashBits;
			header2 = header2 ^ hashBits;
		}
	}
	long64Atput(obj1, header2);
	long64Atput(obj2, header1);
	o1HasYoung = (o2HasYoung = 0);
	for (i = 0, iLimiT = ((numSlotsOf(obj1)) - 1); i <= iLimiT; i += 1) {
		/* begin fetchPointer:ofObject: */
		temp1 = longAt((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		/* begin fetchPointer:ofObject: */
		temp2 = longAt((obj2 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		assert(!(isOopForwarded(obj1)));
		longAtput((obj1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), temp2);
		assert(!(isOopForwarded(obj2)));
		longAtput((obj2 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), temp1);
		if (((temp2 & (tagMask())) == 0)
		 && (oopisLessThan(temp2, GIV(newSpaceLimit)))) {
			o1HasYoung = 1;
		}
		if (((temp1 & (tagMask())) == 0)
		 && (oopisLessThan(temp1, GIV(newSpaceLimit)))) {
			o2HasYoung = 1;
		}
	}
	if (o1HasYoung
	 && ((assert(isNonImmediate(obj1)),
	oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart))))) {
		fmt = (((usqInt) (longAt(obj1))) >> (formatShift())) & (formatMask());
		if (!((fmt >= (sixtyFourBitIndexableFormat()))
			 && (fmt < (firstCompiledMethodFormat())))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(obj1))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(obj1);
			}
		}
	}
	if (o2HasYoung
	 && ((assert(isNonImmediate(obj2)),
	oopisGreaterThanOrEqualTo(obj2, GIV(oldSpaceStart))))) {
		fmt = (((usqInt) (longAt(obj2))) >> (formatShift())) & (formatMask());
		if (!((fmt >= (sixtyFourBitIndexableFormat()))
			 && (fmt < (firstCompiledMethodFormat())))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(obj2))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(obj2);
			}
		}
	}
}


/*	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. */

	/* SpurMemoryManager>>#instanceSizeOf: */
sqInt
instanceSizeOf(sqInt classObj)
{
	assert(addressCouldBeClassObj(classObj));
	return (((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)) & ((1U << (fixedFieldsFieldWidth())) - 1);
}

	/* SpurMemoryManager>>#instantiateClass: */
static sqInt NoDbgRegParms
instantiateClass(sqInt classObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classFormat;
    sqInt classIndex;
    sqInt err;
    sqInt hash;
    sqInt instSpec;
    sqInt newObj;
    usqInt newObj1;
    usqInt numBytes;
    sqInt numSlots;
    usqInt p;

	classFormat = ((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	instSpec = (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask());
	if (!((instSpec <= 1 /* nonIndexablePointerFormat */)
		 || (instSpec == 5 /* ephemeronFormat */))) {
		return null;
	}
	assert(addressCouldBeClassObj(classObj));
	classIndex = (((hash = (long32At(classObj + 4)) & (identityHashHalfWordMask()))) != 0
		? hash
		: (objCouldBeClassObj(classObj)
				? (((err = enterIntoClassTable(classObj))) != 0
						? -err
						: (long32At(classObj + 4)) & (identityHashHalfWordMask()))
				: -PrimErrBadReceiver));
	if (classIndex < 0) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = -classIndex;
		return null;
	}
	/* begin fixedFieldsOfClassFormat: */
	numSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	/* begin allocateSlots:format:classIndex: */
	if (numSlots >= (numSlotsMask())) {
		if ((((usqInt) numSlots) >> 56) > 0) {
			newObj = null;
			goto l4;
		}
		newObj1 = GIV(freeStart) + BaseHeaderSize;
		numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop);
	}
	else {
		newObj1 = GIV(freeStart);
		numBytes = BaseHeaderSize + ((numSlots < 1
	? /* begin allocationUnit */ 8
	: numSlots * BytesPerOop));
	}
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		newObj = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, instSpec, classIndex);
		goto l4;
	}
	if (numSlots >= (numSlotsMask())) {

		/* for header parsing we put a saturated slot count in the prepended overflow size word */
		flag("endianness");
		longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots);
		longAtput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), instSpec, classIndex));
	}
	else {
		longAtput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(instSpec) << (formatShift()))))) + classIndex);
	}
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj1 % (allocationUnit())) == 0);
	GIV(freeStart) += numBytes;
	newObj = newObj1;
	l4:	/* end allocateSlots:format:classIndex: */;
	if (!(newObj == null)) {
		/* begin fillObj:numSlots:with: */
		assert(oopisLessThan(((newObj + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(newObj)));
		for (p = (((usqInt)(newObj + BaseHeaderSize))); p <= (((usqInt)(((newObj + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8 /* allocationUnit */) {
			longAtput(p, GIV(nilObj));
		}
	}
	return newObj;
}

	/* SpurMemoryManager>>#instSpecOfClassFormat: */
sqInt
instSpecOfClassFormat(sqInt classFormat)
{
	return (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask());
}


/*	This field in a class's format inst var corresponds to the 5-bit format
	field stored in every object header
 */

	/* SpurMemoryManager>>#instSpecOfClass: */
static sqInt NoDbgRegParms
instSpecOfClass(sqInt classPointer)
{
    sqInt classFormat;

	/* begin instSpecOfClassFormat: */
	classFormat = ((longAt((classPointer + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	return (((usqInt) classFormat) >> (fixedFieldsFieldWidth())) & (formatMask());
}


/*	the inverse of isPureBitsFormat: */

	/* SpurMemoryManager>>#isAnyPointerFormat: */
static sqInt NoDbgRegParms
isAnyPointerFormat(sqInt format)
{
	return (format <= 5 /* lastPointerFormat */)
	 || (format >= (firstCompiledMethodFormat()));
}


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

	/* SpurMemoryManager>>#isArrayNonImm: */
sqInt
isArrayNonImm(sqInt oop)
{
	return ((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */;
}


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

	/* SpurMemoryManager>>#isArray: */
sqInt
isArray(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */);
}


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

	/* SpurMemoryManager>>#isBytes: */
sqInt
isBytes(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()));
}

	/* SpurMemoryManager>>#isCharacterObject: */
sqInt
isCharacterObject(sqInt oop)
{
	return oop & (characterTag());
}

	/* SpurMemoryManager>>#isCharacterValue: */
sqInt
isCharacterValue(sqInt anInteger)
{
	return ((anInteger >= 0) && (anInteger <= ((1U << 30) - 1)));
}


/*	Answer if aClass exists at only one index in the class table. Be careful
	not to
	be misled by classes that have puns, such as Array. */

	/* SpurMemoryManager>>#isClassAtUniqueIndex: */
static sqInt NoDbgRegParms
isClassAtUniqueIndex(sqInt aClass)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classOrNil;
    sqInt expectedIndex;
    sqInt i;
    sqInt index;
    sqInt j;
    sqInt jLimiT;
    sqInt page;

	expectedIndex = (long32At(aClass + 4)) & (identityHashHalfWordMask());
	/* begin classTableEntriesDo: */
	for (i = 0; i < GIV(numClassTablePages); i += 1) {
		page = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		for (j = 0, jLimiT = ((1U << (classTableMajorIndexShift())) - 1); j <= jLimiT; j += 1) {
			classOrNil = longAt((page + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))));
			if (classOrNil != GIV(nilObj)) {
				index = (((sqInt)((usqInt)(i) << (classTableMajorIndexShift())))) + j;
				if ((classOrNil == aClass)
				 && ((index != expectedIndex)
				 && (index > (lastClassIndexPun())))) {
					return 0;
				}
			}
		}
	}
	return 1;
}

	/* SpurMemoryManager>>#isCompiledMethodFormat: */
static sqInt NoDbgRegParms
isCompiledMethodFormat(sqInt format)
{
	return format >= (firstCompiledMethodFormat());
}


/*	Answer whether the argument header has compiled method format */

	/* SpurMemoryManager>>#isCompiledMethodHeader: */
static sqInt NoDbgRegParms
isCompiledMethodHeader(sqInt objHeader)
{
	return ((((usqInt) objHeader) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat());
}


/*	Answer whether the argument object is of compiled method format */

	/* SpurMemoryManager>>#isCompiledMethod: */
sqInt
isCompiledMethod(sqInt objOop)
{
	return ((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat());
}

	/* SpurMemoryManager>>#isContextHeader: */
static sqInt NoDbgRegParms
isContextHeader(sqInt aHeader)
{
	return (aHeader & (classIndexMask())) == ClassMethodContextCompactIndex;
}

	/* SpurMemoryManager>>#isContext: */
static sqInt NoDbgRegParms
isContext(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex);
}


/*	This is part of storeImageSegmentInto:outPointers:roots:. */

	/* SpurMemoryManager>>#isCopiedIntoSegment: */
static sqInt NoDbgRegParms
isCopiedIntoSegment(sqInt anObjectInTheHeap)
{
	return ((((usqInt) (longAt(anObjectInTheHeap))) >> (markedBitFullShift())) & 1) != 0;
}

	/* SpurMemoryManager>>#isEmptyObjStack: */
static sqInt NoDbgRegParms
isEmptyObjStack(sqInt objStack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (objStack == GIV(nilObj)) {
		return 1;
	}
	eassert(isValidObjStack(objStack));
	return (0 == (longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))))))
	 && (0 == (longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))))));
}


/*	Answer if objOop should be included in an allObjects...Do: enumeration.
	This is for assert-checking only. */

	/* SpurMemoryManager>>#isEnumerableObjectNoAssert: */
static sqInt NoDbgRegParms
isEnumerableObjectNoAssert(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;

	/* begin classIndexOf: */
	classIndex = (longAt(objOop)) & (classIndexMask());
	return (classIndex >= (isForwardedObjectClassIndexPun()))
	 && (classIndex < (GIV(numClassTablePages) * (1U << (classTableMajorIndexShift()))));
}


/*	Answer if objOop should be included in an allObjects...Do: enumeration.
	Non-objects should be excluded; these are bridges and free chunks. */

	/* SpurMemoryManager>>#isEnumerableObject: */
static sqInt NoDbgRegParms
isEnumerableObject(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;

	/* begin classIndexOf: */
	classIndex = (longAt(objOop)) & (classIndexMask());
	assert(((long64At(objOop)) != 0)
	 && (classIndex < (GIV(numClassTablePages) * (classTablePageSize()))));
	return classIndex >= (isForwardedObjectClassIndexPun());
}

	/* SpurMemoryManager>>#isEphemeronFormat: */
static sqInt NoDbgRegParms
isEphemeronFormat(sqInt format)
{
	return format == 5 /* ephemeronFormat */;
}

	/* SpurMemoryManager>>#isEphemeron: */
static sqInt NoDbgRegParms
isEphemeron(sqInt objOop)
{
    sqInt format;

	assert(isNonImmediate(objOop));
	/* begin isEphemeronFormat: */
	format = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	return format == 5 /* ephemeronFormat */;
}

	/* SpurMemoryManager>>#isFixedSizePointerFormat: */
sqInt
isFixedSizePointerFormat(sqInt format)
{
	return (format <= 1 /* nonIndexablePointerFormat */)
	 || (format == 5 /* ephemeronFormat */);
}

	/* SpurMemoryManager>>#isForwardedClassTag: */
static sqInt NoDbgRegParms
isForwardedClassTag(sqInt classIndex)
{
	return classIndex == (isForwardedObjectClassIndexPun());
}


/*	Answer if objOop is that if a forwarder. Take advantage of
	isForwardedObjectClassIndexPun being a power of two to generate a more
	efficient test than the straight-forward
	(self classIndexOf: objOop) = self isForwardedObjectClassIndexPun
	at the cost of this being ambiguous with free chunks. So either never
	apply this to free chunks
	or guard with (self isFreeObject: foo) not. So far the idiom has been to
	guard with isFreeObject: */
/*	self assert: (self isFreeObject: objOop) not. */

	/* SpurMemoryManager>>#isForwarded: */
sqInt
isForwarded(sqInt objOop)
{
	return ((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0;
}

	/* SpurMemoryManager>>#isFreeObject: */
static sqInt NoDbgRegParms
isFreeObject(sqInt objOop)
{
	return ((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun());
}

	/* SpurMemoryManager>>#isFreeOop: */
static sqInt NoDbgRegParms
isFreeOop(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()));
}

	/* SpurMemoryManager>>#isImmediate: */
sqInt
isImmediate(sqInt oop)
{
	return oop & (tagMask());
}

	/* SpurMemoryManager>>#isInClassTable: */
static sqInt NoDbgRegParms
isInClassTable(sqInt objOop)
{
    sqInt hash;

	hash = (long32At(objOop + 4)) & (identityHashHalfWordMask());
	return (hash != 0)
	 && ((classAtIndex(hash)) == objOop);
}

	/* SpurMemoryManager>>#isIndexable: */
sqInt
isIndexable(sqInt objOop)
{
    sqInt fmt;

	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	return (fmt >= 2 /* arrayFormat */)
	 && ((fmt <= (weakArrayFormat()))
	 || (fmt >= (sixtyFourBitIndexableFormat())));
}

	/* SpurMemoryManager>>#isInEden: */
static sqInt NoDbgRegParms
isInEden(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return oopisGreaterThanOrEqualToandLessThan(objOop, ((eden()).start), GIV(freeStart));
}

	/* SpurMemoryManager>>#isInFutureSpace: */
static sqInt NoDbgRegParms
isInFutureSpace(sqInt address)
{
	return oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart());
}


/*	Answer if the given address is in ST object memory. */

	/* SpurMemoryManager>>#isInMemory: */
sqInt
isInMemory(sqInt address)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	if ((oopisLessThan(address, GIV(newSpaceLimit)))
	 && (oopisGreaterThanOrEqualTo(address, GIV(newSpaceStart)))) {
		return (oopisGreaterThanOrEqualToandLessThan(address, ((eden()).start), GIV(freeStart)))
		 || ((oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart)))
		 || ((GIV(gcPhaseInProgress) == ScavengeInProgress)
		 && (oopisGreaterThanOrEqualToandLessThan(address, ((futureSpace()).start), futureSurvivorStart()))));
	}
	/* begin isInSegments: */
	for (i = 0; i < GIV(numSegments); i += 1) {
		if (address < (((GIV(segments)[i]).segStart))) {
			return 0;
		}
		if (address < ((((GIV(segments)[i]).segSize)) + (((GIV(segments)[i]).segStart)))) {
			return 1;
		}
	}
	return 0;
}

	/* SpurMemoryManager>>#isInNewSpace: */
static sqInt NoDbgRegParms
isInNewSpace(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (oopisLessThan(objOop, GIV(newSpaceLimit)))
	 && (oopisGreaterThanOrEqualTo(objOop, GIV(newSpaceStart)));
}

	/* SpurMemoryManager>>#isInOldSpace: */
sqInt
isInOldSpace(sqInt address)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return oopisGreaterThanOrEqualToandLessThan(address, GIV(oldSpaceStart), GIV(endOfMemory));
}

	/* SpurMemoryManager>>#isInPastSpace: */
static sqInt NoDbgRegParms
isInPastSpace(sqInt address)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return oopisGreaterThanOrEqualToandLessThan(address, ((pastSpace()).start), GIV(pastSpaceStart));
}

	/* SpurMemoryManager>>#isLargeFreeObject: */
static sqInt NoDbgRegParms
isLargeFreeObject(sqInt objOop)
{
	return (bytesInObject(objOop)) >= (64 /* numFreeLists */ * 8 /* allocationUnit */);
}

	/* SpurMemoryManager>>#isMaybeFiredEphemeron: */
static sqInt NoDbgRegParms
isMaybeFiredEphemeron(sqInt objOop)
{
    sqInt format;

	/* begin isMaybeFiredEphemeronFormat: */
	format = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	return (format <= 5 /* lastPointerFormat */)
	 && (odd(format));
}

	/* SpurMemoryManager>>#isNonImmediate: */
sqInt
isNonImmediate(sqInt oop)
{
	return (oop & (tagMask())) == 0;
}

	/* SpurMemoryManager>>#isObjEphemeron: */
static sqInt NoDbgRegParms
isObjEphemeron(sqInt objOop)
{
    sqInt format;

	/* begin isEphemeronFormat: */
	format = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	return format == 5 /* ephemeronFormat */;
}

	/* SpurMemoryManager>>#isObjImmutable: */
static sqInt NoDbgRegParms
isObjImmutable(sqInt anOop)
{
	return 
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(anOop))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		;
}


/*	Answer if obj is old. Require that obj is non-immediate. */

	/* SpurMemoryManager>>#isOldObject: */
sqInt
isOldObject(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(isNonImmediate(objOop));
	return oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart));
}


/*	Answer whether the oop is an object of compiled method format */

	/* SpurMemoryManager>>#isOopCompiledMethod: */
sqInt
isOopCompiledMethod(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()));
}

	/* SpurMemoryManager>>#isOopForwarded: */
sqInt
isOopForwarded(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0);
}

	/* SpurMemoryManager>>#isOopImmutable: */
sqInt
isOopImmutable(sqInt oop)
{
	return (oop & (tagMask()))
	 || (((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0);
}

	/* SpurMemoryManager>>#isOopMutable: */
sqInt
isOopMutable(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (!(((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0));
}

	/* SpurMemoryManager>>#isPinned: */
sqInt
isPinned(sqInt objOop)
{
	return ((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0;
}


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

	/* SpurMemoryManager>>#isPointers: */
sqInt
isPointers(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */);
}


/*	the inverse of isAnyPointerFormat: */

	/* SpurMemoryManager>>#isPureBitsFormat: */
static sqInt NoDbgRegParms
isPureBitsFormat(sqInt format)
{
	return (format >= (sixtyFourBitIndexableFormat()))
	 && (format < (firstCompiledMethodFormat()));
}


/*	Answer if oop is young. */

	/* SpurMemoryManager>>#isReallyYoung: */
sqInt
isReallyYoung(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((oop & (tagMask())) == 0)
	 && ((assert(isNonImmediate(oop)),
	(oopisLessThan(oop, GIV(newSpaceLimit)))
		 && (oopisGreaterThanOrEqualTo(oop, GIV(newSpaceStart)))));
}

	/* SpurMemoryManager>>#isRemembered: */
static sqInt NoDbgRegParms
isRemembered(sqInt objOop)
{
	return ((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0;
}


/*	Maybe this should be in SpurSegmentManager only */

	/* SpurMemoryManager>>#isSegmentBridge: */
static sqInt NoDbgRegParms
isSegmentBridge(sqInt objOop)
{
	return ((longAt(objOop)) & (classIndexMask())) == (segmentBridgePun());
}

	/* SpurMemoryManager>>#isSemaphoreOop: */
static sqInt NoDbgRegParms
isSemaphoreOop(sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((anOop & (tagMask())) == 0)
	 && (((longAt(anOop)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord()))))))));
}


/*	This version is private to SpurMemoryManager (for asserts, etc). It does
	not take advantage of the power-of0two optimization in isForwarded:. */

	/* SpurMemoryManager>>#isUnambiguouslyForwarder: */
sqInt
isUnambiguouslyForwarder(sqInt objOop)
{
	return ((longAt(objOop)) & (classIndexMask())) == (isForwardedObjectClassIndexPun());
}


/*	For debugging using printOopsSuchThat: */

	/* SpurMemoryManager>>#isUnmarked: */
sqInt
isUnmarked(sqInt objOop)
{
	return !(((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0);
}

	/* SpurMemoryManager>>#isValidClassTag: */
sqInt
isValidClassTag(sqInt classIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classOrNil;
    sqInt classTablePage;
    sqInt fieldIndex;
    sqInt fieldIndex1;

	assert(((classIndex >= 0) && (classIndex <= ((1U << (classIndexFieldWidth())) - 1))));
	/* begin classOrNilAtIndex: */
	assert((classIndex <= (tagMask()))
	 || (classIndex >= (arrayClassIndexPun())));
	/* begin fetchPointer:ofObject: */
	fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift());
	classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (classTablePage == GIV(nilObj)) {
		classOrNil = GIV(nilObj);
		goto l2;
	}
	/* begin fetchPointer:ofObject: */
	fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1);
	classOrNil = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	l2:	/* end classOrNilAtIndex: */;
	return (classOrNil != GIV(nilObj))
	 && (((long32At(classOrNil + 4)) & (identityHashHalfWordMask())) == classIndex);
}


/*	Answer if the obj stack at objStackRootIndex is valid. */

	/* SpurMemoryManager>>#isValidObjStackAt: */
static sqInt NoDbgRegParms
isValidObjStackAt(sqInt objStackRootIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt stackOrNil;

	/* begin fetchPointer:ofObject: */
	stackOrNil = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(objStackRootIndex) << (shiftForWord())))));
	return (stackOrNil == GIV(nilObj))
	 || (isValidObjStackPagemyIndexfirstPage(stackOrNil, objStackRootIndex, 1));
}


/*	Just check the page itself. */

	/* SpurMemoryManager>>#isValidObjStackPage:myIndex: */
static sqInt NoDbgRegParms
isValidObjStackPagemyIndex(sqInt objStackPage, sqInt myx)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!(((longAt(objStackPage)) & (classIndexMask())) == (sixtyFourBitLongsClassIndexPun()))) {
		GIV(objStackInvalidBecause) = "wrong class index";
		GIV(invalidObjStackPage) = objStackPage;
		return 0;
	}
	if (!(((((usqInt) (longAt(objStackPage))) >> (formatShift())) & (formatMask())) == (sixtyFourBitIndexableFormat()))) {
		GIV(objStackInvalidBecause) = "wrong format";
		GIV(invalidObjStackPage) = objStackPage;
		return 0;
	}
	if (!((numSlotsOfAny(objStackPage)) == ObjStackPageSlots)) {
		GIV(objStackInvalidBecause) = "wrong num slots";
		GIV(invalidObjStackPage) = objStackPage;
		return 0;
	}
	if (!(myx == (longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackMyx) << (shiftForWord())))))))) {
		GIV(objStackInvalidBecause) = "wrong myx";
		GIV(invalidObjStackPage) = objStackPage;
		return 0;
	}
	if (GIV(marking)
	 && (!(((((usqInt) (longAt(objStackPage))) >> (markedBitFullShift())) & 1) != 0))) {
		GIV(objStackInvalidBecause) = "marking but page is unmarked";
		GIV(invalidObjStackPage) = objStackPage;
		return 0;
	}
	return 1;
}


/*	Answer if the obj stack at stackRootIndex is valid. */

	/* SpurMemoryManager>>#isValidObjStackPage:myIndex:firstPage: */
static sqInt NoDbgRegParms
isValidObjStackPagemyIndexfirstPage(sqInt objStackPage, sqInt myx, sqInt isFirstPage)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt freeOrNextPage;
    sqInt index;
    char *ns;
    sqInt page;

	if (!(isValidObjStackPagemyIndex(objStackPage, myx))) {
		return 0;
	}
	/* begin fetchPointer:ofObject: */
	freeOrNextPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))));
	while (freeOrNextPage != 0) {
		if (!isFirstPage) {
			GIV(objStackInvalidBecause) = "free page on other than first page";
			GIV(invalidObjStackPage) = objStackPage;
			return 0;
		}
		if (freeOrNextPage == (longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord()))))))) {
			GIV(objStackInvalidBecause) = "free page = next page";
			GIV(invalidObjStackPage) = freeOrNextPage;
			return 0;
		}
		if (!(isValidObjStackPagemyIndex(freeOrNextPage, myx))) {
			ns = malloc(((strlen(GIV(objStackInvalidBecause))) + (strlen(", on next page"))) + 2);
			strcpy(ns, GIV(objStackInvalidBecause));
			GIV(objStackInvalidBecause) = strcat(ns, ", on next page");
			return 0;
		}
		/* begin fetchPointer:ofObject: */
		page = longAt((freeOrNextPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))));
		if ((page == freeOrNextPage)
		 || (page == objStackPage)) {
			GIV(objStackInvalidBecause) = "circularity in free page list";
			GIV(invalidObjStackPage) = page;
			return 0;
		}
		freeOrNextPage = page;
	}
	if (isFirstPage) {
		if (!(((myx >= (1U << (22 /* classIndexFieldWidth */ - (classTableMajorIndexShift())))) && (myx <= (((1U << (22 /* classIndexFieldWidth */ - (classTableMajorIndexShift()))) + 8 /* hiddenRootSlots */) - 1))))) {
			GIV(objStackInvalidBecause) = "myx out of range";
			GIV(invalidObjStackPage) = objStackPage;
			return 0;
		}
		if (!((longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(myx) << (shiftForWord())))))) == objStackPage)) {
			GIV(objStackInvalidBecause) = "firstPage is not root";
			GIV(invalidObjStackPage) = objStackPage;
			return 0;
		}
	}
	/* begin fetchPointer:ofObject: */
	index = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
	if (!(((index >= 0) && (index <= ObjStackLimit)))) {
		GIV(objStackInvalidBecause) = "bad topx";
		GIV(invalidObjStackPage) = objStackPage;
		return 0;
	}
	/* begin fetchPointer:ofObject: */
	freeOrNextPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
	if (freeOrNextPage == 0) {
		return 1;
	}
	if (freeOrNextPage == objStackPage) {
		GIV(objStackInvalidBecause) = "circularity in objStack page list";
		GIV(invalidObjStackPage) = objStackPage;
		return 0;
	}
	return isValidObjStackPagemyIndexfirstPage(freeOrNextPage, myx, 0);
}


/*	Answer if the obj stack at objStackRootIndex is valid. */

	/* SpurMemoryManager>>#isValidObjStack: */
static sqInt NoDbgRegParms
isValidObjStack(sqInt objStack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!((addressCouldBeObj(objStack))
		 && ((numSlotsOfAny(objStack)) == ObjStackPageSlots))) {
		GIV(objStackInvalidBecause) = "first page not obj or wrong size";
		GIV(invalidObjStackPage) = objStack;
		return 0;
	}
	return isValidObjStackPagemyIndexfirstPage(objStack, longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackMyx) << (shiftForWord()))))), 1);
}

	/* SpurMemoryManager>>#isWeakFormat: */
static sqInt NoDbgRegParms
isWeakFormat(sqInt format)
{
	return format == (weakArrayFormat());
}

	/* SpurMemoryManager>>#isWeakNonImm: */
static sqInt NoDbgRegParms
isWeakNonImm(sqInt objOop)
{
    sqInt format;

	/* begin isWeakFormat: */
	format = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	return format == (weakArrayFormat());
}


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

	/* SpurMemoryManager>>#isWeak: */
sqInt
isWeak(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (isWeakFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())));
}


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

	/* SpurMemoryManager>>#isWordsOrBytes: */
sqInt
isWordsOrBytes(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (isPureBitsFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())));
}


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

	/* SpurMemoryManager>>#isWords: */
sqInt
isWords(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstLongFormat())) && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= ((firstShortFormat()) - 1))));
}


/*	Answer if obj is young. Require that obj is non-immediate. */

	/* SpurMemoryManager>>#isYoungObject: */
sqInt
isYoungObject(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(isNonImmediate(objOop));
	return oopisLessThan(objOop, GIV(newSpaceLimit));
}


/*	Answer if oop is young. */

	/* SpurMemoryManager>>#isYoung: */
sqInt
isYoung(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((oop & (tagMask())) == 0)
	 && (oopisLessThan(oop, GIV(newSpaceLimit)));
}


/*	Answer if oop is an instance of the given class. If the class has a
	(non-zero) compactClassIndex use that to speed up the check. N.B. Inlining
	should result in classOop not being accessed if oop's compact class index
	and compactClassIndex are non-zero. */

	/* SpurMemoryManager>>#is:instanceOf:compactClassIndex: */
static sqInt NoDbgRegParms
isinstanceOfcompactClassIndex(sqInt oop, sqInt classOop, sqInt compactClassIndex)
{
    sqInt ccIndex;

	if (oop & (tagMask())) {
		return 0;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(oop)));
	/* begin classIndexOf: */
	ccIndex = (longAt(oop)) & (classIndexMask());
	if (compactClassIndex != 0) {
		return compactClassIndex == ccIndex;
	}
	else {
		return classOop == (classAtIndex(ccIndex));
	}
}

	/* SpurMemoryManager>>#is:onObjStack: */
static sqInt NoDbgRegParms
isonObjStack(sqInt oop, sqInt objStack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt index;
    sqInt nextPage;

	if (objStack == GIV(nilObj)) {
		return 0;
	}
	assert((numSlotsOfAny(objStack)) == ObjStackPageSlots);
	index = (longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))))) + ObjStackNextx;
	while (index >= ObjStackFixedSlots) {
		if (oop == (longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))))) {
			return 1;
		}
		index -= 1;
	}
	/* begin fetchPointer:ofObject: */
	nextPage = longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
	if (nextPage != 0) {
		if (isonObjStack(oop, nextPage)) {
			return 1;
		}
	}
	return 0;
}


/*	Answer the object the ephemeron guards. This is its first element. */

	/* SpurMemoryManager>>#keyOfEphemeron: */
static sqInt NoDbgRegParms
keyOfEphemeron(sqInt objOop)
{
	assert((isNonImmediate(objOop))
	 && (isObjEphemeron(objOop)));
	/* begin fetchPointer:ofObject: */
	return longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
}

	/* SpurMemoryManager>>#knownClassAtIndex: */
static sqInt NoDbgRegParms
knownClassAtIndex(sqInt classIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(((classIndex >= 1) && (classIndex <= (classTablePageSize()))));
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(classIndex) << (shiftForWord())))));
}

	/* SpurMemoryManager>>#lastPointerFormat */
static sqInt
lastPointerFormat(void)
{
	return 5;
}


/*	Answer the byte offset of the last pointer field of the given object.
	Works with CompiledMethods, as well as ordinary objects.
	Does not examine the stack pointer of contexts to be sure to swizzle
	the nils that fill contexts on snapshot.
	It is invariant that on image load no object contains a forwarding
	pointer, and the image contains no forwarders (see class comment). */

	/* SpurMemoryManager>>#lastPointerOfWhileSwizzling: */
sqInt
lastPointerOfWhileSwizzling(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fmt;
    sqInt header;
    sqInt header1;

	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	assert(fmt != (forwardedFormat()));
	if (fmt <= 5 /* lastPointerFormat */) {
		return (((numSlotsOf(objOop)) - 1) * BytesPerOop) + BaseHeaderSize;
	}
	if (fmt < (firstCompiledMethodFormat())) {
		return 0;
	}
	/* begin methodHeaderOf: */
	assert(isCompiledMethod(objOop));
	header1 = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	return (((((assert((((header) & 7) == 1)),
((header >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1) * BytesPerOop) + BaseHeaderSize;
}


/*	Answer the byte offset of the last pointer field of the given object.
	Works with CompiledMethods, as well as ordinary objects. */

	/* SpurMemoryManager>>#lastPointerOf: */
sqInt
lastPointerOf(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt contextSize;
    sqInt fmt;
    sqInt header;
    sqInt header1;
    sqInt sp;

	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	assert(fmt != (forwardedFormat()));
	if (fmt <= 5 /* lastPointerFormat */) {
		if ((fmt == (indexablePointersFormat()))
		 && (((longAt(objOop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

			/* contexts end at the stack pointer */
			/* begin fetchStackPointerOf: */
			sp = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
			if (!((((sp) & 7) == 1))) {
				contextSize = 0;
				goto l2;
			}
			assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop)));
			contextSize = (sp >> 3);
	l2:	/* end fetchStackPointerOf: */;
			return (((CtxtTempFrameStart - 1) + contextSize) * BytesPerOop) + BaseHeaderSize;
		}
		return (((numSlotsOf(objOop)) - 1) * BytesPerOop) + BaseHeaderSize;
	}
	if (fmt < (firstCompiledMethodFormat())) {
		return 0;
	}
	/* begin methodHeaderOf: */
	assert(isCompiledMethod(objOop));
	header1 = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	return (((((assert((((header) & 7) == 1)),
((header >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) - 1) * BytesPerOop) + BaseHeaderSize;
}

	/* SpurMemoryManager>>#leakCheckBecome */
sqInt
leakCheckBecome(void)
{
	return (checkForLeaks & GCModeBecome) != 0;
}

	/* SpurMemoryManager>>#leakCheckFullGC */
sqInt
leakCheckFullGC(void)
{
	return (checkForLeaks & GCModeFull) != 0;
}

	/* SpurMemoryManager>>#leakCheckIncremental */
sqInt
leakCheckIncremental(void)
{
	return (checkForLeaks & GCModeIncremental) != 0;
}

	/* SpurMemoryManager>>#leakCheckNewSpaceGC */
sqInt
leakCheckNewSpaceGC(void)
{
	return (checkForLeaks & GCModeNewSpace) != 0;
}


/*	for the message send breakpoint; selectors can be immediates. */

	/* SpurMemoryManager>>#lengthOfMaybeImmediate: */
static sqInt NoDbgRegParms
lengthOfMaybeImmediate(sqInt oop)
{
    sqInt fmt;
    usqInt numSlots;
    usqInt numSlots1;

	if (oop & (tagMask())) {
		return 0;
	}
	/* begin lengthOf:format: */
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOfAny: */
	numSlots1 = byteAt(oop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		return numSlots;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		return (numSlots << (shiftForWord())) - (fmt & 7);
	}
	if (fmt >= (firstShortFormat())) {
		return (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
	}
	if (fmt >= (firstLongFormat())) {
		return (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		return numSlots;
	}
	return 0;
}


/*	Answer the number of indexable units in the given object.
	For a CompiledMethod, the size of the method header (in bytes) should
	be subtracted from the result. */

	/* SpurMemoryManager>>#lengthOf: */
sqInt
lengthOf(sqInt objOop)
{
    sqInt fmt;
    usqInt numSlots;
    usqInt numSlots1;

	/* begin lengthOf:format: */
	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOfAny: */
	numSlots1 = byteAt(objOop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		return numSlots;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		return (numSlots << (shiftForWord())) - (fmt & 7);
	}
	if (fmt >= (firstShortFormat())) {
		return (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
	}
	if (fmt >= (firstLongFormat())) {
		return (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		return numSlots;
	}
	return 0;
}

	/* SpurMemoryManager>>#literalCountOfMethodHeader: */
sqInt
literalCountOfMethodHeader(sqInt header)
{
	assert((((header) & 7) == 1));
	return ((header >> 3)) & AlternateHeaderNumLiteralsMask;
}

	/* SpurMemoryManager>>#literalCountOf: */
sqInt
literalCountOf(sqInt methodPointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt header;
    sqInt header1;

	/* begin literalCountOfMethodHeader: */
	assert(isCompiledMethod(methodPointer));
	header1 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	assert((((header) & 7) == 1));
	return ((header >> 3)) & AlternateHeaderNumLiteralsMask;
}


/*	This primitive is called from Smalltalk 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
	segmentWordArray will become an
	array of the loaded objects. 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?
	
	The primitive, if it succeeds, also becomes the segmentWordArray into the
	array of loaded objects.
	This allows fixing up of loaded objects directly, without nextObject,
	which Spur doesn't support. */

	/* SpurMemoryManager>>#loadImageSegmentFrom:outPointers: */
static sqInt NoDbgRegParms NeverInline
loadImageSegmentFromoutPointers(sqInt segmentWordArray, sqInt outPointerArray)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt classIndex1;
    sqInt classIndex11;
    sqInt classIndex2;
    sqInt classIndex3;
    sqInt classOop;
    sqInt classRef;
    sqInt clone;
    sqInt errorCode;
    sqInt errorCode1;
    sqInt fillIdx;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    sqInt followingWord3;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt followingWordAddress3;
    sqInt hash;
    sqInt hash1;
    sqInt i;
    sqInt i1;
    sqInt iLimiT;
    sqInt iLimiT1;
    sqInt loadedObjectsArray;
    usqInt mappedOop;
    usqInt newObj;
    usqInt numBytes;
    sqInt numLoadedObjects;
    usqInt numOutPointers;
    sqInt numSegObjs;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    usqInt numSlots3;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop2;
    sqInt oldClone;
    sqInt oop;
    sqInt oop1;
    usqInt oop2;
    sqInt scanClassTable;
    usqInt segmentLimit;
    sqInt segmentStart;
    sqInt segVersion;

	/* begin numSlotsOf: */
	assert((classIndexOf(segmentWordArray)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(segmentWordArray + 7);
	segmentLimit = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(segmentWordArray - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	if (((segmentLimit == 0
		? 8 /* allocationUnit */ + BaseHeaderSize
		: (segmentLimit << (shiftForWord())) + ((segmentLimit >= (numSlotsMask())
	? BaseHeaderSize + BaseHeaderSize
	: BaseHeaderSize)))) < (8 /* allocationUnit */ + BaseHeaderSize)) {

		/* version info */
		/* one object header */
		return PrimErrBadArgument;
	}
	segVersion = longAt(segmentWordArray + BaseHeaderSize);
	if (!(((segVersion & 0xFFFFFF) == 68021 /* imageFormatVersion */)
		 || (0))) {

		/* low 3 bytes */
		reverseBytesIn32BitWordsIn(segmentWordArray);
		segVersion = longAt(segmentWordArray + BaseHeaderSize);
		if (!(((segVersion & 0xFFFFFF) == 68021 /* imageFormatVersion */)
			 || (0))) {

			/* low 3 bytes */
			reverseBytesIn32BitWordsIn(segmentWordArray);
			return PrimErrBadArgument;
		}
	}
	segmentStart = (segmentWordArray + BaseHeaderSize) + 8 /* allocationUnit */;

	/* Notionally reverse the Byte type objects if the data is from opposite endian machine.
	   Test top byte.  $d on the Mac or $s on the PC.  Rest of word is equal.  If Spur is ever
	   ported to big-endian machines then the segment may have to be byte/word swapped,
	   but so far it only runs on little-endian machines, so for now just fail if endianness is wrong. */
	segmentLimit = ((segmentLimit * BytesPerOop) + segmentWordArray) + BaseHeaderSize;
	flag("endianness");
	if (((((usqInt) segVersion) >> 24) & 0xFF) != ((((usqInt) (imageSegmentVersion())) >> 24) & 0xFF)) {

		/* Reverse the byte-type objects once */
		return PrimErrBadArgument;
	}
	if ((assert(isNonImmediate(segmentWordArray)),
	oopisGreaterThanOrEqualTo(segmentWordArray, GIV(oldSpaceStart)))) {
		/* begin ensureNoNewObjectsIn: */
		scanClassTable = 0;
		for (i = 0, iLimiT = ((numSlotsOf(outPointerArray)) - 1); i <= iLimiT; i += 1) {
			oop1 = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
			if (((oop1 & (tagMask())) == 0)
			 && (oopisLessThan(oop1, GIV(newSpaceLimit)))) {
				clone = cloneInOldSpaceforPinning(oop1, 0);
				if (clone == 0) {
					errorCode = PrimErrNoMemory;
					goto l11;
				}
				if ((((hash = (long32At(oop1 + 4)) & (identityHashHalfWordMask()))) != 0)
				 && ((classOrNilAtIndex(hash)) == oop1)) {
					scanClassTable = 1;
				}
				/* begin forward:to: */
				classIndex1 = isForwardedObjectClassIndexPun();
				assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask()))));
				assert(((7 /* forwardedFormat */ >= 0) && (7 /* forwardedFormat */ <= (formatMask()))));
				longAtput(oop1, ((longAt(oop1)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift()))));
				
#        if IMMUTABILITY
				/* begin setIsImmutableOf:to: */
				longAtput(oop1, (longAt(oop1)) & (~(usqIntptr_t)(1U << (immutableBitShift()))));
#        endif /* IMMUTABILITY */
				/* begin storePointer:ofForwarder:withValue: */
				assert(isForwarded(oop1));
				assert(!(isOopForwarded(clone)));
				if ((assert(isNonImmediate(oop1)),
				oopisGreaterThanOrEqualTo(oop1, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((clone & (tagMask())) == 0)
					 && (oopisLessThan(clone, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(oop1))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(oop1);
						}
					}
				}
				longAtput((oop1 + BaseHeaderSize) + (0U << (shiftForWord())), clone);
				if ((byteAt(oop1 + 7)) == 0) {
					byteAtput(oop1 + 7, 1);
				}
				assert(!(isOopForwarded(outPointerArray)));
				longAtput((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), clone);
			}
		}
		if (scanClassTable) {
			postBecomeScanClassTable(BecamePointerObjectFlag);
		}
		errorCode = 0;
	l11:	/* end ensureNoNewObjectsIn: */;
		if (errorCode != 0) {
			return errorCode;
		}
	}
	/* begin mapOopsAndValidateClassRefsFrom:to:outPointers: */
	assert((classIndexOf(outPointerArray)) > (isForwardedObjectClassIndexPun()));
	numSlots3 = byteAt(outPointerArray + 7);
	numOutPointers = (numSlots3 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(outPointerArray - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots3);
	numSegObjs = 0;
	/* begin objectStartingAt: */
	numSlots11 = byteAt(segmentStart + 7);
	objOop2 = (numSlots11 == (numSlotsMask())
		? segmentStart + BaseHeaderSize
		: segmentStart);
	while (oopisLessThan(objOop2, segmentLimit)) {

		/* No object in the segment should be marked.  If is is something is wrong. */
		numSegObjs += 1;
		if (((((usqInt) (longAt(objOop2))) >> (markedBitFullShift())) & 1) != 0) {
			errorCode = PrimErrInappropriate;
			goto l22;
		}
		/* begin classIndexOf: */
		classIndex3 = (longAt(objOop2)) & (classIndexMask());
		if (classIndex3 & TopHashBit) {
			classIndex3 -= TopHashBit;
			if (classIndex3 >= numOutPointers) {
				errorCode = PrimErrBadIndex;
				goto l22;
			}
			/* begin fetchPointer:ofObject: */
			mappedOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)(classIndex3) << (shiftForWord())))));
			hash1 = (long32At(mappedOop + 4)) & (identityHashHalfWordMask());
			if (!((hash1 > (lastClassIndexPun()))
				 && ((classOrNilAtIndex(hash1)) == mappedOop))) {
				errorCode = PrimErrInappropriate;
				goto l22;
			}
		}
		else {

			/* The class is contained within the segment. */
			if (((oop2 = ((classIndex3 - (firstClassIndexPun())) * 8 /* allocationUnit */) + segmentStart)) >= segmentLimit) {
				errorCode = PrimErrBadIndex;
				goto l22;
			}
			if (((long32At(oop2 + 4)) & (identityHashHalfWordMask())) != 0) {
				errorCode = PrimErrInappropriate;
				goto l22;
			}
		}
		for (i1 = 0, iLimiT1 = ((numPointerSlotsOf(objOop2)) - 1); i1 <= iLimiT1; i1 += 1) {
			/* begin fetchPointer:ofObject: */
			oop2 = longAt((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
			if ((oop2 & (tagMask())) == 0) {
				if (oop2 & TopOopBit) {
					if (((oop2 = (oop2 - TopOopBit) / BytesPerOop)) >= numOutPointers) {
						errorCode = PrimErrBadIndex;
						goto l22;
					}
					/* begin fetchPointer:ofObject: */
					mappedOop = longAt((outPointerArray + BaseHeaderSize) + (oop2 << (shiftForWord())));
				}
				else {
					if ((oop2 & (8 /* allocationUnit */ - 1)) != 0) {
						errorCode = PrimErrInappropriate;
						goto l22;
					}
					if (((mappedOop = oop2 + segmentStart)) >= segmentLimit) {
						errorCode = PrimErrBadIndex;
						goto l22;
					}
				}
				assert(!(isOopForwarded(objOop2)));
				longAtput((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), mappedOop);
			}
		}
		/* begin objectAfter:limit: */
		followingWordAddress3 = addressAfter(objOop2);
		if (oopisGreaterThanOrEqualTo(followingWordAddress3, segmentLimit)) {
			objOop2 = segmentLimit;
			goto l16;
		}
		flag("endianness");
		followingWord3 = longAt(followingWordAddress3);
		objOop2 = ((((usqInt) followingWord3) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress3 + BaseHeaderSize
			: followingWordAddress3);
	l16:	/* end objectAfter:limit: */;
	}
	errorCode = -numSegObjs;
	l22:	/* end mapOopsAndValidateClassRefsFrom:to:outPointers: */;
	if (errorCode > 0) {
		return errorCode;
	}
	numLoadedObjects = -errorCode;
	/* begin allocateSlots:format:classIndex: */
	if (numLoadedObjects >= (numSlotsMask())) {
		if ((((usqInt) numLoadedObjects) >> 56) > 0) {
			loadedObjectsArray = null;
			goto l8;
		}
		newObj = GIV(freeStart) + BaseHeaderSize;
		numBytes = (BaseHeaderSize + BaseHeaderSize) + (numLoadedObjects * BytesPerOop);
	}
	else {
		newObj = GIV(freeStart);
		numBytes = BaseHeaderSize + ((numLoadedObjects < 1
	? /* begin allocationUnit */ 8
	: numLoadedObjects * BytesPerOop));
	}
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		loadedObjectsArray = allocateSlotsInOldSpacebytesformatclassIndex(numLoadedObjects, numBytes, 2 /* arrayFormat */, ClassArrayCompactIndex);
		goto l8;
	}
	if (numLoadedObjects >= (numSlotsMask())) {

		/* for header parsing we put a saturated slot count in the prepended overflow size word */
		flag("endianness");
		longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numLoadedObjects);
		longAtput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), 2 /* arrayFormat */, ClassArrayCompactIndex));
	}
	else {
		longAtput(newObj, (((((usqLong) numLoadedObjects)) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex);
	}
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	GIV(freeStart) += numBytes;
	loadedObjectsArray = newObj;
	l8:	/* end allocateSlots:format:classIndex: */;
	if (!(loadedObjectsArray)) {
		return PrimErrNoMemory;
	}
	/* begin enterClassesIntoClassTableFrom:to: */
	objOop = objectAfter(objectStartingAt(segmentStart));
	while ((oopisLessThan(objOop, segmentLimit))
	 && (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) {
		/* begin setIsRememberedOf:to: */
		longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1U << (rememberedBitShift()))));
		if (((errorCode1 = enterIntoClassTable(objOop))) != 0) {
			oop = objOop;
			objOop = objectAfter(objectStartingAt(segmentStart));
			while (oopisLessThan(objOop, oop)) {
				expungeFromClassTable(objOop);
				/* begin objectAfter:limit: */
				followingWordAddress = addressAfter(objOop);
				if (oopisGreaterThanOrEqualTo(followingWordAddress, segmentLimit)) {
					objOop = segmentLimit;
					goto l4;
				}
				flag("endianness");
				followingWord = longAt(followingWordAddress);
				objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
					? followingWordAddress + BaseHeaderSize
					: followingWordAddress);
	l4:	/* end objectAfter:limit: */;
			}
			errorCode = errorCode1;
			goto l6;
		}
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, segmentLimit)) {
			objOop = segmentLimit;
			goto l5;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l5:	/* end objectAfter:limit: */;
	}
	errorCode = 0;
	l6:	/* end enterClassesIntoClassTableFrom:to: */;
	if (errorCode != 0) {
		return errorCode;
	}
	/* begin assignClassIndicesAndPinFrom:to:outPointers:filling: */
	numSlots2 = byteAt(segmentStart + 7);
	objOop1 = (numSlots2 == (numSlotsMask())
		? segmentStart + BaseHeaderSize
		: segmentStart);
	fillIdx = 0;
	while (oopisLessThan(objOop1, segmentLimit)) {
		assert(!(isOopForwarded(loadedObjectsArray)));
		longAtput((loadedObjectsArray + BaseHeaderSize) + (((sqInt)((usqInt)(fillIdx) << (shiftForWord())))), objOop1);

		/* In the segment, class indices are offset indexes into the segment data,
		   or into outPointers.  See mapOopsFrom:to:outPointers:outHashes: and
		   newOutPointer:at:in:hashes:. */
		fillIdx += 1;
		classRef = (longAt(objOop1)) & (classIndexMask());
		if (classRef & TopHashBit) {
			classOop = longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((classRef - TopHashBit)) << (shiftForWord())))));
		}
		else {
			classOop = ((classRef - (firstClassIndexPun())) * 8 /* allocationUnit */) + segmentStart;
		}
		classIndex2 = (long32At(classOop + 4)) & (identityHashHalfWordMask());
		assert((classIndex2 > (lastClassIndexPun()))
		 && ((classOrNilAtIndex(classIndex2)) == classOop));
		/* begin setClassIndexOf:to: */
		assert(((classIndex2 >= 0) && (classIndex2 <= (classIndexMask()))));
		longAtput(objOop1, ((longAt(objOop1)) & (~(usqIntptr_t)(classIndexMask()))) + classIndex2);
		if (((oopisLessThan(objOop1, GIV(newSpaceLimit)))
		 && (oopisGreaterThanOrEqualTo(objOop1, GIV(newSpaceStart))))
		 && (((((usqInt) (longAt(objOop1))) >> (pinnedBitShift())) & 1) != 0)) {
			oldClone = cloneInOldSpaceforPinning(objOop1, 1);
			if (oldClone != 0) {
				/* begin setIsPinnedOf:to: */
				longAtput(oldClone, (longAt(oldClone)) | (1U << (pinnedBitShift())));
				/* begin forward:to: */
				classIndex11 = isForwardedObjectClassIndexPun();
				assert(((classIndex11 >= 0) && (classIndex11 <= (classIndexMask()))));
				assert(((7 /* forwardedFormat */ >= 0) && (7 /* forwardedFormat */ <= (formatMask()))));
				longAtput(objOop1, ((longAt(objOop1)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex11 + (7U << (formatShift()))));
				
#        if IMMUTABILITY
				/* begin setIsImmutableOf:to: */
				longAtput(objOop1, (longAt(objOop1)) & (~(usqIntptr_t)(1U << (immutableBitShift()))));
#        endif /* IMMUTABILITY */
				/* begin storePointer:ofForwarder:withValue: */
				assert(isForwarded(objOop1));
				assert(!(isOopForwarded(oldClone)));
				if ((assert(isNonImmediate(objOop1)),
				oopisGreaterThanOrEqualTo(objOop1, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((oldClone & (tagMask())) == 0)
					 && (oopisLessThan(oldClone, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(objOop1))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(objOop1);
						}
					}
				}
				longAtput((objOop1 + BaseHeaderSize) + (0U << (shiftForWord())), oldClone);
				if ((byteAt(objOop1 + 7)) == 0) {
					byteAtput(objOop1 + 7, 1);
				}
			}
		}
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, segmentLimit)) {
			objOop1 = segmentLimit;
			goto l13;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l13:	/* end objectAfter:limit: */;
	}
	if ((byteAt(segmentWordArray + 7)) == (numSlotsMask())) {
		/* begin rawOverflowSlotsOf:put: */
		longAtput(segmentWordArray - BaseHeaderSize, (((sqInt)((usqInt)((numSlotsMask())) << 56))) + (8 /* allocationUnit */ / BytesPerOop));
		8 /* allocationUnit */ / BytesPerOop;
	}
	else {
		/* begin rawNumSlotsOf:put: */
		byteAtput(segmentWordArray + 7, 8 /* allocationUnit */ / BytesPerOop);
	}
	/* begin forward:to: */
	classIndex = isForwardedObjectClassIndexPun();
	assert(((classIndex >= 0) && (classIndex <= (classIndexMask()))));
	assert(((7 /* forwardedFormat */ >= 0) && (7 /* forwardedFormat */ <= (formatMask()))));
	longAtput(segmentWordArray, ((longAt(segmentWordArray)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift()))));
	
#  if IMMUTABILITY
	/* begin setIsImmutableOf:to: */
	longAtput(segmentWordArray, (longAt(segmentWordArray)) & (~(usqIntptr_t)(1U << (immutableBitShift()))));
#  endif /* IMMUTABILITY */
	/* begin storePointer:ofForwarder:withValue: */
	assert(isForwarded(segmentWordArray));
	assert(!(isOopForwarded(loadedObjectsArray)));
	if ((assert(isNonImmediate(segmentWordArray)),
	oopisGreaterThanOrEqualTo(segmentWordArray, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((loadedObjectsArray & (tagMask())) == 0)
		 && (oopisLessThan(loadedObjectsArray, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(segmentWordArray))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(segmentWordArray);
			}
		}
	}
	longAtput((segmentWordArray + BaseHeaderSize) + (0U << (shiftForWord())), loadedObjectsArray);
	if ((byteAt(segmentWordArray + 7)) == 0) {
		byteAtput(segmentWordArray + 7, 1);
	}
	runLeakCheckerFor(GCModeImageSegment);
	/* begin objectStartingAt: */
	numSlots1 = byteAt(segmentStart + 7);
	return (numSlots1 == (numSlotsMask())
		? segmentStart + BaseHeaderSize
		: segmentStart);
}


/*	Scan the heap printing the oops of any and all objects that are instances
	of aClassOop
 */

	/* SpurMemoryManager>>#longPrintInstancesOf: */
void
longPrintInstancesOf(sqInt aClassOop)
{
    sqInt classIndex;

	classIndex = (long32At(aClassOop + 4)) & (identityHashHalfWordMask());
	if (classIndex != (isFreeObjectClassIndexPun())) {
		longPrintInstancesWithClassIndex(classIndex);
	}
}


/*	Scan the heap printing any and all objects whose classIndex equals the
	argument. 
 */

	/* SpurMemoryManager>>#longPrintInstancesWithClassIndex: */
void
longPrintInstancesWithClassIndex(sqInt classIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	/* begin allHeapEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (((longAt(objOop1)) & (classIndexMask())) == classIndex) {
			longPrintOop(objOop1);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop, limit)) {
		if (((longAt(objOop)) & (classIndexMask())) == classIndex) {
			longPrintOop(objOop);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop, GIV(freeStart))) {
		if (((longAt(objOop)) & (classIndexMask())) == classIndex) {
			longPrintOop(objOop);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	}


/*	Scan the heap long printing the oops of any and all objects that refer to
	anOop 
 */

	/* SpurMemoryManager>>#longPrintReferencesTo: */
void
longPrintReferencesTo(sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt i;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots2;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt prntObj;

	prntObj = 0;
	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots2 = byteAt(address + 7);
	objOop1 = (numSlots2 == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
		 || (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) {
			if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
				i = (literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart;
			}
			else {
				if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
					i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1));
				}
				else {
					/* begin numSlotsOf: */
					assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun()));
					numSlots = byteAt(objOop1 + 7);
					i = (numSlots == (numSlotsMask())
						? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop1 - BaseHeaderSize))) << 8)))))) >> 8
						: numSlots);
				}
			}
			while (((i -= 1)) >= 0) {
				if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
					printHex(objOop1);
					print(" @ ");
					printNum(i);
					/* begin cr */
					printf("\n");
					prntObj = 1;
					i = 0;
				}
			}
			if (prntObj) {
				prntObj = 0;
				longPrintOop(objOop1);
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l6;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l6:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
		 || (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) {
			if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
				i = (literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart;
			}
			else {
				if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
					i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1));
				}
				else {
					/* begin numSlotsOf: */
					assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun()));
					numSlots = byteAt(objOop1 + 7);
					i = (numSlots == (numSlotsMask())
						? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop1 - BaseHeaderSize))) << 8)))))) >> 8
						: numSlots);
				}
			}
			while (((i -= 1)) >= 0) {
				if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
					printHex(objOop1);
					print(" @ ");
					printNum(i);
					/* begin cr */
					printf("\n");
					prntObj = 1;
					i = 0;
				}
			}
			if (prntObj) {
				prntObj = 0;
				longPrintOop(objOop1);
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
			 || (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) {
				if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
					i = (literalCountOfMethodHeader(methodHeaderOf(objOop11))) + LiteralStart;
				}
				else {
					if (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
						i = CtxtTempFrameStart + (fetchStackPointerOf(objOop11));
					}
					else {
						/* begin numSlotsOf: */
						assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun()));
						numSlots = byteAt(objOop11 + 7);
						i = (numSlots == (numSlotsMask())
							? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop11 - BaseHeaderSize))) << 8)))))) >> 8
							: numSlots);
					}
				}
				while (((i -= 1)) >= 0) {
					if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
						printHex(objOop11);
						print(" @ ");
						printNum(i);
						/* begin cr */
						printf("\n");
						prntObj = 1;
						i = 0;
					}
				}
				if (prntObj) {
					prntObj = 0;
					longPrintOop(objOop11);
				}
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	}

	/* SpurMemoryManager>>#mapExtraRoots */
static void
mapExtraRoots(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt oop;

	if (shouldRemapObj(GIV(specialObjectsOop))) {
		GIV(specialObjectsOop) = remapObj(GIV(specialObjectsOop));
	}
	assert(GIV(remapBufferCount) == 0);
	for (i = 1; i <= GIV(extraRootCount); i += 1) {
		oop = (GIV(extraRoots)[i])[0];
		if (!((oop & (tagMask()))
			 || (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))) {
			if (shouldRemapObj(oop)) {
				(GIV(extraRoots)[i])[0] = (remapObj(oop));
			}
		}
	}
}

	/* SpurMemoryManager>>#mapMournQueue */
static void NeverInline
mapMournQueue(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i1;
    sqInt mourner;
    sqInt numOnThisPage;
    sqInt objStackPage;
    sqInt referent;

	/* begin objStack:do: */
	if (GIV(mournQueue) == GIV(nilObj)) {
		goto l7;
	}
	eassert(isValidObjStack(GIV(mournQueue)));
	objStackPage = GIV(mournQueue);
	while (objStackPage != 0) {
		/* begin fetchPointer:ofObject: */
		numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
		for (i1 = ((numOnThisPage + ObjStackFixedSlots) - 1); i1 >= ObjStackFixedSlots; i1 += -1) {
			/* begin fetchPointer:ofObject: */
			mourner = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
			if ((mourner & (tagMask())) == 0) {

				/* someone could try and become weaklings into immediates... */
				if (((longAt(mourner)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					/* begin followForwarded: */
					assert(isUnambiguouslyForwarder(mourner));
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((mourner + BaseHeaderSize) + (0U << (shiftForWord())));
					while (((referent & (tagMask())) == 0)
					 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
					}
					mourner = referent;
				}
				if (!(isScavengeSurvivor(mourner))) {
					mourner = copyAndForwardMourner(mourner);
				}
				assert(!(isOopForwarded(objStackPage)));
				longAtput((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), mourner);
			}
		}
		/* begin fetchPointer:ofObject: */
		objStackPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
	}
	l7:	/* end objStack:do: */;
}


/*	This is part of storeImageSegmentInto:outPointers:roots:.
	Now scan, adding out pointers to the outPointersArray; all objects in
	arrayOfObjects have had their first fields set to point to their copies in
	segmentWordArray. Answer
	the outIndex if the scan succeded. Fail if outPointers is too small and
	answer -1.
	
	As established by copyObj:toAddr:startAt:stopAt:savedFirstFields:index:,
	the marked bit is set for all objects in the segment
	the remembered bit is set for all classes in the segment.
	
	Class indices should be set as follows (see
	assignClassIndicesAndPinFrom:to:outPointers:filling:) - class indices for
	classes in the segment */

	/* SpurMemoryManager>>#mapOopsFrom:to:outPointers:outHashes: */
static sqInt NoDbgRegParms
mapOopsFromtooutPointersoutHashes(sqInt segStart, sqInt segAddr, sqInt outPointerArray, sqInt savedOutHashes)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt followingWord;
    usqInt followingWordAddress;
    sqInt hash;
    sqInt hash1;
    sqInt hash2;
    sqInt heapOop;
    sqInt i;
    sqInt iLimiT;
    sqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots2;
    sqInt objIndex;
    sqInt objOop;
    sqInt oop;
    sqInt outIndex;
    usqInt p;
    sqInt segIndex;
    sqInt valueWord;
    sqInt valueWord1;


	/* objIndex is for debugging; it mirrors indices in the sender's arrayOfObjects. */
	outIndex = (objIndex = 0);
	/* begin fillObj:numSlots:with: */
	assert((classIndexOf(outPointerArray)) > (isForwardedObjectClassIndexPun()));
	numSlots2 = byteAt(outPointerArray + 7);
	numSlots = (numSlots2 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(outPointerArray - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots2);
	assert(oopisLessThan(((outPointerArray + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(outPointerArray)));
	for (p = (((usqInt)(outPointerArray + BaseHeaderSize))); p <= (((usqInt)(((outPointerArray + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8 /* allocationUnit */) {
		longAtput(p, GIV(nilObj));
	}
	/* begin objectStartingAt: */
	numSlots1 = byteAt(segStart + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? segStart + BaseHeaderSize
		: segStart);
	while (oopisLessThan(objOop, segAddr)) {

		/* Set the classIndex of the instance.  This is a segment offset (segAddr - segStart / allocationUnit) for instances of
		   classes within the segment, and an outPointer index (index in outPointers + TopHashBit) for classes outside the segment. */
		heapOop = fetchClassOfNonImm(objOop);
		if (((((usqInt) (longAt(heapOop))) >> (markedBitFullShift())) & 1) != 0) {

			/* oop is a class in the segment; storeImageSegmentInto:outPointers:roots: established offset is within range. */
			/* begin fetchPointer:ofObject: */
			oop = longAt((heapOop + BaseHeaderSize) + (0U << (shiftForWord())));
			assert(oopisGreaterThanOrEqualToandLessThan(oop, segStart, segAddr));
			segIndex = ((oop - segStart) / 8 /* allocationUnit */) + (firstClassIndexPun());
			if (segIndex & TopHashBit) {

				/* Too many classes in the segment */
				return -1;
			}
		}
		else {

			/* oop is an outPointer; locate or allocate its oop */
			hash = (long32At(heapOop + 4)) & (identityHashHalfWordMask());
			if ((hash & TopHashBit)
			 && (((hash - TopHashBit) <= outIndex)
			 && (heapOop == (longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((hash - TopHashBit)) << (shiftForWord()))))))))) {
				segIndex = hash;
			}
			else {

				/* oop is a new outPointer; allocate its oop */
				/* begin newOutPointer:at:in:hashes: */
				if (outIndex >= (numSlotsOf(outPointerArray))) {

					/* no room in outPointers; fail */
					outIndex = 0;
					goto l9;
				}
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(outPointerArray)));
				if ((assert(isNonImmediate(outPointerArray)),
				oopisGreaterThanOrEqualTo(outPointerArray, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((heapOop & (tagMask())) == 0)
					 && (oopisLessThan(heapOop, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(outPointerArray))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(outPointerArray);
						}
					}
				}
				longAtput((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)(outIndex) << (shiftForWord())))), heapOop);
				/* begin storeLong32:ofObject:withValue: */
				valueWord = (long32At(heapOop + 4)) & (identityHashHalfWordMask());
				long32Atput((savedOutHashes + BaseHeaderSize) + (((sqInt)((usqInt)(outIndex) << 2))), valueWord);
				/* begin setHashBitsOf:to: */
				hash1 = outIndex + TopHashBit;
				assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
				long32Atput(heapOop + 4, ((((long32At(heapOop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash1);
				outIndex += 1;
	l9:	/* end newOutPointer:at:in:hashes: */;
				if (outIndex == 0) {

					/* no room in outPointers; fail */
					return -1;
				}
				segIndex = (long32At(heapOop + 4)) & (identityHashHalfWordMask());
			}
			assert(segIndex & TopHashBit);
		}
		/* begin setClassIndexOf:to: */
		assert(((segIndex >= 0) && (segIndex <= (classIndexMask()))));
		longAtput(objOop, ((longAt(objOop)) & (~(usqIntptr_t)(classIndexMask()))) + segIndex);
		for (i = 0, iLimiT = ((numPointerSlotsOf(objOop)) - 1); i <= iLimiT; i += 1) {
			/* begin fetchPointer:ofObject: */
			heapOop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
			if ((heapOop & (tagMask())) == 0) {
				if (((((usqInt) (longAt(heapOop))) >> (markedBitFullShift())) & 1) != 0) {

					/* oop is an object in the segment. */
					/* begin fetchPointer:ofObject: */
					oop = longAt((heapOop + BaseHeaderSize) + (0U << (shiftForWord())));
					assert(oopisGreaterThanOrEqualToandLessThan(oop, segStart, segAddr));
					oop -= segStart;
				}
				else {

					/* oop is an outPointer; locate or allocate its oop */
					hash = (long32At(heapOop + 4)) & (identityHashHalfWordMask());
					if ((hash & TopHashBit)
					 && (((hash - TopHashBit) <= outIndex)
					 && (heapOop == (longAt((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)((hash - TopHashBit)) << (shiftForWord()))))))))) {
						oop = ((hash - TopHashBit) * BytesPerOop) + TopOopBit;
					}
					else {

						/* oop is a new outPointer; allocate its oop */
						/* begin newOutPointer:at:in:hashes: */
						if (outIndex >= (numSlotsOf(outPointerArray))) {

							/* no room in outPointers; fail */
							outIndex = 0;
							goto l12;
						}
						/* begin storePointer:ofObject:withValue: */
						assert(!(isForwarded(outPointerArray)));
						if ((assert(isNonImmediate(outPointerArray)),
						oopisGreaterThanOrEqualTo(outPointerArray, GIV(oldSpaceStart)))) {

							/* most stores into young objects */
							if (((heapOop & (tagMask())) == 0)
							 && (oopisLessThan(heapOop, GIV(newSpaceLimit)))) {
								/* begin possibleRootStoreInto: */
								if (!(((((usqInt) (longAt(outPointerArray))) >> (rememberedBitShift())) & 1) != 0)) {
									remember(outPointerArray);
								}
							}
						}
						longAtput((outPointerArray + BaseHeaderSize) + (((sqInt)((usqInt)(outIndex) << (shiftForWord())))), heapOop);
						/* begin storeLong32:ofObject:withValue: */
						valueWord1 = (long32At(heapOop + 4)) & (identityHashHalfWordMask());
						long32Atput((savedOutHashes + BaseHeaderSize) + (((sqInt)((usqInt)(outIndex) << 2))), valueWord1);
						/* begin setHashBitsOf:to: */
						hash2 = outIndex + TopHashBit;
						assert(((hash2 >= 0) && (hash2 <= (identityHashHalfWordMask()))));
						long32Atput(heapOop + 4, ((((long32At(heapOop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash2);
						outIndex += 1;
	l12:	/* end newOutPointer:at:in:hashes: */;
						if (outIndex == 0) {

							/* no room in outPointers; fail */
							return -1;
						}
						assert((rawHashBitsOf(heapOop)) & TopHashBit);
						oop = ((((long32At(heapOop + 4)) & (identityHashHalfWordMask())) - TopHashBit) * BytesPerOop) + TopOopBit;
					}
				}
				assert(!(isOopForwarded(objOop)));
				longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), oop);
			}
		}
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, segAddr)) {
			objOop = segAddr;
			goto l4;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l4:	/* end objectAfter:limit: */;
		objIndex += 1;
	}
	return outIndex;
}


/*	Ensure the class of the argument is marked, pushing it on the markStack if
	not already marked.
	And for one-way become, which can create duplicate entries in the class
	table, make sure
	objOop's classIndex refers to the classObj's actual classIndex.
	Note that this is recursive, but the metaclass chain should terminate
	quickly. 
 */

	/* SpurMemoryManager>>#markAndTraceClassOf: */
static void NoDbgRegParms
markAndTraceClassOf(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt classObj;
    sqInt classTablePage;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt objStack;
    sqInt realClassIndex;

	/* begin classIndexOf: */
	classIndex = (longAt(objOop)) & (classIndexMask());
	/* begin classOrNilAtIndex: */
	assert((classIndex <= (tagMask()))
	 || (classIndex >= (arrayClassIndexPun())));
	/* begin fetchPointer:ofObject: */
	fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift());
	classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (classTablePage == GIV(nilObj)) {
		classObj = GIV(nilObj);
		goto l4;
	}
	/* begin fetchPointer:ofObject: */
	fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1);
	classObj = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	l4:	/* end classOrNilAtIndex: */;
	assert(objCouldBeClassObj(classObj));
	realClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
	if ((classIndex != realClassIndex)
	 && (classIndex > (lastClassIndexPun()))) {
		/* begin setClassIndexOf:to: */
		assert(((realClassIndex >= 0) && (realClassIndex <= (classIndexMask()))));
		longAtput(objOop, ((longAt(objOop)) & (~(usqIntptr_t)(classIndexMask()))) + realClassIndex);
	}
	if (!(((((usqInt) (longAt(classObj))) >> (markedBitFullShift())) & 1) != 0)) {
		/* begin setIsMarkedOf:to: */
		assert(!(isFreeObject(classObj)));
		longAtput(classObj, (longAt(classObj)) | (1ULL << (markedBitFullShift())));
		markAndTraceClassOf(classObj);
		/* begin push:onObjStack: */
		objStack = GIV(markStack);
		assert(addressCouldBeOop(classObj));
		if (classObj & (tagMask())) {
			assert(objStack == GIV(markStack));
			assert(addressCouldBeObj(topOfObjStack((0 == (fetchPointerofObject(ObjStackTopx, objStack))
				? fetchPointerofObject(ObjStackNextx, objStack)
				: objStack))));
		}
		else {

			/* There should be no weaklings on the mark stack. */
			assert(!((objStack == GIV(markStack))
			 && (isWeakNonImm(classObj))));
			assert((objStack != GIV(weaklingStack))
			 || (isWeakNonImm(classObj)));
		}
		noCheckPushonObjStack(classObj, objStack);
	}
}


/*	An obj stack is a stack of objects stored in a hidden root slot, such
	as the markStack or the ephemeronQueue. It is a linked list of
	segments, with the hot end at the head of the list. It is a word object.
	The stack pointer is in ObjStackTopx and 0 means empty. */

	/* SpurMemoryManager>>#markAndTraceObjStack:andContents: */
static void NoDbgRegParms
markAndTraceObjStackandContents(sqInt stackOrNil, sqInt markAndTraceContents)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt field;
    sqInt index;
    sqInt objOop;

	if (stackOrNil == GIV(nilObj)) {
		return;
	}
	/* begin setIsMarkedOf:to: */
	assert(!(isFreeObject(stackOrNil)));
	longAtput(stackOrNil, (longAt(stackOrNil)) | (1ULL << (markedBitFullShift())));
	assert((numSlotsOfAny(stackOrNil)) == ObjStackPageSlots);
	/* begin fetchPointer:ofObject: */
	field = longAt((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
	if (field != 0) {
		markAndTraceObjStackandContents(field, markAndTraceContents);
	}
	field = stackOrNil;
	while (1) {
		/* begin fetchPointer:ofObject: */
		field = longAt((field + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))));
		if (!(field != 0)) break;
		/* begin setIsMarkedOf:to: */
		assert(!(isFreeObject(field)));
		longAtput(field, (longAt(field)) | (1ULL << (markedBitFullShift())));
	}
	if (!markAndTraceContents) {
		return;
	}
	index = (longAt((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))))) + ObjStackNextx;
	while (index >= ObjStackFixedSlots) {
		/* begin followObjField:ofObject: */
		objOop = longAt((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
		assert(isNonImmediate(objOop));
		if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			objOop = fixFollowedFieldofObjectwithInitialValue(index, stackOrNil, objOop);
		}
		field = objOop;
		if (!(field & (tagMask()))) {
			markAndTrace(field);
		}
		index -= 1;
	}
}


/*	Mark the argument, and all objects reachable from it, and any remaining
	objects on the mark stack. Follow forwarding pointers in the scan. */
/*	if markAndTrace: is to follow and eliminate forwarding pointers
	in its scan it cannot be handed an r-value which is forwarded.
	The assert for this is in markAndShouldScan: */

	/* SpurMemoryManager>>#markAndTrace: */
void NeverInline
markAndTrace(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classFormat;
    sqInt contextSize;
    sqInt field;
    sqInt fmt;
    sqInt format1;
    sqInt format11;
    sqInt header;
    sqInt header1;
    sqInt index;
    sqInt numLiterals;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt numStrongSlots;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop2;
    sqInt objStack;
    sqInt objStack1;
    sqInt objStack2;
    sqInt objStack3;
    sqInt objStack4;
    sqInt objStack5;
    sqInt objStack6;
    sqInt objToScan;
    sqInt scanLargeObject;
    sqInt sp;

	numStrongSlots = 0;

	/* inline markAndShouldScan: */
	if (objOop & (tagMask())) {
		return;
	}
	assert(!(isForwarded(objOop)));
	if (((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0) {
		return;
	}
	/* begin setIsMarkedOf:to: */
	assert(!(isFreeObject(objOop)));
	longAtput(objOop, (longAt(objOop)) | (1ULL << (markedBitFullShift())));
	format1 = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	if ((format1 >= (sixtyFourBitIndexableFormat()))
	 && (format1 < (firstCompiledMethodFormat()))) {

		/* avoid pushing non-pointer objects on the markStack. */
		/* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */
		if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) {
			markAndTraceClassOf(objOop);
		}
		return;
	}
	if (format1 == (weakArrayFormat())) {

		/* push weaklings on the weakling stack to scan later */
		/* begin push:onObjStack: */
		objStack = GIV(weaklingStack);
		assert(addressCouldBeOop(objOop));
		if (objOop & (tagMask())) {
			assert(objStack == GIV(markStack));
			assert(addressCouldBeObj(topOfObjStack((0 == (fetchPointerofObject(ObjStackTopx, objStack))
				? fetchPointerofObject(ObjStackNextx, objStack)
				: objStack))));
		}
		else {

			/* There should be no weaklings on the mark stack. */
			assert(!((objStack == GIV(markStack))
			 && (isWeakNonImm(objOop))));
			assert((objStack != GIV(weaklingStack))
			 || (isWeakNonImm(objOop)));
		}
		noCheckPushonObjStack(objOop, objStack);
		return;
	}
	if ((format1 == 5 /* ephemeronFormat */)
	 && (activeAndDeferredScan(objOop))) {
		return;
	}
	/* begin markLoopFrom: */

	/* To avoid overflowing the mark stack when we encounter large objects, we
	   push the obj, then its numStrongSlots, and then index the object from the stack. */
	objToScan = objOop;
	do {
		if (objToScan & (tagMask())) {
			scanLargeObject = 1;
		}
		else {
			/* begin numStrongSlotsOfInephemeral: */
			fmt = (((usqInt) (longAt(objToScan))) >> (formatShift())) & (formatMask());
			assert((fmt != (ephemeronFormat()))
			 || (isMarked(keyOfEphemeron(objToScan))));
			if (fmt <= 5 /* lastPointerFormat */) {
				/* begin numSlotsOf: */
				assert((classIndexOf(objToScan)) > (isForwardedObjectClassIndexPun()));
				numSlots1 = byteAt(objToScan + 7);
				numSlots = (numSlots1 == (numSlotsMask())
					? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objToScan - BaseHeaderSize))) << 8)))))) >> 8
					: numSlots1);
				if (fmt <= 2 /* arrayFormat */) {
					numStrongSlots = numSlots;
					goto l15;
				}
				if (fmt == (indexablePointersFormat())) {
					if (((longAt(objToScan)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
						setTraceFlagOnContextsFramesPageIfNeeded(objToScan);
						/* begin fetchStackPointerOf: */
						sp = longAt((objToScan + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
						if (!((((sp) & 7) == 1))) {
							contextSize = 0;
							goto l11;
						}
						assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objToScan)));
						contextSize = (sp >> 3);
	l11:	/* end fetchStackPointerOf: */;
						numStrongSlots = CtxtTempFrameStart + contextSize;
						goto l15;
					}
					numStrongSlots = numSlots;
					goto l15;
				}
				if (fmt == (weakArrayFormat())) {
					/* begin fixedFieldsOfClass: */
					objOop11 = fetchClassOfNonImm(objToScan);
					/* begin fixedFieldsOfClassFormat: */
					classFormat = ((longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
					numStrongSlots = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
					goto l15;
				}
			}
			if (fmt == 7 /* forwardedFormat */) {
				numStrongSlots = 1;
				goto l15;
			}
			if (fmt < (firstCompiledMethodFormat())) {
				numStrongSlots = 0;
				goto l15;
			}
			/* begin methodHeaderOf: */
			assert(isCompiledMethod(objToScan));
			header1 = longAt((objToScan + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
			if ((((header1) & 7) == 1)) {
				header = header1;
			}
			else {
				assert((((usqInt)header1)) < GIV(newSpaceStart));
				assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
				header = ((((CogMethod *) header1))->methodHeader);
			}
			assert((((header) & 7) == 1));
			numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
			numStrongSlots = numLiterals + LiteralStart;
	l15:	/* end numStrongSlotsOfInephemeral: */;
			scanLargeObject = numStrongSlots > 64 /* traceImmediatelySlotLimit */;
		}
		if (scanLargeObject) {

			/* scanning a large object. scan until hitting an unmarked object, then switch to it, if any. */
			if (objToScan & (tagMask())) {
				index = (objToScan >> 3);
				objToScan = topOfObjStack(GIV(markStack));
			}
			else {
				index = numStrongSlots;
				markAndTraceClassOf(objToScan);
			}
			while (index > 0) {
				index -= 1;
				/* begin fetchPointer:ofObject: */
				field = longAt((objToScan + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
				if ((field & (tagMask())) == 0) {
					if (((longAt(field)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {

						/* fixFollowedField: is /not/ inlined */
						field = fixFollowedFieldofObjectwithInitialValue(index, objToScan, field);
					}
					if (field & (tagMask())) {
						goto l3;
					}
					assert(!(isForwarded(field)));
					if (((((usqInt) (longAt(field))) >> (markedBitFullShift())) & 1) != 0) {
						goto l3;
					}
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(field)));
					longAtput(field, (longAt(field)) | (1ULL << (markedBitFullShift())));
					format11 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask());
					if ((format11 >= (sixtyFourBitIndexableFormat()))
					 && (format11 < (firstCompiledMethodFormat()))) {

						/* avoid pushing non-pointer objects on the markStack. */
						/* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */
						if (((longAt(field)) & (classIndexMask())) > (lastClassIndexPun())) {
							markAndTraceClassOf(field);
						}
						goto l3;
					}
					if (format11 == (weakArrayFormat())) {

						/* push weaklings on the weakling stack to scan later */
						/* begin push:onObjStack: */
						objStack6 = GIV(weaklingStack);
						assert(addressCouldBeOop(field));
						if (field & (tagMask())) {
							assert(objStack6 == GIV(markStack));
							assert(addressCouldBeObj(topOfObjStack((0 == (fetchPointerofObject(ObjStackTopx, objStack6))
								? fetchPointerofObject(ObjStackNextx, objStack6)
								: objStack6))));
						}
						else {

							/* There should be no weaklings on the mark stack. */
							assert(!((objStack6 == GIV(markStack))
							 && (isWeakNonImm(field))));
							assert((objStack6 != GIV(weaklingStack))
							 || (isWeakNonImm(field)));
						}
						noCheckPushonObjStack(field, objStack6);
						goto l3;
					}
					if ((format11 == 5 /* ephemeronFormat */)
					 && (activeAndDeferredScan(field))) {
						goto l3;
					}
					if (index > 0) {
						if ((topOfObjStack(GIV(markStack))) != objToScan) {
							/* begin push:onObjStack: */
							objStack1 = GIV(markStack);
							assert(addressCouldBeOop(objToScan));
							if (objToScan & (tagMask())) {
								assert(objStack1 == GIV(markStack));
								assert(addressCouldBeObj(topOfObjStack((0 == (fetchPointerofObject(ObjStackTopx, objStack1))
									? fetchPointerofObject(ObjStackNextx, objStack1)
									: objStack1))));
							}
							else {

								/* There should be no weaklings on the mark stack. */
								assert(!((objStack1 == GIV(markStack))
								 && (isWeakNonImm(objToScan))));
								assert((objStack1 != GIV(weaklingStack))
								 || (isWeakNonImm(objToScan)));
							}
							noCheckPushonObjStack(objToScan, objStack1);
						}
						/* begin push:onObjStack: */
						objOop1 = (((usqInt)index << 3) | 1);
						objStack2 = GIV(markStack);
						assert(addressCouldBeOop(objOop1));
						if (objOop1 & (tagMask())) {
							assert(objStack2 == GIV(markStack));
							assert(addressCouldBeObj(topOfObjStack((0 == (fetchPointerofObject(ObjStackTopx, objStack2))
								? fetchPointerofObject(ObjStackNextx, objStack2)
								: objStack2))));
						}
						else {

							/* There should be no weaklings on the mark stack. */
							assert(!((objStack2 == GIV(markStack))
							 && (isWeakNonImm(objOop1))));
							assert((objStack2 != GIV(weaklingStack))
							 || (isWeakNonImm(objOop1)));
						}
						noCheckPushonObjStack(objOop1, objStack2);
					}
					objToScan = field;
					index = -1;
	l3:	;
				}
			}
			if (index >= 0) {

				/* if loop terminated without finding an unmarked referent, switch to top of stack. */
				objToScan = popObjStack(GIV(markStack));
				if (objToScan == objOop) {
					objToScan = popObjStack(GIV(markStack));
				}
			}
		}
		else {

			/* scanning a small object. scan, marking, pushing unmarked referents, then switch to the top of the stack. */
			index = numStrongSlots;
			markAndTraceClassOf(objToScan);
			while (index > 0) {
				index -= 1;
				/* begin fetchPointer:ofObject: */
				field = longAt((objToScan + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
				if ((field & (tagMask())) == 0) {
					if (((longAt(field)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {

						/* fixFollowedField: is /not/ inlined */
						field = fixFollowedFieldofObjectwithInitialValue(index, objToScan, field);
					}
					if (field & (tagMask())) {
						goto l4;
					}
					assert(!(isForwarded(field)));
					if (((((usqInt) (longAt(field))) >> (markedBitFullShift())) & 1) != 0) {
						goto l4;
					}
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(field)));
					longAtput(field, (longAt(field)) | (1ULL << (markedBitFullShift())));
					format11 = (((usqInt) (longAt(field))) >> (formatShift())) & (formatMask());
					if ((format11 >= (sixtyFourBitIndexableFormat()))
					 && (format11 < (firstCompiledMethodFormat()))) {

						/* avoid pushing non-pointer objects on the markStack. */
						/* Avoid tracing classes of non-objects on the heap, e.g. IRC caches, Sista counters. */
						if (((longAt(field)) & (classIndexMask())) > (lastClassIndexPun())) {
							markAndTraceClassOf(field);
						}
						goto l4;
					}
					if (format11 == (weakArrayFormat())) {

						/* push weaklings on the weakling stack to scan later */
						/* begin push:onObjStack: */
						objStack3 = GIV(weaklingStack);
						assert(addressCouldBeOop(field));
						if (field & (tagMask())) {
							assert(objStack3 == GIV(markStack));
							assert(addressCouldBeObj(topOfObjStack((0 == (fetchPointerofObject(ObjStackTopx, objStack3))
								? fetchPointerofObject(ObjStackNextx, objStack3)
								: objStack3))));
						}
						else {

							/* There should be no weaklings on the mark stack. */
							assert(!((objStack3 == GIV(markStack))
							 && (isWeakNonImm(field))));
							assert((objStack3 != GIV(weaklingStack))
							 || (isWeakNonImm(field)));
						}
						noCheckPushonObjStack(field, objStack3);
						goto l4;
					}
					if ((format11 == 5 /* ephemeronFormat */)
					 && (activeAndDeferredScan(field))) {
						goto l4;
					}
					/* begin push:onObjStack: */
					objStack5 = GIV(markStack);
					assert(addressCouldBeOop(field));
					if (field & (tagMask())) {
						assert(objStack5 == GIV(markStack));
						assert(addressCouldBeObj(topOfObjStack((0 == (fetchPointerofObject(ObjStackTopx, objStack5))
							? fetchPointerofObject(ObjStackNextx, objStack5)
							: objStack5))));
					}
					else {

						/* There should be no weaklings on the mark stack. */
						assert(!((objStack5 == GIV(markStack))
						 && (isWeakNonImm(field))));
						assert((objStack5 != GIV(weaklingStack))
						 || (isWeakNonImm(field)));
					}
					noCheckPushonObjStack(field, objStack5);
					if (((byteAt(field + 7)) > 64 /* traceImmediatelySlotLimit */)
					 && (((numStrongSlots = numStrongSlotsOfInephemeral(field))) > 64 /* traceImmediatelySlotLimit */)) {
						/* begin push:onObjStack: */
						objOop2 = (((usqInt)numStrongSlots << 3) | 1);
						objStack4 = GIV(markStack);
						assert(addressCouldBeOop(objOop2));
						if (objOop2 & (tagMask())) {
							assert(objStack4 == GIV(markStack));
							assert(addressCouldBeObj(topOfObjStack((0 == (fetchPointerofObject(ObjStackTopx, objStack4))
								? fetchPointerofObject(ObjStackNextx, objStack4)
								: objStack4))));
						}
						else {

							/* There should be no weaklings on the mark stack. */
							assert(!((objStack4 == GIV(markStack))
							 && (isWeakNonImm(objOop2))));
							assert((objStack4 != GIV(weaklingStack))
							 || (isWeakNonImm(objOop2)));
						}
						noCheckPushonObjStack(objOop2, objStack4);
					}
	l4:	;
				}
			}
			objToScan = popObjStack(GIV(markStack));
		}
	} while(objToScan != null);
}


/*	Go through the unscanned ephemerons, marking the inactive ones, and
	removing them from the unscanned ephemerons. Answer if any inactive
	ones were found. We cannot fire the ephemerons until all are found to
	be active since scan-marking an inactive ephemeron later in the set may
	render a previously-observed active ephemeron as inactive. */

	/* SpurMemoryManager>>#markInactiveEphemerons */
static sqInt
markInactiveEphemerons(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ephemeron;
    sqInt foundInactive;
    sqInt key;
    sqInt objOop;
    sqInt oop;
    usqInt ptr;

	foundInactive = 0;
	ptr = (GIV(unscannedEphemerons).start);
	while (ptr < ((GIV(unscannedEphemerons).top))) {
		/* begin followedKeyOfEphemeron: */
		objOop = (ephemeron = longAt(ptr));
		assert((isNonImmediate(objOop))
		 && (isEphemeron(objOop)));
		/* begin followOopField:ofObject: */
		oop = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
		if (((oop & (tagMask())) == 0)
		 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			oop = fixFollowedFieldofObjectwithInitialValue(0, objOop, oop);
		}
		key = oop;
		if ((key & (tagMask()))
		 || (((((usqInt) (longAt(key))) >> (markedBitFullShift())) & 1) != 0)) {

			/* Now remove the inactive ephemeron from the set, and scan-mark it.
			   Scan-marking it may add more ephemerons to the set. */
			foundInactive = 1;
			(GIV(unscannedEphemerons).top = ((GIV(unscannedEphemerons).top)) - BytesPerOop);
			if (((GIV(unscannedEphemerons).top)) > ptr) {
				longAtput(ptr, longAt((GIV(unscannedEphemerons).top)));
			}
			markAndTrace(ephemeron);
		}
		else {
			ptr += BytesPerOop;
		}
	}
	return foundInactive;
}


/*	for profiling */
/*	Mark all accessible objects.
	objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged is true if all
	objects are unmarked and/or if unmarked classes shoud be removed from the
	class table. */
/*	If the incremental collector is running mark bits may be set; stop it and
	clear them if necessary.
 */

	/* SpurMemoryManager>>#markObjects: */
static void NoDbgRegParms NeverInline
markObjects(sqInt objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt classOrNil;
    sqInt classTablePage;
    sqInt i;
    sqInt i1;
    sqInt i2;
    sqInt i3;
    sqInt i4;
    sqInt iLimiT;
    sqInt j;
    sqInt jLimiT;
    sqInt largestFree;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop2;
    sqInt oop;
    usqInt oop1;
    sqInt referent;
    sqInt referent1;
    sqInt referent2;
    sqInt referent3;
    sqInt referent4;
    sqInt sizeOfUnusedEden;
    StackPage *thePage;

	runLeakCheckerFor(GCModeFull);
	/* begin shutDownIncrementalGC: */
	if (objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged) {
		assert(allObjectsUnmarked());
	}
	/* begin initializeUnscannedEphemerons */
	largestFree = findLargestFreeChunk();
	sizeOfUnusedEden = (((eden()).limit)) - GIV(freeStart);
	if ((largestFree != null)
	 && ((numSlotsOfAny(largestFree)) > (sizeOfUnusedEden / BytesPerWord))) {
		(GIV(unscannedEphemerons).start = (largestFree + BaseHeaderSize) + ((4 /* freeChunkLargerIndex */ + 1) * BytesPerWord));
		(GIV(unscannedEphemerons).limit = addressAfter(largestFree));
	}
	else {
		(GIV(unscannedEphemerons).start = GIV(freeStart));
		(GIV(unscannedEphemerons).limit = ((eden()).limit));
	}
	(GIV(unscannedEphemerons).top = (GIV(unscannedEphemerons).start));
	/* begin initializeMarkStack */
	ensureRoomOnObjStackAt(MarkStackRootIndex);
	/* begin initializeWeaklingStack */
	ensureRoomOnObjStackAt(WeaklingStackRootIndex);
	GIV(marking) = 1;
	/* begin markAccessibleObjectsAndFireEphemerons */
	assert(GIV(marking));
	assert(validClassTableRootPages());
	assert(allBridgesMarked());
	/* begin initStackPageGC */
	if (GIV(stackPage) != 0) {
		/* begin externalWriteBackHeadFramePointers */
		assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
		assert(GIV(stackPage) == (mostRecentlyUsedPage()));
		assert(!((isFree(GIV(stackPage)))));
		/* begin setHeadFP:andSP:inPage: */
		assert(GIV(stackPointer) < GIV(framePointer));
		assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
		assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
		(GIV(stackPage)->headFP = GIV(framePointer));
		(GIV(stackPage)->headSP = GIV(stackPointer));
		assert(pageListIsWellFormed());
	}
	for (i1 = 0; i1 < GIV(numStackPages); i1 += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i1, GIV(pages));
		(thePage->trace = StackPageUnreached);
	}
	/* begin markAndTraceHiddenRoots */
	markAndTraceObjStackandContents(GIV(markStack), 0);
	markAndTraceObjStackandContents(GIV(weaklingStack), 0);
	markAndTraceObjStackandContents(GIV(mournQueue), 1);
	/* begin setIsMarkedOf:to: */
	objOop1 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord())))));
	assert(!(isFreeObject(objOop1)));
	longAtput(objOop1, (longAt(objOop1)) | (1ULL << (markedBitFullShift())));
	/* begin setIsMarkedOf:to: */
	assert((firstIndexableField(oldSpaceObjectAfter(GIV(trueObj)))) == GIV(freeLists));
	objOop2 = oldSpaceObjectAfter(GIV(trueObj));
	assert(!(isFreeObject(objOop2)));
	longAtput(objOop2, (longAt(objOop2)) | (1ULL << (markedBitFullShift())));
	if (isWeakFormat((((usqInt) (longAt(GIV(classTableFirstPage)))) >> (formatShift())) & (formatMask()))) {
		markAndTrace(GIV(hiddenRootsObj));
		goto l2;
	}
	/* begin setIsMarkedOf:to: */
	assert(!(isFreeObject(GIV(hiddenRootsObj))));
	longAtput(GIV(hiddenRootsObj), (longAt(GIV(hiddenRootsObj))) | (1ULL << (markedBitFullShift())));
	markAndTrace(GIV(classTableFirstPage));
	for (i2 = 1; i2 < GIV(numClassTablePages); i2 += 1) {
		/* begin setIsMarkedOf:to: */
		objOop = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord())))));
		assert(!(isFreeObject(objOop)));
		longAtput(objOop, (longAt(objOop)) | (1ULL << (markedBitFullShift())));
	}
	l2:	/* end markAndTraceHiddenRoots */;
	/* begin markAndTraceExtraRoots */
	assert(GIV(remapBufferCount) == 0);
	for (i4 = 1; i4 <= GIV(extraRootCount); i4 += 1) {
		oop = (GIV(extraRoots)[i4])[0];
		if (!((oop & (tagMask()))
			 || (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))) {
			markAndTrace(oop);
		}
	}
	assert(validClassTableRootPages());
	/* begin markAndTraceInterpreterOops: */
	markAndTraceStackPages(1);
	markAndTraceTraceLog();
	markAndTracePrimTraceLog();
	markAndTrace(GIV(specialObjectsOop));
	if (!(GIV(newMethod) & (tagMask()))) {
		markAndTrace(GIV(newMethod));
	}
	/* begin traceProfileState */
	/* begin followForwardingPointersInProfileState */
	if (((longAt(GIV(profileProcess))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(GIV(profileProcess)));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((GIV(profileProcess) + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		GIV(profileProcess) = referent;
	}
	if (((longAt(GIV(profileMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(GIV(profileMethod)));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent1 = longAt((GIV(profileMethod) + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent1 & (tagMask())) == 0)
		 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		GIV(profileMethod) = referent1;
	}
	if (((longAt(GIV(profileProcess))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(GIV(profileSemaphore)));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent2 = longAt((GIV(profileSemaphore) + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent2 & (tagMask())) == 0)
		 && (((longAt(referent2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		GIV(profileSemaphore) = referent2;
	}
	markAndTrace(GIV(profileProcess));
	markAndTrace(GIV(profileMethod));
	markAndTrace(GIV(profileSemaphore));
	sqLowLevelMFence();
	if ((GIV(longRunningPrimitiveCheckMethod) != null)
	 && (GIV(longRunningPrimitiveCheckSequenceNumber) != GIV(statCheckForEvents))) {
		if (((longAt(GIV(longRunningPrimitiveCheckMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(GIV(longRunningPrimitiveCheckMethod)));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent3 = longAt((GIV(longRunningPrimitiveCheckMethod) + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent3 & (tagMask())) == 0)
			 && (((longAt(referent3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			GIV(longRunningPrimitiveCheckMethod) = referent3;
		}
		markAndTrace(GIV(longRunningPrimitiveCheckMethod));
	}
	if (GIV(longRunningPrimitiveCheckSemaphore) != null) {
		if (((longAt(GIV(longRunningPrimitiveCheckSemaphore))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(GIV(longRunningPrimitiveCheckSemaphore)));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent4 = longAt((GIV(longRunningPrimitiveCheckSemaphore) + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent4 & (tagMask())) == 0)
			 && (((longAt(referent4)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			GIV(longRunningPrimitiveCheckSemaphore) = referent4;
		}
		markAndTrace(GIV(longRunningPrimitiveCheckSemaphore));
	}
	if (!(GIV(tempOop) == 0)) {
		markAndTrace(GIV(tempOop));
	}
	if (!(GIV(tempOop2) == 0)) {
		markAndTrace(GIV(tempOop2));
	}
	for (i3 = 1, iLimiT = (remapBufferCount()); i3 <= iLimiT; i3 += 1) {
		oop1 = GIV(remapBuffer)[i3];
		if (!(oop1 & (tagMask()))) {
			markAndTrace(oop1);
		}
	}
	for (i3 = 1; i3 <= GIV(jmpDepth); i3 += 1) {
		oop1 = GIV(suspendedCallbacks)[i3];
		if (!(oop1 & (tagMask()))) {
			markAndTrace(oop1);
		}
		oop1 = GIV(suspendedMethods)[i3];
		if (!(oop1 & (tagMask()))) {
			markAndTrace(oop1);
		}
	}
	assert(validObjStacks());
	markWeaklingsAndMarkAndFireEphemerons();
	assert(validObjStacks());
	/* begin expungeDuplicateAndUnmarkedClasses: */
	for (i = 1; i < GIV(numClassTablePages); i += 1) {

		/* Avoid expunging the puns by not scanning the 0th page. */
		classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		for (j = 0, jLimiT = ((1U << (classTableMajorIndexShift())) - 1); j <= jLimiT; j += 1) {
			classOrNil = longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))));
			classIndex = (((sqInt)((usqInt)(i) << (classTableMajorIndexShift())))) + j;
			assert((classOrNil == GIV(nilObj))
			 || (addressCouldBeClassObj(classOrNil)));
			if (classOrNil == GIV(nilObj)) {
				if (classIndex < GIV(classTableIndex)) {
					GIV(classTableIndex) = classIndex;
				}
			}
			else {
				if ((objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged
				 && (!(((((usqInt) (longAt(classOrNil))) >> (markedBitFullShift())) & 1) != 0)))
				 || (((long32At(classOrNil + 4)) & (identityHashHalfWordMask())) != classIndex)) {
					assert(!(isOopForwarded(classTablePage)));
					longAtput((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))), GIV(nilObj));
					assert((objectsShouldBeUnmarkedAndUnmarkedClassesShouldBeExpunged
					 && (!(isMarked(classOrNil))))
					 || ((classAtIndex(rawHashBitsOf(classOrNil))) == classOrNil));
					if (classIndex < GIV(classTableIndex)) {
						GIV(classTableIndex) = classIndex;
					}
				}
			}
		}
	}
	assert(GIV(classTableIndex) >= (1U << (classTableMajorIndexShift())));
	nilUnmarkedWeaklingSlots();
	GIV(marking) = 0;
}


/*	After the initial scan-mark is complete ephemerons can be processed.
	Weaklings have accumulated on the weaklingStack, but more may be
	uncovered during ephemeron processing. So trace the strong slots
	of the weaklings, and as ephemerons are processed ensure any newly
	reached weaklings are also traced. */

	/* SpurMemoryManager>>#markWeaklingsAndMarkAndFireEphemerons */
static void
markWeaklingsAndMarkAndFireEphemerons(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classFormat;
    sqInt ephemeron;
    sqInt field;
    sqInt i;
    sqInt i1;
    sqInt iLimiT;
    sqInt key;
    sqInt lastptr;
    sqInt numOnThisPage;
    sqInt numToEnumerate;
    sqInt numToEnumerateOnThisPage;
    sqInt numTracedWeaklings;
    sqInt objOop;
    sqInt objStackPage;
    sqInt oop;
    sqInt oop1;
    sqInt p;
    sqInt size;
    sqInt topIndex;
    sqInt weakling;

	numTracedWeaklings = 0;
	while(1) {
		markAndTraceUntracedReachableStackPages();
		markAndTraceMachineCodeOfMarkedMethods();
		do {
			/* begin objStack:from:do: */
			eassert(isValidObjStack(GIV(weaklingStack)));
			/* begin fetchPointer:ofObject: */
			size = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
			/* begin fetchPointer:ofObject: */
			objStackPage = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
			while (objStackPage != 0) {
				size += ObjStackLimit;
				assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit);
				/* begin fetchPointer:ofObject: */
				objStackPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
			}
			numToEnumerate = size - numTracedWeaklings;
			objStackPage = GIV(weaklingStack);
			while (numToEnumerate > 0) {
				/* begin fetchPointer:ofObject: */
				numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
				numToEnumerateOnThisPage = ((numToEnumerate < numOnThisPage) ? numToEnumerate : numOnThisPage);
				topIndex = (numOnThisPage + ObjStackFixedSlots) - 1;
				for (i1 = topIndex; i1 >= ((topIndex - numToEnumerateOnThisPage) + 1); i1 += -1) {
					assert(isWeak(fetchPointerofObject(i1, objStackPage)));
					weakling = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
					assert(!((isForwarded(weakling))));
					markAndTraceClassOf(weakling);
					for (i = 0, iLimiT = (((assert((formatOf(weakling)) == (weakArrayFormat())),
/* begin fixedFieldsOfClass: */
(objOop = fetchClassOfNonImm(weakling)),
/* begin fixedFieldsOfClassFormat: */
(classFormat = ((longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)),
classFormat & ((1U << (fixedFieldsFieldWidth())) - 1))) - 1); i <= iLimiT; i += 1) {
						/* begin followOopField:ofObject: */
						oop = longAt((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
						if (((oop & (tagMask())) == 0)
						 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
							oop = fixFollowedFieldofObjectwithInitialValue(i, weakling, oop);
						}
						field = oop;
						if (!((field & (tagMask()))
							 || (((((usqInt) (longAt(field))) >> (markedBitFullShift())) & 1) != 0))) {
							markAndTrace(field);
						}
					}
				}
				numToEnumerate -= numToEnumerateOnThisPage;
				/* begin fetchPointer:ofObject: */
				objStackPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
			}
			numTracedWeaklings = size;
		} while((sizeOfObjStack(GIV(weaklingStack))) > numTracedWeaklings);
		if (((GIV(unscannedEphemerons).top)) == ((GIV(unscannedEphemerons).start))) {
			markAndTraceUntracedReachableStackPages();
			markAndTraceMachineCodeOfMarkedMethods();
			freeUntracedStackPages();
			freeUnmarkedMachineCode();
			return;
		}
		if (!(markInactiveEphemerons())) {
			/* begin fireAllUnscannedEphemerons */
			assert(!(noUnscannedEphemerons()));
			assert(allUnscannedEphemeronsAreActive());
			for (p = ((GIV(unscannedEphemerons).start)); p <= (((GIV(unscannedEphemerons).top)) - BytesPerOop); p += BytesPerOop) {
				/* begin fireEphemeron: */
				queueMourner(longAt(p));
				/* begin setFormatOf:to: */
				assert(((1 /* nonIndexablePointerFormat */ >= 0) && (1 /* nonIndexablePointerFormat */ <= (formatMask()))));
				longAtput(longAt(p), ((longAt(longAt(p))) & (~(usqIntptr_t)(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (1U << (formatShift())));
				/* begin signalFinalization: */
				forceInterruptCheck();
				GIV(pendingFinalizationSignals) += 1;
			}
		}
		/* begin markAllUnscannedEphemerons */
		assert(!(noUnscannedEphemerons()));
		assert(allUnscannedEphemeronsAreActive());
		while (((GIV(unscannedEphemerons).top)) > ((GIV(unscannedEphemerons).start))) {
			ephemeron = longAt((GIV(unscannedEphemerons).start));
			lastptr = ((GIV(unscannedEphemerons).top)) - BytesPerOop;
			if (lastptr > ((GIV(unscannedEphemerons).start))) {
				longAtput((GIV(unscannedEphemerons).start), longAt(lastptr));
			}
			(GIV(unscannedEphemerons).top = lastptr);
			assert((isNonImmediate(ephemeron))
			 && (isMaybeFiredEphemeron(ephemeron)));
			/* begin followOopField:ofObject: */
			oop1 = longAt((ephemeron + BaseHeaderSize) + (0U << (shiftForWord())));
			if (((oop1 & (tagMask())) == 0)
			 && (((longAt(oop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				oop1 = fixFollowedFieldofObjectwithInitialValue(0, ephemeron, oop1);
			}
			key = oop1;
			/* begin setIsMarkedOf:to: */
			assert(!(isFreeObject(ephemeron)));
			longAtput(ephemeron, (longAt(ephemeron)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			markAndTrace(key);
			markAndTrace(ephemeron);
		}
	}
}


/*	Answers if the code is installed in a class instantiating objects with the
	format. Used in primitive 
	generation to make a quick path based on where the method is installed.
	This method cannot
	be used as a guarantee as there can be false positive, it's just a
	heuristic. Tries to interpret the last literal of the method as a behavior
	(more than 3 fields, 3rd field a Smi).
	If it can be interpreted as a behavior, answers if instSpec matches the
	format, else answers false. */

	/* SpurMemoryManager>>#maybeMethodClassOf:seemsToBeInstantiating: */
sqInt
maybeMethodClassOfseemsToBeInstantiating(sqInt methodObj, sqInt format)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt instSpec;
    sqInt literal;
    sqInt maybeClassObj;
    sqInt maybeFormat;
    sqInt objOop;
    sqInt objOop1;
    sqInt offset;

	/* begin methodClassOf: */
	offset = (literalCountOfMethodHeader(methodHeaderOf(methodObj))) - 1;
	/* begin followField:ofObject: */
	objOop1 = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
	if (((objOop1 & (tagMask())) == 0)
	 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop1 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodObj, objOop1);
	}
	literal = objOop1;
	if ((literal != GIV(nilObj))
	 && (((literal & (tagMask())) == 0)
	 && (((((usqInt) (longAt(literal))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))) {
		assert((numSlotsOf(literal)) > ValueIndex);
		/* begin followField:ofObject: */
		objOop = longAt((literal + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
		if (((objOop & (tagMask())) == 0)
		 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop);
		}
		maybeClassObj = objOop;
	}
	else {
		/* begin nilObject */
		maybeClassObj = GIV(nilObj);
	}
	if (!(((((usqInt) (longAt(maybeClassObj))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)) {
		return 0;
	}
	if (!((numSlotsOfAny(maybeClassObj)) > InstanceSpecificationIndex)) {
		return 0;
	}
	/* begin fetchPointer:ofObject: */
	maybeFormat = longAt((maybeClassObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))));
	if (!((((maybeFormat) & 7) == 1))) {
		return 0;
	}
	/* begin instSpecOfClassFormat: */
	instSpec = (((usqInt) ((maybeFormat >> 3))) >> (fixedFieldsFieldWidth())) & (formatMask());
	return instSpec == format;
}


/*	Answer one of the objects in the SpecialObjectsArray, if in range,
	otherwise answer nil.
 */

	/* SpurMemoryManager>>#maybeSplObj: */
sqInt
maybeSplObj(sqInt index)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (index < (numSlotsOf(GIV(specialObjectsOop)))
		? (/* begin fetchPointer:ofObject: */
			longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord()))))))
		: 0);
}


/*	Answer the minimum number of additional slots to allocate in an object to
	always be able to shorten it.
	This is enough slots to allocate a minimum-sized object. */

	/* SpurMemoryManager>>#minSlotsForShortening */
sqInt
minSlotsForShortening(void)
{
	return (8 /* allocationUnit */ * 2) / BytesPerOop;
}

	/* SpurMemoryManager>>#newHashBitsOf: */
static sqInt NoDbgRegParms
newHashBitsOf(sqInt objOop)
{
    sqInt hash;

	hash = (newObjectHash()) & (identityHashHalfWordMask());
	/* begin setHashBitsOf:to: */
	assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
	long32Atput(objOop + 4, ((((long32At(objOop + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash);
	return hash;
}


/*	Use a slight variation on D.H. Lehmer's linear congruential generator from
	1951. See e.g. http://en.wikipedia.org/wiki/Linear_congruential_generator. */

	/* SpurMemoryManager>>#newObjectHash */
static sqInt
newObjectHash(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt hash;

	do {
		GIV(lastHash) = GIV(lastHash) * 16807;

		/* adding the top bits gives much better spread.  See below: */
		hash = GIV(lastHash) + (((usqInt) GIV(lastHash)) >> 4);
	} while((hash & (identityHashHalfWordMask())) == 0);
	return hash;
}

	/* SpurMemoryManager>>#newSpaceIsEmpty */
static sqInt
newSpaceIsEmpty(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (GIV(freeStart) == (((eden()).start)))
	 && (GIV(pastSpaceStart) == (((pastSpace()).start)));
}

	/* SpurMemoryManager>>#nilObject */
sqInt
nilObject(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(nilObj);
}


/*	Nil the unmarked slots in the weaklings on the
	weakling stack, finalizing those that lost references.
	Finally, empty the weaklingStack. */
/*	for profiling */

	/* SpurMemoryManager>>#nilUnmarkedWeaklingSlots */
static void NeverInline
nilUnmarkedWeaklingSlots(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt anyUnmarked;
    sqInt anyUnmarked1;
    sqInt i;
    sqInt i1;
    sqInt iLimiT;
    sqInt numOnThisPage;
    sqInt numToEnumerate;
    sqInt numToEnumerateOnThisPage;
    sqInt objStackPage;
    sqInt referent;
    sqInt size;
    sqInt topIndex;
    sqInt weakling;

	eassert(allOldMarkedWeakObjectsOnWeaklingStack());
	if (GIV(weaklingStack) == GIV(nilObj)) {
		return;
	}
	/* begin objStack:from:do: */
	eassert(isValidObjStack(GIV(weaklingStack)));
	/* begin fetchPointer:ofObject: */
	size = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
	/* begin fetchPointer:ofObject: */
	objStackPage = longAt((GIV(weaklingStack) + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
	while (objStackPage != 0) {
		size += ObjStackLimit;
		assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit);
		/* begin fetchPointer:ofObject: */
		objStackPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
	}
	numToEnumerate = size;
	objStackPage = GIV(weaklingStack);
	while (numToEnumerate > 0) {
		/* begin fetchPointer:ofObject: */
		numOnThisPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
		numToEnumerateOnThisPage = ((numToEnumerate < numOnThisPage) ? numToEnumerate : numOnThisPage);
		topIndex = (numOnThisPage + ObjStackFixedSlots) - 1;
		for (i = topIndex; i >= ((topIndex - numToEnumerateOnThisPage) + 1); i += -1) {
			assert(isWeak(fetchPointerofObject(i, objStackPage)));
			weakling = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
			/* begin nilUnmarkedWeaklingSlotsIn: */
			anyUnmarked1 = 0;
			assert(allStrongSlotsOfWeaklingAreMarked(weakling));
			for (i1 = ((assert((formatOf(weakling)) == (weakArrayFormat())),
fixedFieldsOfClass(fetchClassOfNonImm(weakling)))), iLimiT = ((numSlotsOf(weakling)) - 1); i1 <= iLimiT; i1 += 1) {
				/* begin fetchPointer:ofObject: */
				referent = longAt((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
				if ((referent & (tagMask())) == 0) {
					if (((longAt(referent)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) {
						referent = fixFollowedFieldofObjectwithInitialValue(i1, weakling, referent);
					}
					if (!((referent & (tagMask()))
						 || (((((usqInt) (longAt(referent))) >> (markedBitFullShift())) & 1) != 0))) {
						assert(!(isOopForwarded(weakling)));
						longAtput((weakling + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), GIV(nilObj));
						anyUnmarked1 = 1;
					}
				}
			}
			anyUnmarked = anyUnmarked1;
			if (anyUnmarked) {

				/* fireFinalization: could grow the mournQueue and if so,
				   additional pages must be marked to avoid being GC'ed. */
				assert(GIV(marking));
				/* begin fireFinalization: */
				if (GIV(newFinalization)) {
					queueMourner(weakling);
				}
				/* begin signalFinalization: */
				forceInterruptCheck();
				GIV(pendingFinalizationSignals) += 1;
			}
		}
		numToEnumerate -= numToEnumerateOnThisPage;
		/* begin fetchPointer:ofObject: */
		objStackPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
	}
	emptyObjStack(GIV(weaklingStack));
}

	/* SpurMemoryManager>>#noCheckClassAtIndex: */
static sqInt NoDbgRegParms
noCheckClassAtIndex(sqInt classIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classTablePage;
    sqInt fieldIndex;
    sqInt fieldIndex1;

	/* begin fetchPointer:ofObject: */
	fieldIndex = ((usqInt) classIndex) >> (classTableMajorIndexShift());
	classTablePage = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (classTablePage == GIV(nilObj)) {
		return null;
	}
	/* begin fetchPointer:ofObject: */
	fieldIndex1 = classIndex & ((1U << (classTableMajorIndexShift())) - 1);
	return longAt((classTablePage + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
}


/*	Push an element on an objStack. Split from push:onObjStack: for testing. */

	/* SpurMemoryManager>>#noCheckPush:onObjStack: */
static sqInt NoDbgRegParms
noCheckPushonObjStack(sqInt objOop, sqInt objStack)
{
    sqInt topx;

	eassert(isValidObjStack(objStack));
	/* begin fetchPointer:ofObject: */
	topx = longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
	if (topx >= ObjStackLimit) {
		noCheckPushonObjStack(objOop, ensureRoomOnObjStackAt(longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackMyx) << (shiftForWord())))))));
	}
	else {
		/* begin storePointer:ofObjStack:withValue: */
		assert((formatOf(objStack)) == (wordIndexableFormat()));
		longAtput((objStack + BaseHeaderSize) + (((sqInt)((usqInt)((ObjStackFixedSlots + topx)) << (shiftForWord())))), objOop);
		/* begin storePointer:ofObjStack:withValue: */
		assert((formatOf(objStack)) == (wordIndexableFormat()));
		longAtput((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))), topx + 1);
	}
	return objOop;
}


/*	Make sure the oop at fieldIndex in anObject is not forwarded (follow the
	forwarder there-in if so). Answer the (possibly followed) oop at
	fieldIndex.  */

	/* SpurMemoryManager>>#noFixupFollowField:ofObject: */
static sqInt NoDbgRegParms
noFixupFollowFieldofObject(sqInt fieldIndex, sqInt anObject)
{
    sqInt objOop;
    sqInt referent;

	/* begin fetchPointer:ofObject: */
	objOop = longAt((anObject + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(objOop));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		objOop = referent;
	}
	return objOop;
}

	/* SpurMemoryManager>>#noInlineFollowForwarded: */
static sqInt NoDbgRegParms
noInlineFollowForwarded(sqInt objOop)
{
    sqInt referent;

	/* begin followForwarded: */
	assert(isUnambiguouslyForwarder(objOop));
	/* begin fetchPointer:ofMaybeForwardedObject: */
	referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
	while (((referent & (tagMask())) == 0)
	 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	return referent;
}


/*	Object parsing.
	1. all objects have at least a word following the header, for a forwarding
	pointer. 2. objects with an overflow size have a preceeing word with a
	saturated numSlots. If the word
	following an object doesn't have a saturated numSlots field it must be a
	single-header object.
	If the word following does have a saturated numSlots it must be the
	overflow size word. */

	/* SpurMemoryManager>>#noInlineObjectAfter:limit: */
static sqInt NoDbgRegParms
noInlineObjectAfterlimit(sqInt objOop, sqInt limit)
{
    sqInt followingWord;
    usqInt followingWordAddress;

	/* begin objectAfter:limit: */
	followingWordAddress = addressAfter(objOop);
	if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
		return limit;
	}
	flag("endianness");
	followingWord = longAt(followingWordAddress);
	return ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
		? followingWordAddress + BaseHeaderSize
		: followingWordAddress);
}

	/* SpurMemoryManager>>#nonIndexablePointerFormat */
sqInt
nonIndexablePointerFormat(void)
{
	return 1;
}

	/* SpurMemoryManager>>#noUnscannedEphemerons */
static sqInt
noUnscannedEphemerons(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((GIV(unscannedEphemerons).top)) == ((GIV(unscannedEphemerons).start));
}


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

	/* SpurMemoryManager>>#numBytesOfBytes: */
static sqInt NoDbgRegParms
numBytesOfBytes(sqInt objOop)
{
    sqInt fmt;

	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	assert(fmt >= (firstByteFormat()));
	return ((numSlotsOf(objOop)) << (shiftForWord())) - (fmt & 7);
}


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

	/* SpurMemoryManager>>#numBytesOf: */
sqInt
numBytesOf(sqInt objOop)
{
    sqInt fmt;
    usqInt numBytes;
    usqInt numSlots;

	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOf: */
	assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(objOop + 7);
	numBytes = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	numBytes = numBytes << (shiftForWord());
	if (fmt >= (firstByteFormat())) {

		/* bytes (the common case), including CompiledMethod */
		return numBytes - (fmt & 7);
	}
	if (fmt <= (sixtyFourBitIndexableFormat())) {
		return numBytes;
	}
	if (fmt >= (firstShortFormat())) {
		return numBytes - (((sqInt)((usqInt)((fmt & 3)) << 1)));
	}
	return numBytes - (((sqInt)((usqInt)((fmt & 1)) << 2)));
}


/*	Answer the number of pointer fields in the given object.
	Works with CompiledMethods, as well as ordinary objects. */

	/* SpurMemoryManager>>#numPointerSlotsOf: */
sqInt
numPointerSlotsOf(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt contextSize;
    sqInt fmt;
    sqInt header;
    sqInt header1;
    sqInt numLiterals;
    usqInt numSlots;
    sqInt sp;

	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	if (fmt <= 5 /* lastPointerFormat */) {
		if ((fmt == (indexablePointersFormat()))
		 && (((longAt(objOop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

			/* contexts end at the stack pointer */
			/* begin fetchStackPointerOf: */
			sp = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
			if (!((((sp) & 7) == 1))) {
				contextSize = 0;
				goto l2;
			}
			assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop)));
			contextSize = (sp >> 3);
	l2:	/* end fetchStackPointerOf: */;
			return CtxtTempFrameStart + contextSize;
		}
		/* begin numSlotsOf: */
		assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(objOop + 7);
		return (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
	}
	if (fmt == 7 /* forwardedFormat */) {
		return 1;
	}
	if (fmt < (firstCompiledMethodFormat())) {
		return 0;
	}
	/* begin methodHeaderOf: */
	assert(isCompiledMethod(objOop));
	header1 = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	assert((((header) & 7) == 1));
	numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
	return numLiterals + LiteralStart;
}


/*	A private internal version of numSlotsOf: that is happy to be applied to
	free or forwarded objects.
 */

	/* SpurMemoryManager>>#numSlotsOfAny: */
static usqInt NoDbgRegParms
numSlotsOfAny(sqInt objOop)
{
    usqInt numSlots;

	numSlots = byteAt(objOop + 7);
	return (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
}

	/* SpurMemoryManager>>#numSlotsOf: */
usqInt
numSlotsOf(sqInt objOop)
{
    usqInt numSlots;

	flag("endianness");
	assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(objOop + 7);
	return (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
}


/*	Answer the number of strong pointer fields in the given object,
	which is .expected not to be an active ephemeron.
	Works with CompiledMethods, as well as ordinary objects. */

	/* SpurMemoryManager>>#numStrongSlotsOfInephemeral: */
static sqInt NoDbgRegParms
numStrongSlotsOfInephemeral(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classFormat;
    sqInt contextSize;
    sqInt fmt;
    sqInt header;
    sqInt header1;
    sqInt numLiterals;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt sp;

	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	assert((fmt != (ephemeronFormat()))
	 || (isMarked(keyOfEphemeron(objOop))));
	if (fmt <= 5 /* lastPointerFormat */) {
		/* begin numSlotsOf: */
		assert((classIndexOf(objOop)) > (isForwardedObjectClassIndexPun()));
		numSlots1 = byteAt(objOop + 7);
		numSlots = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		if (fmt <= 2 /* arrayFormat */) {
			return numSlots;
		}
		if (fmt == (indexablePointersFormat())) {
			if (((longAt(objOop)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
				setTraceFlagOnContextsFramesPageIfNeeded(objOop);
				/* begin fetchStackPointerOf: */
				sp = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
				if (!((((sp) & 7) == 1))) {
					contextSize = 0;
					goto l3;
				}
				assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop)));
				contextSize = (sp >> 3);
	l3:	/* end fetchStackPointerOf: */;
				return CtxtTempFrameStart + contextSize;
			}
			return numSlots;
		}
		if (fmt == (weakArrayFormat())) {
			/* begin fixedFieldsOfClass: */
			objOop1 = fetchClassOfNonImm(objOop);
			/* begin fixedFieldsOfClassFormat: */
			classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
			return classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
		}
	}
	if (fmt == 7 /* forwardedFormat */) {
		return 1;
	}
	if (fmt < (firstCompiledMethodFormat())) {
		return 0;
	}
	/* begin methodHeaderOf: */
	assert(isCompiledMethod(objOop));
	header1 = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	assert((((header) & 7) == 1));
	numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
	return numLiterals + LiteralStart;
}


/*	Answer the number of strong pointer fields in the given weakling. */

	/* SpurMemoryManager>>#numStrongSlotsOfWeakling: */
sqInt
numStrongSlotsOfWeakling(sqInt objOop)
{
    sqInt classFormat;
    sqInt objOop1;

	assert((formatOf(objOop)) == (weakArrayFormat()));
	/* begin fixedFieldsOfClass: */
	objOop1 = fetchClassOfNonImm(objOop);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	return classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
}


/*	Object parsing.
	1. all objects have at least a word following the header, for a forwarding
	pointer. 2. objects with an overflow size have a preceeing word with a
	saturated slotSize. If the word following
	an object doesn't have a saturated size field it must be a single-header
	object. If the word following
	does have a saturated slotSize it must be the overflow size word. */

	/* SpurMemoryManager>>#objectAfter: */
sqInt
objectAfter(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    sqInt followingWord3;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt followingWordAddress3;
    sqInt limit;

	if (oopisLessThan(objOop, GIV(newSpaceLimit))) {
		if (oopisGreaterThanOrEqualToandLessThan(objOop, ((eden()).start), GIV(freeStart))) {
			/* begin objectAfter:limit: */
			followingWordAddress = addressAfter(objOop);
			if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(freeStart))) {
				return GIV(freeStart);
			}
			flag("endianness");
			followingWord = longAt(followingWordAddress);
			return ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress + BaseHeaderSize
				: followingWordAddress);
		}
		if (oopisGreaterThanOrEqualToandLessThan(objOop, ((pastSpace()).start), GIV(pastSpaceStart))) {
			/* begin objectAfter:limit: */
			followingWordAddress1 = addressAfter(objOop);
			if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) {
				return GIV(pastSpaceStart);
			}
			flag("endianness");
			followingWord1 = longAt(followingWordAddress1);
			return ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress1 + BaseHeaderSize
				: followingWordAddress1);
		}
		/* begin objectAfter:limit: */
		limit = futureSurvivorStart();
		followingWordAddress2 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, limit)) {
			return limit;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		return ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	}
	/* begin objectAfter:limit: */
	followingWordAddress3 = addressAfter(objOop);
	if (oopisGreaterThanOrEqualTo(followingWordAddress3, GIV(endOfMemory))) {
		return GIV(endOfMemory);
	}
	flag("endianness");
	followingWord3 = longAt(followingWordAddress3);
	return ((((usqInt) followingWord3) >> (numSlotsFullShift())) == (numSlotsMask())
		? followingWordAddress3 + BaseHeaderSize
		: followingWordAddress3);
}

	/* SpurMemoryManager>>#objectBefore: */
sqInt
objectBefore(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop2;
    sqInt prev;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	prev = null;
	if (oopisLessThan(objOop, GIV(newSpaceLimit))) {
		/* begin allNewSpaceEntitiesDo: */

		/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
		   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
		prevPrevObj = (prevObj = null);
		assert((((pastSpace()).start)) < (((eden()).start)));
		/* begin objectStartingAt: */
		address = ((pastSpace()).start);
		numSlots = byteAt(address + 7);
		objOop1 = (numSlots == (numSlotsMask())
			? address + BaseHeaderSize
			: address);
		limit = GIV(pastSpaceStart);
		while (oopisLessThan(objOop1, limit)) {
			if (oopisGreaterThanOrEqualTo(objOop1, objOop)) {
				return prev;
			}
			prev = objOop1;
			prevPrevObj = prevObj;
			prevObj = objOop1;
			/* begin objectAfter:limit: */
			followingWordAddress = addressAfter(objOop1);
			if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
				objOop1 = limit;
				goto l1;
			}
			flag("endianness");
			followingWord = longAt(followingWordAddress);
			objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress + BaseHeaderSize
				: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
		}
		/* begin objectStartingAt: */
		address1 = ((eden()).start);
		numSlots1 = byteAt(address1 + 7);
		objOop1 = (numSlots1 == (numSlotsMask())
			? address1 + BaseHeaderSize
			: address1);
		while (oopisLessThan(objOop1, GIV(freeStart))) {
			if (oopisGreaterThanOrEqualTo(objOop1, objOop)) {
				return prev;
			}
			prev = objOop1;
			prevPrevObj = prevObj;
			prevObj = objOop1;
			/* begin objectAfter:limit: */
			followingWordAddress1 = addressAfter(objOop1);
			if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
				objOop1 = GIV(freeStart);
				goto l2;
			}
			flag("endianness");
			followingWord1 = longAt(followingWordAddress1);
			objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress1 + BaseHeaderSize
				: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
		}
		return prev;
	}
	/* begin allOldSpaceEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop2 = GIV(nilObj);
	while (1) {
		assert((objOop2 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop2, GIV(endOfMemory)))) break;
		assert((long64At(objOop2)) != 0);
		if (oopisGreaterThanOrEqualTo(objOop2, objOop)) {
			return prev;
		}
		prev = objOop2;
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop2;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop2);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop2 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop2 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	return prev;
}


/*	For enumerating objects find the header of the first object in a space.
	If the object starts with an overflow size field it will start at the next
	allocationUnit. c.f. numSlotsOf: */

	/* SpurMemoryManager>>#objectStartingAt: */
static sqInt NoDbgRegParms
objectStartingAt(sqInt address)
{
    usqInt numSlots;

	numSlots = byteAt(address + 7);
	return (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
}


/*	This is part of storeImageSegmentInto:outPointers:roots:.
	Answer an Array of all the objects only reachable from the argument, an
	Array of root objects,
	starting with arrayOfRoots. If there is no space, answer a SmallInteger
	whose value is the
	number of slots required. This is used to collect the objects to include
	in an image segment
	on Spur, separate from creating the segment, hence simplifying the
	implementation. Thanks to Igor Stasenko for this idea. */

	/* SpurMemoryManager>>#objectsReachableFromRoots: */
static sqInt NoDbgRegParms NeverInline
objectsReachableFromRoots(sqInt arrayOfRoots)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt count;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt freeChunk;
    sqInt i;
    sqInt i1;
    sqInt i2;
    sqInt iLimiT;
    sqInt iLimiT1;
    sqInt iLimiT2;
    usqInt limit;
    usqInt limit1;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop2;
    sqInt objOop3;
    sqInt oop;
    sqInt oop1;
    sqInt oop2;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    usqInt ptr;
    sqInt referent;
    usqInt start;


	/* & hence start & ptr are too; limit is also because of addressAfter: */
	assert(isArray(arrayOfRoots));
	assert(allObjectsUnmarked());
	/* begin markObjectsIn: */
	assert(!(isFreeObject(arrayOfRoots)));
	longAtput(arrayOfRoots, (longAt(arrayOfRoots)) | (1ULL << (markedBitFullShift())));
	for (i1 = 0, iLimiT1 = ((numSlotsOf(arrayOfRoots)) - 1); i1 <= iLimiT1; i1 += 1) {
		/* begin followField:ofObject: */
		objOop1 = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
		if (((objOop1 & (tagMask())) == 0)
		 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop1 = fixFollowedFieldofObjectwithInitialValue(i1, arrayOfRoots, objOop1);
		}
		oop1 = objOop1;
		if ((oop1 & (tagMask())) == 0) {
			/* begin setIsMarkedOf:to: */
			assert(!(isFreeObject(oop1)));
			longAtput(oop1, (longAt(oop1)) | (1ULL << (markedBitFullShift())));
		}
	}
	markObjects(0);
	assert(isEmptyObjStack(GIV(markStack)));
	assert(isEmptyObjStack(GIV(weaklingStack)));
	assert(noUnscannedEphemerons());
	/* begin unmarkObjectsIn: */
	for (i2 = 0, iLimiT2 = ((numSlotsOf(arrayOfRoots)) - 1); i2 <= iLimiT2; i2 += 1) {
		/* begin followField:ofObject: */
		objOop2 = longAt((arrayOfRoots + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord())))));
		if (((objOop2 & (tagMask())) == 0)
		 && (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop2 = fixFollowedFieldofObjectwithInitialValue(i2, arrayOfRoots, objOop2);
		}
		oop2 = objOop2;
		if ((oop2 & (tagMask())) == 0) {
			/* begin setIsMarkedOf:to: */
			assert(!(isFreeObject(oop2)));
			longAtput(oop2, (longAt(oop2)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
		}
	}

	/* N.B. Does /not/ update totalFreeOldSpace */
	freeChunk = allocateLargestFreeChunk();

	/* but must update so that growth in the markStack does not cause assert fails. */
	GIV(totalFreeOldSpace) -= bytesInObject(freeChunk);
	ptr = (start = freeChunk + BaseHeaderSize);
	limit = addressAfter(freeChunk);

	/* First put the arrayOfRoots; order is important. */
	count = 0;
	noCheckPushonObjStack(arrayOfRoots, GIV(markStack));
	while (!(isEmptyObjStack(GIV(markStack)))) {
		objOop = popObjStack(GIV(markStack));
		assert(isMarked(objOop));
		count += 1;
		if (ptr < limit) {
			longAtput(ptr, objOop);
			ptr += BytesPerOop;
		}
		oop = fetchClassOfNonImm(objOop);
		if (!(((((usqInt) (longAt(oop))) >> (markedBitFullShift())) & 1) != 0)) {
			/* begin setIsMarkedOf:to: */
			assert(!(isFreeObject(oop)));
			longAtput(oop, (longAt(oop)) | (1ULL << (markedBitFullShift())));
			noCheckPushonObjStack(oop, GIV(markStack));
		}
		if ((((longAt(objOop)) & (classIndexMask())) == ClassMethodContextCompactIndex)
		 && ((((((longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(objOop))))) {

			/* widow now, before the copy loop */
			for (i = 0, iLimiT = ((numSlotsOfMarriedContext(objOop)) - 1); i <= iLimiT; i += 1) {
				oop = fetchPointerofMarriedContext(i, objOop);
				if (!((oop & (tagMask()))
					 || (((((usqInt) (longAt(oop))) >> (markedBitFullShift())) & 1) != 0))) {
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(oop)));
					longAtput(oop, (longAt(oop)) | (1ULL << (markedBitFullShift())));
					noCheckPushonObjStack(oop, GIV(markStack));
				}
			}
		}
		else {
			for (i = 0, iLimiT = ((numPointerSlotsOf(objOop)) - 1); i <= iLimiT; i += 1) {
				/* begin fetchPointer:ofObject: */
				oop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
				if (!((oop & (tagMask()))
					 || (((((usqInt) (longAt(oop))) >> (markedBitFullShift())) & 1) != 0))) {
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(oop)));
					longAtput(oop, (longAt(oop)) | (1ULL << (markedBitFullShift())));
					noCheckPushonObjStack(oop, GIV(markStack));
				}
			}
		}
	}
	/* begin unmarkAllObjects */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (((((usqInt) (longAt(objOop11))) >> (markedBitFullShift())) & 1) != 0) {
			if (((longAt(objOop11)) & (classIndexMask())) > (lastClassIndexPun())) {
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(objOop11)));
				longAtput(objOop11, (longAt(objOop11)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			}
			else {
				if (!(((longAt(objOop11)) & (classIndexMask())) == (segmentBridgePun()))) {
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(objOop11)));
					longAtput(objOop11, (longAt(objOop11)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
				}
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l9;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l9:	/* end objectAfter:limit: */;
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop3 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit1 = GIV(pastSpaceStart);
	while (oopisLessThan(objOop3, limit1)) {
		if (((((usqInt) (longAt(objOop3))) >> (markedBitFullShift())) & 1) != 0) {
			if (((longAt(objOop3)) & (classIndexMask())) > (lastClassIndexPun())) {
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(objOop3)));
				longAtput(objOop3, (longAt(objOop3)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			}
			else {
				if (!(((longAt(objOop3)) & (classIndexMask())) == (segmentBridgePun()))) {
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(objOop3)));
					longAtput(objOop3, (longAt(objOop3)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop3;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop3);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit1)) {
			objOop3 = limit1;
			goto l11;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop3 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l11:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop3 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop3, GIV(freeStart))) {
		if (((((usqInt) (longAt(objOop3))) >> (markedBitFullShift())) & 1) != 0) {
			if (((longAt(objOop3)) & (classIndexMask())) > (lastClassIndexPun())) {
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(objOop3)));
				longAtput(objOop3, (longAt(objOop3)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			}
			else {
				if (!(((longAt(objOop3)) & (classIndexMask())) == (segmentBridgePun()))) {
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(objOop3)));
					longAtput(objOop3, (longAt(objOop3)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop3;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop3);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop3 = GIV(freeStart);
			goto l13;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop3 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l13:	/* end objectAfter:limit: */;
	}
	if ((count > ((ptr - start) / BytesPerOop))
	 || ((limit != ptr)
	 && ((limit - ptr) <= 8 /* allocationUnit */))) {

		/* can't split a single word */
		freeObject(freeChunk);
		/* begin checkFreeSpace: */
		assert(bitsSetInFreeSpaceMaskForAllFreeLists());
		assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
		if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) {
			runLeakCheckerForFreeSpace(GCModeFreeSpace);
		}
		return (((usqInt)count << 3) | 1);
	}
	/* begin setFormatOf:to: */
	assert(((2 /* arrayFormat */ >= 0) && (2 /* arrayFormat */ <= (formatMask()))));
	longAtput(freeChunk, ((longAt(freeChunk)) & (~(usqIntptr_t)(((sqInt)((usqInt)((formatMask())) << (formatShift())))))) + (2U << (formatShift())));
	/* begin setClassIndexOf:to: */
	assert(((ClassArrayCompactIndex >= 0) && (ClassArrayCompactIndex <= (classIndexMask()))));
	longAtput(freeChunk, ((longAt(freeChunk)) & (~(usqIntptr_t)(classIndexMask()))) + ClassArrayCompactIndex);
	shortentoIndexableSize(freeChunk, count);
	if (((longAt(freeChunk)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(freeChunk));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		freeChunk = referent;
	}
	/* begin possibleRootStoreInto: */
	if (!(((((usqInt) (longAt(freeChunk))) >> (rememberedBitShift())) & 1) != 0)) {
		remember(freeChunk);
	}
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeImageSegment)) == (GCModeFreeSpace | GCModeImageSegment))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	runLeakCheckerFor(GCModeImageSegment);
	return freeChunk;
}


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

	/* SpurMemoryManager>>#obsoleteDontUseThisFetchWord:ofObject: */
sqInt
obsoleteDontUseThisFetchWordofObject(sqInt fieldIndex, sqInt oop)
{
	/* begin fetchLong32:ofObject: */
	return long32At((oop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << 2))));
}


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

	/* SpurMemoryManager>>#okayOop: */
static sqInt NoDbgRegParms
okayOop(sqInt signedOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt fmt;
    usqInt oop;
    usqLong unusedBits;
    int unusedBitsInYoungObjects;


	/* address and size checks */
	oop = ((usqInt) signedOop);
	if (oop & (tagMask())) {
		return 1;
	}
	if (!(addressCouldBeObj(oop))) {
		error("oop is not a valid address");
		return 0;
	}
	if (!(oopisLessThanOrEqualTo(addressAfter(oop), GIV(endOfMemory)))) {
		error("oop size would make it extend beyond the end of memory");
		return 0;
	}
	if (!(((classIndex = (longAt(oop)) & (classIndexMask()))) >= (firstClassIndexPun()))) {
		error("oop is a free chunk, or bridge, not an object");
		return 0;
	}
	if (((byteAt(oop + 7)) == (numSlotsMask()))
	 && ((byteAt((oop - BaseHeaderSize) + 7)) != (numSlotsMask()))) {
		error("oop header has overflow header word, but overflow word does not have a saturated numSlots field");
		return 0;
	}
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	if ((fmt == 6) || (fmt == 8)) {
		error("oop has an unknown format type");
		return 0;
	}
	if ((fmt == 7 /* forwardedFormat */) != (classIndex == (isForwardedObjectClassIndexPun()))) {
		error("oop has mis-matched format/classIndex fields; only one of them is the isForwarded value");
		return 0;
	}
	unusedBits = (1U << 22 /* classIndexFieldWidth */) | (1ULL << (22 /* identityHashFieldWidth */ + 32));
	if (((long64At(oop)) & unusedBits) != 0) {
		error("some unused header bits are set; should be zero");
		return 0;
	}
	unusedBitsInYoungObjects = ((1U << (greyBitShift())) | (1U << (pinnedBitShift()))) | (1U << (rememberedBitShift()));
	if (((longAt(oop)) & unusedBitsInYoungObjects) != 0) {
		error("some header bits unused in young objects are set; should be zero");
		return 0;
	}
	return 1;
}


/*	Object parsing.
	1. all objects have at least a word following the header, for a forwarding
	pointer. 2. objects with an overflow size have a preceeing word with a
	saturated slotSize. If the word following
	an object doesn't have a saturated size field it must be a single-header
	object. If the word following
	does have a saturated slotSize it must be the overflow size word. */

	/* SpurMemoryManager>>#oldSpaceObjectAfter: */
sqInt
oldSpaceObjectAfter(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt followingWord;
    usqInt followingWordAddress;

	/* begin objectAfter:limit: */
	followingWordAddress = addressAfter(objOop);
	if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
		return GIV(endOfMemory);
	}
	flag("endianness");
	followingWord = longAt(followingWordAddress);
	return ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
		? followingWordAddress + BaseHeaderSize
		: followingWordAddress);
}


/*	in an effort to fix a compiler bug with two-way become post r3427 */
/*	Allocate two new objects, n1 & n2. Copy the contents appropriately.
	Convert obj1 and obj2 into forwarding objects pointing to n2 and n1
	respectively  */

	/* SpurMemoryManager>>#outOfPlaceBecome:and:copyHashFlag: */
static void NoDbgRegParms NeverInline
outOfPlaceBecomeandcopyHashFlag(sqInt obj1, sqInt obj2, sqInt copyHashFlag)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt classIndex1;
    sqInt clone1;
    sqInt clone2;
    sqInt hash;
    sqInt hash1;
    sqInt hash2;
    sqInt hash3;

	clone1 = (((longAt(obj1)) & (classIndexMask())) == ClassMethodContextCompactIndex
		? cloneContext(obj1)
		: clone(obj1));
	clone2 = (((longAt(obj2)) & (classIndexMask())) == ClassMethodContextCompactIndex
		? cloneContext(obj2)
		: clone(obj2));
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(obj1))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		/* begin setIsImmutableOf:to: */
		longAtput(clone1, (longAt(clone1)) | (1U << (immutableBitShift())));
	}
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(obj2))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		/* begin setIsImmutableOf:to: */
		longAtput(clone2, (longAt(clone2)) | (1U << (immutableBitShift())));
	}
	if (copyHashFlag) {
		/* begin setHashBitsOf:to: */
		hash = (long32At(obj1 + 4)) & (identityHashHalfWordMask());
		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
		long32Atput(clone1 + 4, ((((long32At(clone1 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash);
		/* begin setHashBitsOf:to: */
		hash1 = (long32At(obj2 + 4)) & (identityHashHalfWordMask());
		assert(((hash1 >= 0) && (hash1 <= (identityHashHalfWordMask()))));
		long32Atput(clone2 + 4, ((((long32At(clone2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash1);
	}
	else {
		/* begin setHashBitsOf:to: */
		hash2 = (long32At(obj2 + 4)) & (identityHashHalfWordMask());
		assert(((hash2 >= 0) && (hash2 <= (identityHashHalfWordMask()))));
		long32Atput(clone1 + 4, ((((long32At(clone1 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash2);
		/* begin setHashBitsOf:to: */
		hash3 = (long32At(obj1 + 4)) & (identityHashHalfWordMask());
		assert(((hash3 >= 0) && (hash3 <= (identityHashHalfWordMask()))));
		long32Atput(clone2 + 4, ((((long32At(clone2 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash3);
	}
	/* begin forward:to: */
	classIndex = isForwardedObjectClassIndexPun();
	assert(((classIndex >= 0) && (classIndex <= (classIndexMask()))));
	assert(((7 /* forwardedFormat */ >= 0) && (7 /* forwardedFormat */ <= (formatMask()))));
	longAtput(obj1, ((longAt(obj1)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift()))));
	
#  if IMMUTABILITY
	/* begin setIsImmutableOf:to: */
	longAtput(obj1, (longAt(obj1)) & (~(usqIntptr_t)(1U << (immutableBitShift()))));
#  endif /* IMMUTABILITY */
	/* begin storePointer:ofForwarder:withValue: */
	assert(isForwarded(obj1));
	assert(!(isOopForwarded(clone2)));
	if ((assert(isNonImmediate(obj1)),
	oopisGreaterThanOrEqualTo(obj1, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((clone2 & (tagMask())) == 0)
		 && (oopisLessThan(clone2, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(obj1))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(obj1);
			}
		}
	}
	longAtput((obj1 + BaseHeaderSize) + (0U << (shiftForWord())), clone2);
	if ((byteAt(obj1 + 7)) == 0) {
		byteAtput(obj1 + 7, 1);
	}
	/* begin forward:to: */
	classIndex1 = isForwardedObjectClassIndexPun();
	assert(((classIndex1 >= 0) && (classIndex1 <= (classIndexMask()))));
	assert(((7 /* forwardedFormat */ >= 0) && (7 /* forwardedFormat */ <= (formatMask()))));
	longAtput(obj2, ((longAt(obj2)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex1 + (7U << (formatShift()))));
	
#  if IMMUTABILITY
	/* begin setIsImmutableOf:to: */
	longAtput(obj2, (longAt(obj2)) & (~(usqIntptr_t)(1U << (immutableBitShift()))));
#  endif /* IMMUTABILITY */
	/* begin storePointer:ofForwarder:withValue: */
	assert(isForwarded(obj2));
	assert(!(isOopForwarded(clone1)));
	if ((assert(isNonImmediate(obj2)),
	oopisGreaterThanOrEqualTo(obj2, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((clone1 & (tagMask())) == 0)
		 && (oopisLessThan(clone1, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(obj2))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(obj2);
			}
		}
	}
	longAtput((obj2 + BaseHeaderSize) + (0U << (shiftForWord())), clone1);
	if ((byteAt(obj2 + 7)) == 0) {
		byteAtput(obj2 + 7, 1);
	}
	if ((((assert(isNonImmediate(obj1)),
	oopisLessThan(obj1, GIV(newSpaceLimit)))) != ((assert(isNonImmediate(clone2)),
	oopisLessThan(clone2, GIV(newSpaceLimit)))))
	 || (((assert(isNonImmediate(obj2)),
	oopisLessThan(obj2, GIV(newSpaceLimit)))) != ((assert(isNonImmediate(clone1)),
	oopisLessThan(clone1, GIV(newSpaceLimit)))))) {
		GIV(becomeEffectsFlags) = GIV(becomeEffectsFlags) | OldBecameNewFlag;
	}
}


/*	Attempt to pin objOop, which must not be immediate.
	If the attempt succeeds answer objOop's (possibly moved) oop.
	If the attempt fails, which can only occur if there is no memory, answer
	0.  */

	/* SpurMemoryManager>>#pinObject: */
sqInt
pinObject(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classIndex;
    sqInt i;
    sqInt oldClone;
    sqInt referent;
    SpurSegmentInfo *seg;

	assert(isNonImmediate(objOop));
	flag("policy decision here. if already old, do we clone in a segment containing pinned objects or merely pin?");
	if ((assert(isNonImmediate(objOop)),
	oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) {
		if ((numBytesOf(objOop)) > (1024 * 1024)) {
			/* begin setIsPinnedOf:to: */
			longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift())));
			return objOop;
		}
		/* begin segmentContainingObj: */
		for (i = (GIV(numSegments) - 1); i >= 0; i += -1) {
			if (objOop >= (((GIV(segments)[i]).segStart))) {
				seg = (&(GIV(segments)[i]));
				goto l1;
			}
		}
		seg = null;
	l1:	/* end segmentContainingObj: */;
		if ((seg->containsPinned)) {
			/* begin setIsPinnedOf:to: */
			longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift())));
			return objOop;
		}
		if (!(someSegmentContainsPinned())) {
			/* begin setIsPinnedOf:to: */
			longAtput(objOop, (longAt(objOop)) | (1U << (pinnedBitShift())));
			(seg->containsPinned = 1);
			return objOop;
		}
	}
	oldClone = cloneInOldSpaceforPinning(objOop, 1);
	if (oldClone != 0) {
		GIV(becomeEffectsFlags) = becomeEffectFlagsFor(objOop);
		/* begin setIsPinnedOf:to: */
		longAtput(oldClone, (longAt(oldClone)) | (1U << (pinnedBitShift())));
		/* begin forward:to: */
		classIndex = isForwardedObjectClassIndexPun();
		assert(((classIndex >= 0) && (classIndex <= (classIndexMask()))));
		assert(((7 /* forwardedFormat */ >= 0) && (7 /* forwardedFormat */ <= (formatMask()))));
		longAtput(objOop, ((longAt(objOop)) & (~(usqIntptr_t)((((sqInt)((usqInt)((formatMask())) << (formatShift())))) + (classIndexMask())))) + (classIndex + (7U << (formatShift()))));
		
#    if IMMUTABILITY
		/* begin setIsImmutableOf:to: */
		longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1U << (immutableBitShift()))));
#    endif /* IMMUTABILITY */
		/* begin storePointer:ofForwarder:withValue: */
		assert(isForwarded(objOop));
		assert(!(isOopForwarded(oldClone)));
		if ((assert(isNonImmediate(objOop)),
		oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((oldClone & (tagMask())) == 0)
			 && (oopisLessThan(oldClone, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(objOop);
				}
			}
		}
		longAtput((objOop + BaseHeaderSize) + (0U << (shiftForWord())), oldClone);
		if ((byteAt(objOop + 7)) == 0) {
			byteAtput(objOop + 7, 1);
		}
		/* begin followSpecialObjectsOop */
		if (((longAt(GIV(specialObjectsOop))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(GIV(specialObjectsOop)));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent & (tagMask())) == 0)
			 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			GIV(specialObjectsOop) = referent;
		}
		followForwardedObjectFieldstoDepth(GIV(specialObjectsOop), 0);
		/* begin postBecomeAction: */
		spurPostBecomeAction(GIV(becomeEffectsFlags));
		if (GIV(becomeEffectsFlags) & OldBecameNewFlag) {
			addAllToYoungReferrers();
		}
		cogitPostGCAction(GIV(gcMode));
		/* begin nilUncoggableMethods */
		GIV(lastCoggableInterpretedBlockMethod) = (GIV(lastUncoggableInterpretedBlockMethod) = null);
		GIV(gcMode) = 0;
		postBecomeScanClassTable(GIV(becomeEffectsFlags));
		GIV(becomeEffectsFlags) = 0;
	}
	return oldClone;
}

	/* SpurMemoryManager>>#popObjStack: */
static sqInt NoDbgRegParms
popObjStack(sqInt objStack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt myx;
    sqInt nextPage;
    sqInt top;
    sqInt topx;

	eassert(isValidObjStack(objStack));
	/* begin fetchPointer:ofObject: */
	topx = longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
	if (topx == 0) {
		assert((fetchPointerofObject(ObjStackNextx, objStack)) == 0);
		return null;
	}
	topx -= 1;
	/* begin fetchPointer:ofObject: */
	top = longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)((topx + ObjStackFixedSlots)) << (shiftForWord())))));
	/* begin storePointer:ofObjStack:withValue: */
	assert((formatOf(objStack)) == (wordIndexableFormat()));
	longAtput((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))), topx);
	if ((topx == 0)
	 && (((nextPage = longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord()))))))) != 0)) {
		/* begin storePointer:ofObjStack:withValue: */
		assert((formatOf(nextPage)) == (wordIndexableFormat()));
		longAtput((nextPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))), objStack);
		/* begin storePointer:ofObjStack:withValue: */
		assert((formatOf(objStack)) == (wordIndexableFormat()));
		longAtput((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))), 0);
		/* begin fetchPointer:ofObject: */
		myx = longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackMyx) << (shiftForWord())))));
		/* begin updateRootOfObjStackAt:with: */
		assert(!(isForwarded(GIV(hiddenRootsObj))));
		if ((assert(isNonImmediate(GIV(hiddenRootsObj))),
		oopisGreaterThanOrEqualTo(GIV(hiddenRootsObj), GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((nextPage & (tagMask())) == 0)
			 && (oopisLessThan(nextPage, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(GIV(hiddenRootsObj)))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(GIV(hiddenRootsObj));
				}
			}
		}
		longAtput((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(myx) << (shiftForWord())))), nextPage);
		
		switch (myx) {
		case MarkStackRootIndex:
			GIV(markStack) = nextPage;
			break;
		case WeaklingStackRootIndex:
			GIV(weaklingStack) = nextPage;
			break;
		case MournQueueRootIndex:
			GIV(mournQueue) = nextPage;
			break;
		default:
			error("Case not found and no otherwise clause");
		}
		eassert(isValidObjStack(nextPage));
	}
	else {
		eassert(isValidObjStack(objStack));
	}
	return top;
}


/*	Pop and return the possibly remapped object from the remap buffer.
	We support this excessence for compatibility with ObjectMemory.
	Spur doesn't GC during allocation. */

	/* SpurMemoryManager>>#popRemappableOop */
sqInt
popRemappableOop(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;

	oop = GIV(remapBuffer)[GIV(remapBufferCount)];
	GIV(remapBufferCount) -= 1;
	return oop;
}


/*	Scan the class table post-become (iff an active class object was becommed)
	to ensure no
	forwarding pointers, and no unhashed classes exist in the class table.
	
	Note that one-way become can cause duplications in the class table.
	When can these be eliminated? We use the classTableBitmap to mark
	classTable entries
	(not the classes themselves, since marking a class doesn't help in knowing
	if its index is used).
	On image load, and during incrememtal scan-mark and full GC, classIndices
	are marked.
	We can somehow avoid following classes from the classTable until after
	this mark phase. */

	/* SpurMemoryManager>>#postBecomeScanClassTable: */
static void NoDbgRegParms
postBecomeScanClassTable(sqInt effectsFlags)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classOrNil;
    sqInt i;
    sqInt j;
    sqInt jLimiT;
    sqInt page;
    sqInt referent;

	assert(validClassTableRootPages());
	if (!(effectsFlags & BecamePointerObjectFlag)) {
		return;
	}
	for (i = 0; i < GIV(numClassTablePages); i += 1) {
		/* begin fetchPointer:ofObject: */
		page = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		assert(!(isForwarded(page)));
		for (j = 0, jLimiT = ((numSlotsOf(page)) - 1); j <= jLimiT; j += 1) {
			/* begin fetchPointer:ofObject: */
			classOrNil = longAt((page + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))));
			if (classOrNil != GIV(nilObj)) {
				if (((longAt(classOrNil)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					/* begin followForwarded: */
					assert(isUnambiguouslyForwarder(classOrNil));
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((classOrNil + BaseHeaderSize) + (0U << (shiftForWord())));
					while (((referent & (tagMask())) == 0)
					 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
					}
					classOrNil = referent;
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(page)));
					if ((assert(isNonImmediate(page)),
					oopisGreaterThanOrEqualTo(page, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((classOrNil & (tagMask())) == 0)
						 && (oopisLessThan(classOrNil, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(page))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(page);
							}
						}
					}
					longAtput((page + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))), classOrNil);
				}
				if (((long32At(classOrNil + 4)) & (identityHashHalfWordMask())) == 0) {
					assert(!(isOopForwarded(page)));
					longAtput((page + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))), GIV(nilObj));
					if (((((sqInt)((usqInt)(i) << (classTableMajorIndexShift())))) + j) < GIV(classTableIndex)) {
						GIV(classTableIndex) = (((sqInt)((usqInt)(i) << (classTableMajorIndexShift())))) + j;
					}
				}
			}
		}
	}
	assert(GIV(classTableIndex) >= (1U << (classTableMajorIndexShift())));
}

	/* SpurMemoryManager>>#primitiveErrorTable */
sqInt
primitiveErrorTable(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(PrimErrTableIndex) << (shiftForWord())))));
}


/*	Scan the heap printing the oops of any and all contexts that refer to
	anOop 
 */

	/* SpurMemoryManager>>#printActivationsOf: */
void
printActivationsOf(sqInt aMethodObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if ((((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)
		 && (aMethodObj == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))))))) {
			printHex(objOop1);
			/* begin space */
			putchar(' ');
			printOopShort(objOop1);
			print(" pc ");
			printHex(longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))));
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if ((((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)
		 && (aMethodObj == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))))))) {
			printHex(objOop1);
			/* begin space */
			putchar(' ');
			printOopShort(objOop1);
			print(" pc ");
			printHex(longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))));
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if ((((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex)
			 && (aMethodObj == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))))))) {
				printHex(objOop11);
				/* begin space */
				putchar(' ');
				printOopShort(objOop11);
				print(" pc ");
				printHex(longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))));
				/* begin cr */
				printf("\n");
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	}

	/* SpurMemoryManager>>#printBogons */
void
printBogons(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin printTheBogons: */
	print("bogon ");
	printf("0x%" PRIxSQINT "", GIV(bogon));
	/* begin cr */
	printf("\n");
	print("anomaly ");
	printf("0x%" PRIxSQINT "", GIV(anomaly));
	/* begin cr */
	printf("\n");
}


/*	Scan the heap printing the oops of any and all contexts that refer to
	anOop 
 */

	/* SpurMemoryManager>>#printContextReferencesTo: */
void
printContextReferencesTo(sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt i;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
			i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1));
			while (((i -= 1)) >= 0) {
				if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
					printHex(objOop1);
					print(" @ ");
					printNum(i);
					/* begin space */
					putchar(' ');
					printOopShort(objOop1);
					print(" pc ");
					printHex(longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))));
					/* begin cr */
					printf("\n");
					i = 0;
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
			i = CtxtTempFrameStart + (fetchStackPointerOf(objOop1));
			while (((i -= 1)) >= 0) {
				if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
					printHex(objOop1);
					print(" @ ");
					printNum(i);
					/* begin space */
					putchar(' ');
					printOopShort(objOop1);
					print(" pc ");
					printHex(longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))));
					/* begin cr */
					printf("\n");
					i = 0;
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
				i = CtxtTempFrameStart + (fetchStackPointerOf(objOop11));
				while (((i -= 1)) >= 0) {
					if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
						printHex(objOop11);
						print(" @ ");
						printNum(i);
						/* begin space */
						putchar(' ');
						printOopShort(objOop11);
						print(" pc ");
						printHex(longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))));
						/* begin cr */
						printf("\n");
						i = 0;
					}
				}
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	}

	/* SpurMemoryManager>>#printEntity: */
void
printEntity(sqInt oop)
{
    usqInt n;
    usqInt n1;
    usqInt n2;
    sqInt printFlags;

	printFlags = 0;
	printHex(oop);
	/* begin space */
	putchar(' ');
	if (!(addressCouldBeObj(oop))) {
		print((oop & (tagMask())
			? "immediate"
			: "unknown"));
		return;
	}
	print((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())
		? "free"
		: (((longAt(oop)) & (classIndexMask())) == (segmentBridgePun())
				? "bridge"
				: (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0
						? "forwarder"
						: (((longAt(oop)) & (classIndexMask())) <= (lastClassIndexPun())
								? ((printFlags = 1),
									"pun/obj stack")
								: ((printFlags = 1),
									"object"))))));
	/* begin space */
	putchar(' ');
	/* begin printHexnpnp: */
	n1 = byteAt(oop + 7);
	printf("%" PRIxSQINT "", n1);
	print("/");
	/* begin printHexnpnp: */
	n2 = bytesInObject(oop);
	printf("%" PRIxSQINT "", n2);
	print("/");
	printNum(bytesInObject(oop));
	if (printFlags) {
		/* begin space */
		putchar(' ');
		print((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 15
			? "f:0"
			: "f:"));
		/* begin printHexnpnp: */
		n = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
		printf("%" PRIxSQINT "", n);
		print((((((usqInt) (longAt(oop))) >> (greyBitShift())) & 1) != 0
			? " g"
			: " ."));
		print((((((usqInt) (longAt(oop))) >> (immutableBitShift())) & 1) != 0
			? "i"
			: "."));
		print((((((usqInt) (longAt(oop))) >> (markedBitFullShift())) & 1) != 0
			? "m"
			: "."));
		print((((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0
			? "p"
			: "."));
		print((((((usqInt) (longAt(oop))) >> (rememberedBitShift())) & 1) != 0
			? "r"
			: "."));
	}
	/* begin cr */
	printf("\n");
}

	/* SpurMemoryManager>>#printForwarders */
void
printForwarders(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop2;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	/* begin allHeapEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (((longAt(objOop1)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) {
			printHex(objOop1);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop2 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop2, limit)) {
		if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) {
			printHex(objOop2);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop2;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop2);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop2 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop2 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop2 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop2, GIV(freeStart))) {
		if (((longAt(objOop2)) & (classIndexMask())) == (isForwardedObjectClassIndexPun())) {
			printHex(objOop2);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop2;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop2);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop2 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop2 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	}


/*	This version goes through memory, printing all free chunks.
	Other versions go through the free lists. This one will show
	all free chunks even if the free lists are corrupt. */

	/* SpurMemoryManager>>#printFreeChunks */
void
printFreeChunks(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt seenNewFreeChunk;

	seenNewFreeChunk = 0;
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop, limit)) {
		if (((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
			if (!seenNewFreeChunk) {
				print("NewSpace CONTAINS FREE OBJECT(S)!!");
				/* begin cr */
				printf("\n");
				seenNewFreeChunk = 1;
			}
			/* begin printFreeChunk: */
			printFreeChunkprintAsTreeNode(objOop, 1);
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop, GIV(freeStart))) {
		if (((longAt(objOop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
			if (!seenNewFreeChunk) {
				print("NewSpace CONTAINS FREE OBJECT(S)!!");
				/* begin cr */
				printf("\n");
				seenNewFreeChunk = 1;
			}
			/* begin printFreeChunk: */
			printFreeChunkprintAsTreeNode(objOop, 1);
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (((longAt(objOop1)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
			/* begin printFreeChunk: */
			printFreeChunkprintAsTreeNode(objOop1, 1);
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	}

	/* SpurMemoryManager>>#printFreeChunk: */
void
printFreeChunk(sqInt freeChunk)
{
	printFreeChunkprintAsTreeNode(freeChunk, 1);
}

	/* SpurMemoryManager>>#printFreeChunk:printAsTreeNode: */
static void NoDbgRegParms
printFreeChunkprintAsTreeNode(sqInt freeChunk, sqInt printAsTreeNode)
{
    usqInt n;
    usqInt n1;
    usqInt n2;
    usqInt n3;
    usqInt n4;
    usqInt n5;
    usqInt n6;
    usqInt numBytes;
    void *p;
    void *p1;
    void *p2;
    void *p3;
    void *p4;
    void *p5;

	numBytes = bytesInObject(freeChunk);
	print("freeChunk ");
	/* begin printHexPtrnp: */
	n5 = oopForPointer(((void *) freeChunk));
	printf("0x%" PRIxSQINT "", n5);
	if (printAsTreeNode) {
		print(" - ");
		/* begin printHexPtrnp: */
		p = ((void *) (addressAfter(freeChunk)));
		/* begin printHexnp: */
		n = oopForPointer(p);
		printf("0x%" PRIxSQINT "", n);
	}
	print(" bytes ");
	printNum(numBytes);
	print(" next ");
	/* begin printHexPtrnp: */
	p5 = ((void *) (longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))));
	/* begin printHexnp: */
	n6 = oopForPointer(p5);
	printf("0x%" PRIxSQINT "", n6);
	if (!((assert(numBytes >= (BaseHeaderSize + (allocationUnit()))),
		numBytes == (BaseHeaderSize + 8 /* allocationUnit */)))) {
		print(" prev ");
		/* begin printHexPtrnp: */
		p1 = ((void *) (longAt((freeChunk + BaseHeaderSize) + (1U << (shiftForWord())))));
		/* begin printHexnp: */
		n1 = oopForPointer(p1);
		printf("0x%" PRIxSQINT "", n1);
	}
	if ((numBytes >= (64 /* numFreeLists */ * 8 /* allocationUnit */))
	 && (printAsTreeNode)) {
		print(" ^ ");
		/* begin printHexPtrnp: */
		p2 = ((void *) (longAt((freeChunk + BaseHeaderSize) + (2U << (shiftForWord())))));
		/* begin printHexnp: */
		n2 = oopForPointer(p2);
		printf("0x%" PRIxSQINT "", n2);
		print(" < ");
		/* begin printHexPtrnp: */
		p3 = ((void *) (longAt((freeChunk + BaseHeaderSize) + (3U << (shiftForWord())))));
		/* begin printHexnp: */
		n3 = oopForPointer(p3);
		printf("0x%" PRIxSQINT "", n3);
		print(" > ");
		/* begin printHexPtrnp: */
		p4 = ((void *) (longAt((freeChunk + BaseHeaderSize) + (4U << (shiftForWord())))));
		/* begin printHexnp: */
		n4 = oopForPointer(p4);
		printf("0x%" PRIxSQINT "", n4);
	}
	/* begin cr */
	printf("\n");
}

	/* SpurMemoryManager>>#printFreeListHeads */
void
printFreeListHeads(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt expectedMask;
    sqInt i;
    sqInt iLimiT;

	expectedMask = 0;
	for (i = 0, iLimiT = (64 /* numFreeLists */ - 1); i <= iLimiT; i += 1) {
		printHex(GIV(freeLists)[i]);
		if ((GIV(freeLists)[i]) != 0) {
			expectedMask += 1ULL << i;
		}
		if (((i + 1) % (((usqInt) 32) >> 3 /* logBytesPerOop */)) == 0) {
			/* begin cr */
			printf("\n");
		}
		else {
			print("  ");
		}
	}
	/* begin cr */
	printf("\n");
	print("mask: ");
	printf("0x%" PRIxSQINT "", GIV(freeListsMask));
	print(" expected: ");
	printf("0x%" PRIxSQINT "", expectedMask);
	/* begin cr */
	printf("\n");
}

	/* SpurMemoryManager>>#printFreeList: */
sqInt
printFreeList(sqInt chunkOrIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fieldIndex;
    sqInt freeChunk;

	if ((chunkOrIndex >= 0)
	 && (chunkOrIndex < 64 /* numFreeLists */)) {
		return printFreeList(GIV(freeLists)[chunkOrIndex]);
	}
	freeChunk = chunkOrIndex;
	while (freeChunk != 0) {
		/* begin printFreeChunk: */
		printFreeChunkprintAsTreeNode(freeChunk, 1);
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex = 0 /* freeChunkNextIndex */;
		freeChunk = longAt((freeChunk + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	}
	return 0;
}

	/* SpurMemoryManager>>#printFreeTree */
void
printFreeTree(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	printFreeTreeChunk(GIV(freeLists)[0]);
}


/*	Slang is blind-sided by the inlining of printFreeTreeChunk: into
	printFreeTree. 
 */

	/* SpurMemoryManager>>#printFreeTreeChunk: */
static void NoDbgRegParms
printFreeTreeChunk(sqInt chunkOrZero)
{
	if (chunkOrZero > 0) {
		printFreeTreeChunk(longAt((chunkOrZero + BaseHeaderSize) + (3U << (shiftForWord()))));
		/* begin printFreeChunk: */
		printFreeChunkprintAsTreeNode(chunkOrZero, 1);
		printFreeTreeChunk(longAt((chunkOrZero + BaseHeaderSize) + (4U << (shiftForWord()))));
	}
}


/*	N.B. No safety bounds checks!! We need to look e.g. at corpses. */

	/* SpurMemoryManager>>#printHeaderOf: */
void
printHeaderOf(sqInt objOop)
{
    sqInt aByte;
    sqInt aByte1;
    sqInt aByte2;
    sqInt aByte3;
    sqInt aByte4;
    usqInt n;
    usqInt n1;
    usqInt n2;
    usqInt n3;
    usqInt n4;
    usqInt numSlots;
    usqInt numSlots1;

	printf("0x%" PRIxSQINT "", objOop);
	if ((numSlotsOfAny(objOop)) >= (numSlotsMask())) {
		print(" hdr16 slotf ");
		/* begin printHexnp: */
		numSlots = byteAt((objOop - 8 /* allocationUnit */) + 7);
		n = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt((objOop - 8 /* allocationUnit */) - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
		printf("0x%" PRIxSQINT "", n);
		print(" slotc ");
		/* begin printHexnp: */
		printf("0x%" PRIxSQINT "", ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8);
		/* begin space */
		putchar(' ');
	}
	else {
		print(" hdr8 slots ");
		/* begin printHexnp: */
		numSlots1 = byteAt(objOop + 7);
		n1 = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		printf("0x%" PRIxSQINT "", n1);
	}
	/* begin space */
	putchar(' ');
	/* begin printChar: */
	aByte = (((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0
		? 'M'
		: 'm');
	putchar(aByte);
	/* begin printChar: */
	aByte1 = (((((usqInt) (longAt(objOop))) >> (greyBitShift())) & 1) != 0
		? 'G'
		: 'g');
	putchar(aByte1);
	/* begin printChar: */
	aByte2 = (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0
		? 'P'
		: 'p');
	putchar(aByte2);
	/* begin printChar: */
	aByte3 = (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0
		? 'R'
		: 'r');
	putchar(aByte3);
	/* begin printChar: */
	aByte4 = (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0
		? 'I'
		: 'i');
	putchar(aByte4);
	print(" hash ");
	/* begin printHexnp: */
	n2 = (long32At(objOop + 4)) & (identityHashHalfWordMask());
	printf("0x%" PRIxSQINT "", n2);
	print(" fmt ");
	/* begin printHexnp: */
	n3 = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	printf("0x%" PRIxSQINT "", n3);
	print(" cidx ");
	/* begin printHexnp: */
	n4 = (longAt(objOop)) & (classIndexMask());
	printf("0x%" PRIxSQINT "", n4);
	/* begin cr */
	printf("\n");
}

	/* SpurMemoryManager>>#printHeaderTypeOf: */
static void NoDbgRegParms
printHeaderTypeOf(sqInt objOop)
{
    sqInt aByte;
    sqInt aByte1;
    sqInt aByte2;
    sqInt aByte3;
    sqInt aByte4;

	print(((numSlotsOfAny(objOop)) >= (numSlotsMask())
		? " hdr16 "
		: " hdr8 "));
	/* begin printChar: */
	aByte = (((((usqInt) (longAt(objOop))) >> (immutableBitShift())) & 1) != 0
		? 'i'
		: '.');
	putchar(aByte);
	/* begin printChar: */
	aByte1 = (((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0
		? 'r'
		: '.');
	putchar(aByte1);
	/* begin printChar: */
	aByte2 = (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0
		? 'p'
		: '.');
	putchar(aByte2);
	/* begin printChar: */
	aByte3 = (((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0
		? 'm'
		: '.');
	putchar(aByte3);
	/* begin printChar: */
	aByte4 = (((((usqInt) (longAt(objOop))) >> (greyBitShift())) & 1) != 0
		? 'g'
		: '.');
	putchar(aByte4);
}


/*	Scan the heap printing the oops of any and all objects that are instances
	of aClassOop
 */

	/* SpurMemoryManager>>#printInstancesOf: */
void
printInstancesOf(sqInt aClassOop)
{
    sqInt classIndex;

	classIndex = (long32At(aClassOop + 4)) & (identityHashHalfWordMask());
	if (classIndex != (isFreeObjectClassIndexPun())) {
		printInstancesWithClassIndex(classIndex);
	}
}


/*	Scan the heap printing the oops of any and all objects whose classIndex
	equals the argument.
 */

	/* SpurMemoryManager>>#printInstancesWithClassIndex: */
void
printInstancesWithClassIndex(sqInt classIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	/* begin allHeapEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (((longAt(objOop1)) & (classIndexMask())) == classIndex) {
			printHex(objOop1);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop, limit)) {
		if (((longAt(objOop)) & (classIndexMask())) == classIndex) {
			printHex(objOop);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop, GIV(freeStart))) {
		if (((longAt(objOop)) & (classIndexMask())) == classIndex) {
			printHex(objOop);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	}


/*	Print the objects in the classTable that have bad hashes. */

	/* SpurMemoryManager>>#printInvalidClassTableEntries */
void
printInvalidClassTableEntries(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classOrNil1;
    sqInt hash;
    sqInt i;
    sqInt index;
    sqInt j;
    sqInt jLimiT;
    sqInt page;

	if (!(validClassTableRootPages())) {
		print("class table invalid; cannot print");
		/* begin cr */
		printf("\n");
		return;
	}
	/* begin classTableEntriesDo: */
	for (i = 0; i < GIV(numClassTablePages); i += 1) {
		page = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		for (j = 0, jLimiT = ((1U << (classTableMajorIndexShift())) - 1); j <= jLimiT; j += 1) {
			classOrNil1 = longAt((page + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))));
			if (classOrNil1 != GIV(nilObj)) {
				index = (((sqInt)((usqInt)(i) << (classTableMajorIndexShift())))) + j;
				if ((((longAt(classOrNil1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)
				 || ((((hash = (long32At(classOrNil1 + 4)) & (identityHashHalfWordMask()))) == 0)
				 || ((noCheckClassAtIndex(hash)) != classOrNil1))) {
					print("entry ");
					printHex(index);
					print(" oop ");
					printHex(classOrNil1);
					print(" hash ");
					printHex(hash);
					print(" => ");
					printHex(classAtIndex(hash));
					/* begin cr */
					printf("\n");
				}
			}
		}
	}
}

	/* SpurMemoryManager>>#printMarkedOops */
#if LLDB
void
printMarkedOops(void)
{
	printOopsSuchThat(isMarked);
}
#endif /* LLDB */


/*	Scan the heap printing the oops of any and all methods that implement
	anOop 
 */

	/* SpurMemoryManager>>#printMethodImplementorsOf: */
void
printMethodImplementorsOf(sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
		 && ((maybeSelectorOfMethod(objOop1)) == anOop)) {
			printHex(objOop1);
			/* begin space */
			putchar(' ');
			printOopShort(objOop1);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if ((((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
		 && ((maybeSelectorOfMethod(objOop1)) == anOop)) {
			printHex(objOop1);
			/* begin space */
			putchar(' ');
			printOopShort(objOop1);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
			 && ((maybeSelectorOfMethod(objOop11)) == anOop)) {
				printHex(objOop11);
				/* begin space */
				putchar(' ');
				printOopShort(objOop11);
				/* begin cr */
				printf("\n");
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	}


/*	Scan the heap printing the oops of any and all methods that refer to anOop */

	/* SpurMemoryManager>>#printMethodReferencesTo: */
void
printMethodReferencesTo(sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt i;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
			i = ((literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart) - 1;
			while (((i -= 1)) >= 0) {
				if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
					printHex(objOop1);
					print(" @ ");
					printNum(i);
					/* begin space */
					putchar(' ');
					printOopShort(objOop1);
					/* begin cr */
					printf("\n");
					i = 0;
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		if (((((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
			i = ((literalCountOfMethodHeader(methodHeaderOf(objOop1))) + LiteralStart) - 1;
			while (((i -= 1)) >= 0) {
				if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
					printHex(objOop1);
					print(" @ ");
					printNum(i);
					/* begin space */
					putchar(' ');
					printOopShort(objOop1);
					/* begin cr */
					printf("\n");
					i = 0;
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if (((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
				i = ((literalCountOfMethodHeader(methodHeaderOf(objOop11))) + LiteralStart) - 1;
				while (((i -= 1)) >= 0) {
					if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
						printHex(objOop11);
						print(" @ ");
						printNum(i);
						/* begin space */
						putchar(' ');
						printOopShort(objOop11);
						/* begin cr */
						printf("\n");
						i = 0;
					}
				}
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	}

	/* SpurMemoryManager>>#printObjectsFrom:to: */
void
printObjectsFromto(sqInt startAddress, sqInt endAddress)
{
    sqInt oop;

	oop = objectBefore(startAddress);
	oop = (oop == null
		? startAddress
		: ((objectAfter(oop)) == startAddress
				? startAddress
				: oop));
	while (oopisLessThan(oop, endAddress)) {
		if (!((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()))
			 || (((longAt(oop)) & (classIndexMask())) == (segmentBridgePun())))) {
			printOop(oop);
		}
		oop = objectAfter(oop);
	}
}


/*	Scan the heap printing the oops of any and all objects whose hash equals
	the argument.
 */

	/* SpurMemoryManager>>#printObjectsWithHash: */
void
printObjectsWithHash(sqInt hash)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	/* begin allHeapEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (((long32At(objOop1 + 4)) & (identityHashHalfWordMask())) == hash) {
			shortPrintOop(objOop1);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop, limit)) {
		if (((long32At(objOop + 4)) & (identityHashHalfWordMask())) == hash) {
			shortPrintOop(objOop);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop, GIV(freeStart))) {
		if (((long32At(objOop + 4)) & (identityHashHalfWordMask())) == hash) {
			shortPrintOop(objOop);
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	}

	/* SpurMemoryManager>>#printObjStackPage:myIndex:pageType: */
static void NoDbgRegParms
printObjStackPagemyIndexpageType(sqInt objStackPage, sqInt myx, sqInt pageType)
{
    sqInt freeOrNextPage;
    int isFirstPage;
    int isFreePage;
    int isNextPage;
    sqInt page;

	isFirstPage = pageType == ObjStackMyx;
	isNextPage = pageType == ObjStackNextx;
	isFreePage = pageType == ObjStackFreex;
	printObjStackPagemyIndextag(objStackPage, myx, (isFirstPage
		? "head"
		: (isFreePage
				? "free"
				: "next")));
	if (isFirstPage
	 || (isNextPage)) {
		/* begin tab */
		putchar('	');
		print("topx: ");
		printNum(longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord()))))));
		print(" next: ");
		printHex(longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord()))))));
		if (isFirstPage) {
			print(" free: ");
			printHex(longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord()))))));
		}
		/* begin cr */
		printf("\n");
	}
	if (isFirstPage) {
		/* begin fetchPointer:ofObject: */
		freeOrNextPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))));
		while (freeOrNextPage != 0) {
			printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackFreex);
			/* begin fetchPointer:ofObject: */
			page = longAt((freeOrNextPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))));
			if ((page == freeOrNextPage)
			 || (page == objStackPage)) {
				print("circularity in free page list!!");
				/* begin cr */
				printf("\n");
				page = 0;
			}
			freeOrNextPage = page;
		}
	}
	/* begin fetchPointer:ofObject: */
	freeOrNextPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
	if (freeOrNextPage != 0) {
		printObjStackPagemyIndexpageType(freeOrNextPage, myx, ObjStackNextx);
	}
}

	/* SpurMemoryManager>>#printObjStackPage:myIndex:tag: */
static void NoDbgRegParms
printObjStackPagemyIndextag(sqInt objStackPage, sqInt myx, char *pageType)
{
	print(pageType);
	/* begin space */
	putchar(' ');
	printHex(objStackPage);
	/* begin space */
	putchar(' ');
	print("cx ");
	printNum((longAt(objStackPage)) & (classIndexMask()));
	print(" (");
	printNum(sixtyFourBitLongsClassIndexPun());
	print(") fmt ");
	printNum((((usqInt) (longAt(objStackPage))) >> (formatShift())) & (formatMask()));
	print(" (");
	printNum(sixtyFourBitIndexableFormat());
	print(") sz ");
	printNum(numSlotsOfAny(objStackPage));
	print(" (");
	printNum(ObjStackPageSlots);
	print(") myx: ");
	printNum(longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackMyx) << (shiftForWord()))))));
	print(" (");
	printNum(myx);
	print((((((usqInt) (longAt(objStackPage))) >> (markedBitFullShift())) & 1) != 0
		? ") mkd"
		: ") unmkd"));
	/* begin cr */
	printf("\n");
}

	/* SpurMemoryManager>>#printObjStack: */
void
printObjStack(sqInt objStack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (objStack == GIV(nilObj)) {
		print("nil");
		/* begin cr */
		printf("\n");
	}
	else {
		printObjStackPagemyIndexpageType(objStack, longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackMyx) << (shiftForWord()))))), ObjStackMyx);
	}
}

	/* SpurMemoryManager>>#printOopsExcept: */
void NeverInline
printOopsExcept(sqInt (*function)(sqInt))
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    sqInt n;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	n = 0;
	/* begin allHeapEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (!(function(objOop1))) {
			n += 1;
			printEntity(objOop1);
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop, limit)) {
		if (!(function(objOop))) {
			n += 1;
			printEntity(objOop);
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop, GIV(freeStart))) {
		if (!(function(objOop))) {
			n += 1;
			printEntity(objOop);
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	if (n > 4) {

		/* rabbits */
		printNum(n);
		print(" objects");
		/* begin cr */
		printf("\n");
	}
}

	/* SpurMemoryManager>>#printOopsFrom:to: */
void
printOopsFromto(sqInt startAddress, sqInt endAddress)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstNonEntity;
    sqInt inEmptySpace;
    sqInt lastNonEntity;
    sqInt limit;
    usqInt n;
    usqInt n1;
    usqInt numSlots;
    sqInt oop;

	firstNonEntity = 0;
	oop = objectBefore(startAddress);
	limit = (((((usqIntptr_t)endAddress)) < GIV(endOfMemory)) ? (((usqIntptr_t)endAddress)) : GIV(endOfMemory));
	oop = (oop == null
		? startAddress
		: ((objectAfter(oop)) == startAddress
				? startAddress
				: oop));
	inEmptySpace = 0;
	while (oopisLessThan(oop, limit)) {
		printEntity(oop);
		while (1) {
			oop = objectAfter(oop);
			if (!((long64At(oop)) == 0)) break;
			if (!inEmptySpace) {
				inEmptySpace = 1;
				firstNonEntity = oop;
			}
			lastNonEntity = oop;
		}
		if (inEmptySpace) {
			inEmptySpace = 0;
			print("skipped empty space from ");
			/* begin printHexPtrnp: */
			n = oopForPointer(((void *) firstNonEntity));
			printf("0x%" PRIxSQINT "", n);
			print(" to ");
			/* begin printHexPtrnp: */
			n1 = oopForPointer(((void *) lastNonEntity));
			printf("0x%" PRIxSQINT "", n1);
			/* begin cr */
			printf("\n");
			/* begin objectStartingAt: */
			numSlots = byteAt(oop + 7);
			oop = (numSlots == (numSlotsMask())
				? oop + BaseHeaderSize
				: oop);
		}
	}
}

	/* SpurMemoryManager>>#printOopsSuchThat: */
void NeverInline
printOopsSuchThat(sqInt (*function)(sqInt))
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    sqInt n;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	n = 0;
	/* begin allHeapEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (function(objOop1)) {
			n += 1;
			printEntity(objOop1);
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop, limit)) {
		if (function(objOop)) {
			n += 1;
			printEntity(objOop);
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop, GIV(freeStart))) {
		if (function(objOop)) {
			n += 1;
			printEntity(objOop);
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	if (n > 4) {

		/* rabbits */
		printNum(n);
		print(" objects");
		/* begin cr */
		printf("\n");
	}
}


/*	Scan the heap printing the oops of any and all objects that refer to anOop */

	/* SpurMemoryManager>>#printReferencesTo: */
void
printReferencesTo(sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt contextSize;
    sqInt fmt;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt header;
    sqInt header1;
    sqInt i;
    usqInt limit;
    sqInt numLiterals;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots2;
    sqInt objOop1;
    sqInt objOop11;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt sp;

	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots2 = byteAt(address + 7);
	objOop1 = (numSlots2 == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		/* begin numPointerSlotsOf: */
		fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask());
		if (fmt <= 5 /* lastPointerFormat */) {
			if ((fmt == (indexablePointersFormat()))
			 && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

				/* contexts end at the stack pointer */
				/* begin fetchStackPointerOf: */
				sp = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
				if (!((((sp) & 7) == 1))) {
					contextSize = 0;
					goto l10;
				}
				assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
				contextSize = (sp >> 3);
	l10:	/* end fetchStackPointerOf: */;
				i = CtxtTempFrameStart + contextSize;
				goto l11;
			}
			/* begin numSlotsOf: */
			assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun()));
			numSlots = byteAt(objOop1 + 7);
			i = (numSlots == (numSlotsMask())
				? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop1 - BaseHeaderSize))) << 8)))))) >> 8
				: numSlots);
			goto l11;
		}
		if (fmt == 7 /* forwardedFormat */) {
			i = 1;
			goto l11;
		}
		if (fmt < (firstCompiledMethodFormat())) {
			i = 0;
			goto l11;
		}
		/* begin methodHeaderOf: */
		assert(isCompiledMethod(objOop1));
		header1 = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((((header1) & 7) == 1)) {
			header = header1;
		}
		else {
			assert((((usqInt)header1)) < GIV(newSpaceStart));
			assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
			header = ((((CogMethod *) header1))->methodHeader);
		}
		assert((((header) & 7) == 1));
		numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
		i = numLiterals + LiteralStart;
	l11:	/* end numPointerSlotsOf: */;
		while (((i -= 1)) >= 0) {
			if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
				printHex(objOop1);
				print(" @ ");
				printNum(i);
				/* begin space */
				putchar(' ');
				printOopShort(objOop1);
				/* begin cr */
				printf("\n");
				i = 0;
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l7;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l7:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		/* begin numPointerSlotsOf: */
		fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask());
		if (fmt <= 5 /* lastPointerFormat */) {
			if ((fmt == (indexablePointersFormat()))
			 && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

				/* contexts end at the stack pointer */
				/* begin fetchStackPointerOf: */
				sp = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
				if (!((((sp) & 7) == 1))) {
					contextSize = 0;
					goto l12;
				}
				assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
				contextSize = (sp >> 3);
	l12:	/* end fetchStackPointerOf: */;
				i = CtxtTempFrameStart + contextSize;
				goto l13;
			}
			/* begin numSlotsOf: */
			assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun()));
			numSlots = byteAt(objOop1 + 7);
			i = (numSlots == (numSlotsMask())
				? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop1 - BaseHeaderSize))) << 8)))))) >> 8
				: numSlots);
			goto l13;
		}
		if (fmt == 7 /* forwardedFormat */) {
			i = 1;
			goto l13;
		}
		if (fmt < (firstCompiledMethodFormat())) {
			i = 0;
			goto l13;
		}
		/* begin methodHeaderOf: */
		assert(isCompiledMethod(objOop1));
		header1 = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((((header1) & 7) == 1)) {
			header = header1;
		}
		else {
			assert((((usqInt)header1)) < GIV(newSpaceStart));
			assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
			header = ((((CogMethod *) header1))->methodHeader);
		}
		assert((((header) & 7) == 1));
		numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
		i = numLiterals + LiteralStart;
	l13:	/* end numPointerSlotsOf: */;
		while (((i -= 1)) >= 0) {
			if (anOop == (longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
				printHex(objOop1);
				print(" @ ");
				printNum(i);
				/* begin space */
				putchar(' ');
				printOopShort(objOop1);
				/* begin cr */
				printf("\n");
				i = 0;
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l9;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l9:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			/* begin numPointerSlotsOf: */
			fmt = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask());
			if (fmt <= 5 /* lastPointerFormat */) {
				if ((fmt == (indexablePointersFormat()))
				 && (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

					/* contexts end at the stack pointer */
					/* begin fetchStackPointerOf: */
					sp = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
					if (!((((sp) & 7) == 1))) {
						contextSize = 0;
						goto l14;
					}
					assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop11)));
					contextSize = (sp >> 3);
	l14:	/* end fetchStackPointerOf: */;
					i = CtxtTempFrameStart + contextSize;
					goto l15;
				}
				/* begin numSlotsOf: */
				assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun()));
				numSlots = byteAt(objOop11 + 7);
				i = (numSlots == (numSlotsMask())
					? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop11 - BaseHeaderSize))) << 8)))))) >> 8
					: numSlots);
				goto l15;
			}
			if (fmt == 7 /* forwardedFormat */) {
				i = 1;
				goto l15;
			}
			if (fmt < (firstCompiledMethodFormat())) {
				i = 0;
				goto l15;
			}
			/* begin methodHeaderOf: */
			assert(isCompiledMethod(objOop11));
			header1 = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
			if ((((header1) & 7) == 1)) {
				header = header1;
			}
			else {
				assert((((usqInt)header1)) < GIV(newSpaceStart));
				assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
				header = ((((CogMethod *) header1))->methodHeader);
			}
			assert((((header) & 7) == 1));
			numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
			i = numLiterals + LiteralStart;
	l15:	/* end numPointerSlotsOf: */;
			while (((i -= 1)) >= 0) {
				if (anOop == (longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
					printHex(objOop11);
					print(" @ ");
					printNum(i);
					/* begin space */
					putchar(' ');
					printOopShort(objOop11);
					/* begin cr */
					printf("\n");
					i = 0;
				}
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	}

	/* SpurMemoryManager>>#printUnmarkedOops */
#if LLDB
void
printUnmarkedOops(void)
{
	printOopsExcept(isMarked);
}
#endif /* LLDB */


/*	Attempt to push anEphemeron on the unscanned ephemerons stack
	and answer if the attempt succeeded. Note that the ephemeron
	stack overflowing isn't a disaster; it simply means treating the
	ephemeron as strong in this GC cycle. */

	/* SpurMemoryManager>>#pushOnUnscannedEphemeronsStack: */
static sqInt NoDbgRegParms
pushOnUnscannedEphemeronsStack(sqInt anEphemeron)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(isEphemeron(anEphemeron));
	if (((GIV(unscannedEphemerons).top)) >= ((GIV(unscannedEphemerons).limit))) {
		return 0;
	}
	longAtput((GIV(unscannedEphemerons).top), anEphemeron);
	(GIV(unscannedEphemerons).top = ((GIV(unscannedEphemerons).top)) + BytesPerOop);
	return 1;
}


/*	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.
	We support this excessence for compatibility with ObjectMemory.
	Spur doesn't GC during allocation. */

	/* SpurMemoryManager>>#pushRemappableOop: */
void
pushRemappableOop(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(addressCouldBeOop(oop));
	GIV(remapBuffer)[(GIV(remapBufferCount) += 1)] = oop;
	if (!(GIV(remapBufferCount) <= RemapBufferSize)) {
		error("remapBuffer overflow");
	}
}


/*	Add the ephemeron to the queue and make it non-ephemeral, to avoid
	subsequent firing.
	Alas this means that other ephemerons on the same object not identified in
	this sccavenge
	or GC will not fire until later. But that's life. */

	/* SpurMemoryManager>>#queueMourner: */
static void NoDbgRegParms
queueMourner(sqInt anEphemeronOrWeakArray)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objStack;

	assert((isNonImmediate(anEphemeronOrWeakArray))
	 && (((formatOf(anEphemeronOrWeakArray)) == (ephemeronFormat()))
	 || ((formatOf(anEphemeronOrWeakArray)) == (weakArrayFormat()))));
	assert(!((((formatOf(anEphemeronOrWeakArray)) == (ephemeronFormat()))
 && (isonObjStack(anEphemeronOrWeakArray, GIV(mournQueue))))));
	ensureRoomOnObjStackAt(MournQueueRootIndex);
	/* begin push:onObjStack: */
	objStack = GIV(mournQueue);
	assert(addressCouldBeOop(anEphemeronOrWeakArray));
	if (anEphemeronOrWeakArray & (tagMask())) {
		assert(objStack == GIV(markStack));
		assert(addressCouldBeObj(topOfObjStack((0 == (fetchPointerofObject(ObjStackTopx, objStack))
			? fetchPointerofObject(ObjStackNextx, objStack)
			: objStack))));
	}
	else {

		/* There should be no weaklings on the mark stack. */
		assert(!((objStack == GIV(markStack))
		 && (isWeakNonImm(anEphemeronOrWeakArray))));
		assert((objStack != GIV(weaklingStack))
		 || (isWeakNonImm(anEphemeronOrWeakArray)));
	}
	noCheckPushonObjStack(anEphemeronOrWeakArray, objStack);
}

	/* SpurMemoryManager>>#rawHashBitsOf: */
sqInt
rawHashBitsOf(sqInt objOop)
{
	flag("endianness");
	return (long32At(objOop + 4)) & (identityHashHalfWordMask());
}


/*	Relocate all objStack pages that comprise objStack. */

	/* SpurMemoryManager>>#relocateObjStackForPlanningCompactor: */
static sqInt NoDbgRegParms
relocateObjStackForPlanningCompactor(sqInt objStack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt finishIndex;
    sqInt freeList;
    sqInt fwd;
    sqInt fwd1;
    sqInt i;
    sqInt i1;
    sqInt next;
    sqInt oop;
    sqInt oop1;
    sqInt relocated;
    sqInt result;
    sqInt stackOrNil;

	if (objStack == GIV(nilObj)) {
		return objStack;
	}
	stackOrNil = objStack;
	/* begin fetchPointer:ofObject: */
	freeList = longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))));
	while (1) {
		assert((numSlotsOfAny(stackOrNil)) == ObjStackPageSlots);
		/* begin fetchPointer:ofObject: */
		next = longAt((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
		/* begin relocateObjectsInHeapEntity:from:to: */
		finishIndex = ObjStackNextx + ((long32At(stackOrNil + 4)) & (identityHashHalfWordMask()));
		for (i = ObjStackFreex; i <= finishIndex; i += 1) {
			/* begin fetchPointer:ofObject: */
			oop = longAt((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
			if (((oop & (tagMask())) == 0)
			 && ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(oop, GIV(mobileStart), GIV(lastMobileObject)))
			 && (!(((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0)))) {
				assert(isMarked(oop));
				/* begin fetchPointer:ofObject: */
				fwd = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
				assert(isPostMobile(fwd));
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(stackOrNil)));
				longAtput((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), fwd);
			}
		}
		if ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(stackOrNil, GIV(mobileStart), GIV(lastMobileObject)))
		 && (!(((((usqInt) (longAt(stackOrNil))) >> (pinnedBitShift())) & 1) != 0))) {
			/* begin fetchPointer:ofObject: */
			relocated = longAt((stackOrNil + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		else {
			relocated = stackOrNil;
		}
		if (stackOrNil == objStack) {
			result = relocated;
		}
		/* begin setHashBitsOf:to: */
		assert(((0 >= 0) && (0 <= (identityHashHalfWordMask()))));
		long32Atput(stackOrNil + 4, ((((long32At(stackOrNil + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))));
		if (!(next != 0)) break;
		stackOrNil = next;
	}
	while (freeList != 0) {
		assert((numSlotsOfAny(freeList)) == ObjStackPageSlots);
		/* begin fetchPointer:ofObject: */
		next = longAt((freeList + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))));
		/* begin relocateObjectsInHeapEntity:from:to: */
		for (i1 = ObjStackFreex; i1 <= ObjStackFreex; i1 += 1) {
			/* begin fetchPointer:ofObject: */
			oop1 = longAt((freeList + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
			if (((oop1 & (tagMask())) == 0)
			 && ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(oop1, GIV(mobileStart), GIV(lastMobileObject)))
			 && (!(((((usqInt) (longAt(oop1))) >> (pinnedBitShift())) & 1) != 0)))) {
				assert(isMarked(oop1));
				/* begin fetchPointer:ofObject: */
				fwd1 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord())));
				assert(isPostMobile(fwd1));
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(freeList)));
				longAtput((freeList + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), fwd1);
			}
		}
		if ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(freeList, GIV(mobileStart), GIV(lastMobileObject)))
		 && (!(((((usqInt) (longAt(freeList))) >> (pinnedBitShift())) & 1) != 0))) {
			/* begin fetchPointer:ofObject: */
			longAt((freeList + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		else {
		}
		freeList = next;
	}
	return relocated;
}


/*	Remove the given variable location to the extra roots table. */

	/* SpurMemoryManager>>#removeGCRoot: */
sqInt
removeGCRoot(sqInt *varLoc)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	for (i = 1; i <= GIV(extraRootCount); i++) {
		if (varLoc == (GIV(extraRoots)[i])) {

			/* swap varLoc with last entry */
			GIV(extraRoots)[i] = (GIV(extraRoots)[GIV(extraRootCount)]);
			GIV(extraRootCount) -= 1;
			return 1;
		}
	}
	return 0;
}


/*	This is part of storeImageSegmentInto:outPointers:roots:. */

	/* SpurMemoryManager>>#return:restoringObjectsIn:savedFirstFields:and:savedHashes: */
static sqInt NoDbgRegParms
returnrestoringObjectsInsavedFirstFieldsandsavedHashes(sqInt errCode, sqInt firstArray, sqInt savedFirstFields, sqInt secondArray, sqInt savedHashes)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt hash;
    sqInt i;
    sqInt i1;
    sqInt iLimiT;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt oop;
    sqInt oop1;

	/* begin restoreObjectsIn:upTo:savedFirstFields: */
	/* begin numSlotsOf: */
	assert((classIndexOf(firstArray)) > (isForwardedObjectClassIndexPun()));
	numSlots1 = byteAt(firstArray + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(firstArray - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	for (i = 0; i < numSlots; i += 1) {
		/* begin fetchPointer:ofObject: */
		oop = longAt((firstArray + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(oop)));
		longAtput((oop + BaseHeaderSize) + (0U << (shiftForWord())), longAt((savedFirstFields + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))));
		/* begin setIsMarkedOf:to: */
		assert(!(isFreeObject(oop)));
		longAtput(oop, (longAt(oop)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
	}
	if (oopisGreaterThanOrEqualToandLessThan(savedFirstFields, GIV(oldSpaceStart), GIV(endOfMemory))) {
		freeObject(savedFirstFields);
	}
	/* begin restoreObjectsIn:savedHashes: */
	for (i1 = 0, iLimiT = ((numSlotsOf(secondArray)) - 1); i1 <= iLimiT; i1 += 1) {
		if (((hash = long32At((savedHashes + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << 2)))))) > (identityHashHalfWordMask())) {
			if (oopisGreaterThanOrEqualToandLessThan(savedHashes, GIV(oldSpaceStart), GIV(endOfMemory))) {
				freeObject(savedHashes);
			}
			goto l5;
		}
		/* begin fetchPointer:ofObject: */
		oop1 = longAt((secondArray + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
		/* begin setHashBitsOf:to: */
		assert(((hash >= 0) && (hash <= (identityHashHalfWordMask()))));
		long32Atput(oop1 + 4, ((((long32At(oop1 + 4)) | (identityHashHalfWordMask())) - (identityHashHalfWordMask()))) + hash);
		/* begin setIsMarkedOf:to: */
		assert(!(isFreeObject(oop1)));
		longAtput(oop1, (longAt(oop1)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
	}
	if (oopisGreaterThanOrEqualToandLessThan(savedHashes, GIV(oldSpaceStart), GIV(endOfMemory))) {
		freeObject(savedHashes);
	}
	l5:	/* end restoreObjectsIn:savedHashes: */;
	runLeakCheckerFor(GCModeImageSegment);
	assert(allObjectsUnmarked());
	return errCode;
}


/*	This is part of storeImageSegmentInto:outPointers:roots:. */

	/* SpurMemoryManager>>#return:restoringObjectsIn:upTo:savedFirstFields: */
static sqInt NoDbgRegParms
returnrestoringObjectsInupTosavedFirstFields(sqInt errCode, sqInt firstArray, sqInt limitOrTag, sqInt savedFirstFields)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt oop;

	/* begin restoreObjectsIn:upTo:savedFirstFields: */
	if (limitOrTag == -1) {
		/* begin numSlotsOf: */
		assert((classIndexOf(firstArray)) > (isForwardedObjectClassIndexPun()));
		numSlots1 = byteAt(firstArray + 7);
		numSlots = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(firstArray - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
	}
	else {
		numSlots = limitOrTag;
	}
	for (i = 0; i < numSlots; i += 1) {
		/* begin fetchPointer:ofObject: */
		oop = longAt((firstArray + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(oop)));
		longAtput((oop + BaseHeaderSize) + (0U << (shiftForWord())), longAt((savedFirstFields + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))));
		/* begin setIsMarkedOf:to: */
		assert(!(isFreeObject(oop)));
		longAtput(oop, (longAt(oop)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
	}
	if (oopisGreaterThanOrEqualToandLessThan(savedFirstFields, GIV(oldSpaceStart), GIV(endOfMemory))) {
		freeObject(savedFirstFields);
	}
	runLeakCheckerFor(GCModeImageSegment);
	assert(allObjectsUnmarked());
	return errCode;
}


/*	This exists to get around a compiler bug in Apple LLVM version 7.0.0
	(clang-700.1.76) that was avoiding the second comparison of segVersion
	after the first byte swap. */

	/* SpurMemoryManager>>#reverseBytesIn32BitWordsIn: */
static void NoDbgRegParms NeverInline
reverseBytesIn32BitWordsIn(sqInt segmentWordArray)
{
    sqInt addr;
    sqInt stopAddr;

	/* begin reverseBytesIn32BitWordsFrom:to: */
	stopAddr = addressAfter(segmentWordArray);
	addr = segmentWordArray + BaseHeaderSize;
	while (oopisLessThan(addr, stopAddr)) {
		long32Atput(addr, SQ_SWAP_4_BYTES((long32At(addr))));
		addr += 4;
	}
}

	/* SpurMemoryManager>>#runLeakCheckerForFreeSpace: */
static void NoDbgRegParms
runLeakCheckerForFreeSpace(sqInt gcModes)
{
	if (gcModes & GCModeFreeSpace) {
		reverseDisplayFromto(16, 19);
		clearLeakMapAndMapAccessibleFreeSpace();
		asserta(checkHeapFreeSpaceIntegrity());
	}
}

	/* SpurMemoryManager>>#runLeakCheckerFor: */
static void NoDbgRegParms
runLeakCheckerFor(sqInt gcModes)
{
	/* begin inLineRunLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */
	if (gcModes & checkForLeaks) {
		if (gcModes & GCModeFull) {
			reverseDisplayFromto(0, 7);
		}
		else {
			reverseDisplayFromto(8, 15);
		}
		clearLeakMapAndMapAccessibleObjects();
		asserta(checkHeapIntegrityclassIndicesShouldBeValid(0, 1));
		asserta((checkInterpreterIntegrity()) == 0);
		asserta(checkStackIntegrity());
		asserta(checkCodeIntegrity(gcModes));
	}
	return;
}

	/* SpurMemoryManager>>#runLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */
static void NoDbgRegParms
runLeakCheckerForexcludeUnmarkedObjsclassIndicesShouldBeValid(sqInt gcModes, sqInt excludeUnmarkedObjs, sqInt classIndicesShouldBeValid)
{
	/* begin inLineRunLeakCheckerFor:excludeUnmarkedObjs:classIndicesShouldBeValid: */
	if (gcModes & checkForLeaks) {
		if (gcModes & GCModeFull) {
			reverseDisplayFromto(0, 7);
		}
		else {
			reverseDisplayFromto(8, 15);
		}
		clearLeakMapAndMapAccessibleObjects();
		asserta(checkHeapIntegrityclassIndicesShouldBeValid(excludeUnmarkedObjs, classIndicesShouldBeValid));
		asserta((checkInterpreterIntegrity()) == 0);
		asserta(checkStackIntegrity());
		asserta(checkCodeIntegrity(gcModes));
	}
}


/*	Run the scavenger. */

	/* SpurMemoryManager>>#scavengingGCTenuringIf: */
static void NoDbgRegParms
scavengingGCTenuringIf(sqInt tenuringCriterion)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt probe;

	assert(GIV(remapBufferCount) == 0);
	if (!(asserta(((((eden()).limit)) - GIV(freeStart)) > (interpreterAllocationReserveBytes())))) {
		/* begin tab */
		putchar('	');
		printNum((((eden()).limit)) - GIV(freeStart));
		/* begin space */
		putchar(' ');
		printNum(interpreterAllocationReserveBytes());
		/* begin space */
		putchar(' ');
		printNum((interpreterAllocationReserveBytes()) - ((((eden()).limit)) - GIV(freeStart)));
		/* begin cr */
		printf("\n");
	}
	/* begin checkMemoryMap */
	assert(isYoungObject(GIV(newSpaceStart)));
	assert(isYoungObject(GIV(newSpaceLimit) - BytesPerWord));
	assert(!(isOldObject(GIV(newSpaceStart))));
	assert(!(isOldObject(GIV(newSpaceLimit) - BytesPerWord)));
	assert(!(isYoungObject(GIV(newSpaceLimit))));
	assert(!(isYoungObject(GIV(oldSpaceStart))));
	assert(!(isYoungObject(GIV(endOfMemory))));
	assert(isOldObject(GIV(oldSpaceStart)));
	assert(isOldObject(GIV(endOfMemory)));
	assert(!(isOldObject(minCogMethodAddress())));
	assert(!(isOldObject(maxCogMethodAddress())));
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	runLeakCheckerFor(GCModeNewSpace);
	preGCAction(GCModeNewSpace);
	/* begin flushMethodCacheFrom:to: */
	probe = 0;
	for (i = 1; i <= MethodCacheEntries; i += 1) {
		if (!((GIV(methodCache)[probe + MethodCacheSelector]) == 0)) {
			if ((((oopisGreaterThanOrEqualTo(GIV(methodCache)[probe + MethodCacheSelector], GIV(newSpaceStart)))
			 && (oopisLessThan(GIV(methodCache)[probe + MethodCacheSelector], GIV(newSpaceLimit))))
			 || ((oopisGreaterThanOrEqualTo(GIV(methodCache)[probe + MethodCacheClass], GIV(newSpaceStart)))
			 && (oopisLessThan(GIV(methodCache)[probe + MethodCacheClass], GIV(newSpaceLimit)))))
			 || ((oopisGreaterThanOrEqualTo(GIV(methodCache)[probe + MethodCacheMethod], GIV(newSpaceStart)))
			 && (oopisLessThan(GIV(methodCache)[probe + MethodCacheMethod], GIV(newSpaceLimit))))) {
				GIV(methodCache)[probe + MethodCacheSelector] = 0;
			}
		}
		probe += MethodCacheEntrySize;
	}
	GIV(needGCFlag) = 0;
	GIV(gcStartUsecs) = ioUTCMicrosecondsNow();
	doScavenge(tenuringCriterion);
	GIV(statScavenges) += 1;
	GIV(statGCEndUsecs) = ioUTCMicrosecondsNow();
	GIV(statSGCDeltaUsecs) = GIV(statGCEndUsecs) - GIV(gcStartUsecs);
	GIV(statScavengeGCUsecs) += GIV(statSGCDeltaUsecs);
	GIV(statRootTableCount) = rememberedSetSize();
	/* begin logScavenge */
	if (!(GIV(scavengeLog) == null)) {
		writeScavengeLog();
	}
	postGCAction(GCModeNewSpace);
	runLeakCheckerFor(GCModeNewSpace);
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeNewSpace)) == (GCModeFreeSpace | GCModeNewSpace))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
}


/*	Set the dimensions of the heap, answering the start of oldSpace. edenBytes
	holds the desired ``size of eden''
	which is actually the total size of new space minus the reserve. edenBytes
	is then divided up between eden
	and the two survivor spaces, where each survivor space is a
	scavengerDenominator (one seventh) of the total. */
/*	Transcript
	cr; nextPutAll: 'heapBase: '; print: baseOfHeap; nextPut: $/; nextPutAll:
	baseOfHeap hex;
	nextPutAll: ' memLimit '; print: memLimit; nextPut: $/; nextPutAll:
	memLimit hex;
	nextPutAll: ' memEnd '; print: memEnd; nextPut: $/; nextPutAll: memEnd
	hex; cr; flush. */
/*	This is more than a little counter-intuitive. Eden must include
	interpreterAllocationReserveBytes. 
 */

	/* SpurMemoryManager>>#setHeapBase:memoryLimit:endOfMemory: */
static sqInt NoDbgRegParms NeverInline
setHeapBasememoryLimitendOfMemory(sqInt baseOfHeap, sqInt memLimit, sqInt memEnd)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt actualEdenBytes;
    SpurNewSpaceSpace *aNewSpace;
    usqInt limit;
    sqInt oldStart;
    sqInt p;
    sqInt reserve;
    sqInt survivorBytes;
    sqInt totalBytes;

	reserve = interpreterAllocationReserveBytes();
	GIV(newSpaceStart) = baseOfHeap;
	GIV(newSpaceLimit) = (baseOfHeap + GIV(edenBytes)) + reserve;
	/* begin newSpaceStart:newSpaceBytes:survivorBytes: */
	totalBytes = GIV(newSpaceLimit) - GIV(newSpaceStart);
	survivorBytes = ((((GIV(newSpaceLimit) - GIV(newSpaceStart)) - reserve) / 7 /* scavengerDenominator */) & ~7);
	actualEdenBytes = (((totalBytes - survivorBytes) - survivorBytes) & ~7);
	assert((((totalBytes - actualEdenBytes) - survivorBytes) - survivorBytes) < (allocationUnit()));
	(GIV(pastSpace).start = GIV(newSpaceStart));
	(GIV(pastSpace).limit = GIV(newSpaceStart) + survivorBytes);
	(GIV(futureSpace).start = (GIV(pastSpace).limit));
	(GIV(futureSpace).limit = ((GIV(pastSpace).limit)) + survivorBytes);
	(GIV(eden).start = (GIV(futureSpace).limit));
	(GIV(eden).limit = GIV(newSpaceStart) + totalBytes);
	assert((((futureSpace()).limit)) <= (GIV(newSpaceStart) + totalBytes));
	assert((((((eden()).start)) % (allocationUnit())) + ((((eden()).limit)) % (allocationUnit()))) == 0);
	assert((((((pastSpace()).start)) % (allocationUnit())) + ((((pastSpace()).limit)) % (allocationUnit()))) == 0);
	assert((((((futureSpace()).start)) % (allocationUnit())) + ((((futureSpace()).limit)) % (allocationUnit()))) == 0);
	/* begin initFutureSpaceStart */
	oldStart = GIV(futureSurvivorStart);
	GIV(futureSurvivorStart) = (GIV(futureSpace).start);
	/* begin initSpaceForAllocationCheck:limit: */
	aNewSpace = ((SpurNewSpaceSpace *) ((&GIV(eden))));
	limit = (GIV(eden).limit);
	if (!(GIV(memory) == null)) {
		if (checkAllocFiller()) {
			for (p = ((aNewSpace->start)); p < limit; p += BytesPerWord) {
				longAtput(p, p);
			}
		}
	}
	GIV(tenuringProportion) = 0.9;
	GIV(freeStart) = ((eden()).start);
	GIV(pastSpaceStart) = ((pastSpace()).start);
	GIV(oldSpaceStart) = GIV(newSpaceLimit);
	GIV(freeOldSpaceStart) = memEnd;
	GIV(endOfMemory) = memLimit;
	return baseOfHeap;
}

	/* SpurMemoryManager>>#shortPrintObjectsFrom:to: */
void
shortPrintObjectsFromto(sqInt startAddress, sqInt endAddress)
{
    sqInt oop;

	oop = objectBefore(startAddress);
	oop = (oop == null
		? startAddress
		: ((objectAfter(oop)) == startAddress
				? startAddress
				: oop));
	while (oopisLessThan(oop, endAddress)) {
		if (!(((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()))) {
			shortPrintOop(oop);
		}
		oop = objectAfter(oop);
	}
}


/*	Answer if the oop should be scavenged.. The method is called
	shouldRemapOop: for compatibility with ObjectMemory. */

	/* SpurMemoryManager>>#shouldRemapOop: */
sqInt
shouldRemapOop(sqInt oop)
{
	return ((oop & (tagMask())) == 0)
	 && (shouldRemapObj(oop));
}

	/* SpurMemoryManager>>#sizeOfObjStack: */
static sqInt NoDbgRegParms
sizeOfObjStack(sqInt objStack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objStackPage;
    sqInt total;

	if (objStack == GIV(nilObj)) {
		return 0;
	}
	/* begin fetchPointer:ofObject: */
	total = longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
	objStackPage = objStack;
	while (1) {
		/* begin fetchPointer:ofObject: */
		objStackPage = longAt((objStackPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackNextx) << (shiftForWord())))));
		if (!(objStackPage != 0)) break;
		total += ObjStackLimit;
		assert((fetchPointerofObject(ObjStackTopx, objStackPage)) == ObjStackLimit);
	}
	return total;
}

	/* SpurMemoryManager>>#slidingCompactionInProgress */
static sqInt
slidingCompactionInProgress(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(gcPhaseInProgress) == SlidingCompactionInProgress;
}


/*	*DO NOT CONFUSE THIS WITH numSlotsOf:.
	This is an ObjectMemory compatibility method with questionable semantics.
	Answers 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. */

	/* SpurMemoryManager>>#slotSizeOf: */
sqInt
slotSizeOf(sqInt oop)
{
    sqInt fmt;
    usqInt numSlots;
    usqInt numSlots1;

	if (oop & (tagMask())) {
		return 0;
	}
	/* begin lengthOf:format: */
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOfAny: */
	numSlots1 = byteAt(oop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		return numSlots;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		return (numSlots << (shiftForWord())) - (fmt & 7);
	}
	if (fmt >= (firstShortFormat())) {
		return (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
	}
	if (fmt >= (firstLongFormat())) {
		return (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		return numSlots;
	}
	return 0;
}


/*	Return one of the objects in the specialObjectsArray */

	/* SpurMemoryManager>>#splObj: */
sqInt
splObj(sqInt index)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
}


/*	Answer the start of objOop, which is either the address of the overflow
	size word, or objOop itself, depending on the size of the object. This may
	be applied to any kind of object, normal, forwarders or free chunks. */

	/* SpurMemoryManager>>#startOfObject: */
static usqInt NoDbgRegParms
startOfObject(sqInt objOop)
{
	return ((byteAt(objOop + 7)) == (numSlotsMask())
		? objOop - BaseHeaderSize
		: objOop);
}


/*	Part of InterpreterProxy's 1.14 API */

	/* SpurMemoryManager>>#statNumGCs */
EXPORT(sqInt)
statNumGCs(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (GIV(statScavenges) + GIV(statIncrGCs)) + GIV(statFullGCs);
}


/*	A renaming for the Cogit, which couldn't make sense of GIV(newSpaceLimit) */

	/* SpurMemoryManager>>#storeCheckBoundary */
usqInt
storeCheckBoundary(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(newSpaceLimit);
}


/*	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
	objects in the heap) of the
	set of objects in arrayOfObjects. All pointers from within the set to
	objects outside the set 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 8), but with the high
	bit set.
	
	Since Spur has a class table the load primitive must insert classes that
	have instances into the
	class table. This primitive marks such classes using the isRemembered bit,
	which isn't meaningful
	as a remembered bit in the segment.
	
	The primitive expects the segmentWordArray and outPointerArray to be more
	than adequately long.
	In this case it returns normally, and truncates the two arrays to exactly
	the right size.
	
	The primitive can fail for the following reasons with the specified
	failure codes:
	PrimErrGenericError:		the segmentWordArray is too small for the version
	stamp PrimErrWritePastObject:	the segmentWordArray is too small to contain
	the reachable objects
	PrimErrBadIndex:			the outPointerArray is too small
	PrimErrNoMemory:			additional allocations failed
	PrimErrLimitExceeded:		there is no room in the hash field to store out
	pointer indices or class references. */

	/* SpurMemoryManager>>#storeImageSegmentInto:outPointers:roots: */
static sqInt NoDbgRegParms
storeImageSegmentIntooutPointersroots(sqInt segmentWordArrayArg, sqInt outPointerArrayArg, sqInt arrayOfRootsArg)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arrayOfObjects;
    sqInt arrayOfRoots;
    sqInt classIndex;
    sqInt classIndex1;
    usqInt endSeg;
    sqInt fillValue;
    sqInt formatField;
    sqInt formatField1;
    sqInt hash;
    sqInt here;
    sqInt hereLimiT;
    sqInt i;
    sqInt iLimiT;
    sqInt nClasses;
    usqInt newObj;
    usqInt newObj1;
    sqInt newSegAddrOrError;
    usqInt numBytes;
    usqInt numBytes1;
    sqInt numBytes2;
    sqInt numClassesInSegment;
    sqInt numSlots;
    sqInt numSlots1;
    sqInt numSlots2;
    sqInt numSlots3;
    usqInt numSlots4;
    usqInt numSlots5;
    usqInt numSlots6;
    sqInt objOop;
    sqInt objOop1;
    sqInt outIndex;
    sqInt outPointerArray;
    usqInt p;
    usqInt p1;
    sqInt referent;
    sqInt referent1;
    sqInt referent2;
    sqInt savedFirstFields;
    sqInt savedOutHashes;
    usqInt segAddr;
    sqInt segmentWordArray;
    usqInt segStart;
    sqInt tempObjOop;
    sqInt there;

	if ((
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(segmentWordArrayArg))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		)
	 || (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(outPointerArrayArg))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		)) {
		return PrimErrNoModification;
	}
	if ((((((usqInt) (longAt(segmentWordArrayArg))) >> (pinnedBitShift())) & 1) != 0)
	 || (((((usqInt) (longAt(outPointerArrayArg))) >> (pinnedBitShift())) & 1) != 0)) {
		return PrimErrObjectIsPinned;
	}
	if ((numSlotsOf(outPointerArrayArg)) > (identityHashHalfWordMask())) {
		return PrimErrLimitExceeded;
	}
	runLeakCheckerFor(GCModeImageSegment);
	/* begin scavengingGC */
	scavengingGCTenuringIf(TenureByAge);
	if (((longAt(segmentWordArrayArg)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(segmentWordArrayArg));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((segmentWordArrayArg + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		segmentWordArray = referent;
	}
	else {
		segmentWordArray = segmentWordArrayArg;
	}
	if (((longAt(outPointerArrayArg)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(outPointerArrayArg));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent1 = longAt((outPointerArrayArg + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent1 & (tagMask())) == 0)
		 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		outPointerArray = referent1;
	}
	else {
		outPointerArray = outPointerArrayArg;
	}
	if (((longAt(arrayOfRootsArg)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(arrayOfRootsArg));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent2 = longAt((arrayOfRootsArg + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent2 & (tagMask())) == 0)
		 && (((longAt(referent2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		arrayOfRoots = referent2;
	}
	else {
		arrayOfRoots = arrayOfRootsArg;
	}
	assert(!((forwardersIn(outPointerArray))));
	assert(!((forwardersIn(arrayOfRoots))));
	arrayOfObjects = objectsReachableFromRoots(arrayOfRoots);
	if (!(arrayOfObjects)) {
		return PrimErrNoMemory;
	}
	assert(allObjectsUnmarked());
	assert(!((forwardersIn(arrayOfObjects))));
	/* begin moveClassesForwardsIn: */

	/* if > 0, this is the index of the first non-class past the first element. */
	nClasses = (there = 0);
	for (here = 1, hereLimiT = ((numSlotsOf(arrayOfObjects)) - 1); here <= hereLimiT; here += 1) {
		/* begin fetchPointer:ofObject: */
		objOop1 = longAt((arrayOfObjects + BaseHeaderSize) + (((sqInt)((usqInt)(here) << (shiftForWord())))));
		hash = (long32At(objOop1 + 4)) & (identityHashHalfWordMask());
		if ((hash > (lastClassIndexPun()))
		 && ((classOrNilAtIndex(hash)) == objOop1)) {
			nClasses += 1;
			if (there > 0) {

				/* if there is zero we're in a run of classes at the start so don't move */
				/* begin fetchPointer:ofObject: */
				tempObjOop = longAt((arrayOfObjects + BaseHeaderSize) + (((sqInt)((usqInt)(there) << (shiftForWord())))));
				assert(!(isOopForwarded(arrayOfObjects)));
				longAtput((arrayOfObjects + BaseHeaderSize) + (((sqInt)((usqInt)(there) << (shiftForWord())))), objOop1);
				assert(!(isOopForwarded(arrayOfObjects)));
				longAtput((arrayOfObjects + BaseHeaderSize) + (((sqInt)((usqInt)(here) << (shiftForWord())))), tempObjOop);
				there += 1;
			}
		}
		else {
			if (there == 0) {
				there = here;
			}
		}
	}
	numClassesInSegment = nClasses;
	/* begin allocateSlots:format:classIndex: */
	assert((classIndexOf(arrayOfObjects)) > (isForwardedObjectClassIndexPun()));
	numSlots6 = byteAt(arrayOfObjects + 7);
	numSlots2 = (numSlots6 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(arrayOfObjects - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots6);
	formatField = sixtyFourBitIndexableFormat();
	classIndex = sixtyFourBitLongsClassIndexPun();
	if (numSlots2 >= (numSlotsMask())) {
		if ((((usqInt) numSlots2) >> 56) > 0) {
			savedFirstFields = null;
			goto l17;
		}
		newObj = GIV(freeStart) + BaseHeaderSize;
		numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots2 * BytesPerOop);
	}
	else {
		newObj = GIV(freeStart);
		numBytes = BaseHeaderSize + ((numSlots2 < 1
	? /* begin allocationUnit */ 8
	: numSlots2 * BytesPerOop));
	}
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		savedFirstFields = allocateSlotsInOldSpacebytesformatclassIndex(numSlots2, numBytes, formatField, classIndex);
		goto l17;
	}
	if (numSlots2 >= (numSlotsMask())) {

		/* for header parsing we put a saturated slot count in the prepended overflow size word */
		flag("endianness");
		longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots2);
		longAtput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), formatField, classIndex));
	}
	else {
		longAtput(newObj, (((((usqLong) numSlots2)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + classIndex);
	}
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	GIV(freeStart) += numBytes;
	savedFirstFields = newObj;
	l17:	/* end allocateSlots:format:classIndex: */;
	/* begin allocateSlots:format:classIndex: */
	numBytes2 = (numSlotsOf(outPointerArray)) * 4;
	numSlots3 = (numBytes2 + (BytesPerWord - 1)) / BytesPerWord;
	formatField1 = firstLongFormat();
	classIndex1 = thirtyTwoBitLongsClassIndexPun();
	if (numSlots3 >= (numSlotsMask())) {
		if ((((usqInt) numSlots3) >> 56) > 0) {
			savedOutHashes = null;
			goto l19;
		}
		newObj1 = GIV(freeStart) + BaseHeaderSize;
		numBytes1 = (BaseHeaderSize + BaseHeaderSize) + (numSlots3 * BytesPerOop);
	}
	else {
		newObj1 = GIV(freeStart);
		numBytes1 = BaseHeaderSize + ((numSlots3 < 1
	? /* begin allocationUnit */ 8
	: numSlots3 * BytesPerOop));
	}
	if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		savedOutHashes = allocateSlotsInOldSpacebytesformatclassIndex(numSlots3, numBytes1, formatField1, classIndex1);
		goto l19;
	}
	if (numSlots3 >= (numSlotsMask())) {

		/* for header parsing we put a saturated slot count in the prepended overflow size word */
		flag("endianness");
		longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots3);
		longAtput(newObj1, headerForSlotsformatclassIndex(numSlotsMask(), formatField1, classIndex1));
	}
	else {
		longAtput(newObj1, (((((usqLong) numSlots3)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField1) << (formatShift()))))) + classIndex1);
	}
	assert((numBytes1 % (allocationUnit())) == 0);
	assert((newObj1 % (allocationUnit())) == 0);
	GIV(freeStart) += numBytes1;
	savedOutHashes = newObj1;
	l19:	/* end allocateSlots:format:classIndex: */;
	if ((savedFirstFields == null)
	 || (savedOutHashes == null)) {
		freeObject(arrayOfObjects);
		return PrimErrNoMemory;
	}
	/* begin fillObj:numSlots:with: */
	assert((classIndexOf(savedFirstFields)) > (isForwardedObjectClassIndexPun()));
	numSlots4 = byteAt(savedFirstFields + 7);
	numSlots = (numSlots4 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(savedFirstFields - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots4);
	assert(oopisLessThan(((savedFirstFields + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1, addressAfter(savedFirstFields)));
	for (p = (((usqInt)(savedFirstFields + BaseHeaderSize))); p <= (((usqInt)(((savedFirstFields + BaseHeaderSize) + (numSlots * BytesPerOop)) - 1))); p += 8 /* allocationUnit */) {
		longAtput(p, 0);
	}
	/* begin fillObj:numSlots:with: */
	assert((classIndexOf(savedOutHashes)) > (isForwardedObjectClassIndexPun()));
	numSlots5 = byteAt(savedOutHashes + 7);
	numSlots1 = (numSlots5 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(savedOutHashes - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots5);
	fillValue = (((sqInt)((usqInt)(((identityHashHalfWordMask()) + 1)) << 32))) + ((identityHashHalfWordMask()) + 1);
	assert(oopisLessThan(((savedOutHashes + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1, addressAfter(savedOutHashes)));
	for (p1 = (((usqInt)(savedOutHashes + BaseHeaderSize))); p1 <= (((usqInt)(((savedOutHashes + BaseHeaderSize) + (numSlots1 * BytesPerOop)) - 1))); p1 += 8 /* allocationUnit */) {
		longAtput(p1, fillValue);
	}
	segAddr = segmentWordArray + BaseHeaderSize;

	/* Write a version number for byte order and version check. */
	endSeg = addressAfter(segmentWordArray);
	if (segAddr >= endSeg) {
		return PrimErrGenericFailure;
	}
	long32Atput(segAddr, imageSegmentVersion());
	long32Atput(segAddr + 4, imageSegmentVersion());
	segStart = (segAddr += 8 /* allocationUnit */);
	assert(arrayOfRoots == (fetchPointerofObject(0, arrayOfObjects)));
	for (i = 0, iLimiT = ((numSlotsOf(arrayOfObjects)) - 1); i <= iLimiT; i += 1) {

		/* Check that classes in the segment are addressible.  Since the top bit of the hash field is used to tag
		   classes external to the segment, the segment offset must not inadvertently set this bit.  This limit still
		   allows for a million or more classes. */
		if ((i == numClassesInSegment)
		 && ((((segAddr - segStart) / 8 /* allocationUnit */) + (lastClassIndexPun())) >= TopHashBit)) {
			return returnrestoringObjectsInupTosavedFirstFields(PrimErrLimitExceeded, arrayOfObjects, i, savedFirstFields);
		}
		/* begin fetchPointer:ofObject: */
		objOop = longAt((arrayOfObjects + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		assert(!(((isImmediate(objOop))
 || (isForwarded(objOop)))));
		newSegAddrOrError = copyObjtoAddrstopAtsavedFirstFieldsindex(objOop, segAddr, endSeg, savedFirstFields, i);
		if (oopisLessThan(newSegAddrOrError, segStart)) {
			return returnrestoringObjectsInupTosavedFirstFields(newSegAddrOrError, arrayOfObjects, i, savedFirstFields);
		}
		segAddr = newSegAddrOrError;
	}
	if ((endSeg != segAddr)
	 && ((endSeg - segAddr) < (BaseHeaderSize + BytesPerOop))) {
		return returnrestoringObjectsInupTosavedFirstFields(PrimErrWritePastObject, arrayOfObjects, -1, savedFirstFields);
	}
	if (((outIndex = mapOopsFromtooutPointersoutHashes(segStart, segAddr, outPointerArray, savedOutHashes))) < 0) {

		/* no room in outPointers; fail */
		return returnrestoringObjectsInsavedFirstFieldsandsavedHashes(PrimErrBadIndex, arrayOfObjects, savedFirstFields, outPointerArray, savedOutHashes);
	}
	shortentoIndexableSize(segmentWordArray, (segAddr - (segmentWordArray + BaseHeaderSize)) / 4);
	shortentoIndexableSize(outPointerArray, outIndex);
	return returnrestoringObjectsInsavedFirstFieldsandsavedHashes(PrimNoErr, arrayOfObjects, savedFirstFields, outPointerArray, savedOutHashes);
}

	/* SpurMemoryManager>>#storePointerUnchecked:ofObject:withValue: */
sqInt
storePointerUncheckedofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer)
{
	assert(!(isOopForwarded(objOop)));
	return longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), valuePointer);
}


/*	Note must check here for stores of young objects into old ones. */

	/* SpurMemoryManager>>#storePointer:ofObject:withValue: */
sqInt
storePointerofObjectwithValue(sqInt fieldIndex, sqInt objOop, sqInt valuePointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assert(!(isForwarded(objOop)));
	if ((assert(isNonImmediate(objOop)),
	oopisGreaterThanOrEqualTo(objOop, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((valuePointer & (tagMask())) == 0)
		 && (oopisLessThan(valuePointer, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(objOop))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(objOop);
			}
		}
	}
	return longAtput((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), valuePointer);
}


/*	Answer a new String copied from a null-terminated C string,
	or nil if out of memory. */

	/* SpurMemoryManager>>#stringForCString: */
sqInt
stringForCString(const char *aCString)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt formatField;
    sqInt len;
    usqInt newObj;
    sqInt newString;
    usqInt numBytes;
    sqInt numSlots;

	len = strlen(aCString);
	/* begin allocateSlots:format:classIndex: */
	numSlots = (len + (BytesPerWord - 1)) / BytesPerWord;
	formatField = (firstByteFormat()) + ((8 - len) & (BytesPerWord - 1));
	if (numSlots >= (numSlotsMask())) {
		if ((((usqInt) numSlots) >> 56) > 0) {
			newString = null;
			goto l2;
		}
		newObj = GIV(freeStart) + BaseHeaderSize;
		numBytes = (BaseHeaderSize + BaseHeaderSize) + (numSlots * BytesPerOop);
	}
	else {
		newObj = GIV(freeStart);
		numBytes = BaseHeaderSize + ((numSlots < 1
	? /* begin allocationUnit */ 8
	: numSlots * BytesPerOop));
	}
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		newString = allocateSlotsInOldSpacebytesformatclassIndex(numSlots, numBytes, formatField, ClassByteStringCompactIndex);
		goto l2;
	}
	if (numSlots >= (numSlotsMask())) {

		/* for header parsing we put a saturated slot count in the prepended overflow size word */
		flag("endianness");
		longAtput(GIV(freeStart), (((sqInt)((usqInt)((numSlotsMask())) << (numSlotsFullShift())))) + numSlots);
		longAtput(newObj, headerForSlotsformatclassIndex(numSlotsMask(), formatField, ClassByteStringCompactIndex));
	}
	else {
		longAtput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(formatField) << (formatShift()))))) + ClassByteStringCompactIndex);
	}
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	GIV(freeStart) += numBytes;
	newString = newObj;
	l2:	/* end allocateSlots:format:classIndex: */;
	if (!(newString == null)) {
		strncpy(((char *) (newString + BaseHeaderSize)), aCString, len);
	}
	return newString;
}


/*	This is ObjectMemory's funky entry-point into its incremental GC,
	which is a stop-the-world a young generation reclaimer. In Spur
	we run the scavenger. Answer if space is not low. */

	/* SpurMemoryManager>>#sufficientSpaceAfterGC: */
static sqInt NoDbgRegParms
sufficientSpaceAfterGC(sqInt numBytes)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt heapSizePostGC;

	assert(numBytes == 0);
	scavengingGCTenuringIf(TenureByAge);
	heapSizePostGC = (GIV(totalHeapSizeIncludingBridges) - (GIV(numSegments) * (2 * BaseHeaderSize))) - GIV(totalFreeOldSpace);
	if (((((double) (heapSizePostGC - GIV(heapSizeAtPreviousGC)) )) / GIV(heapSizeAtPreviousGC)) >= GIV(heapGrowthToSizeGCRatio)) {
		fullGC();
	}
	while ((GIV(totalFreeOldSpace) < GIV(growHeadroom))
	 && ((growOldSpaceByAtLeast(0)) != null)) {
		if (GIV(totalFreeOldSpace) >= GIV(growHeadroom)) {
			return 1;
		}
	}
	if (GIV(lowSpaceThreshold) > GIV(totalFreeOldSpace)) {

		/* space is low */

		/* avoid signalling low space twice */
		GIV(lowSpaceThreshold) = 0;
		return 0;
	}
	return 1;
}


/*	On load, swizzle the pointers in an obj stack. Answer the obj stack's oop. */

	/* SpurMemoryManager>>#swizzleObjStackAt: */
static sqInt NoDbgRegParms
swizzleObjStackAt(sqInt objStackRootIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt field;
    sqInt firstPage;
    sqInt index;
    sqInt page;
    sqInt stackOrNil;

	firstPage = (stackOrNil = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(objStackRootIndex) << (shiftForWord()))))));
	if (stackOrNil == GIV(nilObj)) {
		return stackOrNil;
	}
	do {
		assert((numSlotsOfAny(stackOrNil)) == ObjStackPageSlots);
		assert((fetchPointerofObject(ObjStackMyx, stackOrNil)) == objStackRootIndex);

		/* swizzle fields including ObjStackNextx, excluding ObjStackFreex and leave field containing the next link. */
		index = (longAt((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))))) + ObjStackNextx;
		do {
			/* begin fetchPointer:ofObject: */
			field = longAt((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
			if (!((field == 0)
				 || (field & (tagMask())))) {
				field = swizzleObj(field);
				/* begin storePointer:ofObjStack:withValue: */
				assert((formatOf(stackOrNil)) == (wordIndexableFormat()));
				longAtput((stackOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))), field);
			}
		} while(((index -= 1)) >= ObjStackNextx);
	} while(((stackOrNil = field)) != 0);
	if (((stackOrNil = longAt((firstPage + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord()))))))) != 0) {
		page = firstPage;
		do {
			stackOrNil = swizzleObj(stackOrNil);
			/* begin storePointer:ofObjStack:withValue: */
			assert((formatOf(page)) == (wordIndexableFormat()));
			longAtput((page + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord())))), stackOrNil);
			page = stackOrNil;
		} while(((stackOrNil = longAt((page + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackFreex) << (shiftForWord()))))))) != 0);
	}
	assert(isValidObjStackAt(objStackRootIndex));
	/* begin fetchPointer:ofObject: */
	return longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(objStackRootIndex) << (shiftForWord())))));
}


/*	Do an incremental GC that tenures all surviving young objects to old
	space. 
 */

	/* SpurMemoryManager>>#tenuringIncrementalGC */
void
tenuringIncrementalGC(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt savedTenuringThreshold;

	/* begin flushNewSpace */
	savedTenuringThreshold = GIV(tenureThreshold);
	/* begin setRawTenuringThreshold: */
	GIV(tenureThreshold) = GIV(newSpaceLimit);
	scavengingGCTenuringIf(TenureByAge);
	/* begin setRawTenuringThreshold: */
	GIV(tenureThreshold) = savedTenuringThreshold;
	assert((rememberedSetSize()) == 0);
	assert(GIV(pastSpaceStart) == (((pastSpace()).start)));
	assert(GIV(freeStart) == (((eden()).start)));
}


/*	This assert is tricky. push:onObjStack: may call topOfObjStack: just after
	pushing an
	empty page on the stack, and will ask if the second page is valid. */

	/* SpurMemoryManager>>#topOfObjStack: */
static sqInt NoDbgRegParms
topOfObjStack(sqInt objStack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt topx;

	eassert(isValidObjStackPagemyIndexfirstPage(objStack, fetchPointerofObject(ObjStackMyx, objStack), objStack == (fetchPointerofObject(fetchPointerofObject(ObjStackMyx, objStack), GIV(hiddenRootsObj)))));
	/* begin fetchPointer:ofObject: */
	topx = longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(ObjStackTopx) << (shiftForWord())))));
	if (topx == 0) {
		assert((fetchPointerofObject(ObjStackNextx, objStack)) == 0);
		return null;
	}
	/* begin fetchPointer:ofObject: */
	return longAt((objStack + BaseHeaderSize) + (((sqInt)((usqInt)(((topx + ObjStackFixedSlots) - 1)) << (shiftForWord())))));
}


/*	Answers the top of the remappable oop stack. Useful when writing loops.
	We support this excessence for compatibility with ObjectMemory.
	Spur doesn't GC during allocation. */

	/* SpurMemoryManager>>#topRemappableOop */
sqInt
topRemappableOop(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(remapBuffer)[GIV(remapBufferCount)];
}


/*	This method both computes the actual number of free bytes by traversing
	all free objects
	on the free lists/tree, and checks that the tree is valid. It is used
	mainly by checkFreeSpace. */

	/* SpurMemoryManager>>#totalFreeListBytes */
static sqInt
totalFreeListBytes(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bytesInChunk;
    sqInt cameFrom;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt fieldIndex11;
    sqInt fieldIndex2;
    sqInt fieldIndex3;
    sqInt i;
    sqInt iLimiT;
    sqInt largeChild;
    sqInt listNode;
    sqInt nextNode;
    sqInt smallChild;
    sqInt totalFreeBytes;
    sqInt treeNode1;

	totalFreeBytes = 0;
	for (i = 1, iLimiT = (64 /* numFreeLists */ - 1); i <= iLimiT; i += 1) {
		bytesInChunk = i * 8 /* allocationUnit */;
		listNode = GIV(freeLists)[i];
		while (listNode != 0) {
			totalFreeBytes += bytesInChunk;
			/* begin assertValidFreeObject: */
			assert(assertInnerValidFreeObject(listNode));
			assert(bytesInChunk == (bytesInObject(listNode)));
			/* begin fetchPointer:ofFreeChunk: */
			fieldIndex = 0 /* freeChunkNextIndex */;
			nextNode = longAt((listNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
			assert(nextNode != listNode);
			listNode = nextNode;
		}
	}
	/* begin freeTreeNodesDo: */
	treeNode1 = GIV(freeLists)[0];
	if (treeNode1 == 0) {
		goto l6;
	}
	cameFrom = -1;
	do {
		assert((bytesInObject(treeNode1)) >= ((numFreeLists()) * (allocationUnit())));
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex11 = 3 /* freeChunkSmallerIndex */;
		smallChild = longAt((treeNode1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex11) << (shiftForWord())))));
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex2 = 4 /* freeChunkLargerIndex */;
		largeChild = longAt((treeNode1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))));
		assert((smallChild == 0)
		 || (treeNode1 == (fetchPointerofFreeChunk(freeChunkParentIndex(), smallChild))));
		assert((largeChild == 0)
		 || (treeNode1 == (fetchPointerofFreeChunk(freeChunkParentIndex(), largeChild))));
		if (((smallChild == 0)
		 && (largeChild == 0))
		 || ((largeChild == 0
			? cameFrom == smallChild
			: cameFrom == largeChild))) {

			/* and since we've applied we must move on up */
			bytesInChunk = bytesInObject(treeNode1);
			assert((bytesInChunk / (allocationUnit())) >= (numFreeLists()));
			listNode = treeNode1;
			while (listNode != 0) {

				/* self printFreeChunk: listNode */
				/* begin assertValidFreeObject: */
				assert(assertInnerValidFreeObject(listNode));
				assert((listNode == treeNode1)
				 || ((fetchPointerofFreeChunk(freeChunkParentIndex(), listNode)) == 0));
				totalFreeBytes += bytesInChunk;
				assert(bytesInChunk == (bytesInObject(listNode)));
				/* begin fetchPointer:ofFreeChunk: */
				fieldIndex1 = 0 /* freeChunkNextIndex */;
				nextNode = longAt((listNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
				assert(nextNode != listNode);
				listNode = nextNode;
			}
			treeNode1 = treeNode1;
			cameFrom = treeNode1;
			/* begin fetchPointer:ofFreeChunk: */
			fieldIndex3 = 2 /* freeChunkParentIndex */;
			treeNode1 = longAt((treeNode1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord())))));
		}
		else {
			if ((smallChild != 0)
			 && (cameFrom != smallChild)) {
				treeNode1 = smallChild;
			}
			else {
				assert(largeChild != 0);
				treeNode1 = largeChild;
			}
			cameFrom = -1;
		}
	} while(treeNode1 != 0);
	l6:	/* end freeTreeNodesDo: */;
	return totalFreeBytes;
}

	/* SpurMemoryManager>>#trueObject */
sqInt
trueObject(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(trueObj);
}


/*	Unlink a free object from the free lists. Do not alter totalFreeOldSpace.
	Used for coalescing.
 */

	/* SpurMemoryManager>>#unlinkFreeChunk:chunkBytes: */
static sqInt NoDbgRegParms
unlinkFreeChunkchunkBytes(sqInt freeChunk, sqInt chunkBytes)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt fieldIndex2;
    sqInt index;
    sqInt next;
    sqInt next1;
    sqInt nextFreeChunk;
    sqInt prev;


	/* Pathological 64 bits case - size 1 - single linked list */
	index = chunkBytes / 8 /* allocationUnit */;
	if ((assert(chunkBytes >= (BaseHeaderSize + (allocationUnit()))),
	chunkBytes == (BaseHeaderSize + 8 /* allocationUnit */))) {
		return unlinkLilliputianChunkindex(freeChunk, index);
	}
	/* begin fetchPointer:ofFreeChunk: */
	fieldIndex = 1 /* freeChunkPrevIndex */;
	prev = longAt((freeChunk + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	if (prev != 0) {
		/* begin setNextFreeChunkOf:withValue:chunkBytes: */
		nextFreeChunk = longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())));
		/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
		assert(isFreeObject(prev));
		assert((nextFreeChunk == 0)
		 || (isFreeObject(nextFreeChunk)));
		longAtput((prev + BaseHeaderSize) + (0U << (shiftForWord())), nextFreeChunk);
		if ((nextFreeChunk != 0)
		 && (!((assert(chunkBytes >= (BaseHeaderSize + (allocationUnit()))),
		chunkBytes == (BaseHeaderSize + 8 /* allocationUnit */))))) {
			/* begin storePointer:ofFreeChunk:withValue: */
			assert(isFreeObject(nextFreeChunk));
			assert((prev == 0)
			 || (isFreeObject(prev)));
			longAtput((nextFreeChunk + BaseHeaderSize) + (1U << (shiftForWord())), prev);
		}
		return freeChunk;
	}
	if ((index < 64 /* numFreeLists */)
	 && ((1ULL << index) <= GIV(freeListsMask))) {
		/* begin unlinkFreeChunk:atIndex:isLilliputianSize: */
		assert(((bytesInObject(freeChunk)) == (index * (allocationUnit())))
		 && ((index > 1)
		 && ((startOfObject(freeChunk)) == freeChunk)));
		GIV(freeLists)[index] = ((next1 = longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))));
		if (next1 != 0) {
			/* begin storePointer:ofFreeChunk:withValue: */
			fieldIndex2 = 1 /* freeChunkPrevIndex */;
			assert(isFreeObject(next1));
			assert(1);
			longAtput((next1 + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), 0);
		}
		return freeChunk;
	}
	/* begin fetchPointer:ofFreeChunk: */
	fieldIndex1 = 0 /* freeChunkNextIndex */;
	next = longAt((freeChunk + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
	if (next == 0) {

		/* no list; remove the interior node */
		unlinkSolitaryFreeTreeNode(freeChunk);
	}
	else {

		/* list; replace node with it */
		inFreeTreeReplacewith(freeChunk, next);
	}
	return freeChunk;
}

	/* SpurMemoryManager>>#unlinkLilliputianChunk:index: */
static sqInt NoDbgRegParms NeverInline
unlinkLilliputianChunkindex(sqInt freeChunk, sqInt index)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fieldIndex;
    sqInt next;
    sqInt next1;
    sqInt node;
    sqInt prev;


	/* for profiling */
	node = GIV(freeLists)[index];
	prev = 0;
	while (node != 0) {
		assert(node == (startOfObject(node)));
		/* begin assertValidFreeObject: */
		assert(assertInnerValidFreeObject(node));
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex = 0 /* freeChunkNextIndex */;
		next = longAt((node + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
		if (node == freeChunk) {
			if (prev == 0) {
				/* begin unlinkFreeChunk:atIndex:isLilliputianSize: */
				assert(((bytesInObject(freeChunk)) == (index * (allocationUnit())))
				 && ((index > 1)
				 && ((startOfObject(freeChunk)) == freeChunk)));
				GIV(freeLists)[index] = ((next1 = longAt((freeChunk + BaseHeaderSize) + (0U << (shiftForWord())))));
							}
			else {
				/* begin setNextFreeChunkOf:withValue:isLilliputianSize: */
				assert(isFreeObject(prev));
				assert((next == 0)
				 || (isFreeObject(next)));
				longAtput((prev + BaseHeaderSize) + (0U << (shiftForWord())), next);
							}
			return freeChunk;
		}
		prev = node;
		node = next;
	}
	error("freeChunk not found in lilliputian chunk free list");
	return 0;
}


/*	Unlink a freeTreeNode. Assumes the node has no list (null next link). */

	/* SpurMemoryManager>>#unlinkSolitaryFreeTreeNode: */
static void NoDbgRegParms
unlinkSolitaryFreeTreeNode(sqInt freeTreeNode)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt fieldIndex2;
    sqInt fieldIndex3;
    sqInt fieldIndex4;
    sqInt fieldIndex5;
    sqInt fieldIndex6;
    sqInt fieldIndex7;
    sqInt fieldIndex8;
    sqInt larger;
    sqInt parent;
    sqInt smaller;

	assert((fetchPointerofFreeChunk(freeChunkNextIndex(), freeTreeNode)) == 0);
	/* begin fetchPointer:ofFreeChunk: */
	fieldIndex6 = 3 /* freeChunkSmallerIndex */;
	smaller = longAt((freeTreeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex6) << (shiftForWord())))));
	/* begin fetchPointer:ofFreeChunk: */
	fieldIndex7 = 4 /* freeChunkLargerIndex */;
	larger = longAt((freeTreeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex7) << (shiftForWord())))));
	/* begin fetchPointer:ofFreeChunk: */
	fieldIndex8 = 2 /* freeChunkParentIndex */;
	parent = longAt((freeTreeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex8) << (shiftForWord())))));
	if (parent == 0) {

		/* no parent; stitch the subnodes back into the root */
		if (smaller == 0) {
			if (larger != 0) {
				/* begin storePointer:ofFreeChunk:withValue: */
				fieldIndex = 2 /* freeChunkParentIndex */;
				assert(isFreeObject(larger));
				assert(1);
				longAtput((larger + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), 0);
			}
			GIV(freeLists)[0] = larger;
		}
		else {
			/* begin storePointer:ofFreeChunk:withValue: */
			fieldIndex1 = 2 /* freeChunkParentIndex */;
			assert(isFreeObject(smaller));
			assert(1);
			longAtput((smaller + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), 0);
			GIV(freeLists)[0] = smaller;
			if (larger != 0) {
				addFreeSubTree(larger);
			}
		}
	}
	else {

		/* parent; stitch back into appropriate side of parent. */
		if (smaller == 0) {
			/* begin storePointer:ofFreeChunk:withValue: */
			if (freeTreeNode == (longAt((parent + BaseHeaderSize) + (3U << (shiftForWord()))))) {
				/* begin freeChunkSmallerIndex */
				fieldIndex3 = 3;
			}
			else {
				/* begin freeChunkLargerIndex */
				fieldIndex3 = 4;
			}
			assert(isFreeObject(parent));
			assert((larger == 0)
			 || (isFreeObject(larger)));
			longAtput((parent + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord())))), larger);
			if (larger != 0) {
				/* begin storePointer:ofFreeChunk:withValue: */
				fieldIndex2 = 2 /* freeChunkParentIndex */;
				assert(isFreeObject(larger));
				assert((parent == 0)
				 || (isFreeObject(parent)));
				longAtput((larger + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), parent);
			}
		}
		else {
			/* begin storePointer:ofFreeChunk:withValue: */
			if (freeTreeNode == (longAt((parent + BaseHeaderSize) + (3U << (shiftForWord()))))) {
				/* begin freeChunkSmallerIndex */
				fieldIndex4 = 3;
			}
			else {
				/* begin freeChunkLargerIndex */
				fieldIndex4 = 4;
			}
			assert(isFreeObject(parent));
			assert((smaller == 0)
			 || (isFreeObject(smaller)));
			longAtput((parent + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex4) << (shiftForWord())))), smaller);
			/* begin storePointer:ofFreeChunk:withValue: */
			fieldIndex5 = 2 /* freeChunkParentIndex */;
			assert(isFreeObject(smaller));
			assert((parent == 0)
			 || (isFreeObject(parent)));
			longAtput((smaller + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex5) << (shiftForWord())))), parent);
			if (larger != 0) {
				addFreeSubTree(larger);
			}
		}
	}
}

	/* SpurMemoryManager>>#unpinObject: */
sqInt
unpinObject(sqInt objOop)
{
	assert(isNonImmediate(objOop));
	/* begin setIsPinnedOf:to: */
	longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1U << (pinnedBitShift()))));
	return 0;
}

	/* SpurMemoryManager>>#updateListStartingAt: */
static void NoDbgRegParms
updateListStartingAt(sqInt freeNode)
{
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt fieldIndex2;
    sqInt obj;
    sqInt prev;

	if (freeNode == 0) {
		return;
	}
	assert(!((isLilliputianSize(bytesInObject(freeNode)))));
	prev = freeNode;
	/* begin storePointer:ofFreeChunk:withValue: */
	fieldIndex2 = 1 /* freeChunkPrevIndex */;
	assert(isFreeObject(prev));
	assert(1);
	longAtput((prev + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))), 0);
	while (1) {
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex = 0 /* freeChunkNextIndex */;
		obj = longAt((prev + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
		if (!(obj != 0)) break;
		/* begin storePointer:ofFreeChunk:withValue: */
		fieldIndex1 = 1 /* freeChunkPrevIndex */;
		assert(isFreeObject(obj));
		assert((prev == 0)
		 || (isFreeObject(prev)));
		longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))), prev);
		prev = obj;
	}
}


/*	Check the hashes of classes in the table. The tricky thing here is that
	classes may be duplicated
	in the table. So each entry must be in the table at its hash, even if it
	is elsewhere in the table. */

	/* SpurMemoryManager>>#validClassTableHashes */
static sqInt
validClassTableHashes(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classOrNil1;
    sqInt hash;
    sqInt i;
    sqInt ignored;
    sqInt j;
    sqInt jLimiT;
    sqInt page;

	if (!(validClassTableRootPages())) {
		return 0;
	}
	/* begin classTableEntriesDo: */
	for (i = 0; i < GIV(numClassTablePages); i += 1) {
		page = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		for (j = 0, jLimiT = ((1U << (classTableMajorIndexShift())) - 1); j <= jLimiT; j += 1) {
			classOrNil1 = longAt((page + BaseHeaderSize) + (((sqInt)((usqInt)(j) << (shiftForWord())))));
			if (classOrNil1 != GIV(nilObj)) {
				ignored = (((sqInt)((usqInt)(i) << (classTableMajorIndexShift())))) + j;
				if (((longAt(classOrNil1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					return 0;
				}
				/* begin rawHashBitsOf: */
				hash = (long32At(classOrNil1 + 4)) & (identityHashHalfWordMask());
				if (hash == 0) {
					return 0;
				}
				if ((noCheckClassAtIndex(hash)) != classOrNil1) {
					return 0;
				}
			}
		}
	}
	return 1;
}


/*	Answer if hiddenRootsObj is of the right size with the
	expected contents, and if numClassTablePages is correct. */

	/* SpurMemoryManager>>#validClassTableRootPages */
static sqInt
validClassTableRootPages(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt iLimiT;
    sqInt obj;

	if (!((numSlotsOf(GIV(hiddenRootsObj))) == ((1U << (22 /* classIndexFieldWidth */ - (classTableMajorIndexShift()))) + 8 /* hiddenRootSlots */))) {
		return 0;
	}
	if (!((GIV(numClassTablePages) > 1)
		 && (GIV(numClassTablePages) <= (1U << (22 /* classIndexFieldWidth */ - (classTableMajorIndexShift())))))) {
		return 0;
	}
	for (i = 0; i < GIV(numClassTablePages); i += 1) {
		/* begin fetchPointer:ofObject: */
		obj = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if (!((addressCouldBeObj(obj))
			 && ((numSlotsOf(obj)) == (1U << (classTableMajorIndexShift()))))) {
			return 0;
		}
	}
	for (i = GIV(numClassTablePages), iLimiT = ((1U << (22 /* classIndexFieldWidth */ - (classTableMajorIndexShift()))) - 1); i <= iLimiT; i += 1) {
		if ((longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))))) != GIV(nilObj)) {
			return 0;
		}
	}
	return 1;
}

	/* SpurMemoryManager>>#validFreeTree */
sqInt
validFreeTree(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (validFreeTreeChunkparent(GIV(freeLists)[0], 0)) == null;
}

	/* SpurMemoryManager>>#validFreeTreeChunk: */
static sqInt NoDbgRegParms
validFreeTreeChunk(sqInt chunk)
{
	if (!(segmentContainingObj(chunk))) {
		return 0;
	}
	return (validFreeTreeChunkparent(chunk, longAt((chunk + BaseHeaderSize) + (2U << (shiftForWord()))))) == null;
}

	/* SpurMemoryManager>>#validFreeTreeChunk:parent: */
static const char * NoDbgRegParms
validFreeTreeChunkparent(sqInt chunk, sqInt parent)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    const char *reason;

	if (chunk == 0) {
		return null;
	}
	if (!(((chunk & (BaseHeaderSize - 1)) == 0)
		 && (oopisGreaterThanOrEqualToandLessThan(chunk, GIV(oldSpaceStart), GIV(endOfMemory))))) {
		return "not in old space";
	}
	if (((bytesInObject(chunk)) / 8 /* allocationUnit */) < 64 /* numFreeLists */) {
		return "too small";
	}
	if (parent != (longAt((chunk + BaseHeaderSize) + (2U << (shiftForWord()))))) {
		return "bad parent";
	}
	if ((segmentContainingObj(chunk)) != (segmentContainingObj(addressAfter(chunk)))) {
		return "not in one segment";
	}
	reason = validFreeTreeChunkparent(longAt((chunk + BaseHeaderSize) + (3U << (shiftForWord()))), chunk);
	if (!(reason == null)) {
		return reason;
	}
	reason = validFreeTreeChunkparent(longAt((chunk + BaseHeaderSize) + (4U << (shiftForWord()))), chunk);
	if (!(reason == null)) {
		return reason;
	}
	return null;
}

	/* SpurMemoryManager>>#validObjStacks */
static sqInt
validObjStacks(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((GIV(markStack) == GIV(nilObj))
	 || (isValidObjStack(GIV(markStack))))
	 && (((GIV(weaklingStack) == GIV(nilObj))
	 || (isValidObjStack(GIV(weaklingStack))))
	 && ((GIV(mournQueue) == GIV(nilObj))
	 || (isValidObjStack(GIV(mournQueue)))));
}


/*	1 = big, 0 = little */

	/* SpurMemoryManager>>#vmEndianness */
sqInt
vmEndianness(void)
{
	return VMBIGENDIAN;
}


/*	Sweep all of old space, sliding unpinned marked objects down over free and
	unmarked objects.
	Let the segmentManager mark which segments contain pinned objects via
	notePinned:. 
 */

	/* SpurPlanningCompactor>>#compact */
static void NeverInline
compact(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt finalPass;
    sqInt firstPass;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt highestSuitableFreeBlock;
    sqInt i;
    sqInt iLimiT;
    sqInt largestFreeChunk;
    sqInt largestFreeChunk1;
    sqInt largestFreeChunk2;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop111;
    sqInt objOop12;
    sqInt objOop13;
    sqInt objOop31;
    sqInt objOop4;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevObj2;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt prevPrevObj2;
    sqInt sizeOfEden;
    sqInt spaceEstimate;
    sqInt spaceEstimate1;


	/* for profiling */
	if (initializeScanCheckingForFullyCompactedHeap()) {
		/* begin unmarkObjectsInFullyCompactedHeap */
		assert(isOldObject(GIV(nilObj)));
		prevPrevObj1 = (prevObj1 = null);
		objOop11 = GIV(nilObj);
		while (1) {
			assert((objOop11 % (allocationUnit())) == 0);
			if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
			assert((long64At(objOop11)) != 0);
			if (isEnumerableObject(objOop11)) {
				if (oopisGreaterThanOrEqualTo(objOop11, GIV(firstMobileObject))) {
					goto l4;
				}
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(objOop11)));
				longAtput(objOop11, (longAt(objOop11)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			}
			prevPrevObj1 = prevObj1;
			prevObj1 = objOop11;
			/* begin objectAfter:limit: */
			followingWordAddress1 = addressAfter(objOop11);
			if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(endOfMemory))) {
				objOop11 = GIV(endOfMemory);
				goto l3;
			}
			flag("endianness");
			followingWord1 = longAt(followingWordAddress1);
			objOop11 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress1 + BaseHeaderSize
				: followingWordAddress1);
	l3:	/* end objectAfter:limit: */;
		}
	l4:	/* end unmarkInitialImmobileObjects */;
		/* begin unmarkSurvivingObjectsForCompact */
		prevPrevObj = (prevObj = null);
		/* begin objectStartingAt: */
		address = ((pastSpace()).start);
		numSlots = byteAt(address + 7);
		objOop1 = (numSlots == (numSlotsMask())
			? address + BaseHeaderSize
			: address);
		while (oopisLessThan(objOop1, GIV(pastSpaceStart))) {
			assert(isEnumerableObjectNoAssert(objOop1));
			if (((((usqInt) (longAt(objOop1))) >> (markedBitFullShift())) & 1) != 0) {
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(objOop1)));
				longAtput(objOop1, (longAt(objOop1)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			}
			prevPrevObj = prevObj;
			prevObj = objOop1;
			/* begin objectAfter:limit: */
			followingWordAddress = addressAfter(objOop1);
			if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(pastSpaceStart))) {
				objOop1 = GIV(pastSpaceStart);
				goto l1;
			}
			flag("endianness");
			followingWord = longAt(followingWordAddress);
			objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress + BaseHeaderSize
				: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
		}
		return;
	}
	/* begin initializeCompaction */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	/* begin selectSavedFirstFieldsSpace */
	spaceEstimate1 = ((endOfMemory()) - GIV(nilObj)) / 40;
	sizeOfEden = (((eden()).limit)) - (((eden()).start));
	if (spaceEstimate1 > sizeOfEden) {
		/* begin findHighestSuitableFreeBlock: */
		largestFreeChunk2 = findLargestFreeChunk();
		if (!(largestFreeChunk2 == null)) {
			if (((bytesInObject(largestFreeChunk2)) >= spaceEstimate1)
			 && ((((usqInt)largestFreeChunk2)) > (((usqInt)((endOfMemory()) - GIV(totalFreeOldSpace)))))) {
				highestSuitableFreeBlock = largestFreeChunk2;
				goto l9;
			}
		}
		highestSuitableFreeBlock = null;
	l9:	/* end findHighestSuitableFreeBlock: */;
		if (!(highestSuitableFreeBlock == null)) {
			if ((spaceEstimate1 > ((assert(isFreeObject(highestSuitableFreeBlock)),
			bytesInObject(highestSuitableFreeBlock))))
			 && (useSegmentForSavedFirstFieldsSpace(spaceEstimate1))) {
				goto l6;
			}
			if (((assert(isFreeObject(highestSuitableFreeBlock)),
			bytesInObject(highestSuitableFreeBlock))) > sizeOfEden) {
				/* begin useFreeChunkForSavedFirstFieldsSpace: */
				assert(validFreeTreeChunk(highestSuitableFreeBlock));
				(GIV(savedFirstFieldsSpace).start = highestSuitableFreeBlock + (4 /* freeChunkLargerIndex */ * BytesPerOop));
				(GIV(savedFirstFieldsSpace).limit = addressAfter(highestSuitableFreeBlock));
				GIV(savedFirstFieldsSpaceNotInOldSpace) = 0;
				assert(!((savedFirstFieldsSpaceWasAllocated())));
				goto l6;
			}
		}
		if (useSegmentForSavedFirstFieldsSpace(spaceEstimate1)) {
			goto l6;
		}
	}
	/* begin useEdenForSavedFirstFieldsSpace */
	(GIV(savedFirstFieldsSpace).start = ((eden()).start));
	(GIV(savedFirstFieldsSpace).limit = ((eden()).limit));
	GIV(savedFirstFieldsSpaceNotInOldSpace) = 1;
	assert(!((savedFirstFieldsSpaceWasAllocated())));
	l6:	/* end selectSavedFirstFieldsSpace */;
	/* begin unpinRememberedSet */
	objOop4 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord())))));
	GIV(firstFieldOfRememberedSet) = longAt((objOop4 + BaseHeaderSize) + (0U << (shiftForWord())));
	/* begin setIsPinnedOf:to: */
	objOop12 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord())))));
	longAtput(objOop12, (longAt(objOop12)) & (~(usqIntptr_t)(1U << (pinnedBitShift()))));
	/* begin resetFreeListHeads */
	GIV(freeListsMask) = 0;
	for (i = 0, iLimiT = (64 /* numFreeLists */ - 1); i <= iLimiT; i += 1) {
		GIV(freeLists)[i] = 0;
	}
	/* begin totalFreeOldSpace: */
	GIV(totalFreeOldSpace) = 0;
	/* begin beginSlidingCompaction */
	GIV(gcPhaseInProgress) = SlidingCompactionInProgress;
	(GIV(savedFirstFieldsSpace).top = ((GIV(savedFirstFieldsSpace).start)) - BytesPerOop);
	firstPass = 1;
	while (1) {
		finalPass = planCompactSavingForwarders();
		assert((validRelocationPlanInPass(finalPass)) == 0);
		updatePointers();
		copyAndUnmark(firstPass);
				if (finalPass
		 || (GIV(biasForGC))) break;
		firstPass = 0;
		reinitializeScanFrom(GIV(firstFreeObject));
		/* begin updateSavedFirstFieldsSpaceIfNecessary */
		if (((!GIV(savedFirstFieldsSpaceNotInOldSpace))
		 && (oopisGreaterThan((GIV(savedFirstFieldsSpace).start), GIV(nilObj))))
		 && (((GIV(savedFirstFieldsSpace).start)) < GIV(lastMobileObject))) {
			/* begin findHighestSuitableFreeBlock: */
			spaceEstimate = ((GIV(savedFirstFieldsSpace).limit)) - ((GIV(savedFirstFieldsSpace).start));
			largestFreeChunk1 = findLargestFreeChunk();
			if (!(largestFreeChunk1 == null)) {
				if (((bytesInObject(largestFreeChunk1)) >= spaceEstimate)
				 && ((((usqInt)largestFreeChunk1)) > (((usqInt)((endOfMemory()) - GIV(totalFreeOldSpace)))))) {
					largestFreeChunk = largestFreeChunk1;
					goto l5;
				}
			}
			largestFreeChunk = null;
	l5:	/* end findHighestSuitableFreeBlock: */;
			if (largestFreeChunk == null) {
				/* begin useEdenForSavedFirstFieldsSpace */
				(GIV(savedFirstFieldsSpace).start = ((eden()).start));
				(GIV(savedFirstFieldsSpace).limit = ((eden()).limit));
				GIV(savedFirstFieldsSpaceNotInOldSpace) = 1;
				assert(!((savedFirstFieldsSpaceWasAllocated())));
			}
			else {
				/* begin useFreeChunkForSavedFirstFieldsSpace: */
				assert(validFreeTreeChunk(largestFreeChunk));
				(GIV(savedFirstFieldsSpace).start = largestFreeChunk + (4 /* freeChunkLargerIndex */ * BytesPerOop));
				(GIV(savedFirstFieldsSpace).limit = addressAfter(largestFreeChunk));
				GIV(savedFirstFieldsSpaceNotInOldSpace) = 0;
				assert(!((savedFirstFieldsSpaceWasAllocated())));
			}
		}
		(GIV(savedFirstFieldsSpace).top = ((GIV(savedFirstFieldsSpace).start)) - BytesPerOop);
	}
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	/* begin endCompaction */
	prevPrevObj2 = (prevObj2 = null);
	/* begin objectStartingAt: */
	address1 = ((pastSpace()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop13 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop13, GIV(pastSpaceStart))) {
		assert(isEnumerableObjectNoAssert(objOop13));
		if (((((usqInt) (longAt(objOop13))) >> (markedBitFullShift())) & 1) != 0) {
			/* begin setIsMarkedOf:to: */
			assert(!(isFreeObject(objOop13)));
			longAtput(objOop13, (longAt(objOop13)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
		}
		prevPrevObj2 = prevObj2;
		prevObj2 = objOop13;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop13);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(pastSpaceStart))) {
			objOop13 = GIV(pastSpaceStart);
			goto l13;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop13 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l13:	/* end objectAfter:limit: */;
	}
	/* begin endSlidingCompaction */
	GIV(gcPhaseInProgress) = 0;
	/* begin repinRememberedSet */
	if ((rememberedSetSize()) > 0) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		objOop31 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord())))));
		assert(!(isOopForwarded(objOop31)));
		longAtput((objOop31 + BaseHeaderSize) + (0U << (shiftForWord())), GIV(firstFieldOfRememberedSet));
	}
	/* begin setIsPinnedOf:to: */
	objOop111 = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord())))));
	longAtput(objOop111, (longAt(objOop111)) | (1U << (pinnedBitShift())));
	/* begin relocateRememberedSet */
	GIV(rememberedSet) = firstIndexableField(longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord()))))));
	/* begin releaseSavedFirstFieldsSpace */
	if (GIV(savedFirstFieldsSpaceNotInOldSpace)
	 && (oopisGreaterThan((GIV(savedFirstFieldsSpace).start), GIV(nilObj)))) {
		sqDeallocateMemorySegmentAtOfSize(((void *)((GIV(savedFirstFieldsSpace).start))), ((GIV(savedFirstFieldsSpace).limit)) - ((GIV(savedFirstFieldsSpace).start)));
	}
}


/*	Sweep the mobile portion of the heap, moving objects to their eventual
	locations, and clearing their marked bits.
	Remember to update the savedFirstFields of pointer objects, as these have
	been forwarded.
	Answer if the end of the heap was reached (savedFirstFieldsSpace has not
	overflowed). 
	The enumerations in planCompactSavingForwarders,
	updatePointersInMobileObjects and copyAndUnmarkMobileObjects
	match. We could implement them as a single enumeration method taking
	several block arguments, but arguably that
	would make understanding an already tricky algorithm more difficult.
	Instead we tolerate the duplication and encourage
	the reader to diff the three methods to see where they diverge (e.g. via
	Cmd-shift-C).  */

	/* SpurPlanningCompactor>>#copyAndUnmarkMobileObjects */
static sqInt NeverInline
copyAndUnmarkMobileObjects(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt availableSpace;
    usqInt bytes;
    sqInt destObj;
    sqInt finalObject;
    sqInt followingWord;
    usqInt followingWordAddress;
    usqInt limit;
    usqInt next;
    usqInt nextBytes;
    sqInt nextObj;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots2;
    usqInt obj;
    usqInt objBytes;
    sqInt objOop;
    usqInt previousPin;
    sqInt prevObj;
    sqInt prevPrevObj;
    usqInt start;
    usqInt startOfPreviousPin;
    usqInt toFinger;
    usqInt top;

	previousPin = 0;
	assert(!((isMarked(GIV(firstFreeObject)))));
	/* begin startOfObject: */
	toFinger = ((byteAt(GIV(firstFreeObject) + 7)) == (numSlotsMask())
		? GIV(firstFreeObject) - BaseHeaderSize
		: GIV(firstFreeObject));
	top = (GIV(savedFirstFieldsSpace).start);
	startOfPreviousPin = 0;
	/* begin allOldSpaceEntitiesForCompactingFrom:to:do: */
	finalObject = (!(GIV(lastMobileObject))
		? GIV(nilObj)
		: GIV(lastMobileObject));
	assert(isOldObject(GIV(firstFreeObject)));
	assert(oopisLessThanOrEqualTo(finalObject, GIV(endOfMemory)));
	prevPrevObj = (prevObj = null);
	objOop = GIV(firstFreeObject);
	limit = (oopisLessThan(finalObject, GIV(endOfMemory))
		? addressAfter(finalObject)
		: GIV(endOfMemory));
	while (1) {
		assert((objOop % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop, limit))) break;
		assert((long64At(objOop)) != 0);
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
			nextObj = GIV(endOfMemory);
			goto l7;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		nextObj = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l7:	/* end objectAfter:limit: */;
		assert((previousPin == null
			? toFinger <= (startOfObject(objOop))
			: (isMarked(previousPin))
				 && (toFinger <= startOfPreviousPin)));
		assert(GIV(savedFirstFieldsSpaceNotInOldSpace)
		 || (toFinger < top));
		if (((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0) {
			if (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0) {
				if (!(previousPin)) {
					previousPin = objOop;
					/* begin startOfObject: */
					startOfPreviousPin = ((byteAt(objOop + 7)) == (numSlotsMask())
						? objOop - BaseHeaderSize
						: objOop);
				}
			}
			else {
				bytes = bytesInObject(objOop);
				while ((toFinger <= startOfPreviousPin)
				 && ((bytes != ((availableSpace = startOfPreviousPin - toFinger)))
				 && ((bytes + (2 * 8 /* allocationUnit */)) > availableSpace))) {

					/* The object does not fit in the space between toFinger and previousPin.
					   Move toFinger up to point at the first unmarked or mobile object after
					   previousPin, or, if previousPin is contiguous with o, to the start of this
					   object.  Update previousPin to be the next pinned object above toFInger
					   and below this object, or nil if no such pinned object exists.
					   Any unfillable gaps between adjacent pinned objects will be freed. */
					if (availableSpace > 0) {
						/* begin addFreeChunkWithBytes:at: */
						GIV(totalFreeOldSpace) += availableSpace;
						freeChunkWithBytesat(availableSpace, toFinger);
					}
					do {
						assert((isMarked(previousPin))
						 && (isPinned(previousPin)));
						/* begin unmarkPinned: */
						if (!(((longAt(previousPin)) & (classIndexMask())) == (segmentBridgePun()))) {
							/* begin setIsMarkedOf:to: */
							assert(!(isFreeObject(previousPin)));
							longAtput(previousPin, (longAt(previousPin)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
							/* begin notePinned: */
							assert(isPinned(previousPin));
							if (((longAt(previousPin)) & (classIndexMask())) == (segmentBridgePun())) {
								/* begin setIsMarkedOf:to: */
								assert(!(isFreeObject(previousPin)));
								longAtput(previousPin, (longAt(previousPin)) | (1ULL << (markedBitFullShift())));
							}
							else {
								while (oopisLessThan((((GIV(segments)[GIV(sweepIndex)]).segSize)) + (((GIV(segments)[GIV(sweepIndex)]).segStart)), previousPin)) {
									GIV(sweepIndex) += 1;
								}
								((GIV(segments)[GIV(sweepIndex)]).containsPinned = 1);
							}
						}
						toFinger = addressAfter(previousPin);
						/* begin objectStartingAt: */
						numSlots = byteAt(toFinger + 7);
						previousPin = (numSlots == (numSlotsMask())
							? toFinger + BaseHeaderSize
							: toFinger);
					} while((((((usqInt) (longAt(previousPin))) >> (markedBitFullShift())) & 1) != 0)
						 && ((((((usqInt) (longAt(previousPin))) >> (pinnedBitShift())) & 1) != 0)
						 && (previousPin < objOop)));
					while (!((previousPin >= objOop)
					 || ((((((usqInt) (longAt(previousPin))) >> (markedBitFullShift())) & 1) != 0)
					 && (((((usqInt) (longAt(previousPin))) >> (pinnedBitShift())) & 1) != 0)))) {
						previousPin = oldSpaceObjectAfter(previousPin);
					}
					if (previousPin >= objOop) {
						previousPin = null;
						startOfPreviousPin = 0;
					}
					else {
						/* begin startOfObject: */
						startOfPreviousPin = ((byteAt(previousPin + 7)) == (numSlotsMask())
							? previousPin - BaseHeaderSize
							: previousPin);
					}
				}
				/* begin copyAndUnmarkObject:to:bytes:firstField: */
				assert(!(isFreeObject(objOop)));
				longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
				/* begin rawNumSlotsOf: */
				numSlots1 = byteAt(objOop + 7);
				destObj = (numSlots1 == (numSlotsMask())
					? toFinger + BaseHeaderSize
					: toFinger);
				/* begin startOfObject:given: */
				start = (numSlots1 == (numSlotsMask())
					? objOop - BaseHeaderSize
					: objOop);
				memmove(((void *)toFinger), ((void *)start), bytes);
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(destObj)));
				longAtput((destObj + BaseHeaderSize) + (0U << (shiftForWord())), longAt(top));
				toFinger += bytes;
				if (((top += BytesPerOop)) >= ((GIV(savedFirstFieldsSpace).limit))) {
					assert(((GIV(savedFirstFieldsSpace).top)) == (top - BytesPerOop));
					assert(nextObj == GIV(objectAfterLastMobileObject));
					if (!(previousPin)) {
						previousPin = nextObj;
						/* begin startOfObject: */
						startOfPreviousPin = ((byteAt(nextObj + 7)) == (numSlotsMask())
							? nextObj - BaseHeaderSize
							: nextObj);
					}
					if (toFinger < startOfPreviousPin) {
						GIV(firstFreeObject) = initFreeChunkWithBytesat(startOfPreviousPin - toFinger, toFinger);
					}
					else {
						GIV(firstFreeObject) = previousPin;
					}
					return 0;
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		objOop = nextObj;
	}
	freeFromupTonextObject(toFinger, endOfMemory(), (!(previousPin)
		? (!(GIV(objectAfterLastMobileObject))
				? objectAfter(GIV(firstFreeObject))
				: GIV(objectAfterLastMobileObject))
		: previousPin));
	/* begin coalesceFrom: */
	if (toFinger >= (endOfMemory())) {
		goto l12;
	}
	/* begin objectStartingAt: */
	numSlots2 = byteAt(toFinger + 7);
	obj = (numSlots2 == (numSlotsMask())
		? toFinger + BaseHeaderSize
		: toFinger);
	while (1) {
		next = oldSpaceObjectAfter(obj);
		if (!(next < (endOfMemory()))) break;
		if ((((longAt(obj)) & (classIndexMask())) == (isFreeObjectClassIndexPun()))
		 && (((longAt(next)) & (classIndexMask())) == (isFreeObjectClassIndexPun()))) {
			objBytes = bytesInObject(obj);
			nextBytes = bytesInObject(next);
			unlinkFreeChunkchunkBytes(obj, objBytes);
			unlinkFreeChunkchunkBytes(next, nextBytes);
			obj = freeChunkWithBytesat(objBytes + nextBytes, ((byteAt(obj + 7)) == (numSlotsMask())
				? obj - BaseHeaderSize
				: obj));
		}
		else {
			obj = next;
		}
	}
	l12:	/* end coalesceFrom: */;
	return 1;
}


/*	Sweep the heap, unmarking all objects and moving mobile objects to their
	correct positions,
	restoring their savedFirstFields. */

	/* SpurPlanningCompactor>>#copyAndUnmark: */
static void NoDbgRegParms NeverInline
copyAndUnmark(sqInt firstPass)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt finalPass;
    sqInt followingWord;
    sqInt followingWord1;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    sqInt freeBytes;
    sqInt objOop1;
    sqInt objOop2;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt startOfFree;

	startOfFree = 0;
	/* begin logPhase: */
	if (firstPass) {
		/* begin unmarkInitialImmobileObjects */
		assert(isOldObject(GIV(nilObj)));
		prevPrevObj = (prevObj = null);
		objOop1 = GIV(nilObj);
		while (1) {
			assert((objOop1 % (allocationUnit())) == 0);
			if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
			assert((long64At(objOop1)) != 0);
			if (isEnumerableObject(objOop1)) {
				if (oopisGreaterThanOrEqualTo(objOop1, GIV(firstMobileObject))) {
					goto l2;
				}
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(objOop1)));
				longAtput(objOop1, (longAt(objOop1)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			}
			prevPrevObj = prevObj;
			prevObj = objOop1;
			/* begin objectAfter:limit: */
			followingWordAddress = addressAfter(objOop1);
			if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
				objOop1 = GIV(endOfMemory);
				goto l1;
			}
			flag("endianness");
			followingWord = longAt(followingWordAddress);
			objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress + BaseHeaderSize
				: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
		}
	l2:	/* end unmarkInitialImmobileObjects */;
	}
	finalPass = copyAndUnmarkMobileObjects();
	if ((GIV(lastMobileObject) != null)
	 && ((!finalPass)
	 && (GIV(biasForGC)))) {

		/* only ever one pass if biasForGC is true. */
		/* begin unmarkObjectsFromFirstFreeObject */
		freeBytes = 0;
		/* begin allOldSpaceEntitiesFrom:do: */
		assert(isOldObject(GIV(firstFreeObject)));
		prevPrevObj1 = (prevObj1 = null);
		objOop2 = GIV(firstFreeObject);
		while (1) {
			assert((objOop2 % (allocationUnit())) == 0);
			if (!(oopisLessThan(objOop2, GIV(endOfMemory)))) break;
			assert((long64At(objOop2)) != 0);
			if (((((usqInt) (longAt(objOop2))) >> (markedBitFullShift())) & 1) != 0) {
				if (!(startOfFree == null)) {
					/* begin addFreeChunkWithBytes:at: */
					GIV(totalFreeOldSpace) += freeBytes;
					freeChunkWithBytesat(freeBytes, startOfFree);
					startOfFree = null;
					freeBytes = 0;
				}
				if (((((usqInt) (longAt(objOop2))) >> (pinnedBitShift())) & 1) != 0) {
					/* begin unmarkPinned: */
					if (!(((longAt(objOop2)) & (classIndexMask())) == (segmentBridgePun()))) {
						/* begin setIsMarkedOf:to: */
						assert(!(isFreeObject(objOop2)));
						longAtput(objOop2, (longAt(objOop2)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
						/* begin notePinned: */
						assert(isPinned(objOop2));
						if (((longAt(objOop2)) & (classIndexMask())) == (segmentBridgePun())) {
							/* begin setIsMarkedOf:to: */
							assert(!(isFreeObject(objOop2)));
							longAtput(objOop2, (longAt(objOop2)) | (1ULL << (markedBitFullShift())));
						}
						else {
							while (oopisLessThan((((GIV(segments)[GIV(sweepIndex)]).segSize)) + (((GIV(segments)[GIV(sweepIndex)]).segStart)), objOop2)) {
								GIV(sweepIndex) += 1;
							}
							((GIV(segments)[GIV(sweepIndex)]).containsPinned = 1);
						}
					}
				}
				else {
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(objOop2)));
					longAtput(objOop2, (longAt(objOop2)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
				}
			}
			else {
				if (!(startOfFree)) {
					/* begin startOfObject: */
					startOfFree = ((usqInt) (((byteAt(objOop2 + 7)) == (numSlotsMask())
	? objOop2 - BaseHeaderSize
	: objOop2)));
				}
				freeBytes += bytesInObject(objOop2);
			}
			prevPrevObj1 = prevObj1;
			prevObj1 = objOop2;
			/* begin objectAfter:limit: */
			followingWordAddress1 = addressAfter(objOop2);
			if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(endOfMemory))) {
				objOop2 = GIV(endOfMemory);
				goto l4;
			}
			flag("endianness");
			followingWord1 = longAt(followingWordAddress1);
			objOop2 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress1 + BaseHeaderSize
				: followingWordAddress1);
	l4:	/* end objectAfter:limit: */;
		}
		if (!(startOfFree == null)) {
			/* begin addFreeChunkWithBytes:at: */
			GIV(totalFreeOldSpace) += freeBytes;
			freeChunkWithBytesat(freeBytes, startOfFree);
		}
	}
}


/*	Free from toFinger up to limit, dealing with possible intervening pinned
	objects. 
 */

	/* SpurPlanningCompactor>>#freeFrom:upTo:nextObject: */
static void NoDbgRegParms
freeFromupTonextObject(usqInt initialToFinger, usqInt limit, sqInt nextObject)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt numSlots;
    sqInt obj;
    usqInt objStart;
    usqInt toFinger;

	toFinger = initialToFinger;
	/* begin startOfObject: */
	objStart = ((byteAt(nextObject + 7)) == (numSlotsMask())
		? nextObject - BaseHeaderSize
		: nextObject);
	if (toFinger < objStart) {
		/* begin addFreeChunkWithBytes:at: */
		GIV(totalFreeOldSpace) += objStart - toFinger;
		freeChunkWithBytesat(objStart - toFinger, toFinger);
	}
	toFinger = objStart;
	while (objStart < limit) {
		/* begin objectStartingAt: */
		numSlots = byteAt(objStart + 7);
		obj = (numSlots == (numSlotsMask())
			? objStart + BaseHeaderSize
			: objStart);
		if ((((((usqInt) (longAt(obj))) >> (markedBitFullShift())) & 1) != 0)
		 && (((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0)) {
			/* begin unmarkPinned: */
			if (!(((longAt(obj)) & (classIndexMask())) == (segmentBridgePun()))) {
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(obj)));
				longAtput(obj, (longAt(obj)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
				/* begin notePinned: */
				assert(isPinned(obj));
				if (((longAt(obj)) & (classIndexMask())) == (segmentBridgePun())) {
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(obj)));
					longAtput(obj, (longAt(obj)) | (1ULL << (markedBitFullShift())));
				}
				else {
					while (oopisLessThan((((GIV(segments)[GIV(sweepIndex)]).segSize)) + (((GIV(segments)[GIV(sweepIndex)]).segStart)), obj)) {
						GIV(sweepIndex) += 1;
					}
					((GIV(segments)[GIV(sweepIndex)]).containsPinned = 1);
				}
			}
			if (toFinger < objStart) {
				/* begin addFreeChunkWithBytes:at: */
				GIV(totalFreeOldSpace) += objStart - toFinger;
				freeChunkWithBytesat(objStart - toFinger, toFinger);
			}
			toFinger = (objStart = addressAfter(obj));
		}
		else {
			objStart = addressAfter(obj);
		}
	}
	if (limit > toFinger) {
		/* begin addFreeChunkWithBytes:at: */
		GIV(totalFreeOldSpace) += limit - toFinger;
		freeChunkWithBytesat(limit - toFinger, toFinger);
	}
}


/*	Scan for firstFreeObject and firstMobileObject from the start of memory.
	Answer if the heap is already fully compacted. */

	/* SpurPlanningCompactor>>#initializeScanCheckingForFullyCompactedHeap */
static sqInt
initializeScanCheckingForFullyCompactedHeap(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(firstMobileObject) = (GIV(lastMobileObject) = (GIV(objectAfterLastMobileObject) = null));
	reinitializeScanFrom(GIV(hiddenRootsObj));
	if (!(GIV(firstFreeObject))) {
		error("uncompactable heap; no unmarked objects found");
	}
	return GIV(firstMobileObject) >= (endOfMemory());
}

	/* SpurPlanningCompactor>>#isMobile: */
static sqInt NoDbgRegParms
isMobile(sqInt obj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (oopisGreaterThanOrEqualToandLessThanOrEqualTo(obj, GIV(mobileStart), GIV(lastMobileObject)))
	 && (!(((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0));
}


/*	For asserts */

	/* SpurPlanningCompactor>>#isPostMobile: */
static sqInt NoDbgRegParms
isPostMobile(sqInt obj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return oopisGreaterThanOrEqualToandLessThanOrEqualTo(obj, GIV(mobileStart), GIV(lastMobileObject));
}


/*	Sweep the heap from firstFreeObject forwarding marked objects to where
	they can be moved to, saving their forwarding pointer in
	savedFirstFieldsSpace. Continue until either the end of the heap is
	reached or savedFirstFieldsSpace is full.
	Answer if the end of the heap was reached (savedFirstFieldsSpace has not
	overflowed). 
	The enumerations in planCompactSavingForwarders,
	updatePointersInMobileObjects and copyAndUnmarkMobileObjects
	match. We could implement them as a single enumeration method taking
	several block arguments, but arguably that
	would make understanding an already tricky algorithm more difficult.
	Instead we tolerate the duplication and encourage
	the reader to diff the three methods to see where they diverge (e.g. via
	Cmd-shift-C).  */

	/* SpurPlanningCompactor>>#planCompactSavingForwarders */
static sqInt NeverInline
planCompactSavingForwarders(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt availableSpace;
    usqInt bytes;
    sqInt followingWord;
    usqInt followingWordAddress;
    usqInt numSlots;
    sqInt objOop;
    usqInt previousPin;
    sqInt prevObj;
    sqInt prevPrevObj;
    usqInt startOfPreviousPin;
    usqInt toFinger;
    usqInt top;
    sqInt valuePointer;

	previousPin = 0;
	if (((GIV(savedFirstFieldsSpace).top)) < ((GIV(savedFirstFieldsSpace).start))) {
		/* begin logPhase: */
	}
	assert(!((isMarked(GIV(firstFreeObject)))));
	/* begin startOfObject: */
	toFinger = ((byteAt(GIV(firstFreeObject) + 7)) == (numSlotsMask())
		? GIV(firstFreeObject) - BaseHeaderSize
		: GIV(firstFreeObject));
	top = (GIV(savedFirstFieldsSpace).start);
	startOfPreviousPin = 0;
	/* begin allOldSpaceEntitiesFrom:do: */
	assert(isOldObject(GIV(firstFreeObject)));
	prevPrevObj = (prevObj = null);
	objOop = GIV(firstFreeObject);
	while (1) {
		assert((objOop % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break;
		assert((long64At(objOop)) != 0);
		assert((previousPin == null
			? toFinger <= (startOfObject(objOop))
			: (isMarked(previousPin))
				 && (toFinger <= startOfPreviousPin)));
		assert(GIV(savedFirstFieldsSpaceNotInOldSpace)
		 || (toFinger < top));
		if (((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0) {
			if (((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0) {
				if (!(previousPin)) {
					previousPin = objOop;
					/* begin startOfObject: */
					startOfPreviousPin = ((byteAt(objOop + 7)) == (numSlotsMask())
						? objOop - BaseHeaderSize
						: objOop);
				}
			}
			else {
				bytes = bytesInObject(objOop);
				while ((toFinger <= startOfPreviousPin)
				 && ((bytes != ((availableSpace = startOfPreviousPin - toFinger)))
				 && ((bytes + (2 * 8 /* allocationUnit */)) > availableSpace))) {

					/* The object does not fit in the space between toFinger and previousPin.
					   Move toFinger up to point at the first unmarked or mobile object after
					   previousPin, or, if previousPin is contiguous with o, to the start of this
					   object.  Update previousPin to be the next pinned object above toFInger
					   and below this object, or nil if no such pinned object exists.
					   Any unfillable gaps between adjacent pinned objects will be freed. */
					do {
						toFinger = addressAfter(previousPin);
						/* begin objectStartingAt: */
						numSlots = byteAt(toFinger + 7);
						previousPin = (numSlots == (numSlotsMask())
							? toFinger + BaseHeaderSize
							: toFinger);
					} while((((((usqInt) (longAt(previousPin))) >> (markedBitFullShift())) & 1) != 0)
						 && ((((((usqInt) (longAt(previousPin))) >> (pinnedBitShift())) & 1) != 0)
						 && (previousPin < objOop)));
					while (!((previousPin >= objOop)
					 || ((((((usqInt) (longAt(previousPin))) >> (markedBitFullShift())) & 1) != 0)
					 && (((((usqInt) (longAt(previousPin))) >> (pinnedBitShift())) & 1) != 0)))) {
						previousPin = oldSpaceObjectAfter(previousPin);
					}
					if (previousPin >= objOop) {
						previousPin = null;
						startOfPreviousPin = 0;
					}
					else {
						/* begin startOfObject: */
						startOfPreviousPin = ((byteAt(previousPin + 7)) == (numSlotsMask())
							? previousPin - BaseHeaderSize
							: previousPin);
					}
				}
				/* begin forwardMobileObject:to:savedFirstFieldPtr: */
				GIV(lastMobileObject) = objOop;
				longAtput(top, longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord()))));
				/* begin storePointerUnchecked:ofObject:withValue: */
				valuePointer = ((byteAt(objOop + 7)) == (numSlotsMask())
					? toFinger + BaseHeaderSize
					: toFinger);
				assert(!(isOopForwarded(objOop)));
				longAtput((objOop + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer);
				toFinger += bytes;
				if (((top += BytesPerOop)) >= ((GIV(savedFirstFieldsSpace).limit))) {
					(GIV(savedFirstFieldsSpace).top = top - BytesPerOop);
					GIV(objectAfterLastMobileObject) = oldSpaceObjectAfter(GIV(lastMobileObject));
					return 0;
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
			objOop = GIV(endOfMemory);
			goto l6;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l6:	/* end objectAfter:limit: */;
	}
	if (!(GIV(lastMobileObject) == null)) {
		(GIV(savedFirstFieldsSpace).top = top - BytesPerOop);
		GIV(objectAfterLastMobileObject) = oldSpaceObjectAfter(GIV(lastMobileObject));
	}
	return 1;
}


/*	Search for firstFreeObject and firstMobileObject from initialObject, which
	is the
	hiddenRootsObject on the first pass, and the objectAfterLastMobileObject
	on subsequent passes). */

	/* SpurPlanningCompactor>>#reinitializeScanFrom: */
static void NoDbgRegParms
reinitializeScanFrom(sqInt initialObject)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt followingWord;
    usqInt followingWordAddress;
    sqInt objOop;
    sqInt prevObj;
    sqInt prevPrevObj;

	GIV(firstMobileObject) = endOfMemory();
	GIV(firstFreeObject) = scanForFirstFreeAndFirstMobileObjectFrom(initialObject);
	if (!(GIV(firstFreeObject) == null)) {
		/* begin startOfObject: */
		GIV(mobileStart) = ((usqInt) (((byteAt(GIV(firstFreeObject) + 7)) == (numSlotsMask())
	? GIV(firstFreeObject) - BaseHeaderSize
	: GIV(firstFreeObject))));
	}
	if (!(GIV(objectAfterLastMobileObject) == null)) {
		/* begin allOldSpaceEntitiesFrom:to:do: */
		assert((isNonImmediate(GIV(firstFreeObject)))
		 && (isInSegments(GIV(firstFreeObject))));
		assert((isNonImmediate(GIV(objectAfterLastMobileObject)))
		 && (isInSegments(GIV(objectAfterLastMobileObject))));
		prevPrevObj = (prevObj = null);
		objOop = GIV(firstFreeObject);
		while (1) {
			assert((objOop % (allocationUnit())) == 0);
			if (!(oopisLessThanOrEqualTo(objOop, GIV(objectAfterLastMobileObject)))) break;
			assert((long64At(objOop)) != 0);
			if (!((((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0)
				 || ((!(((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0))
				 || (GIV(objectAfterLastMobileObject) == objOop)))) {
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(objOop)));
				longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			}
			prevPrevObj = prevObj;
			prevObj = objOop;
			/* begin objectAfter:limit: */
			followingWordAddress = addressAfter(objOop);
			if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
				objOop = GIV(endOfMemory);
				goto l2;
			}
			flag("endianness");
			followingWord = longAt(followingWordAddress);
			objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress + BaseHeaderSize
				: followingWordAddress);
	l2:	/* end objectAfter:limit: */;
		}
		GIV(firstMobileObject) = GIV(objectAfterLastMobileObject);
	}
}


/*	Scavenge or simply follow objOop. Answer the new location of objOop.
	The send should have been guarded by a send of shouldRemapOop:.
	The method is called remapObj: for compatibility with ObjectMemory. */

	/* SpurPlanningCompactor>>#remapObj: */
sqInt
remapObj(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt referent;
    sqInt resolvedObj;

	/* begin slidingCompactionRemapObj: */
	assert(shouldRemapOop(objOop));
	if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(objOop));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		resolvedObj = referent;
	}
	else {
		assert(!((isInFutureSpace(objOop))));
		resolvedObj = objOop;
	}
	if (GIV(gcPhaseInProgress) > 0) {
		if (GIV(gcPhaseInProgress) == ScavengeInProgress) {
			if ((((resolvedObj & (tagMask())) == 0)
			 && ((assert(isNonImmediate(resolvedObj)),
			(oopisLessThan(resolvedObj, GIV(newSpaceLimit)))
				 && (oopisGreaterThanOrEqualTo(resolvedObj, GIV(newSpaceStart))))))
			 && (!(oopisGreaterThanOrEqualToandLessThan(resolvedObj, ((futureSpace()).start), futureSurvivorStart())))) {
				return copyAndForward(resolvedObj);
			}
		}
		else {
			assert(slidingCompactionInProgress());
			if ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(objOop, GIV(mobileStart), GIV(lastMobileObject)))
			 && (!(((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0))) {
				/* begin fetchPointer:ofObject: */
				return longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
			}
		}
	}
	return resolvedObj;
}

	/* SpurPlanningCompactor>>#savedFirstFieldsSpaceWasAllocated */
static sqInt
savedFirstFieldsSpaceWasAllocated(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(savedFirstFieldsSpaceNotInOldSpace)
	 && (oopisGreaterThan((GIV(savedFirstFieldsSpace).start), GIV(nilObj)));
}


/*	Scan from initialObject, setting firstMobileObject to the first marked
	object after
	the first free object found. Answer the first free object found, or nil if
	none. 
 */

	/* SpurPlanningCompactor>>#scanForFirstFreeAndFirstMobileObjectFrom: */
static sqInt NoDbgRegParms
scanForFirstFreeAndFirstMobileObjectFrom(sqInt initialObject)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstFree;
    sqInt followingWord;
    usqInt followingWordAddress;
    sqInt objOop;
    sqInt prevObj;
    sqInt prevPrevObj;

	firstFree = 0;
	/* begin allOldSpaceEntitiesFrom:do: */
	assert(isOldObject(initialObject));
	prevPrevObj = (prevObj = null);
	objOop = initialObject;
	while (1) {
		assert((objOop % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break;
		assert((long64At(objOop)) != 0);
		if (((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0) {
			if (!(firstFree == null)) {
				GIV(firstMobileObject) = objOop;
				return firstFree;
			}
		}
		else {
			if (!(firstFree)) {
				firstFree = objOop;
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
			objOop = GIV(endOfMemory);
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	return firstFree;
}


/*	Answer if the obj should be scavenged, or simply followed. Sent via the
	compactor from shouldRemapObj:. We test for being already scavenged
	because mapStackPages
	via mapInterpreterOops may be applied twice in the context of a global GC
	where a
	scavenge, followed by a scan-mark-free, and final compaction passes may
	result in
	scavenged fields being visited twice. */

	/* SpurPlanningCompactor>>#shouldRemapObj: */
sqInt
shouldRemapObj(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)
	 || ((GIV(gcPhaseInProgress) > 0)
	 && ((GIV(gcPhaseInProgress) == ScavengeInProgress
		? ((assert(isNonImmediate(objOop)),
			(oopisLessThan(objOop, GIV(newSpaceLimit)))
				 && (oopisGreaterThanOrEqualTo(objOop, GIV(newSpaceStart)))))
			 && (!(oopisGreaterThanOrEqualToandLessThan(objOop, ((futureSpace()).start), futureSurvivorStart())))
		: (oopisGreaterThanOrEqualToandLessThanOrEqualTo(objOop, GIV(mobileStart), GIV(lastMobileObject)))
			 && (!(((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0)))));
}


/*	Sweep the heap, updating all objects to their eventual locations.
	Remember to update the savedFirstFields of pointer objects, as these have
	been forwarded. */

	/* SpurPlanningCompactor>>#updatePointers */
static void NeverInline
updatePointers(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt availableSpace;
    usqInt bytes;
    sqInt contextSize;
    sqInt contextSize1;
    sqInt contextSize2;
    sqInt contextSize3;
    sqInt finishIndex;
    sqInt fmt;
    sqInt fmt1;
    sqInt fmt2;
    sqInt fmt3;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    sqInt followingWord3;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt followingWordAddress3;
    sqInt fwd;
    sqInt fwd1;
    sqInt fwd2;
    sqInt fwd3;
    sqInt fwd4;
    sqInt header;
    sqInt header1;
    sqInt header11;
    sqInt header12;
    sqInt header13;
    sqInt header2;
    sqInt header3;
    sqInt header4;
    sqInt heapEntity;
    sqInt i;
    sqInt i1;
    sqInt i2;
    sqInt i3;
    sqInt i4;
    sqInt numLiterals;
    sqInt numLiterals1;
    sqInt numLiterals2;
    sqInt numLiterals3;
    sqInt numPointerSlots;
    sqInt numPointerSlots1;
    sqInt numPointerSlots2;
    sqInt numPointerSlots3;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    usqInt numSlots3;
    usqInt numSlots4;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop12;
    sqInt objOop4;
    sqInt onePass;
    sqInt oop;
    sqInt oop1;
    sqInt oop2;
    sqInt oop3;
    sqInt oop4;
    usqInt previousPin;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevObj2;
    sqInt prevObj3;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt prevPrevObj2;
    sqInt prevPrevObj3;
    sqInt sp;
    sqInt sp1;
    sqInt sp2;
    sqInt sp3;
    usqInt startOfPreviousPin;
    usqInt toFinger;
    usqInt top;

	previousPin = 0;
	/* begin logPhase: */
	if (!(GIV(lastMobileObject) != null)) {
		return;
	}
	assert((startOfObject(GIV(firstFreeObject))) == GIV(mobileStart));
	mapInterpreterOops();
	mapExtraRoots();
	/* begin updatePointersInManagerHeapEntities */
	GIV(markStack) = relocateObjStackForPlanningCompactor(GIV(markStack));
	GIV(weaklingStack) = relocateObjStackForPlanningCompactor(GIV(weaklingStack));
	GIV(mournQueue) = relocateObjStackForPlanningCompactor(GIV(mournQueue));
	if (((rememberedSetSize()) > 0)
	 && ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(GIV(firstFieldOfRememberedSet), GIV(mobileStart), GIV(lastMobileObject)))
	 && (!(((((usqInt) (longAt(GIV(firstFieldOfRememberedSet)))) >> (pinnedBitShift())) & 1) != 0)))) {
		/* begin fetchPointer:ofObject: */
		GIV(firstFieldOfRememberedSet) = longAt((GIV(firstFieldOfRememberedSet) + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	/* begin relocateObjectsInHeapEntity:from:to: */
	heapEntity = longAt((GIV(hiddenRootsObj) + BaseHeaderSize) + (((sqInt)((usqInt)(RememberedSetRootIndex) << (shiftForWord())))));
	finishIndex = (rememberedSetSize()) - 1;
	for (i = 1; i <= finishIndex; i += 1) {
		/* begin fetchPointer:ofObject: */
		oop = longAt((heapEntity + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if (((oop & (tagMask())) == 0)
		 && ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(oop, GIV(mobileStart), GIV(lastMobileObject)))
		 && (!(((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0)))) {
			assert(isMarked(oop));
			/* begin fetchPointer:ofObject: */
			fwd = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
			assert(isPostMobile(fwd));
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(heapEntity)));
			longAtput((heapEntity + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), fwd);
		}
	}
	if ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(heapEntity, GIV(mobileStart), GIV(lastMobileObject)))
	 && (!(((((usqInt) (longAt(heapEntity))) >> (pinnedBitShift())) & 1) != 0))) {
		/* begin fetchPointer:ofObject: */
		longAt((heapEntity + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	else {
	}
	/* begin updatePointersInSurvivingObjects */
	prevPrevObj1 = (prevObj1 = null);
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots2 = byteAt(address + 7);
	objOop11 = (numSlots2 == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	while (oopisLessThan(objOop11, GIV(pastSpaceStart))) {
		assert(isEnumerableObjectNoAssert(objOop11));
		assert(isMarked(objOop11));
		/* begin updatePointersIn: */
		fmt1 = (((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask());
		if (fmt1 <= 5 /* lastPointerFormat */) {
			if ((fmt1 == (indexablePointersFormat()))
			 && (((longAt(objOop11)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

				/* contexts end at the stack pointer */
				/* begin fetchStackPointerOf: */
				sp1 = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
				if (!((((sp1) & 7) == 1))) {
					contextSize1 = 0;
					goto l46;
				}
				assert((ReceiverIndex + ((sp1 >> 3))) < (lengthOf(objOop11)));
				contextSize1 = (sp1 >> 3);
	l46:	/* end fetchStackPointerOf: */;
				numPointerSlots1 = CtxtTempFrameStart + contextSize1;
				goto l47;
			}
			/* begin numSlotsOf: */
			assert((classIndexOf(objOop11)) > (isForwardedObjectClassIndexPun()));
			numSlots1 = byteAt(objOop11 + 7);
			numPointerSlots1 = (numSlots1 == (numSlotsMask())
				? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop11 - BaseHeaderSize))) << 8)))))) >> 8
				: numSlots1);
			goto l47;
		}
		if (fmt1 == 7 /* forwardedFormat */) {
			numPointerSlots1 = 1;
			goto l47;
		}
		if (fmt1 < (firstCompiledMethodFormat())) {
			numPointerSlots1 = 0;
			goto l47;
		}
		/* begin methodHeaderOf: */
		assert(isCompiledMethod(objOop11));
		header11 = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((((header11) & 7) == 1)) {
			header2 = header11;
		}
		else {
			assert((((usqInt)header11)) < GIV(newSpaceStart));
			assert((((((CogMethod *) header11))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
			header2 = ((((CogMethod *) header11))->methodHeader);
		}
		assert((((header2) & 7) == 1));
		numLiterals1 = ((header2 >> 3)) & AlternateHeaderNumLiteralsMask;
		numPointerSlots1 = numLiterals1 + LiteralStart;
	l47:	/* end numPointerSlotsOf: */;
		for (i2 = 0; i2 < numPointerSlots1; i2 += 1) {
			/* begin fetchPointer:ofObject: */
			oop2 = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord())))));
			if (((oop2 & (tagMask())) == 0)
			 && ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(oop2, GIV(mobileStart), GIV(lastMobileObject)))
			 && (!(((((usqInt) (longAt(oop2))) >> (pinnedBitShift())) & 1) != 0)))) {
				assert((isMarked(oop2))
				 || (objOop11 == (hiddenRootsObject())));
				/* begin fetchPointer:ofObject: */
				fwd2 = longAt((oop2 + BaseHeaderSize) + (0U << (shiftForWord())));
				assert(isPostMobile(fwd2));
				/* begin storePointerUnchecked:ofObject:withValue: */
				assert(!(isOopForwarded(objOop11)));
				longAtput((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord())))), fwd2);
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(pastSpaceStart))) {
			objOop11 = GIV(pastSpaceStart);
			goto l17;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop11 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l17:	/* end objectAfter:limit: */;
	}
	/* begin updatePointersInInitialImmobileObjects */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj2 = (prevObj2 = null);
	objOop12 = GIV(nilObj);
	while (1) {
		assert((objOop12 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop12, GIV(endOfMemory)))) break;
		assert((long64At(objOop12)) != 0);
		if (isEnumerableObject(objOop12)) {
			if (oopisGreaterThanOrEqualTo(objOop12, GIV(firstFreeObject))) {
				goto l32;
			}
			/* begin updatePointersIn: */
			fmt2 = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask());
			if (fmt2 <= 5 /* lastPointerFormat */) {
				if ((fmt2 == (indexablePointersFormat()))
				 && (((longAt(objOop12)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

					/* contexts end at the stack pointer */
					/* begin fetchStackPointerOf: */
					sp2 = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
					if (!((((sp2) & 7) == 1))) {
						contextSize2 = 0;
						goto l49;
					}
					assert((ReceiverIndex + ((sp2 >> 3))) < (lengthOf(objOop12)));
					contextSize2 = (sp2 >> 3);
	l49:	/* end fetchStackPointerOf: */;
					numPointerSlots2 = CtxtTempFrameStart + contextSize2;
					goto l48;
				}
				/* begin numSlotsOf: */
				assert((classIndexOf(objOop12)) > (isForwardedObjectClassIndexPun()));
				numSlots3 = byteAt(objOop12 + 7);
				numPointerSlots2 = (numSlots3 == (numSlotsMask())
					? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop12 - BaseHeaderSize))) << 8)))))) >> 8
					: numSlots3);
				goto l48;
			}
			if (fmt2 == 7 /* forwardedFormat */) {
				numPointerSlots2 = 1;
				goto l48;
			}
			if (fmt2 < (firstCompiledMethodFormat())) {
				numPointerSlots2 = 0;
				goto l48;
			}
			/* begin methodHeaderOf: */
			assert(isCompiledMethod(objOop12));
			header12 = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
			if ((((header12) & 7) == 1)) {
				header3 = header12;
			}
			else {
				assert((((usqInt)header12)) < GIV(newSpaceStart));
				assert((((((CogMethod *) header12))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
				header3 = ((((CogMethod *) header12))->methodHeader);
			}
			assert((((header3) & 7) == 1));
			numLiterals2 = ((header3 >> 3)) & AlternateHeaderNumLiteralsMask;
			numPointerSlots2 = numLiterals2 + LiteralStart;
	l48:	/* end numPointerSlotsOf: */;
			for (i3 = 0; i3 < numPointerSlots2; i3 += 1) {
				/* begin fetchPointer:ofObject: */
				oop3 = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)(i3) << (shiftForWord())))));
				if (((oop3 & (tagMask())) == 0)
				 && ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(oop3, GIV(mobileStart), GIV(lastMobileObject)))
				 && (!(((((usqInt) (longAt(oop3))) >> (pinnedBitShift())) & 1) != 0)))) {
					assert((isMarked(oop3))
					 || (objOop12 == (hiddenRootsObject())));
					/* begin fetchPointer:ofObject: */
					fwd3 = longAt((oop3 + BaseHeaderSize) + (0U << (shiftForWord())));
					assert(isPostMobile(fwd3));
					/* begin storePointerUnchecked:ofObject:withValue: */
					assert(!(isOopForwarded(objOop12)));
					longAtput((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)(i3) << (shiftForWord())))), fwd3);
				}
			}
		}
		prevPrevObj2 = prevObj2;
		prevObj2 = objOop12;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop12);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop12 = GIV(endOfMemory);
			goto l27;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop12 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l27:	/* end objectAfter:limit: */;
	}
	l32:	/* end updatePointersInInitialImmobileObjects */;
	/* begin updatePointersInMobileObjects */
	assert(!((isMarked(GIV(firstFreeObject)))));
	/* begin startOfObject: */
	toFinger = ((byteAt(GIV(firstFreeObject) + 7)) == (numSlotsMask())
		? GIV(firstFreeObject) - BaseHeaderSize
		: GIV(firstFreeObject));
	top = (GIV(savedFirstFieldsSpace).start);
	startOfPreviousPin = 0;
	/* begin allOldSpaceEntitiesFrom:do: */
	assert(isOldObject(GIV(firstFreeObject)));
	prevPrevObj3 = (prevObj3 = null);
	objOop4 = GIV(firstFreeObject);
	while (1) {
		assert((objOop4 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop4, GIV(endOfMemory)))) break;
		assert((long64At(objOop4)) != 0);
		assert((previousPin == null
			? toFinger <= (startOfObject(objOop4))
			: (isMarked(previousPin))
				 && (toFinger <= startOfPreviousPin)));
		if (((((usqInt) (longAt(objOop4))) >> (markedBitFullShift())) & 1) != 0) {
			if (((((usqInt) (longAt(objOop4))) >> (pinnedBitShift())) & 1) != 0) {
				if (!(previousPin)) {
					previousPin = objOop4;
					/* begin startOfObject: */
					startOfPreviousPin = ((byteAt(objOop4 + 7)) == (numSlotsMask())
						? objOop4 - BaseHeaderSize
						: objOop4);
				}
				/* begin updatePointersIn: */
				fmt3 = (((usqInt) (longAt(objOop4))) >> (formatShift())) & (formatMask());
				if (fmt3 <= 5 /* lastPointerFormat */) {
					if ((fmt3 == (indexablePointersFormat()))
					 && (((longAt(objOop4)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

						/* contexts end at the stack pointer */
						/* begin fetchStackPointerOf: */
						sp3 = longAt((objOop4 + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
						if (!((((sp3) & 7) == 1))) {
							contextSize3 = 0;
							goto l50;
						}
						assert((ReceiverIndex + ((sp3 >> 3))) < (lengthOf(objOop4)));
						contextSize3 = (sp3 >> 3);
	l50:	/* end fetchStackPointerOf: */;
						numPointerSlots3 = CtxtTempFrameStart + contextSize3;
						goto l51;
					}
					/* begin numSlotsOf: */
					assert((classIndexOf(objOop4)) > (isForwardedObjectClassIndexPun()));
					numSlots11 = byteAt(objOop4 + 7);
					numPointerSlots3 = (numSlots11 == (numSlotsMask())
						? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop4 - BaseHeaderSize))) << 8)))))) >> 8
						: numSlots11);
					goto l51;
				}
				if (fmt3 == 7 /* forwardedFormat */) {
					numPointerSlots3 = 1;
					goto l51;
				}
				if (fmt3 < (firstCompiledMethodFormat())) {
					numPointerSlots3 = 0;
					goto l51;
				}
				/* begin methodHeaderOf: */
				assert(isCompiledMethod(objOop4));
				header13 = longAt((objOop4 + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
				if ((((header13) & 7) == 1)) {
					header4 = header13;
				}
				else {
					assert((((usqInt)header13)) < GIV(newSpaceStart));
					assert((((((CogMethod *) header13))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
					header4 = ((((CogMethod *) header13))->methodHeader);
				}
				assert((((header4) & 7) == 1));
				numLiterals3 = ((header4 >> 3)) & AlternateHeaderNumLiteralsMask;
				numPointerSlots3 = numLiterals3 + LiteralStart;
	l51:	/* end numPointerSlotsOf: */;
				for (i4 = 0; i4 < numPointerSlots3; i4 += 1) {
					/* begin fetchPointer:ofObject: */
					oop4 = longAt((objOop4 + BaseHeaderSize) + (((sqInt)((usqInt)(i4) << (shiftForWord())))));
					if (((oop4 & (tagMask())) == 0)
					 && ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(oop4, GIV(mobileStart), GIV(lastMobileObject)))
					 && (!(((((usqInt) (longAt(oop4))) >> (pinnedBitShift())) & 1) != 0)))) {
						assert((isMarked(oop4))
						 || (objOop4 == (hiddenRootsObject())));
						/* begin fetchPointer:ofObject: */
						fwd4 = longAt((oop4 + BaseHeaderSize) + (0U << (shiftForWord())));
						assert(isPostMobile(fwd4));
						/* begin storePointerUnchecked:ofObject:withValue: */
						assert(!(isOopForwarded(objOop4)));
						longAtput((objOop4 + BaseHeaderSize) + (((sqInt)((usqInt)(i4) << (shiftForWord())))), fwd4);
					}
				}
			}
			else {
				bytes = bytesInObject(objOop4);
				while ((toFinger <= startOfPreviousPin)
				 && ((bytes != ((availableSpace = startOfPreviousPin - toFinger)))
				 && ((bytes + (2 * 8 /* allocationUnit */)) > availableSpace))) {

					/* The object does not fit in the space between toFinger and previousPin.
					   Move toFinger up to point at the first unmarked or mobile object after
					   previousPin, or, if previousPin is contiguous with o, to the start of this
					   object.  Update previousPin to be the next pinned object above toFInger
					   and below this object, or nil if no such pinned object exists.
					   Any unfillable gaps between adjacent pinned objects will be freed. */
					do {
						toFinger = addressAfter(previousPin);
						/* begin objectStartingAt: */
						numSlots4 = byteAt(toFinger + 7);
						previousPin = (numSlots4 == (numSlotsMask())
							? toFinger + BaseHeaderSize
							: toFinger);
					} while((((((usqInt) (longAt(previousPin))) >> (markedBitFullShift())) & 1) != 0)
						 && ((((((usqInt) (longAt(previousPin))) >> (pinnedBitShift())) & 1) != 0)
						 && (previousPin < objOop4)));
					while (!((previousPin >= objOop4)
					 || ((((((usqInt) (longAt(previousPin))) >> (markedBitFullShift())) & 1) != 0)
					 && (((((usqInt) (longAt(previousPin))) >> (pinnedBitShift())) & 1) != 0)))) {
						previousPin = oldSpaceObjectAfter(previousPin);
					}
					if (previousPin >= objOop4) {
						previousPin = null;
						startOfPreviousPin = 0;
					}
					else {
						/* begin startOfObject: */
						startOfPreviousPin = ((byteAt(previousPin + 7)) == (numSlotsMask())
							? previousPin - BaseHeaderSize
							: previousPin);
					}
				}
				updatePointersInsavedFirstFieldPointer(objOop4, top);
				toFinger += bytes;
				if (((top += BytesPerOop)) >= ((GIV(savedFirstFieldsSpace).limit))) {
					assert(((GIV(savedFirstFieldsSpace).top)) == (top - BytesPerOop));
					onePass = 0;
					goto l45;
				}
			}
		}
		prevPrevObj3 = prevObj3;
		prevObj3 = objOop4;
		/* begin objectAfter:limit: */
		followingWordAddress3 = addressAfter(objOop4);
		if (oopisGreaterThanOrEqualTo(followingWordAddress3, GIV(endOfMemory))) {
			objOop4 = GIV(endOfMemory);
			goto l42;
		}
		flag("endianness");
		followingWord3 = longAt(followingWordAddress3);
		objOop4 = ((((usqInt) followingWord3) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress3 + BaseHeaderSize
			: followingWordAddress3);
	l42:	/* end objectAfter:limit: */;
	}
	assert(((GIV(savedFirstFieldsSpace).top)) == (top - BytesPerOop));
	onePass = 1;
	l45:	/* end updatePointersInMobileObjects */;
	if (!onePass) {
		/* begin updatePointersInObjectsOverflowingSavedFirstFieldsSpace */
		assert(isOldObject(GIV(objectAfterLastMobileObject)));
		prevPrevObj = (prevObj = null);
		objOop1 = GIV(objectAfterLastMobileObject);
		while (1) {
			assert((objOop1 % (allocationUnit())) == 0);
			if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
			assert((long64At(objOop1)) != 0);
			if (isEnumerableObject(objOop1)) {
				if (((((usqInt) (longAt(objOop1))) >> (markedBitFullShift())) & 1) != 0) {
					/* begin updatePointersIn: */
					fmt = (((usqInt) (longAt(objOop1))) >> (formatShift())) & (formatMask());
					if (fmt <= 5 /* lastPointerFormat */) {
						if ((fmt == (indexablePointersFormat()))
						 && (((longAt(objOop1)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

							/* contexts end at the stack pointer */
							/* begin fetchStackPointerOf: */
							sp = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
							if (!((((sp) & 7) == 1))) {
								contextSize = 0;
								goto l53;
							}
							assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(objOop1)));
							contextSize = (sp >> 3);
	l53:	/* end fetchStackPointerOf: */;
							numPointerSlots = CtxtTempFrameStart + contextSize;
							goto l52;
						}
						/* begin numSlotsOf: */
						assert((classIndexOf(objOop1)) > (isForwardedObjectClassIndexPun()));
						numSlots = byteAt(objOop1 + 7);
						numPointerSlots = (numSlots == (numSlotsMask())
							? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop1 - BaseHeaderSize))) << 8)))))) >> 8
							: numSlots);
						goto l52;
					}
					if (fmt == 7 /* forwardedFormat */) {
						numPointerSlots = 1;
						goto l52;
					}
					if (fmt < (firstCompiledMethodFormat())) {
						numPointerSlots = 0;
						goto l52;
					}
					/* begin methodHeaderOf: */
					assert(isCompiledMethod(objOop1));
					header1 = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
					if ((((header1) & 7) == 1)) {
						header = header1;
					}
					else {
						assert((((usqInt)header1)) < GIV(newSpaceStart));
						assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
						header = ((((CogMethod *) header1))->methodHeader);
					}
					assert((((header) & 7) == 1));
					numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
					numPointerSlots = numLiterals + LiteralStart;
	l52:	/* end numPointerSlotsOf: */;
					for (i1 = 0; i1 < numPointerSlots; i1 += 1) {
						/* begin fetchPointer:ofObject: */
						oop1 = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))));
						if (((oop1 & (tagMask())) == 0)
						 && ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(oop1, GIV(mobileStart), GIV(lastMobileObject)))
						 && (!(((((usqInt) (longAt(oop1))) >> (pinnedBitShift())) & 1) != 0)))) {
							assert((isMarked(oop1))
							 || (objOop1 == (hiddenRootsObject())));
							/* begin fetchPointer:ofObject: */
							fwd1 = longAt((oop1 + BaseHeaderSize) + (0U << (shiftForWord())));
							assert(isPostMobile(fwd1));
							/* begin storePointerUnchecked:ofObject:withValue: */
							assert(!(isOopForwarded(objOop1)));
							longAtput((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(i1) << (shiftForWord())))), fwd1);
						}
					}
				}
			}
			prevPrevObj = prevObj;
			prevObj = objOop1;
			/* begin objectAfter:limit: */
			followingWordAddress = addressAfter(objOop1);
			if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
				objOop1 = GIV(endOfMemory);
				goto l11;
			}
			flag("endianness");
			followingWord = longAt(followingWordAddress);
			objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress + BaseHeaderSize
				: followingWordAddress);
	l11:	/* end objectAfter:limit: */;
		}
			}
}


/*	Sweep the pointer fields in obj, updating all references to mobile objects
	to their eventual locations.
	firstFieldPtr is supplied for mobile objects so that the saved first field
	can be updated, and so that
	the first field of a compiled method (which is its header, or reference to
	a CogMethod holding its header)
	can be retrieved. */

	/* SpurPlanningCompactor>>#updatePointersIn:savedFirstFieldPointer: */
static void NoDbgRegParms
updatePointersInsavedFirstFieldPointer(sqInt obj, sqInt firstFieldPtr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt contextSize;
    sqInt field;
    sqInt fmt;
    sqInt fwd;
    sqInt header;
    sqInt i;
    sqInt numLiterals;
    sqInt numPointerSlots;
    usqInt numSlots;
    sqInt oop;
    sqInt sp;

	fmt = (((usqInt) (longAt(obj))) >> (formatShift())) & (formatMask());
	/* begin numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */
	assert((firstFieldPtr != null)
	 && (isMobile(obj)));
	if (fmt <= 5 /* lastPointerFormat */) {
		if ((fmt == (indexablePointersFormat()))
		 && (((longAt(obj)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {

			/* contexts end at the stack pointer */
			/* begin fetchStackPointerOf: */
			sp = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
			if (!((((sp) & 7) == 1))) {
				contextSize = 0;
				goto l7;
			}
			assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(obj)));
			contextSize = (sp >> 3);
	l7:	/* end fetchStackPointerOf: */;
			numPointerSlots = CtxtTempFrameStart + contextSize;
			goto l8;
		}
		/* begin numSlotsOf: */
		assert((classIndexOf(obj)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(obj + 7);
		numPointerSlots = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(obj - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
		goto l8;
	}
	assert(!((fmt == (forwardedFormat()))));
	if (fmt < (firstCompiledMethodFormat())) {
		numPointerSlots = 0;
		goto l8;
	}
	/* begin methodHeaderFromSavedFirstField: */
	field = longAt(firstFieldPtr);
	if ((((field) & 7) == 1)) {
		header = field;
		goto l5;
	}
	assert((isNonImmediate(field))
	 && (field < GIV(newSpaceStart)));
	assert((((((CogMethod *) field))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
	header = ((((CogMethod *) field))->methodHeader);
	l5:	/* end methodHeaderFromSavedFirstField: */;
	assert((((header) & 7) == 1));
	numLiterals = ((header >> 3)) & AlternateHeaderNumLiteralsMask;
	numPointerSlots = numLiterals + LiteralStart;
	l8:	/* end numPointerSlotsWhileCompactingOf:withFormat:savedFirstFieldPointer: */;
	if ((fmt <= 5 /* lastPointerFormat */)
	 && (numPointerSlots > 0)) {

		/* Relocate the saved first field; Note that CompiledMethods can be excluded since their
		   first field is either a SmallInteger or a reference to a CogMethod outside of oldSpace. */
		oop = longAt(firstFieldPtr);
		if (((oop & (tagMask())) == 0)
		 && ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(oop, GIV(mobileStart), GIV(lastMobileObject)))
		 && (!(((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0)))) {
			assert(isMarked(oop));
			/* begin fetchPointer:ofObject: */
			fwd = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
			assert(isPostMobile(fwd));
			longAtput(firstFieldPtr, fwd);
		}
	}
	for (i = 1; i < numPointerSlots; i += 1) {
		/* begin fetchPointer:ofObject: */
		oop = longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if (((oop & (tagMask())) == 0)
		 && ((oopisGreaterThanOrEqualToandLessThanOrEqualTo(oop, GIV(mobileStart), GIV(lastMobileObject)))
		 && (!(((((usqInt) (longAt(oop))) >> (pinnedBitShift())) & 1) != 0)))) {
			assert((isMarked(oop))
			 || (obj == (hiddenRootsObject())));
			/* begin fetchPointer:ofObject: */
			fwd = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
			assert(isPostMobile(fwd));
			/* begin storePointerUnchecked:ofObject:withValue: */
			assert(!(isOopForwarded(obj)));
			longAtput((obj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), fwd);
		}
	}
}


/*	Attempt to allocate a memory segment large enough to hold the
	savedFirstFieldsSpace. Invoked when neither eden nor a large free chunk
	are found to be big enough for the job. */

	/* SpurPlanningCompactor>>#useSegmentForSavedFirstFieldsSpace: */
static sqInt NoDbgRegParms
useSegmentForSavedFirstFieldsSpace(sqInt spaceEstimate)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt allocatedSize;
    sqInt roundedSize;
    void *segAddress;

	allocatedSize = 0;
	roundedSize = ((spaceEstimate + 0x3FF) / 1024) * 1024;
	segAddress = sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto(roundedSize, firstGapOfSizeAtLeast(roundedSize), (&allocatedSize));
	if (!(segAddress == null)) {
		(GIV(savedFirstFieldsSpace).start = ((usqIntptr_t)segAddress));
		(GIV(savedFirstFieldsSpace).limit = (((usqIntptr_t)segAddress)) + allocatedSize);
		GIV(savedFirstFieldsSpaceNotInOldSpace) = 1;
		assert(savedFirstFieldsSpaceWasAllocated());
		return 1;
	}
	return 0;
}


/*	Answer 0 if all the mobile objects from firstMobileObject to
	lastMobileObject have sane forwarding addresses, and that
	savedFirstFieldsSpace is of
	matching capacity. Otherwise answer an error code identifying the anomaly. */

	/* SpurPlanningCompactor>>#validRelocationPlanInPass: */
static sqInt NoDbgRegParms
validRelocationPlanInPass(sqInt onePass)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt destination;
    sqInt followingWord;
    usqInt followingWordAddress;
    sqInt nMobiles;
    sqInt objOop;
    sqInt prevObj;
    sqInt prevPrevObj;
    usqInt toFinger;

	nMobiles = 0;
	toFinger = GIV(mobileStart);
	GIV(anomaly) = null;
	/* begin allOldSpaceEntitiesFrom:do: */
	assert(isOldObject(GIV(firstMobileObject)));
	prevPrevObj = (prevObj = null);
	objOop = GIV(firstMobileObject);
	while (1) {
		assert((objOop % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop, GIV(endOfMemory)))) break;
		assert((long64At(objOop)) != 0);
		if (((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0) {
			if (!(((((usqInt) (longAt(objOop))) >> (pinnedBitShift())) & 1) != 0)) {
				nMobiles += 1;
				/* begin fetchPointer:ofObject: */
				destination = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
				if (!(destination >= toFinger)) {
					GIV(anomaly) = objOop;
					return 1;
				}
				toFinger += bytesInObject(objOop);
				if (oopisGreaterThan(objOop, GIV(lastMobileObject))) {
					GIV(anomaly) = objOop;
					return 2;
				}
				if (objOop == GIV(lastMobileObject)) {
					return ((((((GIV(savedFirstFieldsSpace).top)) + BytesPerOop) - ((GIV(savedFirstFieldsSpace).start))) / BytesPerOop) == nMobiles
						? 0
						: 3);
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, GIV(endOfMemory))) {
			objOop = GIV(endOfMemory);
			goto l2;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l2:	/* end objectAfter:limit: */;
	}
	return ((((((GIV(savedFirstFieldsSpace).top)) + BytesPerOop) - ((GIV(savedFirstFieldsSpace).start))) / BytesPerOop) == nMobiles
		? 0
		: 4);
}

	/* SpurSegmentInfo>>#segLimit */
static usqInt NoDbgRegParms
segLimit(SpurSegmentInfo * self_in_segLimit)
{
	return ((self_in_segLimit->segSize)) + ((self_in_segLimit->segStart));
}

	/* SpurSegmentManager>>#addSegmentOfSize: */
static SpurSegmentInfo * NoDbgRegParms
addSegmentOfSize(sqInt ammount)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt allocatedSize;
    sqInt i;
    sqInt idx;
    sqInt lastSegIndex;
    SpurSegmentInfo *newSeg;
    sqInt newSegIndex;
    void *segAddress;
    sqInt segAddress1;
    sqInt segIndex;

	allocatedSize = 0;
	newSegIndex = 0;
	segAddress = sqAllocateMemorySegmentOfSizeAboveAllocatedSizeInto(ammount, firstGapOfSizeAtLeast(ammount), (&allocatedSize));
	if (!(segAddress == null)) {
		/* begin insertSegmentFor: */
		segAddress1 = ((usqIntptr_t)segAddress);
		assert(segAddress1 >= (segLimit(&GIV(segments)[0])));
		if (GIV(numSegments) == GIV(numSegInfos)) {
			allocateOrExtendSegmentInfos();
		}
		assert(GIV(numSegments) < GIV(numSegInfos));
		segIndex = (lastSegIndex = GIV(numSegments) - 1);
		GIV(numSegments) += 1;
		while(1) {
			if (segAddress1 >= ((((GIV(segments)[segIndex]).segSize)) + (((GIV(segments)[segIndex]).segStart)))) {
				segIndex += 1;
				for (idx = lastSegIndex; idx >= segIndex; idx += -1) {
					GIV(segments)[idx + 1] = (GIV(segments)[idx]);
				}
				newSegIndex = segIndex;
				goto l1;
			}
			segIndex -= 1;
		}
	l1:	/* end insertSegmentFor: */;
		newSeg = (&(GIV(segments)[newSegIndex]));
		(newSeg->segStart = ((usqIntptr_t)segAddress));
		(newSeg->segSize = allocatedSize);
		(newSeg->swizzle = 0);
		assert(!(segmentOverlap()));
		bridgeFromto((&(GIV(segments)[newSegIndex - 1])), newSeg);
		bridgeFromto(newSeg, (!(newSegIndex == (GIV(numSegments) - 1))
			? (&(GIV(segments)[newSegIndex + 1]))
			: 0));

		/* test isInMemory: */
		GIV(totalHeapSizeIncludingBridges) += allocatedSize;
		for (i = 0; i < GIV(numSegments); i += 1) {
			assert(isInSegments(((GIV(segments)[i]).segStart)));
			assert(isInSegments((segLimit(&GIV(segments)[i])) - BytesPerWord));
			assert((!(isInSegments(segLimit(&GIV(segments)[i]))))
			 || ((i < (GIV(numSegments) - 1))
			 && ((segLimit(&GIV(segments)[i])) == (((GIV(segments)[i + 1]).segStart)))));
			assert((!(isInSegments((((GIV(segments)[i]).segStart)) - BytesPerWord)))
			 || ((i > 0)
			 && ((segLimit(&GIV(segments)[i - 1])) == (((GIV(segments)[i]).segStart)))));
		}
		return newSeg;
	}
	return null;
}


/*	Adjust swizzles by firstSegmentShift. Also computes segStarts as
	they were in the image when it was written, so that oops' segments
	can be determined and hence oops correctly swizzled. */

	/* SpurSegmentManager>>#adjustSegmentSwizzlesBy: */
static void NoDbgRegParms
adjustSegmentSwizzlesBy(sqInt firstSegmentShift)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt oldBaseAddr;
    SpurSegmentInfo *segInfo;

	oldBaseAddr = GIV(oldSpaceStart) - firstSegmentShift;
	for (i = 0; i < GIV(numSegments); i += 1) {
		segInfo = (&(GIV(segments)[i]));
		(segInfo->segStart = ((segInfo->segStart)) + oldBaseAddr);
		(segInfo->swizzle = ((segInfo->swizzle)) - oldBaseAddr);
	}
	GIV(canSwizzle) = 1;
}

	/* SpurSegmentManager>>#allBridgesMarked */
static sqInt
allBridgesMarked(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    SpurSegmentInfo *aSegment;
    sqInt bridgeObj;
    sqInt i;
    usqInt numSlots;

	for (i = 0; i < GIV(numSegments); i += 1) {
		/* begin bridgeFor: */
		aSegment = ((SpurSegmentInfo *) ((&(GIV(segments)[i]))));
		/* begin objectStartingAt: */
		address = (((aSegment->segSize)) + ((aSegment->segStart))) - (2 * BaseHeaderSize);
		numSlots = byteAt(address + 7);
		bridgeObj = (numSlots == (numSlotsMask())
			? address + BaseHeaderSize
			: address);
		assert(isValidSegmentBridge(bridgeObj));
		if (!(((((usqInt) (longAt(bridgeObj))) >> (markedBitFullShift())) & 1) != 0)) {
			return 0;
		}
	}
	return 1;
}


/*	Increase the number of allocated segInfos by 16. */

	/* SpurSegmentManager>>#allocateOrExtendSegmentInfos */
static void
allocateOrExtendSegmentInfos(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt newNumSegs;

	if (GIV(numSegInfos) == 0) {
		GIV(numSegInfos) = 16;
		GIV(segments) = calloc(GIV(numSegInfos), sizeof(SpurSegmentInfo));
		return;
	}
	newNumSegs = GIV(numSegInfos) + 16;
	GIV(segments) = realloc(GIV(segments), newNumSegs * (sizeof(SpurSegmentInfo)));
	if (GIV(segments) == 0) {
		error("out of memory; cannot allocate more segments");
	}
	memset(GIV(segments) + GIV(numSegInfos), 0, (newNumSegs - GIV(numSegInfos)) * (sizeof(SpurSegmentInfo)));
	GIV(numSegInfos) = newNumSegs;
}

	/* SpurSegmentManager>>#bridgeAt: */
static sqInt NoDbgRegParms
bridgeAt(sqInt segIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    usqInt numSlots;

	/* begin objectStartingAt: */
	address = (((((&(GIV(segments)[segIndex])))->segSize)) + ((((&(GIV(segments)[segIndex])))->segStart))) - (2 * BaseHeaderSize);
	numSlots = byteAt(address + 7);
	return (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
}

	/* SpurSegmentManager>>#bridgeFor: */
static sqInt NoDbgRegParms
bridgeFor(SpurSegmentInfo *aSegment)
{
    sqInt address;
    usqInt numSlots;

	/* begin objectStartingAt: */
	address = (((aSegment->segSize)) + ((aSegment->segStart))) - (2 * BaseHeaderSize);
	numSlots = byteAt(address + 7);
	return (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
}


/*	Create a bridge from aSegment to the next segment,
	or create a terminating bridge if there is no next segment. */

	/* SpurSegmentManager>>#bridgeFrom:to: */
static void NoDbgRegParms
bridgeFromto(SpurSegmentInfo *aSegment, SpurSegmentInfo *nextSegmentOrNil)
{
    sqInt bridgeSpan;
    sqInt clifton;
    usqInt segEnd;

	segEnd = ((aSegment->segSize)) + ((aSegment->segStart));

	/* clifton is where the Avon bridge begins... */
	clifton = segEnd - (2 * BaseHeaderSize);
	if (nextSegmentOrNil == null) {
		/* begin bridgeSize */
		bridgeSpan = 2 * BaseHeaderSize;
	}
	else {
		bridgeSpan = (((nextSegmentOrNil->segStart)) - segEnd) + (2 * BaseHeaderSize);
	}
	assert(bridgeSpan >= 0);
	initSegmentBridgeWithBytesat(bridgeSpan, clifton);
	assert((addressAfter(objectStartingAt(clifton))) == ((nextSegmentOrNil == null
		? segLimit(aSegment)
		: (nextSegmentOrNil->segStart))));
}

	/* SpurSegmentManager>>#checkSegments */
static void
checkSegments(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	assert(GIV(numSegments) >= 1);
	for (i = 0; i < GIV(numSegments); i += 1) {
		assert(addressCouldBeObj(((GIV(segments)[i]).segStart)));
		assert(isValidSegmentBridge(bridgeAt(i)));
	}
	assert(((segLimit(&GIV(segments)[GIV(numSegments) - 1])) - (bridgeSize())) == (endOfMemory()));
}


/*	The image has been loaded, old segments reconstructed, and the heap
	swizzled into a single contiguous segment. Collapse the segments into one. */

	/* SpurSegmentManager>>#collapseSegmentsPostSwizzle */
static void
collapseSegmentsPostSwizzle(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    SpurSegmentInfo * cascade0;

	GIV(canSwizzle) = 0;
	GIV(numSegments) = 1;
	cascade0 = (&(GIV(segments)[0]));
	(cascade0->segStart = oldSpaceStart());
	(cascade0->segSize = (GIV(totalHeapSizeIncludingBridges) = (endOfMemory()) - (oldSpaceStart())));
	assert(isSegmentBridge(bridgeAt(0)));
	assert((numSlotsOfAny(bridgeAt(0))) == 0);
}


/*	Answer the segment limit of the first segment followed by a gap of at
	least size bytes.
 */

	/* SpurSegmentManager>>#firstGapOfSizeAtLeast: */
static void * NoDbgRegParms
firstGapOfSizeAtLeast(sqInt size)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt bridge;
    sqInt i;
    usqInt numSlots;

	for (i = 0; i <= (GIV(numSegments) - 2); i += 1) {
		/* begin objectStartingAt: */
		address = (((((&(GIV(segments)[i])))->segSize)) + ((((&(GIV(segments)[i])))->segStart))) - (2 * BaseHeaderSize);
		numSlots = byteAt(address + 7);
		bridge = (numSlots == (numSlotsMask())
			? address + BaseHeaderSize
			: address);
		if (((bytesInObject(bridge)) - (2 * BaseHeaderSize)) >= size) {
			return ((void *)((((GIV(segments)[i]).segSize)) + (((GIV(segments)[i]).segStart))));
		}
	}
	return ((void *)((((GIV(segments)[GIV(numSegments) - 1]).segSize)) + (((GIV(segments)[GIV(numSegments) - 1]).segStart))));
}

	/* SpurSegmentManager>>#isEmptySegment: */
static sqInt NoDbgRegParms
isEmptySegment(SpurSegmentInfo *seg)
{
    sqInt address;
    sqInt firstObj;
    usqInt numSlots;

	/* begin objectStartingAt: */
	address = (seg->segStart);
	numSlots = byteAt(address + 7);
	firstObj = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	return (((longAt(firstObj)) & (classIndexMask())) == (isFreeObjectClassIndexPun()))
	 && ((addressAfter(firstObj)) == ((((seg->segSize)) + ((seg->segStart))) - (2 * BaseHeaderSize)));
}

	/* SpurSegmentManager>>#isInSegments: */
static sqInt NoDbgRegParms
isInSegments(usqInt address)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	for (i = 0; i < GIV(numSegments); i += 1) {
		if (address < (((GIV(segments)[i]).segStart))) {
			return 0;
		}
		if (address < ((((GIV(segments)[i]).segSize)) + (((GIV(segments)[i]).segStart)))) {
			return 1;
		}
	}
	return 0;
}


/*	bridges bridge the gaps between segments. They are the last object in each
	segment. 
 */

	/* SpurSegmentManager>>#isValidSegmentBridge: */
static sqInt NoDbgRegParms
isValidSegmentBridge(sqInt objOop)
{
	return ((addressCouldBeObj(objOop))
	 || (objOop == (endOfMemory())))
	 && ((((longAt(objOop)) & (classIndexMask())) == (segmentBridgePun()))
	 && (((byteAt(objOop + 7)) == (numSlotsMask()))
	 || ((numSlotsOfAny(objOop)) == 0)));
}


/*	Answer the the next non-empty segment or nil. The size of a segment
	includes that of its bridge. A segment containing just a free object and a
	bridge will still
	have a size of manager bridgeSize after shortening it in
	prepareForSnapshot. 
 */

	/* SpurSegmentManager>>#nextNonEmptySegmentAfter: */
static SpurSegmentInfo * NoDbgRegParms
nextNonEmptySegmentAfter(sqInt i)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt nextx;

	nextx = i;
	while(1) {
		if (((nextx += 1)) >= GIV(numSegments)) {
			return null;
		}
		if ((((GIV(segments)[nextx]).segSize)) > (2 * BaseHeaderSize)) {
			return (&(GIV(segments)[nextx]));
		}
	}
	return 0;
}


/*	Restore all shortened segments to their proper size, re-freeing the
	trailing space.
 */

	/* SpurSegmentManager>>#postSnapshot */
static void
postSnapshot(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt bytes;
    usqInt freeChunk;
    sqInt i;
    sqInt newEndOfMemory;
    SpurSegmentInfo *seg;


	/* Set endOfMemory first, to avoid assert fails in freeChunkWithBytes:at:. */
	seg = (&(GIV(segments)[GIV(numSegments) - 1]));
	if (((seg->lastFreeObject)) == null) {
		assert((endOfMemory()) == ((segLimit(seg)) - (bridgeSize())));
	}
	else {
		/* begin setEndOfMemory: */
		newEndOfMemory = (((seg->savedSegSize)) + ((seg->segStart))) - (2 * BaseHeaderSize);
		GIV(endOfMemory) = newEndOfMemory;
		if (GIV(freeOldSpaceStart) > newEndOfMemory) {
			GIV(freeOldSpaceStart) = newEndOfMemory;
		}
	}
	for (i = (GIV(numSegments) - 1); i >= 0; i += -1) {
		seg = (&(GIV(segments)[i]));
		freeChunk = (seg->lastFreeObject);
		if (!(freeChunk == null)) {
			address = (((seg->segSize)) + ((seg->segStart))) - (2 * BaseHeaderSize);
			(seg->segSize = (seg->savedSegSize));
			bridgeFromto(seg, (i < (GIV(numSegments) - 1)
				? (&(GIV(segments)[i + 1]))
				: 0));
			/* begin addFreeChunkWithBytes:at: */
			bytes = ((((seg->segSize)) + ((seg->segStart))) - address) - (2 * BaseHeaderSize);
			GIV(totalFreeOldSpace) += bytes;
			freeChunkWithBytesat(bytes, address);
		}
	}
	checkSegments();
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
}


/*	shorten all segments by any trailing free space. */

	/* SpurSegmentManager>>#prepareForSnapshot */
static void NeverInline
prepareForSnapshot(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt cameFrom;
    SpurSegmentInfo * cascade0;
    usqInt chunkBytes;
    sqInt fieldIndex;
    sqInt fieldIndex1;
    sqInt fieldIndex2;
    sqInt fieldIndex3;
    sqInt followingWord;
    usqInt followingWordAddress;
    usqInt freeChunk;
    sqInt i;
    sqInt i1;
    sqInt largeChild;
    sqInt limit;
    sqInt newEndOfMemory;
    sqInt next;
    usqInt node;
    SpurSegmentInfo *seg;
    sqInt smallChild;
    sqInt treeNode;

	checkSegments();
	for (i = 0; i < GIV(numSegments); i += 1) {
		cascade0 = (&(GIV(segments)[i]));
		(cascade0->savedSegSize = ((GIV(segments)[i]).segSize));
		(cascade0->lastFreeObject = null);
	}
	/* begin freeTreeNodesDo: */
	treeNode = GIV(freeLists)[0];
	if (treeNode == 0) {
		goto l5;
	}
	cameFrom = -1;
	do {
		assert((bytesInObject(treeNode)) >= ((numFreeLists()) * (allocationUnit())));
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex1 = 3 /* freeChunkSmallerIndex */;
		smallChild = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex1) << (shiftForWord())))));
		/* begin fetchPointer:ofFreeChunk: */
		fieldIndex2 = 4 /* freeChunkLargerIndex */;
		largeChild = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex2) << (shiftForWord())))));
		assert((smallChild == 0)
		 || (treeNode == (fetchPointerofFreeChunk(freeChunkParentIndex(), smallChild))));
		assert((largeChild == 0)
		 || (treeNode == (fetchPointerofFreeChunk(freeChunkParentIndex(), largeChild))));
		if (((smallChild == 0)
		 && (largeChild == 0))
		 || ((largeChild == 0
			? cameFrom == smallChild
			: cameFrom == largeChild))) {

			/* and since we've applied we must move on up */
			node = treeNode;
			while (node != 0) {
				/* begin objectAfter:limit: */
				limit = endOfMemory();
				followingWordAddress = addressAfter(node);
				if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
					next = limit;
					goto l8;
				}
				flag("endianness");
				followingWord = longAt(followingWordAddress);
				next = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
					? followingWordAddress + BaseHeaderSize
					: followingWordAddress);
	l8:	/* end objectAfter:limit: */;
				if (((longAt(next)) & (classIndexMask())) == (segmentBridgePun())) {
					/* begin segmentContainingObj: */
					for (i1 = (GIV(numSegments) - 1); i1 >= 0; i1 += -1) {
						if (node >= (((GIV(segments)[i1]).segStart))) {
							seg = (&(GIV(segments)[i1]));
							goto l9;
						}
					}
					seg = null;
	l9:	/* end segmentContainingObj: */;
					(seg->lastFreeObject = node);
					node = 0;
				}
				else {
					/* begin fetchPointer:ofFreeChunk: */
					fieldIndex = 0 /* freeChunkNextIndex */;
					node = longAt((node + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
				}
			}
			treeNode = treeNode;
			cameFrom = treeNode;
			/* begin fetchPointer:ofFreeChunk: */
			fieldIndex3 = 2 /* freeChunkParentIndex */;
			treeNode = longAt((treeNode + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex3) << (shiftForWord())))));
		}
		else {
			if ((smallChild != 0)
			 && (cameFrom != smallChild)) {
				treeNode = smallChild;
			}
			else {
				assert(largeChild != 0);
				treeNode = largeChild;
			}
			cameFrom = -1;
		}
	} while(treeNode != 0);
	l5:	/* end freeTreeNodesDo: */;
	for (i = 0; i < GIV(numSegments); i += 1) {
		freeChunk = ((GIV(segments)[i]).lastFreeObject);
		if (!(freeChunk == null)) {
			/* begin detachFreeObject: */
			chunkBytes = bytesInObject(freeChunk);
			GIV(totalFreeOldSpace) -= chunkBytes;
			unlinkFreeChunkchunkBytes(freeChunk, chunkBytes);
			((GIV(segments)[i]).segSize = ((((byteAt(freeChunk + 7)) == (numSlotsMask())
	? freeChunk - BaseHeaderSize
	: freeChunk)) + (2 * BaseHeaderSize)) - (((GIV(segments)[i]).segStart)));
			bridgeFromto((&(GIV(segments)[i])), (i < (GIV(numSegments) - 1)
				? (&(GIV(segments)[i + 1]))
				: 0));
		}
	}
	/* begin setEndOfMemory: */
	newEndOfMemory = ((((GIV(segments)[GIV(numSegments) - 1]).segSize)) + (((GIV(segments)[GIV(numSegments) - 1]).segStart))) - (2 * BaseHeaderSize);
	GIV(endOfMemory) = newEndOfMemory;
	if (GIV(freeOldSpaceStart) > newEndOfMemory) {
		GIV(freeOldSpaceStart) = newEndOfMemory;
	}
}


/*	Read numBytes of image data from f into memory at memoryBaseForImageRead.
	Answer the number of bytes written. In addition, read each segment, build
	up the
	segment info for swizzling, while eliminating the bridge objects at the
	end of each
	segment that specify the distance to and the size of the subsequent
	segment.  */

	/* SpurSegmentManager>>#readHeapFromImageFile:dataBytes: */
static sqInt NoDbgRegParms
readHeapFromImageFiledataBytes(sqImageFile f, sqInt numBytes)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bridge;
    sqInt bridgehead;
    usqLong bridgeSpan;
    sqInt bytesRead;
    usqInt newBase;
    sqInt nextSegmentSize;
    sqInt oldBase;
    SpurSegmentInfo *segInfo;
    sqInt totalBytesRead;

	allocateOrExtendSegmentInfos();
	GIV(numSegments) = (totalBytesRead = 0);

	/* N.B. still must be adjusted by oldBaseAddr. */
	oldBase = 0;
	newBase = oldSpaceStart();
	nextSegmentSize = GIV(firstSegmentSize);
	bridgehead = (GIV(firstSegmentSize) + (oldSpaceStart())) - (2 * BaseHeaderSize);
	while (1) {
		segInfo = (&(GIV(segments)[GIV(numSegments)]));
		(segInfo->segStart = oldBase);
		(segInfo->segSize = nextSegmentSize);
		(segInfo->swizzle = newBase - oldBase);
		bytesRead = sqImageFileRead(pointerForOop(newBase), sizeof(char), nextSegmentSize, f);
		if (bytesRead > 0) {
			totalBytesRead += bytesRead;
		}
		if (bytesRead != nextSegmentSize) {
			return totalBytesRead;
		}
		if (((GIV(numSegments) += 1)) >= GIV(numSegInfos)) {
			allocateOrExtendSegmentInfos();
		}
		bridge = bridgehead + BaseHeaderSize;
		bridgeSpan = ((byteAt(bridgehead + 7)) == 0
			? 0
			: BytesPerOop * (((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(bridge - BaseHeaderSize))) << 8)))))) >> 8));
		oldBase = (oldBase + nextSegmentSize) + bridgeSpan;
		newBase = (newBase + nextSegmentSize) - (2 * BaseHeaderSize);
		nextSegmentSize = ((usqInt)(long64At(bridge)));
		if (!(nextSegmentSize != 0)) break;
		bridgehead = (bridgehead - (2 * BaseHeaderSize)) + nextSegmentSize;
	}
	assert((newBase - (oldSpaceStart())) == (totalBytesRead - (GIV(numSegments) * (bridgeSize()))));
	/* begin setFreeOldSpaceStart: */
	GIV(freeOldSpaceStart) = newBase;
	GIV(firstSegmentSize) = null;
	return totalBytesRead;
}

	/* SpurSegmentManager>>#segmentContainingObj: */
EXPORT(SpurSegmentInfo *)
segmentContainingObj(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	for (i = (GIV(numSegments) - 1); i >= 0; i += -1) {
		if (objOop >= (((GIV(segments)[i]).segStart))) {
			return (&(GIV(segments)[i]));
		}
	}
	return null;
}


/*	Answers true if a segment overlaps with another one. */

	/* SpurSegmentManager>>#segmentOverlap */
static sqInt
segmentOverlap(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt endi;
    usqInt endj;
    sqInt i;
    sqInt j;
    usqInt starti;
    usqInt startj;

	for (i = 0; i < GIV(numSegments); i += 1) {
		starti = ((GIV(segments)[i]).segStart);
		endi = (((GIV(segments)[i]).segSize)) + (((GIV(segments)[i]).segStart));
		for (j = 0; j < GIV(numSegments); j += 1) {
			startj = ((GIV(segments)[j]).segStart);
			endj = (((GIV(segments)[j]).segSize)) + (((GIV(segments)[j]).segStart));
			if (!(i == j)) {
				if (!((starti < startj)
					 || (starti >= endj))) {
					return 1;
				}
				if (!((endi <= startj)
					 || (endi >= endj))) {
					return 1;
				}
			}
		}
	}
	return 0;
}


/*	Answer if any shrinkage was achieved. */

	/* SpurSegmentManager>>#shrinkObjectMemory: */
static sqInt NoDbgRegParms
shrinkObjectMemory(usqInt delta)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    SpurSegmentInfo *best;
    usqInt chunkBytes;
    usqInt currentEnd;
    sqInt delta1;
    SpurSegmentInfo *emptySeg;
    sqInt freeChunk;
    sqInt i;
    sqInt i1;
    sqInt i2;
    sqInt j;
    usqInt numSlots;
    SpurSegmentInfo *seg;
    SpurSegmentInfo *segInfo;
    usqInt shrinkage;

	i = 0;
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeFreeSpace)) == (GCModeFreeSpace | GCModeFreeSpace))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	shrinkage = delta;
	while(1) {
		/* begin findEmptySegNearestInSizeTo: */
		best = null;
		delta1 = shrinkage;
		for (i2 = 0; i2 < GIV(numSegments); i2 += 1) {
			seg = (&(GIV(segments)[i2]));
			if (isEmptySegment(seg)) {
				if (best == null) {
					best = seg;
				}
				else {
					if ((shrinkage >= (((seg->segSize)) * 0.75))
					 && ((SQABS((((sqInt) (((seg->segSize)) - shrinkage))))) < delta1)) {
						best = seg;
						delta1 = SQABS((((sqInt) (((seg->segSize)) - shrinkage))));
					}
				}
			}
		}
		emptySeg = best;
		if ((emptySeg == null)
		 || (((emptySeg->segSize)) > shrinkage)) {
			/* begin checkFreeSpace: */
			assert(bitsSetInFreeSpaceMaskForAllFreeLists());
			assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
			if (((checkForLeaks & (GCModeFreeSpace | GCModeFreeSpace)) == (GCModeFreeSpace | GCModeFreeSpace))) {
				runLeakCheckerForFreeSpace(GCModeFreeSpace);
			}
			return shrinkage < delta;
		}
		shrinkage -= (emptySeg->segSize);
		/* begin detachFreeObject: */
		address = (emptySeg->segStart);
		numSlots = byteAt(address + 7);
		freeChunk = (numSlots == (numSlotsMask())
			? address + BaseHeaderSize
			: address);
		chunkBytes = bytesInObject(freeChunk);
		GIV(totalFreeOldSpace) -= chunkBytes;
		unlinkFreeChunkchunkBytes(freeChunk, chunkBytes);
		/* begin removeSegment: */
		for (i1 = 0; i1 < GIV(numSegments); i1 += 1) {
			if (((emptySeg->segStart)) == (((GIV(segments)[i1]).segStart))) {
				i = i1;
				goto l1;
			}
		}
		error("segment not found");
	l1:	/* end indexOfSegment: */;
		assert(i > 0);
		GIV(totalHeapSizeIncludingBridges) -= (emptySeg->segSize);
		sqDeallocateMemorySegmentAtOfSize(((void *)((emptySeg->segStart))), (emptySeg->segSize));
		for (j = i; j <= (GIV(numSegments) - 2); j += 1) {
			GIV(segments)[j] = (GIV(segments)[j + 1]);
		}
		GIV(numSegments) -= 1;
		bridgeFromto((&(GIV(segments)[i - 1])), (i <= (GIV(numSegments) - 1)
			? (&(GIV(segments)[i]))
			: 0));
		/* begin setLastSegment: */
		segInfo = ((SpurSegmentInfo *) ((&(GIV(segments)[GIV(numSegments) - 1]))));
		currentEnd = (((segInfo->segSize)) + ((segInfo->segStart))) - (2 * BaseHeaderSize);
		if (currentEnd <= GIV(endOfMemory)) {
			GIV(endOfMemory) = currentEnd;
			if (GIV(freeOldSpaceStart) > currentEnd) {
				GIV(freeOldSpaceStart) = currentEnd;
			}
		}
	}
	return 0;
}

	/* SpurSegmentManager>>#someSegmentContainsPinned */
static sqInt
someSegmentContainsPinned(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	for (i = 0; i < GIV(numSegments); i += 1) {
		if (((GIV(segments)[i]).containsPinned)) {
			return 1;
		}
	}
	return 0;
}

	/* SpurSegmentManager>>#swizzleObj: */
static sqInt NoDbgRegParms
swizzleObj(sqInt objOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;

	assert(GIV(canSwizzle));
	for (i = (GIV(numSegments) - 1); i >= 1; i += -1) {
		if (objOop >= (((GIV(segments)[i]).segStart))) {
			return objOop + (((GIV(segments)[i]).swizzle));
		}
	}
	return objOop + (((GIV(segments)[0]).swizzle));
}

	/* SpurSegmentManager>>#totalBytesInSegments */
static usqInt
totalBytesInSegments(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    usqInt total;

	total = 0;
	for (i = 0; i < GIV(numSegments); i += 1) {
		total += ((GIV(segments)[i]).segSize);
	}
	assert(GIV(totalHeapSizeIncludingBridges) == total);
	return total;
}

	/* SpurSegmentManager>>#writeImageSegmentsToFile: */
static sqInt NoDbgRegParms
writeImageSegmentsToFile(sqImageFile aBinaryStream)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt total;

	assert(((endOfMemory()) == (segLimit(&GIV(segments)[GIV(numSegments) - 1])))
	 || (((endOfMemory()) + (bridgeSize())) == (segLimit(&GIV(segments)[GIV(numSegments) - 1]))));
	if (!(GIV(firstSegmentSize) == null)) {
		assert(GIV(firstSegmentSize) == (((GIV(segments)[0]).segSize)));
	}
	assert((((GIV(segments)[0]).segSize)) > 0);
	total = 0;
	for (i = 0; i < GIV(numSegments); i += 1) {
		if ((((GIV(segments)[i]).segSize)) > (2 * BaseHeaderSize)) {
			total += writeSegmentnextSegmenttoFile((&(GIV(segments)[i])), nextNonEmptySegmentAfter(i), aBinaryStream);
		}
	}
	return total;
}


/*	Write the segment contents, the size of and the distance to the next
	segment to aBinaryStream.
 */

	/* SpurSegmentManager>>#writeSegment:nextSegment:toFile: */
static sqInt NoDbgRegParms
writeSegmentnextSegmenttoFile(SpurSegmentInfo *segment, SpurSegmentInfo *nextSegment, sqImageFile aBinaryStream)
{
    usqLong firstSavedBridgeWord;
    sqInt nWritten;
    sqInt pier1;
    sqInt pier2;
    usqLong secondSavedBridgeWord;

	pier1 = (((segment->segSize)) + ((segment->segStart))) - (2 * BaseHeaderSize);
	pier2 = pier1 + BaseHeaderSize;
	assert(isValidSegmentBridge(bridgeFor(segment)));
	assert((startOfObject(bridgeFor(segment))) == pier1);
	firstSavedBridgeWord = long64At(pier1);
	secondSavedBridgeWord = long64At(pier2);
	bridgeFromto(segment, nextSegment);
	long64Atput(pier2, (nextSegment == null
		? 0
		: (nextSegment->segSize)));
	nWritten = sqImageFileWrite(((void *)((segment->segStart))), 1, (segment->segSize), aBinaryStream);
	long64Atput(pier1, firstSavedBridgeWord);
	long64Atput(pier2, secondSavedBridgeWord);
	return nWritten;
}


/*	Answer the current activeProcess. */
/*	useful for VM debugging */

	/* StackInterpreter>>#activeProcess */
sqInt
activeProcess(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objOop;
    sqInt objOop1;

	/* begin fetchPointer:ofObject: */
	objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	return longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
}


/*	The various poll/select calls in the VM should attempt to tally the
	ammount of time spent at idle here, so as to render the uptime value
	meaningful. 
 */

	/* StackInterpreter>>#addIdleUsecs: */
void
addIdleUsecs(sqInt idleUsecs)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(statIdleUsecs) += idleUsecs;
}


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

	/* StackInterpreter>>#addLastLink:toList: */
static void NoDbgRegParms
addLastLinktoList(sqInt proc, sqInt aList)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt lastLink;

	assert(!((isForwarded(proc))));
	assert(!((isForwarded(aList))));
	assert((fetchPointerofObject(NextLinkIndex, proc)) == (nilObject()));
	if ((assert(!(isForwarded(aList))),
	(longAt((aList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))))) == GIV(nilObj))) {
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(aList)));
		if ((assert(isNonImmediate(aList)),
		oopisGreaterThanOrEqualTo(aList, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((proc & (tagMask())) == 0)
			 && (oopisLessThan(proc, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(aList))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(aList);
				}
			}
		}
		longAtput((aList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))), proc);
	}
	else {
		/* begin fetchPointer:ofObject: */
		lastLink = longAt((aList + BaseHeaderSize) + (((sqInt)((usqInt)(LastLinkIndex) << (shiftForWord())))));
		assert(lastLink != proc);
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(lastLink)));
		if ((assert(isNonImmediate(lastLink)),
		oopisGreaterThanOrEqualTo(lastLink, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((proc & (tagMask())) == 0)
			 && (oopisLessThan(proc, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(lastLink))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(lastLink);
				}
			}
		}
		longAtput((lastLink + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))), proc);
	}
	/* begin storePointer:ofObject:withValue: */
	assert(!(isForwarded(aList)));
	if ((assert(isNonImmediate(aList)),
	oopisGreaterThanOrEqualTo(aList, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((proc & (tagMask())) == 0)
		 && (oopisLessThan(proc, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(aList))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(aList);
			}
		}
	}
	longAtput((aList + BaseHeaderSize) + (((sqInt)((usqInt)(LastLinkIndex) << (shiftForWord())))), proc);
	/* begin storePointer:ofObject:withValue: */
	assert(!(isForwarded(proc)));
	if ((assert(isNonImmediate(proc)),
	oopisGreaterThanOrEqualTo(proc, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((aList & (tagMask())) == 0)
		 && (oopisLessThan(aList, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(proc))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(proc);
			}
		}
	}
	longAtput((proc + BaseHeaderSize) + (((sqInt)((usqInt)(MyListIndex) << (shiftForWord())))), aList);
}


/*	Answer if maybeClassObj looks like a class object */

	/* StackInterpreter>>#addressCouldBeClassObj: */
static sqInt NoDbgRegParms
addressCouldBeClassObj(sqInt maybeClassObj)
{
	return (addressCouldBeObj(maybeClassObj))
	 && (objCouldBeClassObj(maybeClassObj));
}

	/* StackInterpreter>>#allOnesAsCharStar */
static char *
allOnesAsCharStar(void)
{
	return ((char *) (((usqInt) -1)));
}


/*	for Cogit */

	/* StackInterpreter>>#argumentCountOfClosure: */
sqInt
argumentCountOfClosure(sqInt closurePointer)
{
    sqInt oop;

	/* begin quickFetchInteger:ofObject: */
	oop = longAt((closurePointer + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureNumArgsIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	return (oop >> 3);
}

	/* StackInterpreter>>#argumentCountOfMethodHeader: */
sqInt
argumentCountOfMethodHeader(sqInt header)
{
	return (((usqInt) header) >> MethodHeaderArgCountShift) & 15;
}

	/* StackInterpreter>>#argumentCountOf: */
sqInt
argumentCountOf(sqInt methodPointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt header;
    sqInt header1;

	/* begin argumentCountOfMethodHeader: */
	assert(isCompiledMethod(methodPointer));
	header1 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	return (((usqInt) header) >> MethodHeaderArgCountShift) & 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. */

	/* StackInterpreter>>#arrayValueOf: */
void *
arrayValueOf(sqInt arrayOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (((arrayOop & (tagMask())) == 0)
	 && (isPureBitsFormat((((usqInt) (longAt(arrayOop))) >> (formatShift())) & (formatMask())))) {
		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	return 0;
}


/*	Returns an integer object */

	/* StackInterpreter>>#asciiOfCharacter: */
static sqInt NoDbgRegParms
asciiOfCharacter(sqInt characterObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (characterObj & (characterTag())) {
		return characterObj - ((characterTag()) - (smallIntegerTag()));
	}
	/* begin primitiveFailFor: */
	GIV(primFailCode) = PrimErrBadArgument;
	return ConstZero;
}

	/* StackInterpreter>>#assertValidExecutionPointe:r:s: */
void
assertValidExecutionPointers(usqInt lip, char *lifp, char *lisp)
{
	assertValidExecutionPointersimbarline(lip, lifp, lisp, !((((usqInt)(longAt(lifp + FoxMethod)))) < (startOfMemory())), __LINE__);
}


/*	Order in the stackLimit checks is important because stackLimit is smashed
	by interrupts. So always check for unsmashed value first to avoid race
	condition. 
 */

	/* StackInterpreter>>#assertValidStackLimits: */
static void NoDbgRegParms
assertValidStackLimits(sqInt ln)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	assertl((GIV(stackLimit) == ((GIV(stackPage)->realStackLimit)))
	 || (GIV(stackLimit) == (allOnesAsCharStar())), ln);
	assertl((((GIV(stackPage)->stackLimit)) == ((GIV(stackPage)->realStackLimit)))
	 || (((GIV(stackPage)->stackLimit)) == (allOnesAsCharStar())), ln);
}


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

	/* StackInterpreter>>#booleanValueOf: */
sqInt
booleanValueOf(sqInt obj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (obj == GIV(trueObj)) {
		return 1;
	}
	if (obj == GIV(falseObj)) {
		return 0;
	}
	/* begin success: */
	
	/* Don't overwrite an error code that has already been set. */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	return null;
}


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

	/* StackInterpreter>>#callbackLeave: */
EXPORT(sqInt)
callbackLeave(sqInt cbID)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!(asserta(primitiveFunctionPointer != 0))) {
		return 0;
	}
	if (!(cbID == GIV(jmpDepth))) {
		return 0;
	}
	if (cbID < 1) {
		return 0;
	}
	longjmp(GIV(jmpBuf)[GIV(jmpDepth)], 1);
	return null;
}


/*	Context switch should not be allowed on every method activation. In
	particular the implementation of ensure: and ifCurtailed: depends on there
	being no
	suspension point on failing primitive 198 (primitiveMarkUnwindMethod).
	slowPrimitiveResponse states
	``N.B. This means there is no suspension point on primitive failure
	which methods such as ensure: and ifCurtailed: rely on.''
	Rather than prevent context switch on all primitives but the ones we
	really need
	to be suspension points (primitiveSignal et al) we choose to allow context
	switch for all but primitiveMarkUnwindMethod. */

	/* StackInterpreter>>#canContextSwitchIfActivating:header: */
sqInt
canContextSwitchIfActivatingheader(sqInt theMethod, sqInt methodHeader)
{
    sqInt firstBytecode;
    sqInt primitiveIndex;

	if (methodHeader & AlternateHeaderHasPrimFlag) {
		firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
		primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)));
	}
	else {
		primitiveIndex = 0;
	}
	return 
#  if 1
		primitiveIndex != 198
#  else /* 1 */
		(primitiveIndex == 0)
			 || ((((primitiveIndex >= 85) && (primitiveIndex <= 88)))
			 || (primitiveIndex == 167))
#  endif /* 1 */
		;
}


/*	Above ObjectMemory, arg must lie in range 0-255! */

	/* StackInterpreter>>#characterForAscii: */
sqInt
characterForAscii(sqInt ascii)
{
	return (((sqInt)((usqInt)(ascii) << (numTagBits())))) + (characterTag());
}


/*	Ensure that all accessible objects in the heap are okay. */

	/* StackInterpreter>>#checkAllAccessibleObjectsOkay */
sqInt
checkAllAccessibleObjectsOkay(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop1;
    sqInt objOop11;
    sqInt ok;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	ok = 1;
	/* begin allObjectsDoSafely: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop1 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop1, limit)) {
		assert(isEnumerableObjectNoAssert(objOop1));
		ok = ok && (checkOkayFields(objOop1));
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop1 = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop1 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop1, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop1));
		ok = ok && (checkOkayFields(objOop1));
		prevPrevObj = prevObj;
		prevObj = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop1 = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			ok = ok && (checkOkayFields(objOop11));
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	return ok;
}


/*	Check for a hit of the longRunningPrimitive probe and if so attempt to
	signal the
	longRunningPrimitiveCheckSemaphore. Answer if a process switch occurred as
	a result. */

	/* StackInterpreter>>#checkDeliveryOfLongRunningPrimitiveSignal */
static sqInt
checkDeliveryOfLongRunningPrimitiveSignal(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if ((GIV(longRunningPrimitiveStopUsecs) > GIV(longRunningPrimitiveStartUsecs))
	 && ((GIV(longRunningPrimitiveCheckSemaphore) != null)
	 && (GIV(longRunningPrimitiveSignalUndelivered)))) {

		/* but not yet delivered */
		GIV(longRunningPrimitiveSignalUndelivered) = 0;

		/* Signal the LRP check semaphore if it is present */
		GIV(longRunningPrimitiveGCUsecs) = ((GIV(gcStartUsecs) < GIV(longRunningPrimitiveStopUsecs))
		 && (GIV(statGCEndUsecs) > GIV(longRunningPrimitiveStartUsecs))
			? GIV(statGCEndUsecs) - GIV(gcStartUsecs)
			: 0);
		return synchronousSignal(GIV(longRunningPrimitiveCheckSemaphore));
	}
	return 0;
}


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

	/* StackInterpreter>>#checkedIntegerValueOf: */
sqInt
checkedIntegerValueOf(sqInt intOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if ((((intOop) & 7) == 1)) {
		return (intOop >> 3);
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
}


/*	Check for possible interrupts and handle one if necessary.
	Answer if a context switch has occurred. */

	/* StackInterpreter>>#checkForEventsMayContextSwitch: */
static sqInt NoDbgRegParms
checkForEventsMayContextSwitch(sqInt mayContextSwitch)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong now;
    sqInt objOop;
    sqInt objOop1;
    sqInt sema;
    sqInt switched;


	/* restore the stackLimit if it has been smashed. */
	GIV(statCheckForEvents) += 1;
	/* begin restoreStackLimit */
	(GIV(stackPage)->stackLimit = (GIV(stackPage)->realStackLimit));
	GIV(stackLimit) = (GIV(stackPage)->stackLimit);
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	ioSynchronousCheckForEvents();
	/* begin checkCogCompiledCodeCompactionCalledFor */
	if (GIV(cogCompiledCodeCompactionCalledFor)) {
		commenceCogCompiledCodeCompaction();
	}
	if (GIV(needGCFlag)) {

		/* sufficientSpaceAfterGC: runs the incremental GC and
		   then, if not enough space is available, the fullGC. */
		if (!(sufficientSpaceAfterGC(0))) {
			setSignalLowSpaceFlagAndSaveProcess();
		}
	}
	if (!mayContextSwitch) {
		return 0;
	}
	switched = 0;
	if ((GIV(profileProcess) != GIV(nilObj))
	 || ((GIV(nextProfileTick) > 0)
	 && ((ioHighResClock()) >= GIV(nextProfileTick)))) {

		/* Take a sample (if not already done so) for the profiler if it is active.  This
		   must be done before any of the synchronousSignals below or else we will
		   attribute a pause in ioRelinquishProcessor to the newly activated process. */
		GIV(nextProfileTick) = 0;
		if (GIV(profileProcess) == GIV(nilObj)) {
			/* begin activeProcess */
			objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
			objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
			GIV(profileProcess) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
			/* begin nilObject */
			GIV(profileMethod) = GIV(nilObj);
		}
		if ((GIV(profileSemaphore) != GIV(nilObj))
		 && (synchronousSignal(GIV(profileSemaphore)))) {
			switched = 1;
		}
	}
	if (checkDeliveryOfLongRunningPrimitiveSignal()) {
		switched = 1;
	}
	if (GIV(signalLowSpace)) {
		/* begin signalLowSpace: */
		GIV(signalLowSpace) = 0;
		/* begin splObj: */
		sema = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheLowSpaceSemaphore) << (shiftForWord())))));
		if ((sema != GIV(nilObj))
		 && (synchronousSignal(sema))) {
			switched = 1;
		}
	}
	if (((now = ioUTCMicroseconds())) >= GIV(nextPollUsecs)) {
		GIV(statIOProcessEvents) += 1;
		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 */
		GIV(nextPollUsecs) = now + 20000;
	}
	if (GIV(interruptPending)) {

		/* reset interrupt flag */
		GIV(interruptPending) = 0;
		/* begin splObj: */
		sema = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheInterruptSemaphore) << (shiftForWord())))));
		if ((sema != GIV(nilObj))
		 && (synchronousSignal(sema))) {
			switched = 1;
		}
	}
	if (GIV(nextWakeupUsecs) != 0) {
		if (now >= GIV(nextWakeupUsecs)) {

			/* set timer interrupt to 0 for 'no timer' */
			GIV(nextWakeupUsecs) = 0;
			/* begin splObj: */
			sema = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheTimerSemaphore) << (shiftForWord())))));
			if ((sema != GIV(nilObj))
			 && (synchronousSignal(sema))) {
				switched = 1;
			}
		}
	}
	if (GIV(pendingFinalizationSignals) > 0) {
		GIV(pendingFinalizationSignals) = 0;
		/* begin splObj: */
		sema = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheFinalizationSemaphore) << (shiftForWord())))));
		if ((sema != GIV(nilObj))
		 && (synchronousSignal(sema))) {
			switched = 1;
		}
	}
	if (signalExternalSemaphores()) {
		switched = 1;
	}
	return switched;
}


/*	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. */

	/* StackInterpreter>>#checkImageVersionFrom:startingAt: */
static sqInt NoDbgRegParms
checkImageVersionFromstartingAt(sqImageFile f, squeakFileOffsetType imageOffset)
{
    sqInt firstVersion;
    sqInt version;
    int w;
    int w1;
    int w2;


	/* check the version number */
	sqImageFileSeek(f, imageOffset);
	version = (firstVersion = getWord32FromFileswap(f, 0));
	if ((version == 68021 /* imageFormatVersion */)
	 || (0)) {
		return 0;
	}
	sqImageFileSeek(f, imageOffset);
	/* begin getWord32FromFile:swap: */
	w2 = 0;
	sqImageFileRead((&w2), sizeof(int), 1, f);
	version = SQ_SWAP_4_BYTES(w2);
	if ((version == 68021 /* imageFormatVersion */)
	 || (0)) {
		return 1;
	}
	if (imageOffset == 0) {

		/* try skipping the first 512 bytes (prepended by certain Mac file transfer utilities) */
		sqImageFileSeek(f, 512);
		/* begin getWord32FromFile:swap: */
		w = 0;
		sqImageFileRead((&w), sizeof(int), 1, f);
		version = w;
		if ((version == 68021 /* imageFormatVersion */)
		 || (0)) {
			return 0;
		}
		sqImageFileSeek(f, 512);
		/* begin getWord32FromFile:swap: */
		w1 = 0;
		sqImageFileRead((&w1), sizeof(int), 1, f);
		version = SQ_SWAP_4_BYTES(w1);
		if ((version == 68021 /* imageFormatVersion */)
		 || (0)) {
			return 1;
		}
	}
	print("This interpreter (vers. ");
	printNum(68021 /* imageFormatVersion */);
	print(") cannot read image file (vers. ");
	printNum(firstVersion);
	print(").");
	/* begin cr */
	printf("\n");
	print("Press CR to quit...");
	getchar();
	ioExitWithErrorCode(1);
	return 0;
}


/*	Perform an integrity/leak check using the heapMap. Assume
	clearLeakMapAndMapAccessibleObjects has set a bit at each
	object's header. Check that all oops in the interpreter's state
	points to a header. Answer 0 if all checks pass. */

	/* StackInterpreter>>#checkInterpreterIntegrity */
static sqInt
checkInterpreterIntegrity(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt flags;
    sqInt i;

	flags = 0;
	if (!(checkOopIntegritynamed(GIV(specialObjectsOop), "specialObjectsOop"))) {
		flags = 1;
	}
	if (!(checkOopIntegritynamed(GIV(newMethod), "newMethod"))) {
		flags += 2;
	}
	if (!(checkOopIntegritynamed(GIV(profileProcess), "profileProcess"))) {
		flags += 4;
	}
	if (!(checkOopIntegritynamed(GIV(profileMethod), "profileMethod"))) {
		flags += 8;
	}
	if (!(checkOopIntegritynamed(GIV(profileSemaphore), "profileSemaphore"))) {
		flags += 16;
	}
	if (!(GIV(tempOop) == 0)) {
		if (!(checkOopIntegritynamed(GIV(tempOop), "tempOop"))) {
			flags += 32;
		}
	}
	if (!(GIV(tempOop2) == 0)) {
		if (!(checkOopIntegritynamed(GIV(tempOop2), "tempOop2"))) {
			flags += 64;
		}
	}
	for (i = 1; i <= GIV(jmpDepth); i += 1) {
		if (!(checkOopIntegritynamedindex(GIV(suspendedCallbacks)[i], "suspendedCallbacks", i))) {
			flags += 128;
		}
		if (!(checkOopIntegritynamedindex(GIV(suspendedMethods)[i], "suspendedMethods", i))) {
			flags += 256;
		}
	}
	if (!(checkLogIntegrity())) {
		flags += 512;
	}
	return flags;
}


/*	Another version of isWidowedContext: for debugging.
	This will not bereave a widowed context. */

	/* StackInterpreter>>#checkIsStillMarriedContext:currentFP: */
static sqInt NoDbgRegParms
checkIsStillMarriedContextcurrentFP(sqInt aContext, char *currentFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *limitFP;
    char *maybeFP;
    sqInt maybeFrameCtxt;
    sqInt referent;
    sqInt senderOop;
    StackPage *thePage;

	if (!((((aContext & (tagMask())) == 0)
		 && (((longAt(aContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))
		 && (((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)))) {
		return 0;
	}
	/* begin frameOfMarriedContext: */
	senderOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop) & 7) == 1));
	maybeFP = pointerForOop(senderOop - 1);
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) maybeFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) maybeFP)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(maybeFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	limitFP = ((thePage == GIV(stackPage))
	 && (currentFP != null)
		? currentFP
		: (thePage->headFP));
	if (!((maybeFP >= limitFP)
		 && ((((((sqInt)(pointerForOop(longAt(maybeFP + FoxSavedFP))))) & (tagMask())) == 0)
		 && ((((assert(((oopForPointer(pointerForOop(longAt(maybeFP + FoxSavedFP)))) & (BytesPerWord - 1)) == 0),
		(oopForPointer(pointerForOop(longAt(maybeFP + FoxSavedFP)))) + (smallIntegerTag()))) == (longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))))))
		 && (((((usqInt)(longAt(maybeFP + FoxMethod)))) < (startOfMemory())
			? ((longAt(maybeFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((maybeFP + FoxIFrameFlags) + 2)) != 0)))))) {
		return 0;
	}

	/* On Spur we need to follow the context to check for a match, but since the VM is
	   only speculating about maybeFrame being a frame, and only speculating about
	   maybeContext being a context, we need to be sure before we can safely follow. */
	maybeFrameCtxt = longAt(maybeFP + FoxThisContext);
	if ((!(isFree(thePage)))
	 && ((isFrameonPage(maybeFP, thePage))
	 && (((longAt(maybeFrameCtxt)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(maybeFrameCtxt));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((maybeFrameCtxt + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		maybeFrameCtxt = referent;
	}
	return maybeFrameCtxt == aContext;
}

	/* StackInterpreter>>#checkOkayInterpreterObjects: */
sqInt
checkOkayInterpreterObjects(sqInt writeBack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt iLimiT;
    sqInt ok;
    sqInt oop;
    sqIntptr_t oopOrZero;

	ok = 1;
	ok = ok && (checkOkayFields(GIV(nilObj)));
	ok = ok && (checkOkayFields(GIV(falseObj)));
	ok = ok && (checkOkayFields(GIV(trueObj)));
	ok = ok && (checkOkayFields(GIV(specialObjectsOop)));
	ok = ok && (checkOkayFields(GIV(messageSelector)));
	ok = ok && (checkOkayFields(GIV(newMethod)));
	ok = ok && (checkOkayFields(GIV(lkupClass)));
	for (i = 0; i < MethodCacheEntries; i += MethodCacheEntrySize) {
		oopOrZero = GIV(methodCache)[i + MethodCacheSelector];
		if (!(oopOrZero == 0)) {
			ok = ok && (checkOkayFields(GIV(methodCache)[i + MethodCacheSelector]));
			ok = ok && (checkOkayFields(GIV(methodCache)[i + MethodCacheMethod]));
		}
	}
	for (i = 1, iLimiT = (remapBufferCount()); i <= iLimiT; i += 1) {
		oop = GIV(remapBuffer)[i];
		if (!(oop & (tagMask()))) {
			ok = ok && (checkOkayFields(oop));
		}
	}
	ok = ok && (checkOkayStackZone(writeBack));
	return ok;
}

	/* StackInterpreter>>#checkOkayStackPage: */
static sqInt NoDbgRegParms
checkOkayStackPage(StackPage *thePage)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *callerFP;
    char *frameRcvrOffset;
    sqInt ok;
    sqInt oop;
    char *theFP;
    char *theSP;

	theSP = (thePage->headSP);
	theFP = (thePage->headFP);

	/* Skip the instruction pointer on top of stack of inactive pages. */
	ok = 1;
	if (!(thePage == GIV(stackPage))) {
		theSP += BytesPerWord;
	}
	while (1) {
		frameRcvrOffset = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? theFP + FoxMFReceiver
			: theFP + FoxIFReceiver);
		while (theSP <= frameRcvrOffset) {
			oop = longAt(theSP);
			if (!((((oop) & 7) == 1))) {
				ok = ok && (checkOkayFields(oop));
			}
			theSP += BytesPerWord;
		}
		if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
			assert(isContext(frameContext(theFP)));
			ok = ok && (checkOkayFields(longAt(theFP + FoxThisContext)));
		}
		ok = ok && (checkOkayFields(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((mframeHomeMethod(theFP))->methodObject)
			: longAt(theFP + FoxMethod))));
		if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break;
		theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
		theFP = callerFP;
	}

	/* caller ip is frameCallerContext in a base frame */
	theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
	while (theSP <= ((thePage->baseAddress))) {
		oop = longAt(theSP);
		if (!((((oop) & 7) == 1))) {
			ok = ok && (checkOkayFields(oop));
		}
		theSP += BytesPerWord;
	}
	return ok;
}


/*	Check that all objects in the stack zone are okay */

	/* StackInterpreter>>#checkOkayStackZone: */
static sqInt NoDbgRegParms
checkOkayStackZone(sqInt writeBack)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt ok;
    StackPage *thePage;

	if (writeBack) {
		/* begin externalWriteBackHeadFramePointers */
		assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
		assert(GIV(stackPage) == (mostRecentlyUsedPage()));
		assert(!((isFree(GIV(stackPage)))));
		/* begin setHeadFP:andSP:inPage: */
		assert(GIV(stackPointer) < GIV(framePointer));
		assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
		assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
		(GIV(stackPage)->headFP = GIV(framePointer));
		(GIV(stackPage)->headSP = GIV(stackPointer));
		assert(pageListIsWellFormed());
	}
	ok = 1;
	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		if (!(isFree(thePage))) {
			ok = ok && (checkOkayStackPage(thePage));
		}
	}
	return ok;
}


/*	Check if the profile timer has expired and if so take a sample.
	If the primitive has failed sample the profileMethod as nil. */

	/* StackInterpreter>>#checkProfileTick: */
static void NoDbgRegParms
checkProfileTick(sqInt aPrimitiveMethod)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objOop;
    sqInt objOop1;

	assert(GIV(nextProfileTick) != 0);
	if ((ioHighResClock()) >= GIV(nextProfileTick)) {
		/* begin activeProcess */
		objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
		objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
		GIV(profileProcess) = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
		if (!GIV(primFailCode)) {
			GIV(profileMethod) = aPrimitiveMethod;
		}
		else {
			/* begin nilObject */
			GIV(profileMethod) = GIV(nilObj);
		}
		forceInterruptCheck();
		GIV(nextProfileTick) = 0;
	}
}


/*	Version of stackPointerForMaybeMarriedContext: with no side-effects (does
	not widow).
	Used for assertion checking. Safe only in external primitives
	(framePointer valid).
	Answer the stackPointer of a Context. */

	/* StackInterpreter>>#checkStackPointerForMaybeMarriedContext: */
static sqInt NoDbgRegParms
checkStackPointerForMaybeMarriedContext(sqInt aContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt header;
    sqInt header1;
    sqInt methodPointer;
    sqInt sp;
    sqInt sp1;

	if (checkIsStillMarriedContextcurrentFP(aContext, GIV(framePointer))) {
		sp = checkStackPointerIndexForFrame(frameOfMarriedContext(aContext));
		assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(aContext)));
		return sp;
	}
	if (((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
		/* begin argumentCountOf: */
		methodPointer = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
		/* begin argumentCountOfMethodHeader: */
		assert(isCompiledMethod(methodPointer));
		header1 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((((header1) & 7) == 1)) {
			header = header1;
		}
		else {
			assert((((usqInt)header1)) < GIV(newSpaceStart));
			assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
			header = ((((CogMethod *) header1))->methodHeader);
		}
		return (((usqInt) header) >> MethodHeaderArgCountShift) & 15;
	}
	/* begin fetchStackPointerOf: */
	sp1 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
	if (!((((sp1) & 7) == 1))) {
		return 0;
	}
	assert((ReceiverIndex + ((sp1 >> 3))) < (lengthOf(aContext)));
	return (sp1 >> 3);
}


/*	Version of stackPointerIndexForFrame: that does not depend on writing back
	head frame pointers.
	Used for assertion checking. Safe only in external primitives
	(framePointer valid).
	Answer the 0-based index rel to the given frame.
	(This is what stackPointer used to be before conversion to pointer) */
/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#checkStackPointerIndexForFrame: */
static sqInt NoDbgRegParms
checkStackPointerIndexForFrame(char *theFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *aFrame;
    char *prevFrame;
    char *startFrame;
    StackPage *thePage;
    char *theSP;

	if (theFP == GIV(framePointer)) {
		return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? (((usqInt) ((theFP + FoxMFReceiver) - GIV(stackPointer))) >> (shiftForWord())) + (((mframeCogMethod(theFP))->cmNumArgs))
			: (((usqInt) ((theFP + FoxIFReceiver) - GIV(stackPointer))) >> (shiftForWord())) + (byteAt((theFP + FoxIFrameFlags) + 1)));
	}
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	/* begin findSPOrNilOf:on:startingFrom: */
	startFrame = (thePage == GIV(stackPage)
		? GIV(framePointer)
		: (thePage->headFP));
	if (startFrame == theFP) {
		if (((thePage->headSP)) >= startFrame) {

			/* If the SP is invalid return the pointer to the receiver field. */
			theSP = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
				? theFP + FoxMFReceiver
				: theFP + FoxIFReceiver);
			goto l2;
		}
		theSP = (thePage == GIV(stackPage)
			? (thePage->headSP)
			: ((thePage->headSP)) + BytesPerWord);
		goto l2;
	}
	aFrame = startFrame;
	while (1) {
		prevFrame = aFrame;
		aFrame = pointerForOop(longAt(aFrame + FoxSavedFP));
		if (!(aFrame != 0)) break;
		if (theFP == aFrame) {
			assert(!(isBaseFrame(prevFrame)));
			theSP = (prevFrame + (frameStackedReceiverOffset(prevFrame))) + BytesPerWord;
			goto l2;
		}
	}
	theSP = null;
	l2:	/* end findSPOrNilOf:on:startingFrom: */;
	if (!(theSP)) {
		return -1;
	}
	return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? (((usqInt) ((theFP + FoxMFReceiver) - theSP)) >> (shiftForWord())) + (((mframeCogMethod(theFP))->cmNumArgs))
		: (((usqInt) ((theFP + FoxIFReceiver) - theSP)) >> (shiftForWord())) + (byteAt((theFP + FoxIFrameFlags) + 1)));
}


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

	/* StackInterpreter>>#classNameOf:Is: */
static sqInt NoDbgRegParms
classNameOfIs(sqInt aClass, char *className)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt length;
    sqInt name;
    char *srcName;

	if ((lengthOfformat(aClass, (((usqInt) (longAt(aClass))) >> (formatShift())) & (formatMask()))) <= GIV(classNameIndex)) {
		return 0;
	}
	/* begin fetchPointer:ofObject: */
	name = longAt((aClass + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(classNameIndex)) << (shiftForWord())))));
	if (!(((name & (tagMask())) == 0)
		 && (((((usqInt) (longAt(name))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))) {
		return 0;
	}
	length = stSizeOf(name);
	srcName = ((char *) (arrayValueOf(name)));
	for (i = 0; i < length; i += 1) {
		if (!((srcName[i]) == (className[i]))) {
			return 0;
		}
	}
	return (className[length]) == 0;
}


/*	Does thisCntx have aContext in its sender chain?
	Cheapo implementation above extant machinery. */

	/* StackInterpreter>>#context:hasSender: */
static sqInt NoDbgRegParms
contexthasSender(sqInt thisCntx, sqInt aContext)
{
    sqInt handlerOrNilOrZero;

	handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(-1, thisCntx, aContext);
	return handlerOrNilOrZero == 0;
}


/*	For asserts. Check that theIP maps back correctly to the context's pc.
	The CallPrimitive bytecode presents a complication. */

	/* StackInterpreter>>#context:hasValidInversePCMappingOf:in: */
static sqInt NoDbgRegParms
contexthasValidInversePCMappingOfin(sqInt aContext, sqInt theIP, char *theFP)
{
    sqInt encodedip;
    sqInt methodHeader;
    sqInt pc;

	/* begin fetchPointer:ofObject: */
	pc = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))));
	encodedip = contextInstructionPointerframe(theIP, theFP);
	return (pc == encodedip)
	 || (((methodHeader = methodHeaderOf(longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord()))))))),
	((/* begin alternateHeaderHasPrimitiveFlag: */
		methodHeader & AlternateHeaderHasPrimFlag))
		 && ((((encodedip >> 3)) - ((pc >> 3))) == (3))));
}


/*	for Cogit */

	/* StackInterpreter>>#copiedValueCountOfClosure: */
sqInt
copiedValueCountOfClosure(sqInt closurePointer)
{
	return (numSlotsOf(closurePointer)) - ClosureFirstCopiedValueIndex;
}


/*	for Cogit */

	/* StackInterpreter>>#copiedValueCountOfFullClosure: */
sqInt
copiedValueCountOfFullClosure(sqInt closurePointer)
{
	return (numSlotsOf(closurePointer)) - FullClosureFirstCopiedValueIndex;
}


/*	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 */

	/* StackInterpreter>>#copyBits */
sqInt
copyBits(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    void *fn;

	fn = ioLoadFunctionFrom("copyBits", "BitBltPlugin");
	if (fn == 0) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(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
 */

	/* StackInterpreter>>#copyBitsFrom:to:at: */
sqInt
copyBitsFromtoat(sqInt x0, sqInt x1, sqInt y)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    void *fn;

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

	/* StackInterpreter>>#couldBeProcess: */
static sqInt NoDbgRegParms NeverInline
couldBeProcess(sqInt oop)
{
	return (addressCouldBeObj(oop))
	 && ((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
	 && ((!(((oop & (tagMask())) == 0)
	 && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex)))
	 && (((lengthOfformat(oop, (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))) > MyListIndex)
	 && (isContext(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord()))))))))));
}


/*	For testing in Smalltalk, this method should be overridden in a subclass. */

	/* StackInterpreter>>#cr */
static void
cr(void)
{
	printf("\n");
}


/*	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: */

	/* StackInterpreter>>#createActualMessageTo: */
static void NoDbgRegParms
createActualMessageTo(sqInt lookupClass)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt argumentArray;
    sqInt i;
    usqInt message;
    usqInt newObj;
    usqInt newObj1;
    usqInt numBytes;
    usqInt numBytes1;
    sqInt numSlots;
    char *sp;


	/* This is a useful break-point */
	assert((isImmediate(GIV(messageSelector)))
	 || (addressCouldBeObj(GIV(messageSelector))));
	/* begin mnuBreakpoint:receiver: */
	mnuBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), null);
	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
	assert((GIV(argumentCount) >= 0)
	 && ((knownClassAtIndex(ClassArrayCompactIndex)) != GIV(nilObj)));
	assert((2 /* arrayFormat */) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex))));
	/* begin allocateSmallNewSpaceSlots:format:classIndex: */
	assert(GIV(argumentCount) < (numSlotsMask()));
	newObj = GIV(freeStart);
	numBytes = BaseHeaderSize + ((GIV(argumentCount) < 1
	? 8 /* allocationUnit */
	: GIV(argumentCount) * BytesPerOop));
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
			error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
			argumentArray = 0;
			goto l4;
		}
	}
	long64Atput(newObj, (((((usqLong) GIV(argumentCount))) << (numSlotsFullShift())) + (2U << (formatShift()))) + ClassArrayCompactIndex);
	GIV(freeStart) += numBytes;
	argumentArray = newObj;
	l4:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
	numSlots = MessageLookupClassIndex + 1;
	assert((numSlots >= 0)
	 && ((knownClassAtIndex(ClassMessageCompactIndex)) != GIV(nilObj)));
	assert((1 /* nonIndexablePointerFormat */) == (instSpecOfClass(knownClassAtIndex(ClassMessageCompactIndex))));
	/* begin allocateSmallNewSpaceSlots:format:classIndex: */
	assert(numSlots < (numSlotsMask()));
	newObj1 = GIV(freeStart);
	numBytes1 = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
	assert((numBytes1 % (allocationUnit())) == 0);
	assert((newObj1 % (allocationUnit())) == 0);
	if ((GIV(freeStart) + numBytes1) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes1) > (((eden()).limit))) {
			error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
			message = 0;
			goto l5;
		}
	}
	long64Atput(newObj1, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (1U << (formatShift()))) + ClassMessageCompactIndex);
	GIV(freeStart) += numBytes1;
	message = newObj1;
	l5:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
	for (i = ((GIV(argumentCount) - 1) * BytesPerOop); i >= 0; i += (-BytesPerOop)) {
		longAtput((argumentArray + BaseHeaderSize) + i, popStack());
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(message)));
	longAtput((message + BaseHeaderSize) + (((sqInt)((usqInt)(MessageSelectorIndex) << (shiftForWord())))), GIV(messageSelector));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(message)));
	longAtput((message + BaseHeaderSize) + (((sqInt)((usqInt)(MessageArgumentsIndex) << (shiftForWord())))), argumentArray);
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(message)));
	longAtput((message + BaseHeaderSize) + (((sqInt)((usqInt)(MessageLookupClassIndex) << (shiftForWord())))), lookupClass);
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), message);
	GIV(stackPointer) = sp;
	GIV(argumentCount) = 1;
}


/*	Return the default number of stack pages allocate at startup.
	This V3 default suits Qwaq Forums (specifically general rendering).
	The Spur default reflects tuning for GC performance ast Cadence.
	It is probably a bit high for normal use but QF is profligate with
	processes. The actual value can be set via vmParameterAt: and/or a
	preference in the ini file. */

	/* StackInterpreter>>#defaultNumStackPages */
static sqInt
defaultNumStackPages(void)
{
	return 50;
}


/*	Release the VM to other threads and answer the current thread's index.
	Currently valid flags for the non-threaded VM are:
	DisownVMLockOutFullGC	- prevent fullGCs while this thread disowns the VM
	DisownVMForFFICall			- informs the VM that it is entering an FFI call
	
	This is the entry-point for plugins and primitives that wish to release
	the VM while
	performing some operation that may potentially block, and for callbacks
	returning back to some blocking operation. While this exists for the
	threaded FFI VM we use
	it to reset newMethod and the argumentCount after a callback. */

	/* StackInterpreter>>#disownVM: */
sqInt
disownVM(sqInt flags)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt top;

	assert(GIV(primFailCode) == 0);
	assert((isImmediate(flags)
		? ((((flags) & 7) == 1))
			 && (((((flags >> 3)) >= 0) && (((flags >> 3)) <= (argumentCountOfMethodHeader(-1)))))
		: (flags == (flags & ((DisownVMLockOutFullGC + DisownVMForFFICall) + DisownVMForThreading)))
			 && (flags & DisownVMForFFICall)));
	if ((!(flags & (tagMask())))
	 && (flags & DisownVMForFFICall)) {
		assert((isOopCompiledMethod(GIV(newMethod)))
		 && ((argumentCountOf(GIV(newMethod))) == GIV(argumentCount)));
		GIV(inFFIFlags) = DisownVMForFFICall;
		return flags;
	}
	assert(((((flags) & 7) == 1))
	 && (((((flags >> 3)) >= 0) && (((flags >> 3)) <= (argumentCountOfMethodHeader(-1))))));
	GIV(argumentCount) = (flags >> 3);
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(newMethod) = top;
	assert((isOopCompiledMethod(GIV(newMethod)))
	 && ((argumentCountOf(GIV(newMethod))) == GIV(argumentCount)));
	return 0;
}

	/* StackInterpreter>>#divorceAllFrames */
static sqInt
divorceAllFrames(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeContext;
    StackPage *aPage;
    sqInt i;
    char *theFP;
    char *theSP;

	if (GIV(stackPage) != 0) {
		/* begin externalWriteBackHeadFramePointers */
		assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
		assert(GIV(stackPage) == (mostRecentlyUsedPage()));
		assert(!((isFree(GIV(stackPage)))));
		/* begin setHeadFP:andSP:inPage: */
		assert(GIV(stackPointer) < GIV(framePointer));
		assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
		assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
		(GIV(stackPage)->headFP = GIV(framePointer));
		(GIV(stackPage)->headSP = GIV(stackPointer));
		assert(pageListIsWellFormed());
	}
	/* begin ensureFrameIsMarried:SP: */
	theFP = GIV(framePointer);
	theSP = GIV(stackPointer) + BytesPerWord;
	if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
		assert(isContext(frameContext(theFP)));
		activeContext = longAt(theFP + FoxThisContext);
		goto l2;
	}
	activeContext = marryFrameSP(theFP, theSP);
	l2:	/* end ensureFrameIsMarried:SP: */;
	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		aPage = stackPageAtpages(i, GIV(pages));
		if (!(isFree(aPage))) {
			divorceFramesIn(aPage);
		}
	}
	/* begin zeroStackPage */
	assert((GIV(stackPage) == 0)
	 || ((((GIV(stackPage)->headFP)) == GIV(framePointer))
	 && (((GIV(stackPage)->headSP)) == GIV(stackPointer))));
	GIV(stackPage) = 0;
	return activeContext;
}

	/* StackInterpreter>>#divorceFramesIn: */
static void NoDbgRegParms
divorceFramesIn(StackPage *aStackPage)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt calleeContext;
    char *calleeFP;
    sqInt callerContextOrNil;
    sqInt theContext;
    char *theFP;
    sqInt theIP;
    StackPage *thePage;
    char *theSP;
    sqInt valuePointer;
    sqInt valuePointer1;

	GIV(statStackPageDivorce) += 1;
	theFP = (aStackPage->headFP);
	theSP = (aStackPage->headSP);
	theIP = longAt(theSP);

	/* theSP points at hottest item on frame's stack */
	theSP += BytesPerWord;
	calleeContext = null;
	while (1) {
		/* begin ensureFrameIsMarried:SP: */
		if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
			assert(isContext(frameContext(theFP)));
			theContext = longAt(theFP + FoxThisContext);
			goto l4;
		}
		theContext = marryFrameSP(theFP, theSP);
	l4:	/* end ensureFrameIsMarried:SP: */;
		updateStateOfSpouseContextForFrameWithSP(theFP, theSP);
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = contextInstructionPointerframe(theIP, theFP);
		assert(!(isOopForwarded(theContext)));
		longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer);
		assert((frameReceiver(theFP)) == (fetchPointerofObject(ReceiverIndex, theContext)));
		if (calleeContext != null) {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(calleeContext)));
			if ((assert(isNonImmediate(calleeContext)),
			oopisGreaterThanOrEqualTo(calleeContext, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((theContext & (tagMask())) == 0)
				 && (oopisLessThan(theContext, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(calleeContext))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(calleeContext);
					}
				}
			}
			longAtput((calleeContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), theContext);
		}
		calleeContext = theContext;
		calleeFP = theFP;
		theIP = ((sqInt)(pointerForOop(longAt(theFP + FoxCallerSavedIP))));
		theFP = pointerForOop(longAt(theFP + FoxSavedFP));
		if (!(theFP != 0)) break;

		/* theSP points at stacked hottest item on frame's stack */
		assert(!(isBaseFrame(calleeFP)));
		theSP = (calleeFP + (frameStackedReceiverOffset(calleeFP))) + BytesPerWord;
	}
	/* begin storePointer:ofObject:withValue: */
	assert(isBaseFrame(calleeFP));
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) calleeFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) calleeFP)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(calleeFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	callerContextOrNil = longAt((thePage->baseAddress));
	assert(addressCouldBeObj(callerContextOrNil));
	assert((callerContextOrNil == (nilObject()))
	 || (isContext(callerContextOrNil)));
	valuePointer1 = callerContextOrNil;
	assert(!(isForwarded(theContext)));
	if ((assert(isNonImmediate(theContext)),
	oopisGreaterThanOrEqualTo(theContext, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((valuePointer1 & (tagMask())) == 0)
		 && (oopisLessThan(valuePointer1, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(theContext))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(theContext);
			}
		}
	}
	longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer1);
	(aStackPage->baseFP = 0);
}


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

	/* StackInterpreter>>#doPrimitiveDiv:by: */
static sqInt NoDbgRegParms
doPrimitiveDivby(sqInt rcvr, sqInt arg)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArg;
    sqInt integerRcvr;
    sqInt posArg;
    sqInt posRcvr;
    sqInt result;
    sqInt successBoolean;

	integerArg = 0;
	integerRcvr = 0;
	if ((rcvr & arg) & (smallIntegerTag())) {
		integerRcvr = (rcvr >> 3);
		integerArg = (arg >> 3);
		/* begin success: */
		if (!(integerArg != 0)) {

			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (GIV(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 = (((((usqInt) result) >> 60) + 1) & 15) <= 1;
	if (!successBoolean) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	return result;
}

	/* StackInterpreter>>#doPrimitiveMod:by: */
static sqInt NoDbgRegParms
doPrimitiveModby(sqInt rcvr, sqInt arg)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerArg;
    sqInt integerRcvr;
    sqInt integerResult;
    sqInt successBoolean;

	integerArg = 0;
	integerRcvr = 0;
	if ((rcvr & arg) & (smallIntegerTag())) {
		integerRcvr = (rcvr >> 3);
		integerArg = (arg >> 3);
		/* begin success: */
		if (!(integerArg != 0)) {

			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	if (GIV(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 = (((((usqInt) integerResult) >> 60) + 1) & 15) <= 1;
	if (!successBoolean) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	return integerResult;
}


/*	Signal the external semaphore with the given index. Answer if a context
	switch occurs as a result. Do not bounds check. This has been done in the
	caller.  */

	/* StackInterpreter>>#doSignalSemaphoreWithIndex: */
sqInt
doSignalSemaphoreWithIndex(sqInt index)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt sema;
    sqInt xArray;

	/* begin splObj: */
	xArray = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ExternalObjectsArray) << (shiftForWord())))));
	assert(isArray(xArray));
	/* begin fetchPointer:ofObject: */
	sema = longAt((xArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))));
	assert(!(isOopForwarded(sema)));
	return (((sema & (tagMask())) == 0)
	 && (((longAt(sema)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord())))))))))
	 && (synchronousSignal(sema));
}

	/* StackInterpreter>>#dummyReferToProxy */
static void
dummyReferToProxy(void)
{
	interpreterProxy = interpreterProxy;
}


/*	Answerr the caller context for a frame. If the frame has a caller
	frame that doesn't have a context, then marry the caller frame. */

	/* StackInterpreter>>#ensureCallerContext: */
static sqInt NoDbgRegParms
ensureCallerContext(char *theFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    char *callerFP;
    StackPage *thePage;

	callerFP = pointerForOop(longAt(theFP + FoxSavedFP));
	if (callerFP == 0) {

		/* base frame, context in saved ip slot (or base of stack in Cog) */
		/* begin frameCallerContext: */
		assert(isBaseFrame(theFP));
		/* begin stackPageFor: */
		thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		callerContextOrNil = longAt((thePage->baseAddress));
		assert(addressCouldBeObj(callerContextOrNil));
		assert((callerContextOrNil == (nilObject()))
		 || (isContext(callerContextOrNil)));
		return callerContextOrNil;
	}
	/* begin ensureFrameIsMarried:SP: */
	if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) {
		assert(isContext(frameContext(callerFP)));
		return longAt(callerFP + FoxThisContext);
	}
	return marryFrameSP(callerFP, (assert(!(isBaseFrame(theFP))),
	(theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord));
}


/*	Ensure the image data has been updated to suit the current VM. */

	/* StackInterpreter>>#ensureImageFormatIsUpToDate: */
static void NoDbgRegParms
ensureImageFormatIsUpToDate(sqInt swapBytes)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt addr;
    sqInt addr1;
    sqInt address;
    sqInt address1;
    sqInt address11;
    sqInt address2;
    sqInt fmt;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord11;
    sqInt followingWord2;
    sqInt followingWord21;
    sqInt followingWord3;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress11;
    usqInt followingWordAddress2;
    usqInt followingWordAddress21;
    usqInt followingWordAddress3;
    usqInt limit;
    usqInt limit1;
    sqInt methodHeader;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop111;
    sqInt objOop12;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevObj11;
    sqInt prevObj2;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt prevPrevObj11;
    sqInt prevPrevObj2;
    sqInt stopAddr;
    int swapFloatWords;
    int temp;
    sqInt temp1;
    sqInt wordAddr;

	if (swapBytes) {
		/* begin reverseBytesInImage */
		addr = GIV(oldSpaceStart);
		while (oopisLessThan(addr, GIV(endOfMemory))) {
			longAtput(addr, SQ_SWAP_8_BYTES((longAt(addr))));
			addr += BytesPerWord;
		}
		/* begin updateObjectsPostByteSwap */
		swapFloatWords = VMBIGENDIAN != GIV(imageFloatsBigEndian);
		assert(ClassFloatCompactIndex != 0);
		/* begin allObjectsDo: */
		
		/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
		   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
		prevPrevObj2 = (prevObj2 = null);
		assert((((pastSpace()).start)) < (((eden()).start)));
		/* begin objectStartingAt: */
		address2 = ((pastSpace()).start);
		numSlots2 = byteAt(address2 + 7);
		objOop12 = (numSlots2 == (numSlotsMask())
			? address2 + BaseHeaderSize
			: address2);
		limit1 = GIV(pastSpaceStart);
		while (oopisLessThan(objOop12, limit1)) {
			assert(isEnumerableObjectNoAssert(objOop12));
			fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask());
			if (fmt >= (firstByteFormat())) {

				/* oop contains bytes */
				wordAddr = objOop12 + BaseHeaderSize;
				if (fmt >= (firstCompiledMethodFormat())) {

					/* compiled method; start after methodHeader and literals */
					methodHeader = longAt(objOop12 + BaseHeaderSize);
					wordAddr += (((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop;
				}
				/* begin reverseBytesFrom:to: */
				stopAddr = objOop12 + (((numSlotsOf(objOop12)) << (shiftForWord())) + BaseHeaderSize);
				addr1 = wordAddr;
				while (oopisLessThan(addr1, stopAddr)) {
					longAtput(addr1, SQ_SWAP_8_BYTES((longAt(addr1))));
					addr1 += BytesPerWord;
				}
			}
			if (fmt == (firstLongFormat())) {

				/* Bitmap, Float etc */
				if (swapFloatWords
				 && ((compactClassIndexOf(objOop12)) == ClassFloatCompactIndex)) {
					temp1 = longAt(objOop12 + BaseHeaderSize);
					longAtput(objOop12 + BaseHeaderSize, longAt((objOop12 + BaseHeaderSize) + 4));
					longAtput((objOop12 + BaseHeaderSize) + 4, temp1);
				}
				else {
									}
			}
			prevPrevObj2 = prevObj2;
			prevObj2 = objOop12;
			/* begin objectAfter:limit: */
			followingWordAddress3 = addressAfter(objOop12);
			if (oopisGreaterThanOrEqualTo(followingWordAddress3, limit1)) {
				objOop12 = limit1;
				goto l9;
			}
			flag("endianness");
			followingWord3 = longAt(followingWordAddress3);
			objOop12 = ((((usqInt) followingWord3) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress3 + BaseHeaderSize
				: followingWordAddress3);
	l9:	/* end objectAfter:limit: */;
		}
		/* begin objectStartingAt: */
		address11 = ((eden()).start);
		numSlots11 = byteAt(address11 + 7);
		objOop12 = (numSlots11 == (numSlotsMask())
			? address11 + BaseHeaderSize
			: address11);
		while (oopisLessThan(objOop12, GIV(freeStart))) {
			assert(isEnumerableObjectNoAssert(objOop12));
			fmt = (((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask());
			if (fmt >= (firstByteFormat())) {

				/* oop contains bytes */
				wordAddr = objOop12 + BaseHeaderSize;
				if (fmt >= (firstCompiledMethodFormat())) {

					/* compiled method; start after methodHeader and literals */
					methodHeader = longAt(objOop12 + BaseHeaderSize);
					wordAddr += (((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop;
				}
				/* begin reverseBytesFrom:to: */
				stopAddr = objOop12 + (((numSlotsOf(objOop12)) << (shiftForWord())) + BaseHeaderSize);
				addr1 = wordAddr;
				while (oopisLessThan(addr1, stopAddr)) {
					longAtput(addr1, SQ_SWAP_8_BYTES((longAt(addr1))));
					addr1 += BytesPerWord;
				}
			}
			if (fmt == (firstLongFormat())) {

				/* Bitmap, Float etc */
				if (swapFloatWords
				 && ((compactClassIndexOf(objOop12)) == ClassFloatCompactIndex)) {
					temp1 = longAt(objOop12 + BaseHeaderSize);
					longAtput(objOop12 + BaseHeaderSize, longAt((objOop12 + BaseHeaderSize) + 4));
					longAtput((objOop12 + BaseHeaderSize) + 4, temp1);
				}
				else {
									}
			}
			prevPrevObj2 = prevObj2;
			prevObj2 = objOop12;
			/* begin objectAfter:limit: */
			followingWordAddress11 = addressAfter(objOop12);
			if (oopisGreaterThanOrEqualTo(followingWordAddress11, GIV(freeStart))) {
				objOop12 = GIV(freeStart);
				goto l11;
			}
			flag("endianness");
			followingWord11 = longAt(followingWordAddress11);
			objOop12 = ((((usqInt) followingWord11) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress11 + BaseHeaderSize
				: followingWordAddress11);
	l11:	/* end objectAfter:limit: */;
		}
		/* begin allOldSpaceObjectsDo: */
		assert(isOldObject(GIV(nilObj)));
		prevPrevObj11 = (prevObj11 = null);
		objOop111 = GIV(nilObj);
		while (1) {
			assert((objOop111 % (allocationUnit())) == 0);
			if (!(oopisLessThan(objOop111, GIV(endOfMemory)))) break;
			assert((long64At(objOop111)) != 0);
			if (isEnumerableObject(objOop111)) {
				fmt = (((usqInt) (longAt(objOop111))) >> (formatShift())) & (formatMask());
				if (fmt >= (firstByteFormat())) {

					/* oop contains bytes */
					wordAddr = objOop111 + BaseHeaderSize;
					if (fmt >= (firstCompiledMethodFormat())) {

						/* compiled method; start after methodHeader and literals */
						methodHeader = longAt(objOop111 + BaseHeaderSize);
						wordAddr += (((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart) * BytesPerOop;
					}
					/* begin reverseBytesFrom:to: */
					stopAddr = objOop111 + (((numSlotsOf(objOop111)) << (shiftForWord())) + BaseHeaderSize);
					addr1 = wordAddr;
					while (oopisLessThan(addr1, stopAddr)) {
						longAtput(addr1, SQ_SWAP_8_BYTES((longAt(addr1))));
						addr1 += BytesPerWord;
					}
				}
				if (fmt == (firstLongFormat())) {

					/* Bitmap, Float etc */
					if (swapFloatWords
					 && ((compactClassIndexOf(objOop111)) == ClassFloatCompactIndex)) {
						temp1 = longAt(objOop111 + BaseHeaderSize);
						longAtput(objOop111 + BaseHeaderSize, longAt((objOop111 + BaseHeaderSize) + 4));
						longAtput((objOop111 + BaseHeaderSize) + 4, temp1);
					}
					else {
											}
				}
			}
			prevPrevObj11 = prevObj11;
			prevObj11 = objOop111;
			/* begin objectAfter:limit: */
			followingWordAddress21 = addressAfter(objOop111);
			if (oopisGreaterThanOrEqualTo(followingWordAddress21, GIV(endOfMemory))) {
				objOop111 = GIV(endOfMemory);
				goto l7;
			}
			flag("endianness");
			followingWord21 = longAt(followingWordAddress21);
			objOop111 = ((((usqInt) followingWord21) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress21 + BaseHeaderSize
				: followingWordAddress21);
	l7:	/* end objectAfter:limit: */;
		}
			}
	else {
		/* begin convertFloatsToPlatformOrder */
		if (VMBIGENDIAN == GIV(imageFloatsBigEndian)) {
			goto l6;
		}
		assert(ClassFloatCompactIndex != 0);
		/* begin allObjectsDo: */
		
		/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
		   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
		prevPrevObj = (prevObj = null);
		assert((((pastSpace()).start)) < (((eden()).start)));
		/* begin objectStartingAt: */
		address = ((pastSpace()).start);
		numSlots = byteAt(address + 7);
		objOop1 = (numSlots == (numSlotsMask())
			? address + BaseHeaderSize
			: address);
		limit = GIV(pastSpaceStart);
		while (oopisLessThan(objOop1, limit)) {
			assert(isEnumerableObjectNoAssert(objOop1));
			if ((compactClassIndexOf(objOop1)) == ClassFloatCompactIndex) {
				temp = long32At(objOop1 + BaseHeaderSize);
				long32Atput(objOop1 + BaseHeaderSize, long32At((objOop1 + BaseHeaderSize) + 4));
				long32Atput((objOop1 + BaseHeaderSize) + 4, temp);
			}
			prevPrevObj = prevObj;
			prevObj = objOop1;
			/* begin objectAfter:limit: */
			followingWordAddress = addressAfter(objOop1);
			if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
				objOop1 = limit;
				goto l1;
			}
			flag("endianness");
			followingWord = longAt(followingWordAddress);
			objOop1 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress + BaseHeaderSize
				: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
		}
		/* begin objectStartingAt: */
		address1 = ((eden()).start);
		numSlots1 = byteAt(address1 + 7);
		objOop1 = (numSlots1 == (numSlotsMask())
			? address1 + BaseHeaderSize
			: address1);
		while (oopisLessThan(objOop1, GIV(freeStart))) {
			assert(isEnumerableObjectNoAssert(objOop1));
			if ((compactClassIndexOf(objOop1)) == ClassFloatCompactIndex) {
				temp = long32At(objOop1 + BaseHeaderSize);
				long32Atput(objOop1 + BaseHeaderSize, long32At((objOop1 + BaseHeaderSize) + 4));
				long32Atput((objOop1 + BaseHeaderSize) + 4, temp);
			}
			prevPrevObj = prevObj;
			prevObj = objOop1;
			/* begin objectAfter:limit: */
			followingWordAddress1 = addressAfter(objOop1);
			if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
				objOop1 = GIV(freeStart);
				goto l2;
			}
			flag("endianness");
			followingWord1 = longAt(followingWordAddress1);
			objOop1 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress1 + BaseHeaderSize
				: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
		}
		/* begin allOldSpaceObjectsDo: */
		assert(isOldObject(GIV(nilObj)));
		prevPrevObj1 = (prevObj1 = null);
		objOop11 = GIV(nilObj);
		while (1) {
			assert((objOop11 % (allocationUnit())) == 0);
			if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
			assert((long64At(objOop11)) != 0);
			if (isEnumerableObject(objOop11)) {
				if ((compactClassIndexOf(objOop11)) == ClassFloatCompactIndex) {
					temp = long32At(objOop11 + BaseHeaderSize);
					long32Atput(objOop11 + BaseHeaderSize, long32At((objOop11 + BaseHeaderSize) + 4));
					long32Atput((objOop11 + BaseHeaderSize) + 4, temp);
				}
			}
			prevPrevObj1 = prevObj1;
			prevObj1 = objOop11;
			/* begin objectAfter:limit: */
			followingWordAddress2 = addressAfter(objOop11);
			if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
				objOop11 = GIV(endOfMemory);
				goto l5;
			}
			flag("endianness");
			followingWord2 = longAt(followingWordAddress2);
			objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
				? followingWordAddress2 + BaseHeaderSize
				: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
		}
	l6:	/* end convertFloatsToPlatformOrder */;
	}
}

	/* StackInterpreter>>#establishFrameForContextToReturnTo: */
static char * NoDbgRegParms
establishFrameForContextToReturnTo(sqInt contextToReturnTo)
{
    sqInt senderOop;
    StackPage *thePage;

	if (!(((contextToReturnTo & (tagMask())) == 0)
		 && (((longAt(contextToReturnTo)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
		return 0;
	}
	if (((((longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
		if (isWidowedContext(contextToReturnTo)) {

			/* error: home's sender is dead; cannot return */
			return 0;
		}
		/* begin frameOfMarriedContext: */
		senderOop = longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		return (assert((((senderOop) & 7) == 1)),
			pointerForOop(senderOop - 1));
	}
	if (!(((((longAt((contextToReturnTo + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))) & 7) == 1))) {
		return 0;
	}
	thePage = makeBaseFrameFor(contextToReturnTo);
	markStackPageMostRecentlyUsed(thePage);
	return (thePage->baseFP);
}


/*	Divorce a single frame and its context. If it is not the top frame of a
	stack this means splitting its stack. */

	/* StackInterpreter>>#externalDivorceFrame:andContext: */
static void NoDbgRegParms
externalDivorceFrameandContext(char *theFP, sqInt ctxt)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    sqInt callerCtx;
    char *callerFP;
    char *callerFP1;
    sqInt callerIP;
    char *callerSP;
    char *frameAbove;
    StackPage *lruOrFree;
    StackPage *newPage;
    int onCurrent;
    sqInt theIP;
    StackPage *thePage;
    StackPage *thePage1;
    char *theSP;
    sqInt valuePointer;


	/* stackPage needs to have current head pointers to avoid confusion. */
	assert((GIV(stackPage) == 0)
	 || (GIV(stackPage) == (mostRecentlyUsedPage())));
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	if (!((onCurrent = thePage == GIV(stackPage)))) {
		markStackPageNextMostRecentlyUsed(thePage);
	}
	theSP = findSPOfon(theFP, thePage);
	updateStateOfSpouseContextForFrameWithSP(theFP, theSP);
	/* begin ensureCallerContext: */
	callerFP1 = pointerForOop(longAt(theFP + FoxSavedFP));
	if (callerFP1 == 0) {

		/* base frame, context in saved ip slot (or base of stack in Cog) */
		/* begin frameCallerContext: */
		assert(isBaseFrame(theFP));
		/* begin stackPageFor: */
		thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		callerContextOrNil = longAt((thePage1->baseAddress));
		assert(addressCouldBeObj(callerContextOrNil));
		assert((callerContextOrNil == (nilObject()))
		 || (isContext(callerContextOrNil)));
		callerCtx = callerContextOrNil;
		goto l6;
	}
	/* begin ensureFrameIsMarried:SP: */
	if (((((usqInt)(longAt(callerFP1 + FoxMethod)))) < (startOfMemory())
		? ((longAt(callerFP1 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((callerFP1 + FoxIFrameFlags) + 2)) != 0)) {
		assert(isContext(frameContext(callerFP1)));
		callerCtx = longAt(callerFP1 + FoxThisContext);
		goto l6;
	}
	callerCtx = marryFrameSP(callerFP1, (assert(!(isBaseFrame(theFP))),
	(theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord));
	l6:	/* end ensureCallerContext: */;
	if (((frameAbove = findFrameAboveinPage(theFP, thePage))) == 0) {

		/* If we're divorcing the top frame we can simply peel it off. */
		theIP = longAt((thePage->headSP));
	}
	else {

		/* othewise move all frames above to a new stack and then peel the frame off. */
		/* begin newStackPage */
		lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage);
		if (((lruOrFree->baseFP)) == 0) {
			newPage = lruOrFree;
			goto l1;
		}
		divorceFramesIn(lruOrFree);
		newPage = lruOrFree;
	l1:	/* end newStackPage */;
		theIP = oopForPointer(pointerForOop(longAt(frameAbove + FoxCallerSavedIP)));
		frameAbove = moveFramesInthroughtoPage(thePage, frameAbove, newPage);
		if (onCurrent) {
			/* begin setStackPageAndLimit: */
			assert(newPage != 0);
			GIV(stackPage) = newPage;
			if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
				GIV(stackLimit) = (GIV(stackPage)->stackLimit);
			}
			markStackPageMostRecentlyUsed(newPage);
			/* begin setStackPointersFromPage: */
			GIV(stackPointer) = (newPage->headSP);
			GIV(framePointer) = (newPage->headFP);
		}
		else {
			markStackPageMostRecentlyUsed(newPage);
		}
		assert((frameCallerContext(frameAbove)) == ctxt);
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = contextInstructionPointerframe(theIP, theFP);
	assert(!(isOopForwarded(ctxt)));
	longAtput((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer);
	/* begin storePointer:ofObject:withValue: */
	assert(!(isForwarded(ctxt)));
	if ((assert(isNonImmediate(ctxt)),
	oopisGreaterThanOrEqualTo(ctxt, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((callerCtx & (tagMask())) == 0)
		 && (oopisLessThan(callerCtx, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(ctxt))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(ctxt);
			}
		}
	}
	longAtput((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), callerCtx);
	callerFP = pointerForOop(longAt(theFP + FoxSavedFP));
	if (callerFP == 0) {

		/* theFP is a base frame; it is now alone; free the entire page */
		freeStackPage(thePage);
	}
	else {
		callerIP = oopForPointer(pointerForOop(longAt(theFP + FoxCallerSavedIP)));
		callerSP = ((assert(!(isBaseFrame(theFP))),
(theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)) - BytesPerWord;
		longAtput(callerSP, callerIP);
		/* begin setHeadFP:andSP:inPage: */
		assert(callerSP < callerFP);
		assert((callerSP < ((thePage->baseAddress)))
		 && (callerSP > (((thePage->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
		assert((callerFP < ((thePage->baseAddress)))
		 && (callerFP > (((thePage->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
		(thePage->headFP = callerFP);
		(thePage->headSP = callerSP);
	}
}


/*	Ensure aFramePtr is a base frame. Then we can assign its sender.
	Answer the possibly moved location of the frame. */

	/* StackInterpreter>>#externalEnsureIsBaseFrame: */
static char * NoDbgRegParms
externalEnsureIsBaseFrame(char *aFramePtr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    int onCurrent;
    char *theFP;
    StackPage *thePage;

	if ((longAt(aFramePtr + FoxSavedFP)) == 0) {
		return aFramePtr;
	}
	theFP = aFramePtr;
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));

	/* Storing the frame's sender with its caller's context
	   has the side effect of making theFP a base frame. */
	onCurrent = thePage == GIV(stackPage);
	theFP = storeSenderOfFramewithValue(theFP, ensureCallerContext(theFP));
	if (onCurrent) {
		assert(GIV(stackPage) != thePage);
		/* begin setStackPointersFromPage: */
		GIV(stackPointer) = (GIV(stackPage)->headSP);
		GIV(framePointer) = (GIV(stackPage)->headFP);
	}
	else {
		markStackPageMostRecentlyUsed(GIV(stackPage));
	}
	assert(pageListIsWellFormed());
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	return theFP;
}

	/* StackInterpreter>>#externalInstVar:ofContext:put: */
static sqInt NoDbgRegParms
externalInstVarofContextput(sqInt index, sqInt maybeMarriedContext, sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    int onCurrentPage;
    sqInt senderOop;
    char *theFP;
    StackPage *thePage;
    sqInt thePC;

	assert(isContext(maybeMarriedContext));
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	assert(!((isObjImmutable(maybeMarriedContext))));
	if (!((((((longAt((maybeMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(maybeMarriedContext))))) {
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(maybeMarriedContext)));
		if ((assert(isNonImmediate(maybeMarriedContext)),
		oopisGreaterThanOrEqualTo(maybeMarriedContext, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((anOop & (tagMask())) == 0)
			 && (oopisLessThan(anOop, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(maybeMarriedContext))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(maybeMarriedContext);
				}
			}
		}
		longAtput((maybeMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))), anOop);
		if (index == StackPointerIndex) {
			ensureContextIsExecutionSafeAfterAssignToStackPointer(maybeMarriedContext);
		}
		return null;
	}
	/* begin frameOfMarriedContext: */
	senderOop = longAt((maybeMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop) & 7) == 1));
	theFP = pointerForOop(senderOop - 1);
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	onCurrentPage = thePage == GIV(stackPage);
	if (index == SenderIndex) {
		storeSenderOfFramewithValue(theFP, anOop);
	}
	else {
		externalDivorceFrameandContext(theFP, maybeMarriedContext);
		if ((index == MethodIndex)
		 && (((((int) ((thePC = longAt((maybeMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))))) < 0)
		 && ((((thePC) & 7) == 1)))) {
			ensureContextHasBytecodePC(maybeMarriedContext);
		}
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(maybeMarriedContext)));
		if ((assert(isNonImmediate(maybeMarriedContext)),
		oopisGreaterThanOrEqualTo(maybeMarriedContext, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((anOop & (tagMask())) == 0)
			 && (oopisLessThan(anOop, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(maybeMarriedContext))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(maybeMarriedContext);
				}
			}
		}
		longAtput((maybeMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))), anOop);
		if (index == StackPointerIndex) {
			ensureContextIsExecutionSafeAfterAssignToStackPointer(maybeMarriedContext);
		}
	}
	if (onCurrentPage) {
		/* begin setStackPointersFromPage: */
		GIV(stackPointer) = (GIV(stackPage)->headSP);
		GIV(framePointer) = (GIV(stackPage)->headFP);
	}
	else {
		markStackPageMostRecentlyUsed(GIV(stackPage));
	}
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(pageListIsWellFormed());
	assert(validStackPageBaseFrames());
	return 0;
}


/*	Invoke a quick primitive.
	Called under the assumption that primFunctionPtr has been preloaded */

	/* StackInterpreter>>#externalQuickPrimitiveResponse */
static sqInt
externalQuickPrimitiveResponse(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt localPrimIndex;
    sqInt oop;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    char *sp4;

	assert(isPrimitiveFunctionPointerAnIndex());
	localPrimIndex = ((sqInt) primitiveFunctionPointer);
	assert((localPrimIndex > 0xFF)
	 && (localPrimIndex < 520));
	if (localPrimIndex >= 264) {
		/* begin pop:thenPush: */
		oop = longAt(((longAt(GIV(stackPointer))) + BaseHeaderSize) + (((sqInt)((usqInt)((localPrimIndex - 264)) << (shiftForWord())))));
		longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), oop);
		GIV(stackPointer) = sp;
		return 1;
	}
	if (localPrimIndex == 256) {
		return 1;
	}
	if (localPrimIndex == 257) {
		/* begin pop:thenPush: */
		longAtput((sp1 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), GIV(trueObj));
		GIV(stackPointer) = sp1;
		return 1;
	}
	if (localPrimIndex == 258) {
		/* begin pop:thenPush: */
		longAtput((sp2 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), GIV(falseObj));
		GIV(stackPointer) = sp2;
		return 1;
	}
	if (localPrimIndex == 259) {
		/* begin pop:thenPush: */
		longAtput((sp3 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), GIV(nilObj));
		GIV(stackPointer) = sp3;
		return 1;
	}
	/* begin pop:thenPush: */
	longAtput((sp4 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)(localPrimIndex - 261) << 3) | 1));
	GIV(stackPointer) = sp4;
	return 1;
}


/*	not inlined for breakpoint value... */

	/* StackInterpreter>>#failUnbalancedPrimitive */
static void
failUnbalancedPrimitive(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin primitiveFailFor: */
	GIV(primFailCode) = PrimErrBadNumArgs;
}


/*	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. */

	/* StackInterpreter>>#fetchArray:ofObject: */
void *
fetchArrayofObject(sqInt fieldIndex, sqInt objectPointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt arrayOop;

	/* begin fetchPointer:ofObject: */
	arrayOop = longAt((objectPointer + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	/* begin arrayValueOf: */
	if (((arrayOop & (tagMask())) == 0)
	 && (isPureBitsFormat((((usqInt) (longAt(arrayOop))) >> (formatShift())) & (formatMask())))) {
		return ((void *) (pointerForOop(arrayOop + BaseHeaderSize)));
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	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. */

	/* StackInterpreter>>#fetchFloat:ofObject: */
double
fetchFloatofObject(sqInt fieldIndex, sqInt objectPointer)
{
    sqInt floatOop;

	/* begin fetchPointer:ofObject: */
	floatOop = longAt((objectPointer + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	return floatValueOf(floatOop);
}


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

	/* StackInterpreter>>#fetchInteger:ofObject: */
sqInt
fetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt intOop;

	/* begin fetchPointer:ofObject: */
	intOop = longAt((objectPointer + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	/* begin checkedIntegerValueOf: */
	if ((((intOop) & 7) == 1)) {
		return (intOop >> 3);
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
}


/*	Fetch a slot from a married context. Compute the value
	of the relevant inst var from the spouse frame's state.
	
	This method assumes frame pointers have been written back. */

	/* StackInterpreter>>#fetchPointer:ofMarriedContext: */
static sqInt NoDbgRegParms
fetchPointerofMarriedContext(sqInt offset, sqInt aContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    char *callerFP;
    sqInt frameNumArgs;
    sqInt frameNumArgs1;
    sqInt senderOop;
    sqInt senderOop1;
    char *spouseFP;
    StackPage *thePage;

	assert(isContext(aContext));
	assert((((GIV(stackPage)->headFP)) == GIV(framePointer))
	 && (((GIV(stackPage)->headSP)) == GIV(stackPointer)));
	assert(checkIsStillMarriedContextcurrentFP(aContext, GIV(framePointer)));
	if (offset <= ReceiverIndex) {
		if (!(offset <= StackPointerIndex)) {
			/* begin fetchPointer:ofObject: */
			return longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(offset) << (shiftForWord())))));
		}
		/* begin frameOfMarriedContext: */
		senderOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop) & 7) == 1));
		spouseFP = pointerForOop(senderOop - 1);
		if (offset == SenderIndex) {
			/* begin ensureCallerContext: */
			callerFP = pointerForOop(longAt(spouseFP + FoxSavedFP));
			if (callerFP == 0) {

				/* base frame, context in saved ip slot (or base of stack in Cog) */
				/* begin frameCallerContext: */
				assert(isBaseFrame(spouseFP));
				/* begin stackPageFor: */
				thePage = stackPageAtpages((assert((((((char *) spouseFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) spouseFP)) <= (((char *) GIV(pages)))))),
				pageIndexForstackBasePlus1bytesPerPage(spouseFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
				callerContextOrNil = longAt((thePage->baseAddress));
				assert(addressCouldBeObj(callerContextOrNil));
				assert((callerContextOrNil == (nilObject()))
				 || (isContext(callerContextOrNil)));
				return callerContextOrNil;
			}
			/* begin ensureFrameIsMarried:SP: */
			if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory())
				? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
				: (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) {
				assert(isContext(frameContext(callerFP)));
				return longAt(callerFP + FoxThisContext);
			}
			return marryFrameSP(callerFP, (assert(!(isBaseFrame(spouseFP))),
			(spouseFP + (frameStackedReceiverOffset(spouseFP))) + BytesPerWord));
		}
		if (offset == StackPointerIndex) {
			return (((usqInt)(stackPointerIndexForFrame(spouseFP)) << 3) | 1);
		}
		if (offset == InstructionPointerIndex) {
			return instructionPointerForFramecurrentFPcurrentIP(spouseFP, GIV(framePointer), GIV(instructionPointer));
		}
	}
	/* begin frameOfMarriedContext: */
	senderOop1 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop1) & 7) == 1));
	spouseFP = pointerForOop(senderOop1 - 1);
	return ((((offset - ReceiverIndex) >= 1) && ((offset - ReceiverIndex) <= (stackPointerIndexForFrame(spouseFP))))
		? ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())
				? ((offset - (ReceiverIndex + 1)) < ((frameNumArgs = ((mframeCogMethod(spouseFP))->cmNumArgs)))
						? longAt((spouseFP + FoxCallerSavedIP) + ((frameNumArgs - (offset - (ReceiverIndex + 1))) * BytesPerWord))
						: longAt(((spouseFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - (offset - (ReceiverIndex + 1))) * BytesPerWord)))
				: ((offset - (ReceiverIndex + 1)) < ((frameNumArgs1 = byteAt((spouseFP + FoxIFrameFlags) + 1)))
						? longAt((spouseFP + FoxCallerSavedIP) + ((frameNumArgs1 - (offset - (ReceiverIndex + 1))) * BytesPerWord))
						: longAt(((spouseFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - (offset - (ReceiverIndex + 1))) * BytesPerWord))))
		: /* begin nilObject */ GIV(nilObj));
}


/*	Return the stackPointer of a Context or BlockContext.
	Does not deal with married contexts. Use only for debug
	printing or object tracing functions. To obtain an accurate
	stack pointer use stackPointerForMaybeMarriedContext: */

	/* StackInterpreter>>#fetchStackPointerOf: */
static sqInt NoDbgRegParms
fetchStackPointerOf(sqInt aContext)
{
    sqInt sp;

	/* begin fetchPointer:ofObject: */
	sp = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
	if (!((((sp) & 7) == 1))) {
		return 0;
	}
	assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(aContext)));
	return (sp >> 3);
}

	/* StackInterpreter>>#findClassContainingMethod:startingAt: */
static sqInt NoDbgRegParms
findClassContainingMethodstartingAt(sqInt meth, sqInt classObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classDict;
    usqInt classDictSize;
    sqInt currClass;
    sqInt i;
    sqInt methodArray;
    usqInt numSlots;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop2;
    sqInt referent;
    sqInt referent1;
    sqInt referent2;
    sqInt referent3;

	if (((classObj & (tagMask())) == 0)
	 && (((longAt(classObj)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(classObj));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((classObj + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		currClass = referent;
	}
	else {
		currClass = classObj;
	}
	do {
		assert(!(isForwarded(currClass)));
		if (!(addressCouldBeClassObj(currClass))) {
			/* begin nilObject */
			return GIV(nilObj);
		}
		/* begin noFixupFollowField:ofObject: */
		objOop1 = longAt((currClass + BaseHeaderSize) + (((sqInt)((usqInt)(MethodDictionaryIndex) << (shiftForWord())))));
		if (((objOop1 & (tagMask())) == 0)
		 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(objOop1));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent2 = longAt((objOop1 + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent2 & (tagMask())) == 0)
			 && (((longAt(referent2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			objOop1 = referent2;
		}
		classDict = objOop1;
		assert(!(isForwarded(classDict)));
		/* begin numSlotsOf: */
		assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(classDict + 7);
		classDictSize = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(classDict - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
		if (classDictSize > MethodArrayIndex) {
			/* begin noFixupFollowField:ofObject: */
			objOop = longAt((classDict + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
			if (((objOop & (tagMask())) == 0)
			 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(objOop));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent1 = longAt((objOop + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent1 & (tagMask())) == 0)
				 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				objOop = referent1;
			}
			methodArray = objOop;
			assert(!(isForwarded(methodArray)));
			i = 0;
			while (i < (classDictSize - SelectorStart)) {
				if (meth == (noFixupFollowFieldofObject(i, methodArray))) {
					return currClass;
				}
				i += 1;
			}
		}
		/* begin noFixupFollowField:ofObject: */
		objOop2 = longAt((currClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop2 & (tagMask())) == 0)
		 && (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(objOop2));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent3 = longAt((objOop2 + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent3 & (tagMask())) == 0)
			 && (((longAt(referent3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			objOop2 = referent3;
		}
		currClass = objOop2;
	} while(!(currClass == GIV(nilObj)));
	return currClass;
}

	/* StackInterpreter>>#findClassOfMethod:forReceiver: */
sqInt
findClassOfMethodforReceiver(sqInt meth, sqInt rcvr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt rclass;
    sqInt tagBits;

	if (((rcvr & (tagMask()))
	 || (addressCouldBeObj(rcvr)))
	 && (!(((rcvr & (tagMask())) == 0)
	 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)))) {
		rclass = findClassContainingMethodstartingAt(meth, (((tagBits = rcvr & (tagMask()))) != 0
			? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))
			: fetchClassOfNonImm(rcvr)));
		if (rclass != GIV(nilObj)) {
			return rclass;
		}
	}
	if (!((addressCouldBeObj(meth))
		 && (((((usqInt) (longAt(meth))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		/* begin nilObject */
		return GIV(nilObj);
	}
	return findClassContainingMethodstartingAt(meth, safeMethodClassOf(meth));
}


/*	Answer the frame above theFP (adjacent frame nearest head end).
	If theFP is the head frame answer 0. */

	/* StackInterpreter>>#findFrameAbove:inPage: */
static char * NoDbgRegParms
findFrameAboveinPage(char *theFP, StackPage *thePage)
{
    char *callerFP;
    char *fp;

	fp = (thePage->headFP);
	if (fp == theFP) {
		return 0;
	}
	while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) {
		if (callerFP == theFP) {
			return fp;
		}
		fp = callerFP;
	}
	error("did not find theFP in stack page");
	return 0;
}

	/* StackInterpreter>>#findHomeForContext: */
static sqInt NoDbgRegParms
findHomeForContext(sqInt aContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt closureOrNil;

	if (!(((aContext & (tagMask())) == 0)
		 && (((longAt(aContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
		return null;
	}
	/* begin fetchPointer:ofObject: */
	closureOrNil = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureIndex) << (shiftForWord())))));
	if (closureOrNil == GIV(nilObj)) {
		return aContext;
	}
	if (((compactClassIndexOf(closureOrNil)) != ClassBlockClosureCompactIndex)
	 && ((compactClassIndexOf(closureOrNil)) != ClassFullBlockClosureCompactIndex)) {
		return null;
	}
	return findHomeForContext(longAt((closureOrNil + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureOuterContextIndex) << (shiftForWord()))))));
}


/*	See findUnwindThroughContext:. Alas this is mutually recursive with
	findMethodWithPrimitive:FromFP:SP:ThroughContext: instead of iterative.
	We're doing the simplest thing that could possibly work. Niceties can
	wait.  */
/*	Being mutually-recursive with findMethodWithPrimitive:FromFP:UpToContext:
	gives the author's type inference algorithm headaches. Wimp out by
	declaring the return type.
 */

	/* StackInterpreter>>#findMethodWithPrimitive:FromContext:UpToContext: */
static sqInt NoDbgRegParms
findMethodWithPrimitiveFromContextUpToContext(sqInt primitive, sqInt senderContext, sqInt homeContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    sqInt senderContext1;
    sqInt senderOop;
    char *startFP;
    sqInt theContext;
    char *theFP;
    char *theFPAbove;
    sqInt theMethod;
    sqInt theMethod1;
    StackPage *thePage;
    char *theSP;

	assert((senderContext == (nilObject()))
	 || (isContext(senderContext)));
	assert((homeContext == (nilObject()))
	 || (isContext(homeContext)));
	theContext = senderContext;
	while (1) {
		if (theContext == GIV(nilObj)) {
			return theContext;
		}
		if (((((longAt((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) break;
		if (theContext == homeContext) {
			return 0;
		}
		if (!((primitive == 0)
			 || ((longAt((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureIndex) << (shiftForWord())))))) != GIV(nilObj)))) {
			/* begin fetchPointer:ofObject: */
			theMethod = longAt((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
			if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == primitive) {
				return theContext;
			}
		}
		/* begin fetchPointer:ofObject: */
		theContext = longAt((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	}
	if (isWidowedContext(theContext)) {
		/* begin nilObject */
		return GIV(nilObj);
	}
	/* begin findMethodWithPrimitive:FromFP:UpToContext: */
	senderOop = longAt((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop) & 7) == 1));
	startFP = pointerForOop(senderOop - 1);
	theFP = startFP;
	theFPAbove = startFP;
	do {
		if ((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0))
		 && (homeContext == (longAt(theFP + FoxThisContext)))) {
			return 0;
		}
		if (!((primitive == 0)
			 || (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
				? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
				: (byteAt((theFP + FoxIFrameFlags) + 3)) != 0)))) {
			theMethod1 = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
				? ((mframeHomeMethod(theFP))->methodObject)
				: longAt(theFP + FoxMethod));
			if ((primitiveIndexOfMethodheader(theMethod1, methodHeaderOf(theMethod1))) == primitive) {
				if (theFP == theFPAbove) {
					theSP = findSPOfon(theFP, stackPageFor(theFP));
				}
				else {
					assert(!(isBaseFrame(theFPAbove)));
					theSP = (theFPAbove + (frameStackedReceiverOffset(theFPAbove))) + BytesPerWord;
				}
				/* begin ensureFrameIsMarried:SP: */
				if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
					: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
					assert(isContext(frameContext(theFP)));
					return longAt(theFP + FoxThisContext);
				}
				return marryFrameSP(theFP, theSP);
			}
		}
		theFPAbove = theFP;
		theFP = pointerForOop(longAt(theFP + FoxSavedFP));
	} while(theFP != 0);
	/* begin frameCallerContext: */
	assert(isBaseFrame(theFPAbove));
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	callerContextOrNil = longAt((thePage->baseAddress));
	assert(addressCouldBeObj(callerContextOrNil));
	assert((callerContextOrNil == (nilObject()))
	 || (isContext(callerContextOrNil)));
	senderContext1 = callerContextOrNil;
	if (!(((senderContext1 & (tagMask())) == 0)
		 && (((longAt(senderContext1)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
		/* begin nilObject */
		return GIV(nilObj);
	}
	return findMethodWithPrimitiveFromContextUpToContext(primitive, senderContext1, homeContext);
}

	/* StackInterpreter>>#findSelectorOfMethod: */
sqInt
findSelectorOfMethod(sqInt meth)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classDict;
    usqInt classDictSize;
    sqInt classObj;
    sqInt i;
    sqInt methodArray;
    usqInt numSlots;
    sqInt selector;

	if (!(addressCouldBeObj(meth))) {
		/* begin nilObject */
		return GIV(nilObj);
	}
	if (((longAt(meth)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		return findSelectorOfMethod(followForwarded(meth));
	}
	if (!(((meth & (tagMask())) == 0)
		 && (((((usqInt) (longAt(meth))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		/* begin nilObject */
		return GIV(nilObj);
	}
	selector = maybeSelectorOfMethod(meth);
	if (!(selector == null)) {
		return selector;
	}
	classObj = safeMethodClassOf(meth);
	if (addressCouldBeClassObj(classObj)) {
		/* begin fetchPointer:ofObject: */
		classDict = longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(MethodDictionaryIndex) << (shiftForWord())))));
		/* begin numSlotsOf: */
		assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(classDict + 7);
		classDictSize = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(classDict - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
		if (classDictSize > MethodArrayIndex) {
			/* begin fetchPointer:ofObject: */
			methodArray = longAt((classDict + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
			i = 0;
			while (i < (classDictSize - SelectorStart)) {
				if (meth == (longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
					/* begin fetchPointer:ofObject: */
					return longAt((classDict + BaseHeaderSize) + (((sqInt)((usqInt)((i + SelectorStart)) << (shiftForWord())))));
				}
				i += 1;
			}
		}
	}
	/* begin nilObject */
	return GIV(nilObj);
}


/*	Search for the stack pointer for theFP. This points to the hottest item on
	the frame's stack.
	DO NOT CALL THIS WITH theFP == localFP OR theFP == framePointer! */

	/* StackInterpreter>>#findSPOf:on: */
static char * NoDbgRegParms
findSPOfon(char *theFP, StackPage *thePage)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *aFrame;
    char *prevFrame;
    char *startFrame;
    char *theSP;

	assert(!((isFree(thePage))));
	/* begin findSPOrNilOf:on:startingFrom: */
	startFrame = (thePage->headFP);
	if (startFrame == theFP) {
		if (((thePage->headSP)) >= startFrame) {

			/* If the SP is invalid return the pointer to the receiver field. */
			theSP = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
				? theFP + FoxMFReceiver
				: theFP + FoxIFReceiver);
			goto l1;
		}
		theSP = (thePage == GIV(stackPage)
			? (thePage->headSP)
			: ((thePage->headSP)) + BytesPerWord);
		goto l1;
	}
	aFrame = startFrame;
	while (1) {
		prevFrame = aFrame;
		aFrame = pointerForOop(longAt(aFrame + FoxSavedFP));
		if (!(aFrame != 0)) break;
		if (theFP == aFrame) {
			assert(!(isBaseFrame(prevFrame)));
			theSP = (prevFrame + (frameStackedReceiverOffset(prevFrame))) + BytesPerWord;
			goto l1;
		}
	}
	theSP = null;
	l1:	/* end findSPOrNilOf:on:startingFrom: */;
	if (!(theSP == null)) {
		return theSP;
	}
	error("did not find theFP in stack page");
	return 0;
}


/*	Search for either an unwind-protect (activation of method with primitive
	198) or homeContext along the sender chain, which ever is found first.
	Return values:
	0			home context was found on sender chain with no intervening
	unwind-protects nilObj		home context could not be found => cannotReturn
	context		the context of an intervening unwind-protect implies home context
	was found */
/*	Almost always (98%) the home is on the same page, in which case we know it
	will be found.
 */

	/* StackInterpreter>>#findUnwindThroughContext: */
static sqInt NoDbgRegParms
findUnwindThroughContext(sqInt homeContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    sqInt ctxtOrNilOrZero;
    sqInt onSamePage;
    sqInt senderContext;
    char *theFP;
    char *theFPAbove;
    sqInt theMethod;
    sqInt theMethod1;
    StackPage *thePage;
    char *theSP;


	/* Since nothing changes we don't need to internalize. */
	onSamePage = ((((((longAt((homeContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(homeContext))))
	 && (((assert((((((char *) GIV(framePointer))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) GIV(framePointer))) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(GIV(framePointer), GIV(stackBasePlus1), GIV(bytesPerPage)))) == (pageIndexFor(frameOfMarriedContext(homeContext))));
	/* begin findMethodWithPrimitive:FromFP:UpToContext: */
	theFP = GIV(framePointer);
	theFPAbove = GIV(framePointer);
	do {
		if ((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0))
		 && (homeContext == (longAt(theFP + FoxThisContext)))) {
			ctxtOrNilOrZero = 0;
			goto l4;
		}
		if (!(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
				? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
				: (byteAt((theFP + FoxIFrameFlags) + 3)) != 0))) {
			theMethod1 = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
				? ((mframeHomeMethod(theFP))->methodObject)
				: longAt(theFP + FoxMethod));
			if ((primitiveIndexOfMethodheader(theMethod1, methodHeaderOf(theMethod1))) == 198) {
				if (theFP == theFPAbove) {
					theSP = findSPOfon(theFP, stackPageFor(theFP));
				}
				else {
					assert(!(isBaseFrame(theFPAbove)));
					theSP = (theFPAbove + (frameStackedReceiverOffset(theFPAbove))) + BytesPerWord;
				}
				/* begin ensureFrameIsMarried:SP: */
				if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
					: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
					assert(isContext(frameContext(theFP)));
					ctxtOrNilOrZero = longAt(theFP + FoxThisContext);
					goto l4;
				}
				ctxtOrNilOrZero = marryFrameSP(theFP, theSP);
				goto l4;
			}
		}
		theFPAbove = theFP;
		theFP = pointerForOop(longAt(theFP + FoxSavedFP));
	} while(theFP != 0);
	/* begin frameCallerContext: */
	assert(isBaseFrame(theFPAbove));
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	callerContextOrNil = longAt((thePage->baseAddress));
	assert(addressCouldBeObj(callerContextOrNil));
	assert((callerContextOrNil == (nilObject()))
	 || (isContext(callerContextOrNil)));
	senderContext = callerContextOrNil;
	if (!(((senderContext & (tagMask())) == 0)
		 && (((longAt(senderContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
		/* begin nilObject */
		ctxtOrNilOrZero = GIV(nilObj);
		goto l4;
	}
	ctxtOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(198, senderContext, homeContext);
	l4:	/* end findMethodWithPrimitive:FromFP:UpToContext: */;
	assert(!((onSamePage
 && (ctxtOrNilOrZero == (nilObject())))));
	if (ctxtOrNilOrZero == 0) {
		/* begin fetchPointer:ofObject: */
		theMethod = longAt((homeContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
		if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == 198) {
			return homeContext;
		}
		return 0;
	}
	if (!(onSamePage
		 || (ctxtOrNilOrZero == GIV(nilObj)))) {
		if ((findMethodWithPrimitiveFromContextUpToContext(0, ctxtOrNilOrZero, homeContext)) == GIV(nilObj)) {
			/* begin nilObject */
			return GIV(nilObj);
		}
	}
	return ctxtOrNilOrZero;
}


/*	Flush the method caches of references to oldMethod. */

	/* StackInterpreter>>#flushMethodCacheForMethod: */
static void NoDbgRegParms
flushMethodCacheForMethod(sqInt oldMethod)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt probe;

	probe = 0;
	for (i = 1; i <= MethodCacheEntries; i += 1) {
		if ((GIV(methodCache)[probe + MethodCacheMethod]) == oldMethod) {
			GIV(methodCache)[probe + MethodCacheSelector] = 0;
		}
		probe += MethodCacheEntrySize;
	}
	flushExternalPrimitiveOf(oldMethod);
}


/*	follow pointers in the current stack frame up to theSP. */

	/* StackInterpreter>>#followForwardedFrameContents:stackPointer: */
static void NoDbgRegParms
followForwardedFrameContentsstackPointer(char *theFP, char *theSP)
{
    sqInt oop;
    char *ptr;
    sqInt referent;
    char * toDoLimit1;
    char * toDoLimit2;

	for (ptr = theSP, toDoLimit1 = (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
	? theFP + FoxMFReceiver
	: theFP + FoxIFReceiver)); ptr <= toDoLimit1; ptr += BytesPerWord) {
		oop = longAt(ptr);
		if (((oop & (tagMask())) == 0)
		 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			longAtput(ptr, followForwarded(oop));
		}
	}
	for (ptr = ((theFP + FoxCallerSavedIP) + BytesPerWord), toDoLimit2 = (theFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
	? ((mframeCogMethod(theFP))->cmNumArgs)
	: byteAt((theFP + FoxIFrameFlags) + 1))))); ptr <= toDoLimit2; ptr += BytesPerWord) {
		oop = longAt(ptr);
		if (((oop & (tagMask())) == 0)
		 && (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(oop));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent & (tagMask())) == 0)
			 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			oop = referent;
			longAtput(ptr, oop);
		}
	}
	if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 3)) != 0)) {
		assert(oop == (longAt(theFP + (frameStackedReceiverOffset(theFP)))));
		followForwardedObjectFieldstoDepth(oop, 0);
	}
	assert(!(isForwarded(frameMethodObject(theFP))));
	if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
		assert(!(isForwarded(frameContext(theFP))));
	}
}


/*	Force an interrupt check ASAP.
	Must set the stack page's limit before stackLimit to avoid
	a race condition if this is called from an interrupt handler. */

	/* StackInterpreter>>#forceInterruptCheck */
sqInt
forceInterruptCheck(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    void (*iccFunc)();
    StackPage *thePage;


	/* Do _not_ set stackLimit until the stack system has been initialized.
	   stackLimit is the initialization flag for the stack system. */
	if (GIV(stackLimit) == 0) {
		return null;
	}
	thePage = GIV(stackPage);
	if ((thePage != null)
	 && (thePage != 0)) {
		(thePage->stackLimit = ((char *) (((usqInt) -1))));
	}
	/* begin allOnesAsCharStar */
	GIV(stackLimit) = ((char *) (((usqInt) -1)));
	sqLowLevelMFence();
	if (((iccFunc = interruptCheckChain)) != null) {
		iccFunc();
	}
	GIV(statForceInterruptCheck) += 1;
	return 0;
}

	/* StackInterpreter>>#frameContext: */
static sqInt NoDbgRegParms
frameContext(char *theFP)
{
	return longAt(theFP + FoxThisContext);
}

	/* StackInterpreter>>#frameOfMarriedContext: */
static char * NoDbgRegParms
frameOfMarriedContext(sqInt aContext)
{
    sqInt senderOop;

	/* begin fetchPointer:ofObject: */
	senderOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	return (assert((((senderOop) & 7) == 1)),
		pointerForOop(senderOop - 1));
}


/*	Answer the offset in bytes from the a frame pointer to its stacked
	receiver, given the argument count. The receiver of a message send or the
	closure of
	a block activation is always on the stack above any arguments and the
	frame itself. See the diagram in StackInterpreter
	class>>initializeFrameIndices.  */

	/* StackInterpreter>>#frameStackedReceiverOffsetNumArgs: */
static sqInt NoDbgRegParms
frameStackedReceiverOffsetNumArgs(sqInt numArgs)
{
	return (FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord()))));
}


/*	Answer the offset in bytes from the the frame pointer to its stacked
	receiver. The receiver of a message send or the closure of a block
	activation is
	always on the stack above any arguments and the frame itself. See the
	diagram in StackInterpreter class>>initializeFrameIndices. */

	/* StackInterpreter>>#frameStackedReceiverOffset: */
static sqInt NoDbgRegParms
frameStackedReceiverOffset(char *theFP)
{
    sqInt numArgs;

	/* begin frameStackedReceiverOffsetNumArgs: */
	numArgs = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? ((mframeCogMethod(theFP))->cmNumArgs)
		: byteAt((theFP + FoxIFrameFlags) + 1));
	return (FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord()))));
}


/*	Answer the stacked receiver given the frame's argument count.
	The receiver of a message send or the closure of a block activation is
	always on the stack above any arguments and the frame itself. See the
	diagram in StackInterpreter class>>initializeFrameIndices. */

	/* StackInterpreter>>#frameStackedReceiver:numArgs: */
static sqInt NoDbgRegParms
frameStackedReceivernumArgs(char *theFP, sqInt numArgs)
{
	return longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord()))))));
}


/*	Free any untraced stack pages. */

	/* StackInterpreter>>#freeUntracedStackPages */
static void
freeUntracedStackPages(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    StackPage *thePage;

	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		if ((!(isFree(thePage)))
		 && (((thePage->trace)) == StackPageUnreached)) {
			assert(noMarkedContextsOnPage(thePage));
			freeStackPage(thePage);
		}
		assert(((thePage->trace = StackPageTraceInvalid)) != 0);
	}
}


/*	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.
 */

	/* StackInterpreter>>#fullDisplayUpdate */
sqInt
fullDisplayUpdate(void)
{
	updateDisplayLeftTopRightBottom(0, 0, displayWidth, displayHeight);
	ioForceDisplayUpdate();
	return 0;
}


/*	Find an actual function pointer for this primitiveIndex. This is an
	opportunity to specialise the prim for the relevant class (format for
	example). Default for now is simply the entry in the base primitiveTable. */

	/* StackInterpreter>>#functionPointerFor:inClass: */
void (*functionPointerForinClass(sqInt primIdx,sqInt theClass))(void)

{
	return (primIdx > MaxPrimitiveIndex
		? 0
		: primitiveTable[primIdx]);
}


/*	Answer the errorCode object to supply to a failing primitive method that
	accepts one.
	If there is a primitive error table and the primFailCode is a valid index
	there-in answer
	the corresponding entry in the table, otherwise simply answer the code as
	an integer.
 */

	/* StackInterpreter>>#getErrorObjectFromPrimFailCode */
static sqInt
getErrorObjectFromPrimFailCode(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt clone;
    sqInt errObj;
    sqInt fieldIndex;
    sqInt i;
    sqInt knownClassIndex;
    usqInt newObj;
    usqInt numBytes;
    usqInt numSlots;
    sqInt objOop;
    sqInt table;
    sqInt valuePointer;
    sqInt valuePointer1;
    sqInt valuePointer2;
    sqInt valuePointer3;

	if (GIV(primFailCode) > 0) {
		/* begin splObj: */
		table = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(PrimErrTableIndex) << (shiftForWord())))));
		if (GIV(primFailCode) <= (numSlotsOf(table))) {
			/* begin followField:ofObject: */
			fieldIndex = GIV(primFailCode) - 1;
			/* begin fetchPointer:ofObject: */
			objOop = longAt((table + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
			if (((objOop & (tagMask())) == 0)
			 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop = fixFollowedFieldofObjectwithInitialValue(fieldIndex, table, objOop);
			}
			errObj = objOop;
			if (((GIV(primFailCode) == PrimErrOSError)
			 || (GIV(primFailCode) == PrimErrFFIException))
			 && ((((((usqInt) (longAt(errObj))) >> (formatShift())) & (formatMask())) == 1 /* nonIndexablePointerFormat */)
			 && (((numSlots = numSlotsOf(errObj))) >= 2))) {
				/* begin cloneOSErrorObj:numSlots: */
				/* begin eeInstantiateSmallClassIndex:format:numSlots: */
				knownClassIndex = (longAt(errObj)) & (classIndexMask());
				assert((numSlots >= 0)
				 && ((knownClassIndex != 0)
				 && ((knownClassAtIndex(knownClassIndex)) != GIV(nilObj))));
				assert((1 /* nonIndexablePointerFormat */) == (instSpecOfClass(knownClassAtIndex(knownClassIndex))));
				/* begin allocateSmallNewSpaceSlots:format:classIndex: */
				assert(numSlots < (numSlotsMask()));
				newObj = GIV(freeStart);
				numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
				assert((numBytes % (allocationUnit())) == 0);
				assert((newObj % (allocationUnit())) == 0);
				if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
					if (!GIV(needGCFlag)) {
						/* begin scheduleScavenge */
						GIV(needGCFlag) = 1;
						forceInterruptCheck();
					}
					if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
						error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
						clone = 0;
						goto l5;
					}
				}
				long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (1U << (formatShift()))) + knownClassIndex);
				GIV(freeStart) += numBytes;
				clone = newObj;
	l5:	/* end eeInstantiateSmallClassIndex:format:numSlots: */;
				for (i = 0; i < numSlots; i += 1) {
					/* begin storePointerUnchecked:ofObject:withValue: */
					valuePointer = longAt((errObj + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
					assert(!(isOopForwarded(clone)));
					longAtput((clone + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer);
				}
				if ((numSlots > 2)
				 && (GIV(primFailCode) == PrimErrFFIException)) {
					/* begin storePointerUnchecked:ofObject:withValue: */
					valuePointer1 = positive64BitIntegerFor(((usqLong) GIV(osErrorCode)));
					assert(!(isOopForwarded(clone)));
					longAtput((clone + BaseHeaderSize) + (1U << (shiftForWord())), valuePointer1);
					/* begin storePointerUnchecked:ofObject:withValue: */
					valuePointer2 = positiveMachineIntegerFor(GIV(exceptionPC));
					assert(!(isOopForwarded(clone)));
					longAtput((clone + BaseHeaderSize) + (2U << (shiftForWord())), valuePointer2);
				}
				else {
					/* begin storePointerUnchecked:ofObject:withValue: */
					valuePointer3 = signed64BitIntegerFor(GIV(osErrorCode));
					assert(!(isOopForwarded(clone)));
					longAtput((clone + BaseHeaderSize) + (1U << (shiftForWord())), valuePointer3);
				}
				errObj = clone;
			}
			return errObj;
		}
	}
	return (((usqInt)GIV(primFailCode) << 3) | 1);
}

	/* StackInterpreter>>#getFullScreenFlag */
sqInt
getFullScreenFlag(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(fullScreenFlag);
}

	/* StackInterpreter>>#getInterruptKeycode */
sqInt
getInterruptKeycode(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(interruptKeycode);
}

	/* StackInterpreter>>#getInterruptPending */
sqInt
getInterruptPending(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(interruptPending);
}

	/* StackInterpreter>>#getNextWakeupUsecs */
usqLong
getNextWakeupUsecs(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(nextWakeupUsecs);
}

	/* StackInterpreter>>#getSavedWindowSize */
sqInt
getSavedWindowSize(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(savedWindowSize);
}


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

	/* StackInterpreter>>#getShortFromFile:swap: */
static sqInt NoDbgRegParms
getShortFromFileswap(sqImageFile aFile, sqInt swapFlag)
{
    unsigned short w;

	w = 0;
	sqImageFileRead((&w), sizeof(unsigned short), 1, aFile);
	return (swapFlag
		? ((((usqInt) w) >> 8) & 0xFF) | (((sqInt)((usqInt)((w & 0xFF)) << 8)))
		: w);
}


/*	Answer the screen size to write to the snapshot.
	If the actual screen size is zero then write the savedWindowSize instead. */

	/* StackInterpreter>>#getSnapshotScreenSize */
static sqInt
getSnapshotScreenSize(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt screenSize;

	screenSize = ioScreenSize();
	if (((screenSize & 0xFFFF) == 0)
	 || ((((usqInt) screenSize) >> 16) == 0)) {
		screenSize = GIV(savedWindowSize);
	}
	return screenSize;
}


/*	For Alien FFI */

	/* StackInterpreter>>#getStackPointer */
sqInt *
getStackPointer(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return ((sqInt *) GIV(stackPointer));
}


/*	return the global session ID value */

	/* StackInterpreter>>#getThisSessionID */
sqInt
getThisSessionID(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(globalSessionID);
}


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

	/* StackInterpreter>>#getWord32FromFile:swap: */
static sqInt NoDbgRegParms
getWord32FromFileswap(sqImageFile aFile, sqInt swapFlag)
{
    int w;

	w = 0;
	sqImageFileRead((&w), sizeof(int), 1, aFile);
	return (swapFlag
		? SQ_SWAP_4_BYTES(w)
		: w);
}


/*	Handle a send fault that is due to a send using a forwarded selector.
	Unforward the selector and follow the current method and special
	selectors array to unforward the source of the forwarded selector. */

	/* StackInterpreter>>#handleForwardedSelectorFaultFor: */
static sqInt NoDbgRegParms
handleForwardedSelectorFaultFor(sqInt selectorOop)
{
    sqInt referent;

	assert(isOopForwarded(selectorOop));
	followForwardedFieldsInCurrentMethod();
	followForwardedObjectFieldstoDepth(splObj(SpecialSelectors), 0);
	/* begin followForwarded: */
	assert(isUnambiguouslyForwarder(selectorOop));
	/* begin fetchPointer:ofMaybeForwardedObject: */
	referent = longAt((selectorOop + BaseHeaderSize) + (0U << (shiftForWord())));
	while (((referent & (tagMask())) == 0)
	 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	return referent;
}


/*	Handle a send fault that may be due to a send to a forwarded object.
	Unforward the receiver on the stack and answer its actual class. */

	/* StackInterpreter>>#handleForwardedSendFaultForTag: */
static sqInt NoDbgRegParms
handleForwardedSendFaultForTag(sqInt classTag)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt rcvr;
    sqInt referent;
    sqInt tagBits;

	assert(isForwardedClassTag(classTag));

	/* should *not* be a super send, so the receiver should be forwarded. */
	rcvr = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));
	assert(isOopForwarded(rcvr));
	/* begin followForwarded: */
	assert(isUnambiguouslyForwarder(rcvr));
	/* begin fetchPointer:ofMaybeForwardedObject: */
	referent = longAt((rcvr + BaseHeaderSize) + (0U << (shiftForWord())));
	while (((referent & (tagMask())) == 0)
	 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	rcvr = referent;
	longAtput(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord), rcvr);
	followForwardedFrameContentsstackPointer(GIV(framePointer), GIV(stackPointer) + ((GIV(argumentCount) + 1) * BytesPerWord));
	if (isPointers(((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
		? longAt(GIV(framePointer) + FoxMFReceiver)
		: longAt(GIV(framePointer) + FoxIFReceiver)))) {
		followForwardedObjectFieldstoDepth(((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
			? longAt(GIV(framePointer) + FoxMFReceiver)
			: longAt(GIV(framePointer) + FoxIFReceiver)), 0);
	}
	return (((tagBits = rcvr & (tagMask()))) != 0
		? tagBits
		: (longAt(rcvr)) & (classIndexMask()));
}


/*	Handle a special send fault that may be due to a special selector
	send accessing a forwarded object. obj is forwarded.
	Unforward stack contents and and inst vars and answer obj's target. */

	/* StackInterpreter>>#handleSpecialSelectorSendFaultFor:fp:sp: */
static sqInt NoDbgRegParms
handleSpecialSelectorSendFaultForfpsp(sqInt obj, char *theFP, char *theSP)
{
    sqInt rcvr;
    sqInt referent;

	assert(isOopForwarded(obj));
	followForwardedFrameContentsstackPointer(theFP, theSP);
	rcvr = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? longAt(theFP + FoxMFReceiver)
		: longAt(theFP + FoxIFReceiver));
	if (((rcvr & (tagMask())) == 0)
	 && (((((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)) {
		followForwardedObjectFieldstoDepth(rcvr, 0);
	}
	/* begin followForwarded: */
	assert(isUnambiguouslyForwarder(obj));
	/* begin fetchPointer:ofMaybeForwardedObject: */
	referent = longAt((obj + BaseHeaderSize) + (0U << (shiftForWord())));
	while (((referent & (tagMask())) == 0)
	 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	return referent;
}


/*	Check for stack overflow, moving frames to another stack if so.
	This should *only* be sent from checkForStackOverflow. */

	/* StackInterpreter>>#handleStackOverflow */
static void NeverInline
handleStackOverflow(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    char *callerFP;
    char *callerFP1;
    StackPage *lruOrFree;
    StackPage *newPage;
    sqInt overflowCount;
    char *overflowLimitAddress;
    sqInt source;
    char *theFP;
    StackPage *thePage;

	assert(GIV(stackPointer) < ((GIV(stackPage)->realStackLimit)));
	/* begin maybeTraceStackOverflow */
	if (recordOverflowTrace()) {
		/* begin recordTrace:thing:source: */
		source = ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
			? TraceIsFromMachineCode
			: TraceIsFromInterpreter);
		GIV(traceLog)[GIV(traceLogIndex)] = TraceStackOverflow;
		GIV(traceLog)[GIV(traceLogIndex) + 1] = TraceStackOverflow;
		GIV(traceLog)[GIV(traceLogIndex) + 2] = source;
		GIV(traceLogIndex) = (GIV(traceLogIndex) + 3) % TraceBufferSize;
	}
	if (recordPrimTrace()) {
		/* begin fastLogPrim: */
		GIV(primTraceLog)[GIV(primTraceLogIndex)] = TraceStackOverflow;
		primTraceLogIndex(GIV(primTraceLogIndex) + 1);
	}

	/* The stack has overflowed this page.  If the system is executing some recursive algorithm,
	   e.g. fibonacci, then the system could thrash overflowing the stack if the call soon returns
	   back to the current page.  To avoid thrashing, since overflow is quite slow, we can move
	   more than one frame.  The idea is to record which page has overflowed, and the first
	   time it overflows move one frame, the second time two frames, and so on.  We move no
	   more frames than would leave the page half occupied. */
	GIV(statStackOverflow) += 1;
	theFP = GIV(framePointer);
	if (GIV(stackPage) == GIV(overflowedPage)) {
		overflowLimitAddress = ((GIV(stackPage)->baseAddress)) - GIV(overflowLimit);
		overflowCount = (GIV(extraFramesToMoveOnOverflow) += 1);
		while ((((overflowCount -= 1)) >= 0)
		 && ((((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) < overflowLimitAddress)
		 && (!((longAt(callerFP + FoxSavedFP)) == 0)))) {
			theFP = callerFP;
		}
	}
	else {
		GIV(overflowedPage) = GIV(stackPage);
		GIV(extraFramesToMoveOnOverflow) = 0;
	}
	/* begin ensureCallerContext: */
	callerFP1 = pointerForOop(longAt(theFP + FoxSavedFP));
	if (callerFP1 == 0) {

		/* base frame, context in saved ip slot (or base of stack in Cog) */
		/* begin frameCallerContext: */
		assert(isBaseFrame(theFP));
		/* begin stackPageFor: */
		thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		callerContextOrNil = longAt((thePage->baseAddress));
		assert(addressCouldBeObj(callerContextOrNil));
		assert((callerContextOrNil == (nilObject()))
		 || (isContext(callerContextOrNil)));
		goto l3;
	}
	/* begin ensureFrameIsMarried:SP: */
	if (((((usqInt)(longAt(callerFP1 + FoxMethod)))) < (startOfMemory())
		? ((longAt(callerFP1 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((callerFP1 + FoxIFrameFlags) + 2)) != 0)) {
		assert(isContext(frameContext(callerFP1)));
		longAt(callerFP1 + FoxThisContext);
		goto l3;
	}
	marryFrameSP(callerFP1, (assert(!(isBaseFrame(theFP))),
	(theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord));
	l3:	/* end ensureCallerContext: */;
	/* begin newStackPage */
	lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage);
	if (((lruOrFree->baseFP)) == 0) {
		newPage = lruOrFree;
		goto l1;
	}
	divorceFramesIn(lruOrFree);
	newPage = lruOrFree;
	l1:	/* end newStackPage */;
	moveFramesInthroughtoPage(GIV(stackPage), theFP, newPage);
	/* begin setStackPageAndLimit: */
	assert(newPage != 0);
	GIV(stackPage) = newPage;
	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
	}
	markStackPageMostRecentlyUsed(newPage);
	/* begin setStackPointersFromPage: */
	GIV(stackPointer) = (newPage->headSP);
	GIV(framePointer) = (newPage->headFP);
	assert(validInstructionPointerinFrame(GIV(instructionPointer) + 1, GIV(framePointer)));
	assert((!(frameHasContext(GIV(framePointer))))
	 || (isContext(frameContext(GIV(framePointer)))));
}


/*	The stackPointer is below the stackLimit. This is either because of a
	stack overflow or the setting of stackLimit to indicate a possible
	interrupt. Check for stackOverflow and interrupts anddeal with each
	appropriately. Answer if a context switch occurred. */

	/* StackInterpreter>>#handleStackOverflowOrEventAllowContextSwitch: */
static sqInt NoDbgRegParms
handleStackOverflowOrEventAllowContextSwitch(sqInt mayContextSwitch)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin checkForStackOverflow */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if (GIV(stackPointer) < ((GIV(stackPage)->realStackLimit))) {
		handleStackOverflow();
	}
	if (GIV(stackLimit) == ((GIV(stackPage)->realStackLimit))) {
		return 0;
	}
	return checkForEventsMayContextSwitch(mayContextSwitch);
}


/*	This is a C implementation needed by ioSetMaxExtSemTableSize
	and e.g. stackPageByteSize. */

	/* StackInterpreter>>#highBit: */
sqInt
highBit(usqInt anUnsignedValue)
{
    sqInt bitNo;
    usqInt shifted;


	/* so it shows up in senders... */
	shifted = anUnsignedValue;
	bitNo = 0;
	
#  if BytesPerWord > 4
	if (!(shifted < (1ULL << 32))) {
		shifted = ((usqInt) shifted) >> 32;
		bitNo += 32;
	}
#  endif /* BytesPerWord > 4 */
	if (!(shifted < (1U << 16))) {
		shifted = ((usqInt) shifted) >> 16;
		bitNo += 16;
	}
	if (!(shifted < (1U << 8))) {
		shifted = ((usqInt) shifted) >> 8;
		bitNo += 8;
	}
	if (!(shifted < (1U << 4))) {
		shifted = ((usqInt) shifted) >> 4;
		bitNo += 4;
	}
	if (!(shifted < (1U << 2))) {
		shifted = ((usqInt) shifted) >> 2;
		bitNo += 2;
	}
	if (!(shifted < (1U << 1))) {
		shifted = ((usqInt) shifted) >> 1;
		bitNo += 1;
	}
	return bitNo + shifted;
}


/*	If thePage is the stackPage and the stackPointer and/or the framePointer
	are pointing within it,
	answer if thePage's heapSP and headFP are equal to the stackPointer and
	framePointer respectively.
 */

	/* StackInterpreter>>#ifCurrentStackPageHasValidHeadPointers: */
static sqInt NoDbgRegParms
ifCurrentStackPageHasValidHeadPointers(StackPage *thePage)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (thePage == GIV(stackPage)) {
		if ((((thePage->lastAddress)) < GIV(framePointer))
		 && (GIV(framePointer) < ((thePage->baseAddress)))) {
			if (((thePage->headFP)) != GIV(framePointer)) {
				return 0;
			}
		}
		if ((((thePage->lastAddress)) < GIV(stackPointer))
		 && (GIV(stackPointer) < ((thePage->baseAddress)))) {
			if (((thePage->headSP)) != GIV(stackPointer)) {
				return 0;
			}
		}
	}
	return 1;
}

	/* StackInterpreter>>#iframeMethod: */
static usqInt NoDbgRegParms
iframeMethod(char *theFP)
{
	return longAt(theFP + FoxMethod);
}


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

	/* StackInterpreter>>#includesBehavior:ThatOf: */
sqInt
includesBehaviorThatOf(sqInt aClass, sqInt aSuperclass)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objOop;
    sqInt theClass;

	if (aSuperclass == GIV(nilObj)) {
		return 0;
	}
	theClass = aClass;
	while (1) {
		if (theClass == aSuperclass) {
			return 1;
		}
		if (!(theClass != GIV(nilObj))) break;
		/* begin followField:ofObject: */
		objOop = longAt((theClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop & (tagMask())) == 0)
		 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, theClass, objOop);
		}
		theClass = objOop;
	}
	return 0;
}


/*	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.
 */

	/* StackInterpreter>>#ioFilename:fromString:ofLength:resolveAliases: */
void
ioFilenamefromStringofLengthresolveAliases(char *aCharBuffer, char *aFilenameString, sqInt filenameLength, sqInt aBoolean)
{
	sqGetFilenameFromString(aCharBuffer, aFilenameString, filenameLength, aBoolean);
}


/*	A base frame (first frame in a stack page) is so marked by having a null
	saved fp.
 */

	/* StackInterpreter>>#isBaseFrame: */
static sqInt NoDbgRegParms
isBaseFrame(char *theFP)
{
	return (longAt(theFP + FoxSavedFP)) == 0;
}

	/* StackInterpreter>>#isBooleanObject: */
sqInt
isBooleanObject(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return (oop == GIV(trueObj))
	 || (oop == GIV(falseObj));
}

	/* StackInterpreter>>#isFloatObject: */
sqInt
isFloatObject(sqInt oop)
{
    sqInt tagBits;

	return (((tagBits = oop & (tagMask()))) != 0
		? tagBits == (smallFloatTag())
		: ((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex);
}

	/* StackInterpreter>>#isFrame:onPage: */
static sqInt NoDbgRegParms
isFrameonPage(char *aFrame, StackPage *aPage)
{
    char *prevFP;
    char *theFP;

	assert(!((isFree(aPage))));
	theFP = (aPage->headFP);
	prevFP = theFP - BytesPerWord;
	while (1) {
		if (theFP == aFrame) {
			return 1;
		}
		if (!((theFP > prevFP)
		 && (theFP < ((aPage->baseFP))))) break;
		prevFP = theFP;
		/* begin frameCallerFP: */
		theFP = pointerForOop(longAt(theFP + FoxSavedFP));
	}
	return 0;
}


/*	Answer true if the oop is kind of Integer (Small or Large). */

	/* StackInterpreter>>#isKindOfInteger: */
sqInt
isKindOfInteger(sqInt oop)
{
	return ((((oop) & 7) == 1))
	 || (((oop & (tagMask())) == 0)
	 && ((((usqInt)(((longAt(oop)) & (classIndexMask())) - ClassLargeNegativeIntegerCompactIndex))) <= 1));
}

	/* StackInterpreter>>#isLargeIntegerObject: */
sqInt
isLargeIntegerObject(sqInt oop)
{
	/* begin isLargeIntegerInstance: */
	return ((oop & (tagMask())) == 0)
	 && ((((usqInt)(((longAt(oop)) & (classIndexMask())) - ClassLargeNegativeIntegerCompactIndex))) <= 1);
}

	/* StackInterpreter>>#isLargeNegativeIntegerObject: */
sqInt
isLargeNegativeIntegerObject(sqInt oop)
{
	/* begin isInstanceOfClassLargeNegativeInteger: */
	return ((oop & (tagMask())) == 0)
	 && (((longAt(oop)) & (classIndexMask())) == ClassLargeNegativeIntegerCompactIndex);
}

	/* StackInterpreter>>#isLargePositiveIntegerObject: */
sqInt
isLargePositiveIntegerObject(sqInt oop)
{
	/* begin isInstanceOfClassLargePositiveInteger: */
	return ((oop & (tagMask())) == 0)
	 && (((longAt(oop)) & (classIndexMask())) == ClassLargePositiveIntegerCompactIndex);
}


/*	Answer if the argument, which can be any object, is a live context. */

	/* StackInterpreter>>#isLiveContext: */
static sqInt NoDbgRegParms
isLiveContext(sqInt oop)
{
	assert(!((isOopForwarded(oop))));
	if (!(((oop & (tagMask())) == 0)
		 && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
		return 0;
	}
	if (isNonImmediate(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) {
		return ((((longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord()))))))) & 7) == 1);
	}
	return !(isWidowedContext(oop));
}

	/* StackInterpreter>>#isMarriedOrWidowedContext: */
static sqInt NoDbgRegParms
isMarriedOrWidowedContext(sqInt aContext)
{
	return ((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1);
}


/*	This virtual machine provides two primitives that executes arbitrary
	primitives, one
	for indexed primitivces and one for named primitives. These meta
	primitives are used
	in the debugger to execute primitives while simulating execution. Spur
	needs to know
	the accessor depth for a primitive so that failures due to forwarders can
	be fixed up
	and retried. This method identifies such meta primitives so that
	metaAccessorDepth can be substituted when appropriate. */

	/* StackInterpreter>>#isMetaPrimitiveIndex: */
static sqInt NoDbgRegParms
isMetaPrimitiveIndex(sqInt primIndex)
{
	return (primIndex == PrimNumberDoPrimitive)
	 || (primIndex == PrimNumberDoExternalCall);
}


/*	Answer if the method is an external primtiive call (prim 117) with a null
	external primtiive.
	This is just for an assert in the CoInterpreter. */

	/* StackInterpreter>>#isNullExternalPrimitiveCall: */
static sqInt NoDbgRegParms
isNullExternalPrimitiveCall(sqInt aMethodObj)
{
    sqInt lit;

	if (!(((primitiveIndexOfMethodheader(aMethodObj, methodHeaderOf(aMethodObj))) == PrimNumberExternalCall)
		 && ((literalCountOfMethodHeader(methodHeaderOf(aMethodObj))) > 0))) {
		return 0;
	}
	/* begin fetchPointer:ofObject: */
	lit = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)((0 + LiteralStart)) << (shiftForWord())))));
	return (((lit & (tagMask())) == 0)
	 && (((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
	 && (((numSlotsOf(lit)) == 4)
	 && (((longAt((lit + BaseHeaderSize) + (3U << (shiftForWord())))) == ConstZero)
	 || ((longAt((lit + BaseHeaderSize) + (3U << (shiftForWord())))) == ConstMinusOne)));
}


/*	We save slots in the method cache by using the primitiveFunctionPointer
	to hold either a function pointer or the index of a quick primitive. Since
	quick primitive indices are small they can't be confused with function
	addresses. */

	/* StackInterpreter>>#isPrimitiveFunctionPointerAnIndex */
static sqInt
isPrimitiveFunctionPointerAnIndex(void)
{
	return (((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex;
}

	/* StackInterpreter>>#isQuickPrimitiveIndex: */
sqInt
isQuickPrimitiveIndex(sqInt anInteger)
{
	return ((anInteger >= 256) && (anInteger <= 519));
}


/*	Reading the sender, instructionPointer and stackPointer inst vars of a
	context must take
	account of potentially married contexts and fetch the state from the
	frame. method,
	closureOrNil and receiver can safely be fetched from the context without
	checking. 
 */

	/* StackInterpreter>>#isReadMediatedContextInstVarIndex: */
sqInt
isReadMediatedContextInstVarIndex(sqInt index)
{
	return index <= StackPointerIndex;
}

	/* StackInterpreter>>#isSingleContext: */
static sqInt NoDbgRegParms
isSingleContext(sqInt aContext)
{
    sqInt oop;

	/* begin isNonImmediate: */
	oop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	return (oop & (tagMask())) == 0;
}


/*	Answer if aClosure is a vanilla BlockClosure as in the first Cog release,
	BlockClosure laid out as 
	'outerContext, startpc, numArgs. FullBlockClosure is laid out as
	outerContext, method, numArgs, receiver.
	So either answer true if we're not supporting FullBlockClosure, or test
	the startpc/method field. */

	/* StackInterpreter>>#isVanillaBlockClosure: */
static sqInt NoDbgRegParms
isVanillaBlockClosure(sqInt aClosure)
{
	return ((((longAt((aClosure + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureStartPCIndex) << (shiftForWord()))))))) & 7) == 1);
}


/*	See if the argument is married to a live frame or not. i.e. see if there
	is a matching
	frame whose frameContext field is aOnceMarriedContext, or a forwarder to
	it. If aOnceMarriedContext is not married to a live frame, turn it into a
	bereaved single context.
	This version is for use during scavenging when stack references may be
	forwarded. Following what appear to be references to forwarded objects on
	the stack is dangerous;
	an instruction ponter may be correctly aligned and may point to bytes that
	just happen
	to look like a forwarder. So it is only safe to follow fields that we know
	are frameContext
	fields; hence the stack page is walked to check that aOnceMarriedContext
	is pointing to
	a live frame. This only has to happen during scavenging because after a
	become: all
	frameContext fields have been followed and so there is no need to follow
	forwarders.  */

	/* StackInterpreter>>#isWidowedContextDuringGC: */
static sqInt NoDbgRegParms
isWidowedContextDuringGC(sqInt aOnceMarriedContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt anInteger;
    char *maybeFrame;
    sqInt maybeFrameCtxt;
    sqInt referent;
    sqInt senderOop;
    char *shouldBeFrameCallerField;
    StackPage *thePage;
    sqInt valuePointer;
    sqInt valuePointer1;

	assert((isContext(aOnceMarriedContext))
	 && (isMarriedOrWidowedContext(aOnceMarriedContext)));
	/* begin frameOfMarriedContext: */
	senderOop = longAt((aOnceMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop) & 7) == 1));
	maybeFrame = pointerForOop(senderOop - 1);
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) maybeFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) maybeFrame)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(maybeFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	if (!((isFree(thePage))
		 || (maybeFrame < ((thePage->headFP))))) {

		/* The frame pointer is within the bounds of a live page.
		   Now check if it matches a frame. */
		/* begin withoutSmallIntegerTags: */
		anInteger = longAt((aOnceMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))));
		assert((((anInteger) & 7) == 1));
		shouldBeFrameCallerField = pointerForOop(anInteger - 1);
		if (((pointerForOop(longAt(maybeFrame + FoxSavedFP))) == shouldBeFrameCallerField)
		 && (((((usqInt)(longAt(maybeFrame + FoxMethod)))) < (startOfMemory())
			? ((longAt(maybeFrame + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((maybeFrame + FoxIFrameFlags) + 2)) != 0))) {
			/* begin frameContext: */
			maybeFrameCtxt = longAt(maybeFrame + FoxThisContext);
			if ((isFrameonPage(maybeFrame, thePage))
			 && (((longAt(maybeFrameCtxt)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(maybeFrameCtxt));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((maybeFrameCtxt + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent & (tagMask())) == 0)
				 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				maybeFrameCtxt = referent;
				/* begin setFrameContext:to: */
				longAtput(maybeFrame + FoxThisContext, maybeFrameCtxt);
			}
			if (maybeFrameCtxt == aOnceMarriedContext) {

				/* It is still married! */
				return 0;
			}
		}
	}
	/* begin markContextAsDead: */
	assert(isContext(aOnceMarriedContext));
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = GIV(nilObj);
	assert(!(isOopForwarded(aOnceMarriedContext)));
	longAtput((aOnceMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer1 = GIV(nilObj);
	assert(!(isOopForwarded(aOnceMarriedContext)));
	longAtput((aOnceMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1);
	return 1;
}


/*	See if the argument is married to a live frame or not.
	If it is not, turn it into a bereaved single context. This version is safe
	for use
	only when no frameContext fields may be forwarded (as maybe the case
	when scavenging). Post become: all frameContext fields are followed, and
	hence nrmally no following of frameCOtext fields is necessary. But during
	a scavenge one must use isWidowedContextDuringGC:. */

	/* StackInterpreter>>#isWidowedContext: */
static sqInt NoDbgRegParms
isWidowedContext(sqInt aOnceMarriedContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt anInteger;
    sqInt senderOop;
    char *shouldBeFrameCallerField;
    char *theFrame;
    StackPage *thePage;
    sqInt valuePointer;
    sqInt valuePointer1;

	assert((isContext(aOnceMarriedContext))
	 && (isMarriedOrWidowedContext(aOnceMarriedContext)));
	/* begin frameOfMarriedContext: */
	senderOop = longAt((aOnceMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop) & 7) == 1));
	theFrame = pointerForOop(senderOop - 1);
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFrame)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFrame)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFrame, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	if (!((isFree(thePage))
		 || (theFrame < ((thePage->headFP))))) {

		/* The frame pointer is within the bounds of a live page.
		   Now check if it matches a frame. */
		/* begin withoutSmallIntegerTags: */
		anInteger = longAt((aOnceMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))));
		assert((((anInteger) & 7) == 1));
		shouldBeFrameCallerField = pointerForOop(anInteger - 1);
		if (((pointerForOop(longAt(theFrame + FoxSavedFP))) == shouldBeFrameCallerField)
		 && (((((usqInt)(longAt(theFrame + FoxMethod)))) < (startOfMemory())
			? ((longAt(theFrame + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((theFrame + FoxIFrameFlags) + 2)) != 0))) {
			assert(!(((isFrameonPage(theFrame, thePage))
 && (isForwarded(frameContext(theFrame))))));
			if ((longAt(theFrame + FoxThisContext)) == aOnceMarriedContext) {

				/* It is still married! */
				return 0;
			}
		}
	}
	/* begin markContextAsDead: */
	assert(isContext(aOnceMarriedContext));
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = GIV(nilObj);
	assert(!(isOopForwarded(aOnceMarriedContext)));
	longAtput((aOnceMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer1 = GIV(nilObj);
	assert(!(isOopForwarded(aOnceMarriedContext)));
	longAtput((aOnceMarriedContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1);
	return 1;
}


/*	Wrining any inst vars of a context must take account of potentially
	married contexts
	and set the state in the frame. Inst vars in subclasses don't need
	mediation; subclasses
	can't marry. */

	/* StackInterpreter>>#isWriteMediatedContextInstVarIndex: */
sqInt
isWriteMediatedContextInstVarIndex(sqInt index)
{
	return index <= ReceiverIndex;
}


/*	Support for external primitives. */

	/* StackInterpreter>>#is:KindOfClass: */
sqInt
isKindOfClass(sqInt oop, sqInt aClass)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objOop;
    sqInt oopClass;
    sqInt tagBits;

	/* begin fetchClassOf: */
	oopClass = (((tagBits = oop & (tagMask()))) != 0
		? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))
		: fetchClassOfNonImm(oop));
	while (!(oopClass == GIV(nilObj))) {
		if (oopClass == aClass) {
			return 1;
		}
		/* begin followField:ofObject: */
		objOop = longAt((oopClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop & (tagMask())) == 0)
		 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, oopClass, objOop);
		}
		oopClass = objOop;
	}
	return 0;
}


/*	Support for external primitives. */

	/* StackInterpreter>>#is:KindOf: */
sqInt
isKindOf(sqInt oop, char *className)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objOop;
    sqInt oopClass;
    sqInt tagBits;

	/* begin fetchClassOf: */
	oopClass = (((tagBits = oop & (tagMask()))) != 0
		? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))
		: fetchClassOfNonImm(oop));
	while (!(oopClass == GIV(nilObj))) {
		if (classNameOfIs(oopClass, className)) {
			return 1;
		}
		/* begin followField:ofObject: */
		objOop = longAt((oopClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop & (tagMask())) == 0)
		 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, oopClass, objOop);
		}
		oopClass = objOop;
	}
	return 0;
}


/*	Support for external primitives */

	/* StackInterpreter>>#is:MemberOf: */
sqInt
isMemberOf(sqInt oop, char *className)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oopClass;
    sqInt tagBits;

	/* begin fetchClassOf: */
	oopClass = (((tagBits = oop & (tagMask()))) != 0
		? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))
		: fetchClassOfNonImm(oop));
	return classNameOfIs(oopClass, className);
}

	/* StackInterpreter>>#lengthOfNameOfClass: */
static sqInt NoDbgRegParms
lengthOfNameOfClass(sqInt classOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fmt;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    sqInt objOop;

	/* begin numSlotsOf: */
	assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun()));
	numSlots1 = byteAt(classOop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(classOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (numSlots == GIV(metaclassNumSlots)) {
		return lengthOfNameOfClass(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))));
	}
	if (numSlots <= GIV(classNameIndex)) {
		return 0;
	}
	/* begin lengthOf: */
	objOop = longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(classNameIndex)) << (shiftForWord())))));
	/* begin lengthOf:format: */
	fmt = (((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOfAny: */
	numSlots11 = byteAt(objOop + 7);
	numSlots2 = (numSlots11 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(objOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots11);
	if (fmt <= 5 /* ephemeronFormat */) {
		return numSlots2;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		return (numSlots2 << (shiftForWord())) - (fmt & 7);
	}
	if (fmt >= (firstShortFormat())) {
		return (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3);
	}
	if (fmt >= (firstLongFormat())) {
		return (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1);
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		return numSlots2;
	}
	return 0;
}

	/* StackInterpreter>>#literal:ofMethod: */
sqInt
literalofMethod(sqInt offset, sqInt methodPointer)
{
	/* begin fetchPointer:ofObject: */
	return longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
}


/*	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
 */

	/* StackInterpreter>>#loadBitBltFrom: */
sqInt
loadBitBltFrom(sqInt bb)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    void *fn;

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

	/* StackInterpreter>>#loadInitialContext */
void
loadInitialContext(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeContext;
    sqInt activeProc;
    sqInt objOop;
    sqInt objOop1;

	runLeakCheckerFor(GCModeFull);
	/* begin activeProcess */
	objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	activeProc = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
	/* begin fetchPointer:ofObject: */
	activeContext = longAt((activeProc + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord())))));
	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
}

	/* StackInterpreter>>#longPrintOop: */
void
longPrintOop(sqInt oop)
{
    sqInt byte;
    sqInt bytecodesPerLine;
    sqInt class;
    CogMethod *cogMethod;
    sqInt column;
    unsigned short field16;
    unsigned int field32;
    usqLong field64;
    sqInt fieldOop;
    sqInt fmt;
    sqInt fmt1;
    sqInt fmt2;
    sqInt i;
    sqInt iLimiT;
    sqInt index;
    sqInt lastIndex;
    sqInt len;
    usqInt n;
    usqInt n1;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    sqInt startIP;

	if ((oop & (tagMask()))
	 || ((!(addressCouldBeObj(oop)))
	 || (((oop & (8 /* allocationUnit */ - 1)) != 0)
	 || ((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()))
	 || (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))))) {
		printOop(oop);
		return;
	}
	printHex(oop);
	class = fetchClassOfNonImm(oop);
	if (class == null) {
		print(" has a nil class!!");
	}
	else {
		print(": a(n) ");
		printNameOfClasscount(class, 5);
		print(" (");
		/* begin printHexnp: */
		n = (longAt(oop)) & (classIndexMask());
		printf("0x%" PRIxSQINT "", n);
		print("=>");
		printf("0x%" PRIxSQINT "", class);
		print(")");
	}
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	print(" format ");
	printf("0x%" PRIxSQINT "", fmt);
	if (fmt > 5 /* lastPointerFormat */) {
		print(" nbytes ");
		printNum(numBytesOf(oop));
	}
	else {
		if ((fmt >= 2 /* arrayFormat */)
		 && ((fmt <= (weakArrayFormat()))
		 || (fmt >= (sixtyFourBitIndexableFormat())))) {
			/* begin lengthOf:format: */
			fmt1 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
			/* begin numSlotsOfAny: */
			numSlots1 = byteAt(oop + 7);
			numSlots = (numSlots1 == (numSlotsMask())
				? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
				: numSlots1);
			if (fmt1 <= 5 /* ephemeronFormat */) {
				len = numSlots;
				goto l8;
			}
			if (fmt1 >= (firstByteFormat())) {

				/* bytes, including CompiledMethod */
				len = (numSlots << (shiftForWord())) - (fmt1 & 7);
				goto l8;
			}
			if (fmt1 >= (firstShortFormat())) {
				len = (numSlots << ((shiftForWord()) - 1)) - (fmt1 & 3);
				goto l8;
			}
			if (fmt1 >= (firstLongFormat())) {
				len = (numSlots << ((shiftForWord()) - 2)) - (fmt1 & 1);
				goto l8;
			}
			if (fmt1 == (sixtyFourBitIndexableFormat())) {
				len = numSlots;
				goto l8;
			}
			len = 0;
	l8:	/* end lengthOf:format: */;
			print(" size ");
			printNum(len - (fixedFieldsOfformatlength(oop, fmt, len)));
		}
	}
	printHeaderTypeOf(oop);
	print(" hash ");
	/* begin printHexnp: */
	n1 = (long32At(oop + 4)) & (identityHashHalfWordMask());
	printf("0x%" PRIxSQINT "", n1);
	/* begin cr */
	printf("\n");
	if (((fmt >= (firstByteFormat())) && (fmt <= ((firstCompiledMethodFormat()) - 1)))) {
		printStringOf(oop);
		/* begin cr */
		printf("\n");
		return;
	}
	if (((fmt >= (firstLongFormat())) && (fmt <= ((firstByteFormat()) - 1)))) {
		for (i = 0, iLimiT = (((((((usqInt) (numBytesOf(oop))) >> 2) < 256) ? (((usqInt) (numBytesOf(oop))) >> 2) : 256)) - 1); i <= iLimiT; i += 1) {
			/* begin fetchLong32:ofObject: */
			field32 = ((sqInt) (long32At((oop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << 2))))));
			/* begin space */
			putchar(' ');
			printNum(i);
			/* begin space */
			putchar(' ');
			printHex(field32);
			/* begin space */
			putchar(' ');
			/* begin cr */
			printf("\n");
		}
		return;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		for (i = 0, iLimiT = (((((((usqInt) (numBytesOf(oop))) >> 3) < 256) ? (((usqInt) (numBytesOf(oop))) >> 3) : 256)) - 1); i <= iLimiT; i += 1) {
			/* begin fetchLong64:ofObject: */
			field64 = long64At((oop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << 3))));
			/* begin space */
			putchar(' ');
			printNum(i);
			/* begin space */
			putchar(' ');
			printHex(field64);
			/* begin space */
			putchar(' ');
			/* begin cr */
			printf("\n");
		}
		return;
	}
	if (((fmt >= (firstShortFormat())) && (fmt <= ((firstShortFormat()) + 1)))) {
		for (i = 0, iLimiT = (((((((usqInt) (numBytesOf(oop))) >> 1) < 256) ? (((usqInt) (numBytesOf(oop))) >> 1) : 256)) - 1); i <= iLimiT; i += 1) {
			/* begin fetchShort16:ofObject: */
			field16 = shortAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(i) << 1))));
			/* begin space */
			putchar(' ');
			printNum(i);
			/* begin space */
			putchar(' ');
			printHex(field16);
			/* begin space */
			putchar(' ');
			/* begin cr */
			printf("\n");
		}
		return;
	}
	startIP = (((lastPointerOf(oop)) + BytesPerOop) - BaseHeaderSize) / BytesPerOop;
	lastIndex = ((256 < startIP) ? 256 : startIP);
	if (lastIndex > 0) {
		for (i = 1; i <= lastIndex; i += 1) {
			/* begin fetchPointer:ofObject: */
			fieldOop = longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)((i - 1)) << (shiftForWord())))));
			/* begin space */
			putchar(' ');
			printNum(i - 1);
			/* begin space */
			putchar(' ');
			printHex(fieldOop);
			/* begin space */
			putchar(' ');
			if ((i == 1)
			 && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) {
				/* begin printMethodHeaderOop: */
				if ((assert(((((fieldOop) & 7) == 1))
					 || (((((usqInt)fieldOop)) < (startOfMemory()))
					 && ((((usqInt)fieldOop)) >= (minCogMethodAddress())))),
				(fieldOop & (smallIntegerTag())) == 0)) {
					cogMethod = methodFor(pointerForOop(fieldOop));
					if (cogMethod != 0) {
						printHex(fieldOop);
						/* begin space */
						putchar(' ');
						printDecodeMethodHeaderOop((cogMethod->methodHeader));
						goto l13;
					}
				}
				printDecodeMethodHeaderOop(fieldOop);
				/* return self */
	l13:	/* end printMethodHeaderOop: */;
			}
			else {
				printOopShort(fieldOop);
			}
			/* begin cr */
			printf("\n");
		}
	}
	if (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
		startIP = (startIP * BytesPerWord) + 1;
		/* begin lengthOf:format: */
		fmt2 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
		/* begin numSlotsOfAny: */
		numSlots11 = byteAt(oop + 7);
		numSlots2 = (numSlots11 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots11);
		if (fmt2 <= 5 /* ephemeronFormat */) {
			lastIndex = numSlots2;
			goto l10;
		}
		if (fmt2 >= (firstByteFormat())) {

			/* bytes, including CompiledMethod */
			lastIndex = (numSlots2 << (shiftForWord())) - (fmt2 & 7);
			goto l10;
		}
		if (fmt2 >= (firstShortFormat())) {
			lastIndex = (numSlots2 << ((shiftForWord()) - 1)) - (fmt2 & 3);
			goto l10;
		}
		if (fmt2 >= (firstLongFormat())) {
			lastIndex = (numSlots2 << ((shiftForWord()) - 2)) - (fmt2 & 1);
			goto l10;
		}
		if (fmt2 == (sixtyFourBitIndexableFormat())) {
			lastIndex = numSlots2;
			goto l10;
		}
		lastIndex = 0;
	l10:	/* end lengthOf:format: */;
		if ((lastIndex - startIP) > 100) {
			lastIndex = startIP + 100;
		}
		bytecodesPerLine = 8;
		column = 1;
		for (index = startIP; index <= lastIndex; index += 1) {
			if (column == 1) {
				printf("0x%08" PRIxSQPTR ": ", (usqIntptr_t)(oop+BaseHeaderSize+index-1));
			}
			/* begin fetchByte:ofObject: */
			byte = byteAt((oop + BaseHeaderSize) + (index - 1));
			printf(" %02x/%-3d", (int)byte,(int)byte);
			column += 1;
			if (column > bytecodesPerLine) {
				column = 1;
				/* begin cr */
				printf("\n");
			}
		}
		if (!(column == 1)) {
			/* begin cr */
			printf("\n");
		}
	}
	else {
		if (startIP > lastIndex) {
			print("...");
			/* begin cr */
			printf("\n");
		}
	}
}


/*	Answer the relevant long store temp bytecode, which indicates it has a
	primitive error code.
 */
/*	234		11101010	i i i i i i i i	Store Temporary Variable #iiiiiiii */
/*	129 10000001 jjkkkkkk Store (Receiver Variable, Temporary Location,
	Illegal, Literal Variable) [jj] #kkkkkk */

	/* StackInterpreter>>#longStoreBytecodeForHeader: */
sqInt
longStoreBytecodeForHeader(sqInt methodHeader)
{
	return 
#  if MULTIPLEBYTECODESETS
		((((sqLong) methodHeader)) < 0
				? AltLongStoreBytecode
				: LongStoreBytecode)
#  else /* MULTIPLEBYTECODESETS */
		LongStoreBytecode
#  endif /* MULTIPLEBYTECODESETS */
		;
}


/*	This method implements a simple method lookup cache. If an entry for the
	given selector and classTag is found in the cache, set the values of
	'newMethod' and
	'primitiveFunctionPointer' and answer true. Otherwise, answer false. */

	/* StackInterpreter>>#lookupInMethodCacheSel:classTag: */
static sqInt NoDbgRegParms
lookupInMethodCacheSelclassTag(sqInt selector, sqInt classTag)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt hash;
    sqInt probe;

	/* begin inlineLookupInMethodCacheSel:classTag: */
	hash = selector ^ (((sqInt)((usqInt)(classTag) << 2)));

	/* first probe */
	probe = hash & MethodCacheMask;
	if (((GIV(methodCache)[probe + MethodCacheSelector]) == selector)
	 && ((GIV(methodCache)[probe + MethodCacheClass]) == classTag)) {
		GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod];
		primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction]));
		return 1;
	}

	/* second probe */
	probe = (((usqInt) hash) >> 1) & MethodCacheMask;
	if (((GIV(methodCache)[probe + MethodCacheSelector]) == selector)
	 && ((GIV(methodCache)[probe + MethodCacheClass]) == classTag)) {
		GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod];
		primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction]));
		return 1;
	}
	probe = (((usqInt) hash) >> 2) & MethodCacheMask;
	if (((GIV(methodCache)[probe + MethodCacheSelector]) == selector)
	 && ((GIV(methodCache)[probe + MethodCacheClass]) == classTag)) {
		GIV(newMethod) = GIV(methodCache)[probe + MethodCacheMethod];
		primitiveFunctionPointer = ((void (*)()) (GIV(methodCache)[probe + MethodCachePrimFunction]));
		return 1;
	}
	return 0;
}

	/* StackInterpreter>>#lookupMethodInClass: */
static sqInt NoDbgRegParms
lookupMethodInClass(sqInt class)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt currentClass;
    sqInt dictionary;
    sqInt found;
    sqInt index;
    usqInt length;
    sqInt mask;
    sqInt methodArray;
    sqInt nextSelector;
    usqInt numSlots;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop2;
    sqInt objOop3;
    sqInt objOop4;
    sqInt selector;
    sqInt wrapAround;

	assert(addressCouldBeClassObj(class));
	/* begin lookupBreakFor: */
	if ((breakLookupClassTag != null)
	 && ((class == breakLookupClassTag)
	 || (((long32At(class + 4)) & (identityHashHalfWordMask())) == breakLookupClassTag))) {
		warning("lookup class send break (heartbeat suppressed)");
	}
	currentClass = class;
	while (currentClass != GIV(nilObj)) {
		/* begin followObjField:ofObject: */
		objOop = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(MethodDictionaryIndex) << (shiftForWord())))));
		assert(isNonImmediate(objOop));
		if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			objOop = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop);
		}
		dictionary = objOop;
		if (dictionary == GIV(nilObj)) {

			/* MethodDict pointer is nil (hopefully due a swapped out stub)
			   -- raise exception #cannotInterpret:. */
			createActualMessageTo(class);
			/* begin splObj: */
			GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorCannotInterpret) << (shiftForWord())))));
			/* begin sendBreakpoint:receiver: */
			selector = GIV(messageSelector);
			sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(selector), lengthOfMaybeImmediate(selector), null);
			return lookupMethodInClass(followFieldofObject(SuperclassIndex, currentClass));
		}
		/* begin lookupMethodInDictionary: */
		assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(dictionary + 7);
		length = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(dictionary - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);

		/* Use linear search on small dictionaries; its cheaper.
		   Also the limit can be set to force linear search of all dictionaries, which supports the
		   booting of images that need rehashing (e.g. because a tracer has generated an image
		   with different hashes but hasn't rehashed it yet.) */
		mask = (length - SelectorStart) - 1;
		if (mask <= GIV(methodDictLinearSearchLimit)) {
			index = 0;
			while (index <= mask) {
				/* begin fetchPointer:ofObject: */
				nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)((index + SelectorStart)) << (shiftForWord())))));
				if (((nextSelector & (tagMask())) == 0)
				 && (((longAt(nextSelector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					nextSelector = fixFollowedFieldofObjectwithInitialValue(index + SelectorStart, dictionary, nextSelector);
				}
				if (nextSelector == GIV(messageSelector)) {
					/* begin followObjField:ofObject: */
					objOop4 = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
					assert(isNonImmediate(objOop4));
					if (((longAt(objOop4)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
						objOop4 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop4);
					}
					methodArray = objOop4;
					/* begin followField:ofObject: */
					objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
					if (((objOop11 & (tagMask())) == 0)
					 && (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11);
					}
					GIV(newMethod) = objOop11;
					found = 1;
					goto l18;
				}
				index += 1;
			}
			found = 0;
			goto l18;
		}

		/* It is assumed that there are some nils in this dictionary, and search will
		   stop when one is encountered. However, if there are no nils, then wrapAround
		   will be detected the second time the loop gets to the end of the table. */
		index = SelectorStart + (mask & ((GIV(messageSelector) & (tagMask())
	? (GIV(messageSelector) >> 3)
	: (long32At(GIV(messageSelector) + 4)) & (identityHashHalfWordMask()))));
		wrapAround = 0;
		while (1) {
			/* begin fetchPointer:ofObject: */
			nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
			if (nextSelector == GIV(nilObj)) {
				found = 0;
				goto l18;
			}
			if (((nextSelector & (tagMask())) == 0)
			 && (((longAt(nextSelector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				nextSelector = fixFollowedFieldofObjectwithInitialValue(index + SelectorStart, dictionary, nextSelector);
			}
			if (nextSelector == GIV(messageSelector)) {
				/* begin followObjField:ofObject: */
				objOop2 = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
				assert(isNonImmediate(objOop2));
				if (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					objOop2 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop2);
				}
				methodArray = objOop2;
				/* begin followField:ofObject: */
				objOop3 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
				if (((objOop3 & (tagMask())) == 0)
				 && (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop3 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop3);
				}
				GIV(newMethod) = objOop3;
				found = 1;
				goto l18;
			}
			index += 1;
			if (index == length) {
				if (wrapAround) {
					found = 0;
					goto l18;
				}
				wrapAround = 1;
				index = SelectorStart;
			}
		}
		found = 0;
	l18:	/* end lookupMethodInDictionary: */;
		if (found) {
			return currentClass;
		}
		/* begin followField:ofObject: */
		objOop1 = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop1 & (tagMask())) == 0)
		 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop1);
		}
		currentClass = objOop1;
	}
	if (GIV(messageSelector) == (splObj(SelectorDoesNotUnderstand))) {
		error("Recursive not understood error encountered");
	}
	createActualMessageTo(class);
	/* begin splObj: */
	GIV(messageSelector) = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SelectorDoesNotUnderstand) << (shiftForWord())))));
	sendBreakpointreceiver(GIV(messageSelector) + BaseHeaderSize, lengthOfformat(GIV(messageSelector), (((usqInt) (longAt(GIV(messageSelector)))) >> (formatShift())) & (formatMask())), null);
	return lookupMethodInClass(class);
}


/*	Lookup messageSelector in class. Answer 0 on success. Answer the splObj:
	index for the error selector to use on failure rather than performing MNU
	processing etc. */

	/* StackInterpreter>>#lookupMNUInClass: */
static sqInt NoDbgRegParms
lookupMNUInClass(sqInt class)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt currentClass;
    sqInt dictionary;
    sqInt found;
    sqInt index;
    usqInt length;
    sqInt mask;
    sqInt methodArray;
    sqInt nextSelector;
    usqInt numSlots;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop2;
    sqInt objOop3;
    sqInt objOop4;
    sqInt objOop5;
    sqInt wrapAround;

	/* begin lookupBreakFor: */
	if ((breakLookupClassTag != null)
	 && ((class == breakLookupClassTag)
	 || (((long32At(class + 4)) & (identityHashHalfWordMask())) == breakLookupClassTag))) {
		warning("lookup class send break (heartbeat suppressed)");
	}
	currentClass = class;
	while (currentClass != GIV(nilObj)) {
		/* begin followObjField:ofObject: */
		objOop1 = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(MethodDictionaryIndex) << (shiftForWord())))));
		assert(isNonImmediate(objOop1));
		if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop1);
		}
		dictionary = objOop1;
		if (dictionary == GIV(nilObj)) {
			/* begin followField:ofObject: */
			objOop = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
			if (((objOop & (tagMask())) == 0)
			 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop);
			}
			GIV(lkupClass) = objOop;
			return SelectorCannotInterpret;
		}
		/* begin lookupMethodInDictionary: */
		assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(dictionary + 7);
		length = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(dictionary - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);

		/* Use linear search on small dictionaries; its cheaper.
		   Also the limit can be set to force linear search of all dictionaries, which supports the
		   booting of images that need rehashing (e.g. because a tracer has generated an image
		   with different hashes but hasn't rehashed it yet.) */
		mask = (length - SelectorStart) - 1;
		if (mask <= GIV(methodDictLinearSearchLimit)) {
			index = 0;
			while (index <= mask) {
				/* begin fetchPointer:ofObject: */
				nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)((index + SelectorStart)) << (shiftForWord())))));
				if (((nextSelector & (tagMask())) == 0)
				 && (((longAt(nextSelector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					nextSelector = fixFollowedFieldofObjectwithInitialValue(index + SelectorStart, dictionary, nextSelector);
				}
				if (nextSelector == GIV(messageSelector)) {
					/* begin followObjField:ofObject: */
					objOop4 = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
					assert(isNonImmediate(objOop4));
					if (((longAt(objOop4)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
						objOop4 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop4);
					}
					methodArray = objOop4;
					/* begin followField:ofObject: */
					objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
					if (((objOop11 & (tagMask())) == 0)
					 && (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11);
					}
					GIV(newMethod) = objOop11;
					found = 1;
					goto l16;
				}
				index += 1;
			}
			found = 0;
			goto l16;
		}

		/* It is assumed that there are some nils in this dictionary, and search will
		   stop when one is encountered. However, if there are no nils, then wrapAround
		   will be detected the second time the loop gets to the end of the table. */
		index = SelectorStart + (mask & ((GIV(messageSelector) & (tagMask())
	? (GIV(messageSelector) >> 3)
	: (long32At(GIV(messageSelector) + 4)) & (identityHashHalfWordMask()))));
		wrapAround = 0;
		while (1) {
			/* begin fetchPointer:ofObject: */
			nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
			if (nextSelector == GIV(nilObj)) {
				found = 0;
				goto l16;
			}
			if (((nextSelector & (tagMask())) == 0)
			 && (((longAt(nextSelector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				nextSelector = fixFollowedFieldofObjectwithInitialValue(index + SelectorStart, dictionary, nextSelector);
			}
			if (nextSelector == GIV(messageSelector)) {
				/* begin followObjField:ofObject: */
				objOop2 = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
				assert(isNonImmediate(objOop2));
				if (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					objOop2 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop2);
				}
				methodArray = objOop2;
				/* begin followField:ofObject: */
				objOop3 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
				if (((objOop3 & (tagMask())) == 0)
				 && (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop3 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop3);
				}
				GIV(newMethod) = objOop3;
				found = 1;
				goto l16;
			}
			index += 1;
			if (index == length) {
				if (wrapAround) {
					found = 0;
					goto l16;
				}
				wrapAround = 1;
				index = SelectorStart;
			}
		}
		found = 0;
	l16:	/* end lookupMethodInDictionary: */;
		if (found) {
			addNewMethodToCache(class);
			return 0;
		}
		/* begin followField:ofObject: */
		objOop5 = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop5 & (tagMask())) == 0)
		 && (((longAt(objOop5)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop5 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop5);
		}
		currentClass = objOop5;
	}
	GIV(lkupClass) = class;
	return SelectorDoesNotUnderstand;
}


/*	Lookup messageSelector in class. Answer 0 on success. Answer the splObj:
	index for the error selector to use on failure rather than performing MNU
	processing etc. */

	/* StackInterpreter>>#lookupOrdinaryNoMNUEtcInClass: */
static sqInt NoDbgRegParms
lookupOrdinaryNoMNUEtcInClass(sqInt class)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt currentClass;
    sqInt dictionary;
    sqInt found;
    sqInt index;
    usqInt length;
    sqInt mask;
    sqInt methodArray;
    sqInt nextSelector;
    usqInt numSlots;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop2;
    sqInt objOop3;
    sqInt objOop4;
    sqInt objOop5;
    sqInt wrapAround;

	/* begin lookupBreakFor: */
	if ((breakLookupClassTag != null)
	 && ((class == breakLookupClassTag)
	 || (((long32At(class + 4)) & (identityHashHalfWordMask())) == breakLookupClassTag))) {
		warning("lookup class send break (heartbeat suppressed)");
	}
	currentClass = class;
	while (currentClass != GIV(nilObj)) {
		/* begin followObjField:ofObject: */
		objOop1 = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(MethodDictionaryIndex) << (shiftForWord())))));
		assert(isNonImmediate(objOop1));
		if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			objOop1 = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop1);
		}
		dictionary = objOop1;
		if (dictionary == GIV(nilObj)) {
			/* begin followField:ofObject: */
			objOop = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
			if (((objOop & (tagMask())) == 0)
			 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop);
			}
			GIV(lkupClass) = objOop;
			return SelectorCannotInterpret;
		}
		/* begin lookupMethodInDictionary: */
		assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(dictionary + 7);
		length = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(dictionary - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);

		/* Use linear search on small dictionaries; its cheaper.
		   Also the limit can be set to force linear search of all dictionaries, which supports the
		   booting of images that need rehashing (e.g. because a tracer has generated an image
		   with different hashes but hasn't rehashed it yet.) */
		mask = (length - SelectorStart) - 1;
		if (mask <= GIV(methodDictLinearSearchLimit)) {
			index = 0;
			while (index <= mask) {
				/* begin fetchPointer:ofObject: */
				nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)((index + SelectorStart)) << (shiftForWord())))));
				if (((nextSelector & (tagMask())) == 0)
				 && (((longAt(nextSelector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					nextSelector = fixFollowedFieldofObjectwithInitialValue(index + SelectorStart, dictionary, nextSelector);
				}
				if (nextSelector == GIV(messageSelector)) {
					/* begin followObjField:ofObject: */
					objOop4 = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
					assert(isNonImmediate(objOop4));
					if (((longAt(objOop4)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
						objOop4 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop4);
					}
					methodArray = objOop4;
					/* begin followField:ofObject: */
					objOop11 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
					if (((objOop11 & (tagMask())) == 0)
					 && (((longAt(objOop11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						objOop11 = fixFollowedFieldofObjectwithInitialValue(index, methodArray, objOop11);
					}
					GIV(newMethod) = objOop11;
					found = 1;
					goto l16;
				}
				index += 1;
			}
			found = 0;
			goto l16;
		}

		/* It is assumed that there are some nils in this dictionary, and search will
		   stop when one is encountered. However, if there are no nils, then wrapAround
		   will be detected the second time the loop gets to the end of the table. */
		index = SelectorStart + (mask & ((GIV(messageSelector) & (tagMask())
	? (GIV(messageSelector) >> 3)
	: (long32At(GIV(messageSelector) + 4)) & (identityHashHalfWordMask()))));
		wrapAround = 0;
		while (1) {
			/* begin fetchPointer:ofObject: */
			nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
			if (nextSelector == GIV(nilObj)) {
				found = 0;
				goto l16;
			}
			if (((nextSelector & (tagMask())) == 0)
			 && (((longAt(nextSelector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				nextSelector = fixFollowedFieldofObjectwithInitialValue(index + SelectorStart, dictionary, nextSelector);
			}
			if (nextSelector == GIV(messageSelector)) {
				/* begin followObjField:ofObject: */
				objOop2 = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
				assert(isNonImmediate(objOop2));
				if (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					objOop2 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop2);
				}
				methodArray = objOop2;
				/* begin followField:ofObject: */
				objOop3 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
				if (((objOop3 & (tagMask())) == 0)
				 && (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop3 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop3);
				}
				GIV(newMethod) = objOop3;
				found = 1;
				goto l16;
			}
			index += 1;
			if (index == length) {
				if (wrapAround) {
					found = 0;
					goto l16;
				}
				wrapAround = 1;
				index = SelectorStart;
			}
		}
		found = 0;
	l16:	/* end lookupMethodInDictionary: */;
		if (found) {
			addNewMethodToCache(class);
			return 0;
		}
		/* begin followField:ofObject: */
		objOop5 = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop5 & (tagMask())) == 0)
		 && (((longAt(objOop5)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop5 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop5);
		}
		currentClass = objOop5;
	}
	GIV(lkupClass) = class;
	return SelectorDoesNotUnderstand;
}


/*	Lookup selector in class. Answer the method or nil. This is a debugging
	routine. It does /not/ side-effect lookupClass or newMethod. */

	/* StackInterpreter>>#lookupSelector:inClass: */
sqInt
lookupSelectorinClass(sqInt selector, sqInt class)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt currentClass;
    sqInt dictionary;
    sqInt index;
    usqInt length;
    sqInt mask;
    sqInt meth;
    sqInt methodArray;
    sqInt nextSelector;
    usqInt numSlots;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop2;
    sqInt objOop3;
    sqInt wrapAround;

	currentClass = class;
	while (currentClass != GIV(nilObj)) {
		/* begin followObjField:ofObject: */
		objOop = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(MethodDictionaryIndex) << (shiftForWord())))));
		assert(isNonImmediate(objOop));
		if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
			objOop = fixFollowedFieldofObjectwithInitialValue(MethodDictionaryIndex, currentClass, objOop);
		}
		dictionary = objOop;
		if (dictionary == GIV(nilObj)) {
			return null;
		}
		/* begin lookupMethodFor:InDictionary: */
		assert((classIndexOf(dictionary)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(dictionary + 7);
		length = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(dictionary - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
		mask = (length - SelectorStart) - 1;

		/* It is assumed that there are some nils in this dictionary, and search will
		   stop when one is encountered. However, if there are no nils, then wrapAround
		   will be detected the second time the loop gets to the end of the table. */
		index = SelectorStart + (mask & ((selector & (tagMask())
	? (selector >> 3)
	: (long32At(selector + 4)) & (identityHashHalfWordMask()))));
		wrapAround = 0;
		while (1) {
			/* begin fetchPointer:ofObject: */
			nextSelector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
			if (nextSelector == GIV(nilObj)) {
				meth = null;
				goto l8;
			}
			if (((nextSelector & (tagMask())) == 0)
			 && (((longAt(nextSelector)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				nextSelector = fixFollowedFieldofObjectwithInitialValue(index + SelectorStart, dictionary, nextSelector);
			}
			if (nextSelector == selector) {
				/* begin followObjField:ofObject: */
				objOop2 = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
				assert(isNonImmediate(objOop2));
				if (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					objOop2 = fixFollowedFieldofObjectwithInitialValue(MethodArrayIndex, dictionary, objOop2);
				}
				methodArray = objOop2;
				/* begin followField:ofObject: */
				objOop1 = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
				if (((objOop1 & (tagMask())) == 0)
				 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					objOop1 = fixFollowedFieldofObjectwithInitialValue(index - SelectorStart, methodArray, objOop1);
				}
				meth = objOop1;
				goto l8;
			}
			index += 1;
			if (index == length) {
				if (wrapAround) {
					meth = null;
					goto l8;
				}
				wrapAround = 1;
				index = SelectorStart;
			}
		}
		meth = null;
	l8:	/* end lookupMethodFor:InDictionary: */;
		if (!(meth == null)) {
			return meth;
		}
		/* begin followField:ofObject: */
		objOop3 = longAt((currentClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
		if (((objOop3 & (tagMask())) == 0)
		 && (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop3 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currentClass, objOop3);
		}
		currentClass = objOop3;
	}
	return null;
}


/*	Convert married contexts to widowed contexts, and in the CoInterpreter,
	map any machine code pcs to bytecode pcs, and then nil all slots beyond
	top of stack, so that the context can be resumed on any VM. */

	/* StackInterpreter>>#makeContextSnapshotSafe: */
static void NoDbgRegParms
makeContextSnapshotSafe(sqInt ctxt)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt iLimiT;
    sqInt valuePointer;
    sqInt valuePointer1;
    sqInt valuePointer2;

	assert(isContext(ctxt));
	if (((((longAt((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
		/* begin markContextAsDead: */
		assert(isContext(ctxt));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer2 = GIV(nilObj);
		assert(!(isOopForwarded(ctxt)));
		longAtput((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer2);
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer1 = GIV(nilObj);
		assert(!(isOopForwarded(ctxt)));
		longAtput((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1);
	}
	else {
		ensureContextHasBytecodePC(ctxt);
	}
	for (i = ((fetchStackPointerOf(ctxt)) + CtxtTempFrameStart), iLimiT = ((numSlotsOf(ctxt)) - 1); i <= iLimiT; i += 1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = GIV(nilObj);
		assert(!(isOopForwarded(ctxt)));
		longAtput((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer);
	}
}


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

	/* StackInterpreter>>#makePointwithxValue:yValue: */
usqInt
makePointwithxValueyValue(sqInt xValue, sqInt yValue)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classObj;
    sqInt knownClassIndex;
    usqInt newObj;
    usqInt numBytes;
    sqInt numSlots;
    sqInt objFormat;
    usqInt pointResult;

	/* begin eeInstantiateSmallClass:numSlots: */
	classObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassPoint) << (shiftForWord())))));
	numSlots = YIndex + 1;
	assert((rawHashBitsOf(classObj)) != 0);
	/* begin eeInstantiateSmallClassIndex:format:numSlots: */
	knownClassIndex = (long32At(classObj + 4)) & (identityHashHalfWordMask());
	/* begin instSpecOfClassFormat: */
	objFormat = (((usqInt) (((longAt((classObj + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3))) >> (fixedFieldsFieldWidth())) & (formatMask());
	assert((numSlots >= 0)
	 && ((knownClassIndex != 0)
	 && ((knownClassAtIndex(knownClassIndex)) != GIV(nilObj))));
	assert(((objFormat < (firstByteFormat())
		? objFormat
		: objFormat & (byteFormatMask()))) == (instSpecOfClass(knownClassAtIndex(knownClassIndex))));
	/* begin allocateSmallNewSpaceSlots:format:classIndex: */
	assert(numSlots < (numSlotsMask()));
	newObj = GIV(freeStart);
	numBytes = BaseHeaderSize + ((numSlots < 1
	? 8 /* allocationUnit */
	: numSlots * BytesPerOop));
	assert((numBytes % (allocationUnit())) == 0);
	assert((newObj % (allocationUnit())) == 0);
	if ((GIV(freeStart) + numBytes) > GIV(scavengeThreshold)) {
		if (!GIV(needGCFlag)) {
			/* begin scheduleScavenge */
			GIV(needGCFlag) = 1;
			forceInterruptCheck();
		}
		if ((GIV(freeStart) + numBytes) > (((eden()).limit))) {
			error("no room in eden for allocateSmallNewSpaceSlots:format:classIndex:");
			pointResult = 0;
			goto l3;
		}
	}
	long64Atput(newObj, (((((usqLong) numSlots)) << (numSlotsFullShift())) + (((sqInt)((usqInt)(objFormat) << (formatShift()))))) + knownClassIndex);
	GIV(freeStart) += numBytes;
	pointResult = newObj;
	l3:	/* end eeInstantiateSmallClass:numSlots: */;
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(pointResult)));
	longAtput((pointResult + BaseHeaderSize) + (((sqInt)((usqInt)(XIndex) << (shiftForWord())))), (((usqInt)xValue << 3) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(pointResult)));
	longAtput((pointResult + BaseHeaderSize) + (((sqInt)((usqInt)(YIndex) << (shiftForWord())))), (((usqInt)yValue << 3) | 1));
	return pointResult;
}


/*	Map all oops in the interpreter's state to their new values 
	during garbage collection or a become: operation. */
/*	Assume: All traced variables contain valid oops. */

	/* StackInterpreter>>#mapInterpreterOops */
static void
mapInterpreterOops(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    int mapInstructionPointer;
    usqInt oop;
    sqInt theGCMode;

	mapStackPages();
	/* begin mapMachineCode: */
	theGCMode = GIV(gcMode);
	mapObjectReferencesInMachineCode(theGCMode);
	/* begin mapTraceLogs */
	mapTraceLog();
	mapPrimTraceLog();
	/* begin mapVMRegisters */
	if (shouldRemapObj(GIV(method))) {

		/* i.e. interpreter instructionPointer in method as opposed to machine code? */
		if ((mapInstructionPointer = GIV(instructionPointer) > GIV(method))) {
			GIV(instructionPointer) -= GIV(method);
		}
		GIV(method) = remapObj(GIV(method));
		if (mapInstructionPointer) {
			GIV(instructionPointer) += GIV(method);
		}
	}
	if (((GIV(newMethod) & (tagMask())) == 0)
	 && (shouldRemapObj(GIV(newMethod)))) {

		/* maybe oop due to object-as-method */
		GIV(newMethod) = remapObj(GIV(newMethod));
	}
	/* begin mapProfileState */
	if (shouldRemapObj(GIV(profileProcess))) {
		GIV(profileProcess) = remapObj(GIV(profileProcess));
	}
	if (shouldRemapObj(GIV(profileMethod))) {
		GIV(profileMethod) = remapObj(GIV(profileMethod));
	}
	if (shouldRemapObj(GIV(profileSemaphore))) {
		GIV(profileSemaphore) = remapObj(GIV(profileSemaphore));
	}
	sqLowLevelMFence();
	if (!(GIV(longRunningPrimitiveCheckMethod) == null)) {
		if (GIV(longRunningPrimitiveCheckSequenceNumber) == GIV(statCheckForEvents)) {
			GIV(longRunningPrimitiveCheckMethod) = GIV(newMethod);
		}
		else {
			if (shouldRemapObj(GIV(longRunningPrimitiveCheckMethod))) {
				GIV(longRunningPrimitiveCheckMethod) = remapObj(GIV(longRunningPrimitiveCheckMethod));
			}
		}
		sqLowLevelMFence();
	}
	if (!(GIV(longRunningPrimitiveCheckSemaphore) == null)) {
		if (shouldRemapObj(GIV(longRunningPrimitiveCheckSemaphore))) {
			GIV(longRunningPrimitiveCheckSemaphore) = remapObj(GIV(longRunningPrimitiveCheckSemaphore));
		}
	}
	/* begin remapCallbackState */
	for (i = 1; i <= GIV(jmpDepth); i += 1) {
		oop = GIV(suspendedCallbacks)[i];
		if (((oop & (tagMask())) == 0)
		 && (shouldRemapObj(oop))) {
			GIV(suspendedCallbacks)[i] = (remapObj(oop));
		}
		oop = GIV(suspendedMethods)[i];
		if (shouldRemapObj(oop)) {
			GIV(suspendedMethods)[i] = (remapObj(oop));
		}
	}
	if ((GIV(tempOop) != 0)
	 && (((GIV(tempOop) & (tagMask())) == 0)
	 && (shouldRemapObj(GIV(tempOop))))) {
		GIV(tempOop) = remapObj(GIV(tempOop));
	}
	if ((GIV(tempOop2) != 0)
	 && (((GIV(tempOop2) & (tagMask())) == 0)
	 && (shouldRemapObj(GIV(tempOop2))))) {
		GIV(tempOop2) = remapObj(GIV(tempOop2));
	}
}


/*	GC of pages. Throwing away all stack pages on full GC is simple but
	dangerous because it causes us to allocate lots of contexts immediately
	before a GC.
	Reclaiming pages whose top context is not referenced is poor because it
	would take N incrementalGCs to reclaim N unused pages. Only the page whose
	top context is not referred to by the bottom context of any other page
	would be
	reclaimed. Not until the next GC would the page whose top contect is the
	previously reclaimed page's base frame's bottom context be reclaimed.
	
	Better is to not mark stack pages until their contexts are encountered. We
	can eagerly trace the active page and the page reachable from its bottom
	context if any, and so on. Other pages can be marked when we encounter a
	married context. */

	/* StackInterpreter>>#markAndTraceStackPages: */
static sqInt NoDbgRegParms
markAndTraceStackPages(sqInt fullGCFlag)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    sqInt context;
    sqInt i;
    void *pointer;
    sqInt senderOop;
    char *theFP;
    StackPage *thePage;
    StackPage *thePage2;

	if (!fullGCFlag) {
		for (i = 0; i < GIV(numStackPages); i += 1) {
			/* begin stackPageAt: */
			thePage = stackPageAtpages(i, GIV(pages));
			if (!(isFree(thePage))) {
				markAndTraceStackPage(thePage);
			}
		}
		return null;
	}
	if (GIV(stackPage) == 0) {
		return null;
	}
	thePage = GIV(stackPage);
	do {
		markAndTraceStackPage(thePage);
		/* begin frameCallerContext: */
		theFP = (thePage->baseFP);
		assert(isBaseFrame(theFP));
		/* begin stackPageFor: */
		thePage2 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		callerContextOrNil = longAt((thePage2->baseAddress));
		assert(addressCouldBeObj(callerContextOrNil));
		assert((callerContextOrNil == (nilObject()))
		 || (isContext(callerContextOrNil)));
		context = callerContextOrNil;
		if ((((context & (tagMask())) == 0)
		 && (((longAt(context)) & (classIndexMask())) == ClassMethodContextCompactIndex))
		 && ((((((longAt((context + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && ((((((longAt((context + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(context)))))) {
			/* begin stackPageFor: */
			senderOop = longAt((context + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
			assert((((senderOop) & 7) == 1));
			pointer = pointerForOop(senderOop - 1);
			/* begin stackPageAt: */
			thePage = stackPageAtpages((assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))),
			pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
			assert(!(isFree(thePage)));
		}
	} while(((thePage->trace)) < StackPageTraced);
	return 0;
}


/*	Trace any untraced pages */

	/* StackInterpreter>>#markAndTraceUntracedReachableStackPages */
static void
markAndTraceUntracedReachableStackPages(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt foundToBeTracedPage;
    sqInt i;
    StackPage *thePage;

	do {
		foundToBeTracedPage = 0;
		for (i = 0; i < GIV(numStackPages); i += 1) {
			/* begin stackPageAt: */
			thePage = stackPageAtpages(i, GIV(pages));
			if ((!(isFree(thePage)))
			 && (((thePage->trace)) == StackPageReachedButUntraced)) {
				foundToBeTracedPage = 1;
				markAndTraceStackPage(thePage);
			}
		}
	} while(foundToBeTracedPage);
}


/*	This is a helper for primitiveObjectPointsTo so it *does not* check the
	frameContext field because that is an implicit self-reference not present
	in the state .
 */

	/* StackInterpreter>>#marriedContext:pointsTo:stackDeltaForCurrentFrame: */
static sqInt NoDbgRegParms
marriedContextpointsTostackDeltaForCurrentFrame(sqInt spouseContext, sqInt anOop, sqInt stackDeltaForCurrentFrame)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *rcvrOffset;
    sqInt senderOop;
    char *theFP;
    StackPage *thePage;
    char *theSP;

	/* begin frameOfMarriedContext: */
	senderOop = longAt((spouseContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop) & 7) == 1));
	theFP = pointerForOop(senderOop - 1);
	if (theFP == GIV(framePointer)) {
		theSP = GIV(stackPointer) + (stackDeltaForCurrentFrame * BytesPerWord);
	}
	else {
		/* begin stackPageFor: */
		thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		theSP = findSPOfon(theFP, thePage);
	}
	if ((((anOop) & 7) == 1)) {

		/* Check stack and instruction pointer fields. */
		if ((anOop == ((((((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
	? (((usqInt) ((theFP + FoxMFReceiver) - theSP)) >> (shiftForWord())) + (((mframeCogMethod(theFP))->cmNumArgs))
	: (((usqInt) ((theFP + FoxIFReceiver) - theSP)) >> (shiftForWord())) + (byteAt((theFP + FoxIFrameFlags) + 1)))) << 3) | 1)))
		 || (anOop == (externalInstVarofContext(InstructionPointerIndex, spouseContext)))) {
			return 1;
		}
	}
	else {

		/* Check method and sender fields, avoiding unnecessarily reifying sender context. */
		if (anOop == (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((mframeHomeMethod(theFP))->methodObject)
			: longAt(theFP + FoxMethod)))) {
			return 1;
		}
		if ((longAt(theFP + FoxSavedFP)) == 0) {
			if (anOop == (frameCallerContext(theFP))) {
				return 1;
			}
		}
		else {
			if ((((((usqInt)(longAt((pointerForOop(longAt(theFP + FoxSavedFP))) + FoxMethod)))) < (startOfMemory())
				? ((longAt((pointerForOop(longAt(theFP + FoxSavedFP))) + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
				: (byteAt(((pointerForOop(longAt(theFP + FoxSavedFP))) + FoxIFrameFlags) + 2)) != 0))
			 && (anOop == (longAt((pointerForOop(longAt(theFP + FoxSavedFP))) + FoxThisContext)))) {
				return 1;
			}
		}
	}
	rcvrOffset = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? theFP + FoxMFReceiver
		: theFP + FoxIFReceiver);
	while (theSP <= rcvrOffset) {
		if (anOop == (longAt(theSP))) {
			return 1;
		}
		theSP += BytesPerWord;
	}
	theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
	rcvrOffset = theFP + (frameStackedReceiverOffset(theFP));
	while (theSP <= rcvrOffset) {
		if (anOop == (longAt(theSP))) {
			return 1;
		}
		theSP += BytesPerWord;
	}
	return 0;
}


/*	Establish aContext at the base of a new stackPage, make the stackPage the
	active one and set-up the interreter registers. This is used to boot the
	system and bring it back after a snapshot. */

	/* StackInterpreter>>#marryContextInNewStackPageAndInitializeInterpreterRegisters: */
static void NoDbgRegParms
marryContextInNewStackPageAndInitializeInterpreterRegisters(sqInt aContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aMethodObj;
    StackPage *newPage;
    sqInt top;

	assert(GIV(stackPage) == 0);
	newPage = makeBaseFrameFor(aContext);
	/* begin setStackPageAndLimit: */
	assert(newPage != 0);
	GIV(stackPage) = newPage;
	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
	}
	markStackPageMostRecentlyUsed(newPage);
	/* begin setStackPointersFromPage: */
	GIV(stackPointer) = (newPage->headSP);
	GIV(framePointer) = (newPage->headFP);
	/* begin setMethod: */
	aMethodObj = longAt(((GIV(stackPage)->headFP)) + FoxMethod);
	assert((((usqInt)aMethodObj)) >= (startOfMemory()));
	GIV(method) = aMethodObj;
	assert(isOopCompiledMethod(GIV(method)));
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
}


/*	Marry an unmarried frame. This means creating a spouse context
	initialized with a subset of the frame's state (state through the last
	argument) that references the frame. */

	/* StackInterpreter>>#marryFrame:SP: */
static sqInt NoDbgRegParms
marryFrameSP(char *theFP, char *theSP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt closureOrNil;
    CogMethod *cogMethod;
    sqInt frameNumArgs;
    sqInt frameNumArgs2;
    sqInt i;
    sqInt methodFieldOrObj;
    usqInt numArgs;
    sqInt numSlots;
    sqInt numStack;
    sqInt rcvr;
    sqInt theContext;
    sqInt valuePointer;
    sqInt valuePointer2;

	/* begin marryFrame:SP:copyTemps: */
	assert(!(frameHasContext(theFP)));
	assert(!(isBaseFrame(theFP)));
	assert(addressCouldBeOop(longAt(theSP)));
	/* begin frameMethodField: */
	methodFieldOrObj = longAt(theFP + FoxMethod);
	if ((((usqInt)methodFieldOrObj)) < (startOfMemory())) {

		/* inline (self isMachineCodeFrame: theFP) */
		longAtput(theFP + FoxMethod, methodFieldOrObj + MFMethodFlagHasContextFlag);
		cogMethod = ((CogMethod *) (methodFieldOrObj & MFMethodMask));
		numArgs = (cogMethod->cmNumArgs);
		if (((cogMethod->cmType)) == CMMethod) {
			if ((cogMethod->cpicHasMNUCaseOrCMIsFullBlock)) {
				closureOrNil = longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (numArgs << (shiftForWord()))));
			}
			else {
				closureOrNil = GIV(nilObj);
			}
		}
		else {
			cogMethod = (((((CogBlockMethod *) cogMethod))->cpicHasMNUCaseOrCMIsFullBlock)
				? ((CogMethod *) (((CogBlockMethod *) cogMethod)))
				: ((CogMethod *) ((((usqInt)(((CogBlockMethod *) cogMethod)))) - (((((CogBlockMethod *) cogMethod))->homeOffset)))));
			closureOrNil = longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (numArgs << (shiftForWord()))));
		}
		numSlots = ((((cogMethod->methodHeader)) & LargeContextBit) != 0
			? LargeContextSlots
			: SmallContextSlots);
		methodFieldOrObj = (cogMethod->methodObject);
		rcvr = longAt(theFP + FoxMFReceiver);
		numStack = (((usqInt) ((theFP + FoxMFReceiver) - theSP)) >> (shiftForWord())) + numArgs;
	}
	else {
		/* begin setIFrameHasContext: */
		byteAtput((theFP + FoxIFrameFlags) + 2, 1);
		/* begin iframeNumArgs: */
		numArgs = byteAt((theFP + FoxIFrameFlags) + 1);
		numSlots = (methodHeaderIndicatesLargeFrame(methodHeaderOf(methodFieldOrObj))
			? LargeContextSlots
			: SmallContextSlots);
		if ((byteAt((theFP + FoxIFrameFlags) + 3)) != 0) {
			closureOrNil = longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (numArgs << (shiftForWord()))));
		}
		else {
			closureOrNil = GIV(nilObj);
		}
		/* begin iframeReceiver: */
		rcvr = longAt(theFP + FoxIFReceiver);
		numStack = (((usqInt) ((theFP + FoxIFReceiver) - theSP)) >> (shiftForWord())) + numArgs;
	}
	theContext = allocateNewSpaceSlotsformatclassIndex(numSlots, indexablePointersFormat(), ClassMethodContextCompactIndex);
	/* begin setFrameContext:to: */
	longAtput(theFP + FoxThisContext, theContext);
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(theContext)));
	longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), (assert(((oopForPointer(theFP)) & (BytesPerWord - 1)) == 0),
	(oopForPointer(theFP)) + (smallIntegerTag())));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(((oopForPointer(pointerForOop(longAt(theFP + FoxSavedFP)))) & (BytesPerWord - 1)) == 0);
	valuePointer2 = (oopForPointer(pointerForOop(longAt(theFP + FoxSavedFP)))) + (smallIntegerTag());
	assert(!(isOopForwarded(theContext)));
	longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer2);
	assert(!(isOopForwarded(theContext)));
	longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))), (((usqInt)numStack << 3) | 1));
	assert(!(isOopForwarded(theContext)));
	longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))), methodFieldOrObj);
	assert(!(isOopForwarded(theContext)));
	longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureIndex) << (shiftForWord())))), closureOrNil);
	assert(!(isOopForwarded(theContext)));
	longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)(ReceiverIndex) << (shiftForWord())))), rcvr);
	for (i = 1; i <= numArgs; i += 1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
			valuePointer = ((i - 1) < ((frameNumArgs = ((mframeCogMethod(theFP))->cmNumArgs)))
				? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs - (i - 1)) * BytesPerWord))
				: longAt(((theFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - (i - 1)) * BytesPerWord)));
		}
		else {
			/* begin itemporary:in: */
			valuePointer = ((i - 1) < ((frameNumArgs2 = byteAt((theFP + FoxIFrameFlags) + 1)))
				? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs2 - (i - 1)) * BytesPerWord))
				: longAt(((theFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs2 - (i - 1)) * BytesPerWord)));
		}
		assert(!(isOopForwarded(theContext)));
		longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)((ReceiverIndex + i)) << (shiftForWord())))), valuePointer);
	}
	for (i = (numArgs + 1); i <= numStack; i += 1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(theContext)));
		longAtput((theContext + BaseHeaderSize) + (((sqInt)((usqInt)((ReceiverIndex + i)) << (shiftForWord())))), GIV(nilObj));
	}
	assert(frameHasContext(theFP));
	assert((frameOfMarriedContext(theContext)) == theFP);
	assert((numStack + ReceiverIndex) < (lengthOf(theContext)));
	return theContext;
}


/*	Assert-only check for leaks after external prim calls if checkForLeaks
	includes the GCCheckPrimCall flag.
	This is ionly really useful from a low-level C debugger, hence no
	accessors for checkedPluginName.
 */

	/* StackInterpreter>>#maybeLeakCheckExternalPrimCall: */
static sqInt NoDbgRegParms
maybeLeakCheckExternalPrimCall(sqInt aMethodObj)
{
	if ((checkForLeaks & GCCheckPrimCall)
	 && (((primitiveIndexOfMethodheader(aMethodObj, methodHeaderOf(aMethodObj))) == PrimNumberExternalCall)
	 && (checkedPluginName == (fetchPointerofObject(0, literalofMethod(0, aMethodObj)))))) {
		runLeakCheckerFor(GCCheckPrimCall);
	}
	return 1;
}


/*	Answer the selector of a method, assuming its penultimate literal is
	either a symbol or a pointer object whose first slot references the method
	and whose second slot is a symbol (i.e. an AdditionalMethodState). If a
	Symbol can't be found answer nil. This isn't satisfactory, as it puts a
	lot of information
	into the VM, but it is needed for adequate crash debugging at Cadence.
	With full blocks as of 9/2016 the last literal of a CompiledBlock is a
	back pointer
	to the enclosing block or compiled method. */

	/* StackInterpreter>>#maybeSelectorOfMethod: */
sqInt
maybeSelectorOfMethod(sqInt methodObj)
{
    sqInt maybeSelector;
    sqInt offset;
    sqInt offset1;
    sqInt penultimateLiteral;
    sqInt ultimateLiteral;

	assert(isOopCompiledMethod(methodObj));
	assert(isOopCompiledMethod(methodObj));
	/* begin literal:ofMethod: */
	offset = (literalCountOf(methodObj)) - 1;
	/* begin fetchPointer:ofObject: */
	ultimateLiteral = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
	if (((ultimateLiteral & (tagMask())) == 0)
	 && (((((usqInt) (longAt(ultimateLiteral))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))) {
		return maybeSelectorOfMethod(ultimateLiteral);
	}
	assert(isOopCompiledMethod(methodObj));
	/* begin literal:ofMethod: */
	offset1 = (literalCountOf(methodObj)) - 2;
	/* begin fetchPointer:ofObject: */
	penultimateLiteral = longAt((methodObj + BaseHeaderSize) + (((sqInt)((usqInt)((offset1 + LiteralStart)) << (shiftForWord())))));
	if (((penultimateLiteral & (tagMask())) == 0)
	 && (isPureBitsFormat((((usqInt) (longAt(penultimateLiteral))) >> (formatShift())) & (formatMask())))) {
		return ((fetchClassTagOfNonImm(penultimateLiteral)) == (fetchClassTagOfNonImm(splObj(SelectorDoesNotUnderstand)))
			? penultimateLiteral
			: 0);
	}
	return ((((penultimateLiteral & (tagMask())) == 0)
	 && (((((usqInt) (longAt(penultimateLiteral))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
	 && (((numSlotsOf(penultimateLiteral)) >= 2)
	 && (((longAt((penultimateLiteral + BaseHeaderSize) + (0U << (shiftForWord())))) == methodObj)
	 && (((maybeSelector = longAt((penultimateLiteral + BaseHeaderSize) + (1U << (shiftForWord())))),
	(((maybeSelector & (tagMask())) == 0)
		 && (isPureBitsFormat((((usqInt) (longAt(maybeSelector))) >> (formatShift())) & (formatMask()))))
		 && ((fetchClassTagOfNonImm(maybeSelector)) == (fetchClassTagOfNonImm(splObj(SelectorDoesNotUnderstand))))))))
		? maybeSelector
		: 0);
}

	/* StackInterpreter>>#methodArgumentCount */
sqInt
methodArgumentCount(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(argumentCount);
}

	/* StackInterpreter>>#methodClassAssociationOf: */
sqInt
methodClassAssociationOf(sqInt methodPointer)
{
    sqInt offset;

	/* begin literal:ofMethod: */
	offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1;
	/* begin fetchPointer:ofObject: */
	return longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
}


/*	Answer the method class of a method which is the value of an Association
	in the last literal,
	or answer nil if there isn't one.
	Using a read barrier here simplifies the become implementation and costs
	very little
	because the class index and ValueIndex of the association almost certainly
	share a cache line. */

	/* StackInterpreter>>#methodClassOf: */
sqInt
methodClassOf(sqInt methodPointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt literal;
    sqInt objOop;
    sqInt objOop1;
    sqInt offset;

	/* begin followLiteral:ofMethod: */
	offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1;
	/* begin followField:ofObject: */
	objOop1 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
	if (((objOop1 & (tagMask())) == 0)
	 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop1 = fixFollowedFieldofObjectwithInitialValue(offset + LiteralStart, methodPointer, objOop1);
	}
	literal = objOop1;
	return ((literal != GIV(nilObj))
	 && (((literal & (tagMask())) == 0)
	 && (((((usqInt) (longAt(literal))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
		? (assert((numSlotsOf(literal)) > ValueIndex),
			/* begin followField:ofObject: */
			(objOop = longAt((literal + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))))),
			(((objOop & (tagMask())) == 0)
				 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)
					? (objOop = fixFollowedFieldofObjectwithInitialValue(ValueIndex, literal, objOop))
					: 0),
			objOop)
		: /* begin nilObject */ GIV(nilObj));
}

	/* StackInterpreter>>#methodHeaderIndicatesLargeFrame: */
static sqInt NoDbgRegParms
methodHeaderIndicatesLargeFrame(sqInt methodHeader)
{
	return (methodHeader & LargeContextBit) != 0;
}

	/* StackInterpreter>>#methodPrimitiveIndex */
sqInt
methodPrimitiveIndex(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstBytecode;
    sqInt header;
    sqInt methodHeader;

	if (!((addressCouldBeObj(GIV(newMethod)))
		 && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		return -1;
	}
	/* begin primitiveIndexOfMethod:header: */
	assert(isCompiledMethod(GIV(newMethod)));
	header = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	return (methodHeader & AlternateHeaderHasPrimFlag
		? ((firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize),
			(byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))))
		: 0);
}


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

	/* StackInterpreter>>#methodReturnBool: */
sqInt
methodReturnBool(sqInt boolean)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	/* begin pop:thenPushBool: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (boolean
		? GIV(trueObj)
		: GIV(falseObj)));
	GIV(stackPointer) = sp;
	return 0;
}


/*	Sets the return value for a method. */

	/* StackInterpreter>>#methodReturnFloat: */
sqInt
methodReturnFloat(double aFloat)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt nItems;
    char *sp;

	/* begin pop:thenPushFloat: */
	nItems = GIV(argumentCount) + 1;
	longAtput((sp = GIV(stackPointer) + ((nItems - 1) * BytesPerWord)), floatObjectOf(aFloat));
	GIV(stackPointer) = sp;
	return 0;
}


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

	/* StackInterpreter>>#methodReturnInteger: */
sqInt
methodReturnInteger(sqInt integer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	/* begin pop:thenPushInteger: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)integer << 3) | 1));
	GIV(stackPointer) = sp;
	return 0;
}


/*	Sets the return value for a method */

	/* StackInterpreter>>#methodReturnReceiver */
sqInt
methodReturnReceiver(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	/* begin pop: */
	GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	return 0;
}


/*	Sets the return value for a method. */

	/* StackInterpreter>>#methodReturnString: */
sqInt
methodReturnString(char *aCString)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;
    char *sp;

	/* begin pop:thenPush: */
	oop = stringForCString(aCString);
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
	return 0;
}


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

	/* StackInterpreter>>#methodReturnValue: */
sqInt
methodReturnValue(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

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


/*	A negative header selects the alternate bytecode set. */

	/* StackInterpreter>>#methodUsesAlternateBytecodeSet: */
sqInt
methodUsesAlternateBytecodeSet(sqInt aMethodObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt header;
    sqInt methodHeader;

	/* begin headerIndicatesAlternateBytecodeSet: */
	assert(isCompiledMethod(aMethodObj));
	header = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	return (((sqLong) methodHeader)) < 0;
}


/*	Answer if aMethodObj contains a primitive and uses the primitive error
	code. 
 */

	/* StackInterpreter>>#methodUsesPrimitiveErrorCode: */
static sqInt NoDbgRegParms
methodUsesPrimitiveErrorCode(sqInt aMethodObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstBytecode;
    sqInt header;
    sqInt methodHeader;

	/* begin methodHeaderOf: */
	assert(isCompiledMethod(aMethodObj));
	header = longAt((aMethodObj + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	return (((methodHeader & AlternateHeaderHasPrimFlag
		? (/* begin firstBytecodeOfAlternateHeader:method: */
			(firstBytecode = (aMethodObj + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize),
			(byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))))
		: 0)) > 0)
	 && ((
#  if MULTIPLEBYTECODESETS
		((((sqLong) methodHeader)) < 0
				? AltLongStoreBytecode
				: LongStoreBytecode)
#  else /* MULTIPLEBYTECODESETS */
		LongStoreBytecode
#  endif /* MULTIPLEBYTECODESETS */
		) == (fetchByteofObject((((literalCountOf(aMethodObj)) + LiteralStart) * BytesPerOop) + (3), aMethodObj)));
}


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

	/* StackInterpreter>>#moduleUnloaded: */
EXPORT(void)
moduleUnloaded(char *aModuleName)
{
	if ((strcmp(aModuleName, "SurfacePlugin")) == 0) {

		/* Surface plugin went away. Should never happen. But  then, who knows */
		showSurfaceFn = 0;
	}
}


/*	Brain-damaged nameOfClass: for C VM. Does *not* answer Foo class for
	metaclasses. Use e.g. classIsMeta: to avoid being fooled. */

	/* StackInterpreter>>#nameOfClass: */
static char * NoDbgRegParms
nameOfClass(sqInt classOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt maybeNameOop;
    sqInt maybeThisClassOop;
    usqInt numSlots;
    usqInt numSlots1;

	/* begin numSlotsOf: */
	assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun()));
	numSlots1 = byteAt(classOop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(classOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (numSlots == GIV(metaclassNumSlots)) {
		/* begin fetchPointer:ofObject: */
		maybeThisClassOop = longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord())))));
		if (addressCouldBeClassObj(maybeThisClassOop)) {
			return nameOfClass(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))));
		}
		return "bad class";
	}
	if (!((numSlots > GIV(classNameIndex))
		 && (((maybeNameOop = longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(classNameIndex)) << (shiftForWord())))))),
		((maybeNameOop & (tagMask())) == 0)
			 && (((((usqInt) (longAt(maybeNameOop))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))))) {
		return "bad class";
	}
	return firstIndexableField(maybeNameOop);
}

	/* StackInterpreter>>#noInlineTemporary:in: */
static sqInt NoDbgRegParms
noInlineTemporaryin(sqInt offset, char *theFP)
{
    sqInt frameNumArgs;
    sqInt frameNumArgs1;

	return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? (offset < ((frameNumArgs = ((mframeCogMethod(theFP))->cmNumArgs)))
				? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs - offset) * BytesPerWord))
				: longAt(((theFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - offset) * BytesPerWord)))
		: (offset < ((frameNumArgs1 = byteAt((theFP + FoxIFrameFlags) + 1)))
				? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs1 - offset) * BytesPerWord))
				: longAt(((theFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - offset) * BytesPerWord))));
}

	/* StackInterpreter>>#noInlineTemporary:in:put: */
static sqInt NoDbgRegParms
noInlineTemporaryinput(sqInt offset, char *theFP, sqInt valueOop)
{
    sqInt frameNumArgs;
    sqInt frameNumArgs1;

	return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? longAtput((offset < ((frameNumArgs = ((mframeCogMethod(theFP))->cmNumArgs)))
				? (theFP + FoxCallerSavedIP) + ((frameNumArgs - offset) * BytesPerWord)
				: ((theFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - offset) * BytesPerWord)), valueOop)
		: (offset < ((frameNumArgs1 = byteAt((theFP + FoxIFrameFlags) + 1)))
				? longAtput((theFP + FoxCallerSavedIP) + ((frameNumArgs1 - offset) * BytesPerWord), valueOop)
				: longAtput(((theFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - offset) * BytesPerWord), valueOop)));
}


/*	Answer true if there are no marked contexts on thePage. */

	/* StackInterpreter>>#noMarkedContextsOnPage: */
static sqInt NoDbgRegParms
noMarkedContextsOnPage(StackPage *thePage)
{
    char *theFP;

	assert(!(isFree(thePage)));
	theFP = (thePage->headFP);
	do {
		if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
			: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
			assert(isContext(frameContext(theFP)));
			if (((((usqInt) (longAt(longAt(theFP + FoxThisContext)))) >> (markedBitFullShift())) & 1) != 0) {
				return 0;
			}
		}
	} while(((theFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0);
	return 1;
}


/*	Answer the number of effective pointer fields in the given context. */

	/* StackInterpreter>>#numSlotsOfMarriedContext: */
static sqInt NoDbgRegParms
numSlotsOfMarriedContext(sqInt aContext)
{
    sqInt contextSize;

	contextSize = stackPointerIndexForFrame(frameOfMarriedContext(aContext));
	return CtxtTempFrameStart + contextSize;
}

	/* StackInterpreter>>#numStkPages */
static sqInt
numStkPages(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return GIV(numStackPages);
}


/*	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. 
 */

	/* StackInterpreter>>#objCouldBeClassObj: */
sqInt
objCouldBeClassObj(sqInt objOop)
{
    sqInt fieldOop;

	return (((((usqInt) (longAt(objOop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
	 && (((numSlotsOfAny(objOop)) > InstanceSpecificationIndex)
	 && (((fieldOop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))))),
	((addressCouldBeObj(fieldOop))
		 && ((((((usqInt) (longAt(fieldOop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
		 || ((((fieldOop & (tagMask())) == 0)
		 && (((longAt(fieldOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))
		 && (isPointers(followForwarded(fieldOop))))))
		 && (((fieldOop = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(MethodDictionaryIndex) << (shiftForWord())))))),
		((addressCouldBeObj(fieldOop))
			 && ((((((usqInt) (longAt(fieldOop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
			 || ((((fieldOop & (tagMask())) == 0)
			 && (((longAt(fieldOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))
			 && (isPointers(followForwarded(fieldOop))))))
			 && (((((longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord()))))))) & 7) == 1)))))));
}


/*	This is the entry-point for plugins and primitives that wish to reacquire
	the VM after having
	released it via disownVM or callbacks that want to acquire it without
	knowing their ownership
	status. While this exists for the threaded FFI VM we use it to reset
	newMethod and the
	argumentCount after a callback.
	
	Answer -1 if the current thread is unknown to the VM and fails to take
	ownership. 
 */

	/* StackInterpreter>>#ownVM: */
sqInt
ownVM(sqInt threadIndexAndFlags)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    extern sqInt amInVMThread(void);
    char *sp;

	
#  if COGMTVM
	if (!(amInVMThread())) {
		return -1;
	}
#  endif /* COGMTVM */
	assert((isOopCompiledMethod(GIV(newMethod)))
	 && ((argumentCountOf(GIV(newMethod))) == GIV(argumentCount)));
	if (threadIndexAndFlags & DisownVMForFFICall) {
		GIV(inFFIFlags) = 0;
		return threadIndexAndFlags;
	}
	assert(GIV(primFailCode) == 0);
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
	GIV(stackPointer) = sp;
	return (((usqInt)GIV(argumentCount) << 3) | 1);
}

	/* StackInterpreter>>#penultimateLiteralOf: */
sqInt
penultimateLiteralOf(sqInt aMethodOop)
{
    sqInt offset;

	assert(isOopCompiledMethod(aMethodOop));
	/* begin literal:ofMethod: */
	offset = (literalCountOfMethodHeader(methodHeaderOf(aMethodOop))) - 2;
	/* begin fetchPointer:ofObject: */
	return longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
}


/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#popStack */
sqInt
popStack(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt top;

	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	return top;
}


/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#pop: */
sqInt
pop(sqInt nItems)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(stackPointer) += nItems * BytesPerWord;
	return null;
}


/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#pop:thenPush: */
void
popthenPush(sqInt nItems, sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	longAtput((sp = GIV(stackPointer) + ((nItems - 1) * BytesPerWord)), oop);
	GIV(stackPointer) = sp;
}

	/* StackInterpreter>>#positiveMachineIntegerFor: */
static sqInt NoDbgRegParms
positiveMachineIntegerFor(usqIntptr_t value)
{
    sqInt resultObj;

	resultObj = positive64BitIntegerFor(value);
	return resultObj;
}


/*	Update the displayBits after a GC may have moved it.
	Answer if the displayBits appear valid */

	/* StackInterpreter>>#postGCUpdateDisplayBits */
static sqInt
postGCUpdateDisplayBits(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    void * bitsNow;
    sqInt bitsOop;
    sqInt displayObj;

	/* begin splObj: */
	displayObj = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheDisplay) << (shiftForWord())))));
	if (!((((displayObj & (tagMask())) == 0)
		 && (((((usqInt) (longAt(displayObj))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
		 && (((lengthOfformat(displayObj, (((usqInt) (longAt(displayObj))) >> (formatShift())) & (formatMask()))) >= 4)
		 && (isWordsOrBytes((bitsOop = longAt((displayObj + BaseHeaderSize) + (0U << (shiftForWord()))))))))) {
		return 0;
	}
	if (!(((((usqInt) (longAt(bitsOop))) >> (pinnedBitShift())) & 1) != 0)) {
		bitsNow = firstIndexableField(bitsOop);
		if (displayBits != bitsNow) {
			displayBits = bitsNow;
			ioNoteDisplayChangedwidthheightdepth(displayBits, displayWidth, displayHeight, displayDepth);
		}
	}
	return 1;
}


/*	With 0 args answers whether ioProcessEvents is enabled and being called.
	With 1 arg expects a boolean which will enable ioProcessEvents if true and
	disable it if false, answering its previous state. */

	/* StackInterpreter>>#primitiveEventProcessingControl */
EXPORT(void)
primitiveEventProcessingControl(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    int enabled;
    char *sp;
    char *sp1;

	enabled = inIOProcessEvents >= 0;
	if (GIV(argumentCount) == 0) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (enabled
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp;
		return;
	}
	if (GIV(argumentCount) == 1) {
		if ((longAt(GIV(stackPointer))) == GIV(trueObj)) {
			if (inIOProcessEvents < 0) {
				inIOProcessEvents = 0;
			}
		}
		else {
			if ((longAt(GIV(stackPointer))) == GIV(falseObj)) {
				inIOProcessEvents = -1;
			}
			else {
				/* begin primitiveFailFor: */
				GIV(primFailCode) = PrimErrBadArgument;
				return;
			}
		}
		/* begin pop:thenPushBool: */
		longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (enabled
			? GIV(trueObj)
			: GIV(falseObj)));
		GIV(stackPointer) = sp1;
		return;
	}
	/* begin primitiveFailFor: */
	GIV(primFailCode) = PrimErrBadNumArgs;
}


/*	Note: With the Squeak V3 format 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 derived primitive function pointer is stored in the
	method cache. With the
	Spur format we assume a 3-byte CallPrimitive with a little-endian 16-bit
	primitive index. */

	/* StackInterpreter>>#primitiveIndexOfMethod:header: */
sqInt
primitiveIndexOfMethodheader(sqInt theMethod, sqInt methodHeader)
{
    sqInt firstBytecode;

	return (methodHeader & AlternateHeaderHasPrimFlag
		? ((firstBytecode = (theMethod + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize),
			(byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))))
		: 0);
}

	/* StackInterpreter>>#primitiveIndexOf: */
sqInt
primitiveIndexOf(sqInt methodPointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstBytecode;
    sqInt header;
    sqInt methodHeader;

	/* begin primitiveIndexOfMethod:header: */
	assert(isCompiledMethod(methodPointer));
	header = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	return (methodHeader & AlternateHeaderHasPrimFlag
		? ((firstBytecode = (methodPointer + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize),
			(byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))))
		: 0);
}

	/* StackInterpreter>>#printActivationNameForSelector:startClass: */
static void NoDbgRegParms
printActivationNameForSelectorstartClass(sqInt aSelector, sqInt startClass)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classDict;
    usqInt classDictSize;
    sqInt currClass;
    sqInt i;
    sqInt methClass;
    usqInt numSlots;
    sqInt objOop;

	if (addressCouldBeObj(startClass)) {
		/* begin findClassForSelector:lookupClass:do: */
		currClass = startClass;
		do {
			/* begin fetchPointer:ofObject: */
			classDict = longAt((currClass + BaseHeaderSize) + (((sqInt)((usqInt)(MethodDictionaryIndex) << (shiftForWord())))));
			/* begin numSlotsOf: */
			assert((classIndexOf(classDict)) > (isForwardedObjectClassIndexPun()));
			numSlots = byteAt(classDict + 7);
			classDictSize = (numSlots == (numSlotsMask())
				? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(classDict - BaseHeaderSize))) << 8)))))) >> 8
				: numSlots);
			i = SelectorStart;
			while (i < classDictSize) {
				if (aSelector == (longAt((classDict + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord()))))))) {
					methClass = currClass;
					goto l5;
				}
				i += 1;
			}
			/* begin followField:ofObject: */
			objOop = longAt((currClass + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
			if (((objOop & (tagMask())) == 0)
			 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, currClass, objOop);
			}
			currClass = objOop;
		} while(!(currClass == GIV(nilObj)));
		methClass = null;
	l5:	/* end findClassForSelector:lookupClass:do: */;
		if ((methClass == null)
		 || (startClass == methClass)) {
			printNameOfClasscount(methClass, 5);
			/* begin printChar: */
			putchar('>');
			if (!(methClass)) {
				printStringOf(splObj(SelectorDoesNotUnderstand));
				print(" ");
			}
		}
		else {
			printNameOfClasscount(startClass, 5);
			/* begin printChar: */
			putchar('(');
			printNameOfClasscount(methClass, 5);
			/* begin printChar: */
			putchar(')');
			/* begin printChar: */
			putchar('>');
		}
	}
	else {
		print("INVALID CLASS");
	}
	if ((aSelector & (tagMask()))
	 || (addressCouldBeObj(aSelector))) {
		if (((aSelector & (tagMask())) == 0)
		 && (((((usqInt) (longAt(aSelector))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()))) {
			printStringOf(aSelector);
		}
		else {
			printOopShort(aSelector);
		}
	}
	else {
		print("INVALID SELECTOR");
	}
}

	/* StackInterpreter>>#printActivationNameFor:receiver:isBlock:firstTemporary: */
static void NoDbgRegParms
printActivationNameForreceiverisBlockfirstTemporary(sqInt aMethod, sqInt anObject, sqInt isBlock, sqInt maybeMessage)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt classObj;
    sqInt methClass;
    sqInt methodSel;
    sqInt rclass;
    sqInt tagBits;
    sqInt tagBits1;

	if (isBlock) {
		print("[] in ");
	}
	/* begin findClassOfMethod:forReceiver: */
	if (((anObject & (tagMask()))
	 || (addressCouldBeObj(anObject)))
	 && (!(((anObject & (tagMask())) == 0)
	 && (((longAt(anObject)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)))) {
		rclass = findClassContainingMethodstartingAt(aMethod, (((tagBits1 = anObject & (tagMask()))) != 0
			? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits1) << (shiftForWord())))))
			: fetchClassOfNonImm(anObject)));
		if (rclass != GIV(nilObj)) {
			methClass = rclass;
			goto l2;
		}
	}
	if (!((addressCouldBeObj(aMethod))
		 && (((((usqInt) (longAt(aMethod))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		/* begin nilObject */
		methClass = GIV(nilObj);
		goto l2;
	}
	methClass = findClassContainingMethodstartingAt(aMethod, safeMethodClassOf(aMethod));
	l2:	/* end findClassOfMethod:forReceiver: */;
	methodSel = findSelectorOfMethod(aMethod);
	if (((anObject & (tagMask()))
	 || (addressCouldBeObj(anObject)))
	 && ((!(((anObject & (tagMask())) == 0)
	 && (((longAt(anObject)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)))
	 && (addressCouldBeClassObj((classObj = (((tagBits = anObject & (tagMask()))) != 0
		? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))
		: fetchClassOfNonImm(anObject))))))) {
		if ((classObj == methClass)
		 || ((methClass == null)
		 || (methClass == GIV(nilObj)))) {
			printNameOfClasscount(classObj, 5);
		}
		else {
			printNameOfClasscount(classObj, 5);
			print("(");
			printNameOfClasscount(methClass, 5);
			print(")");
		}
	}
	else {
		print("INVALID RECEIVER");
	}
	print(">");
	if ((methodSel & (tagMask()))
	 || (addressCouldBeObj(methodSel))) {
		if (methodSel == GIV(nilObj)) {
			print("(nil)");
		}
		else {
			printStringOf(methodSel);
		}
	}
	else {
		print("INVALID SELECTOR");
	}
	if ((methodSel == (splObj(SelectorDoesNotUnderstand)))
	 && ((addressCouldBeObj(maybeMessage))
	 && ((fetchClassOfNonImm(maybeMessage)) == (splObj(ClassMessage))))) {

		/* print arg message selector */
		/* begin fetchPointer:ofObject: */
		methodSel = longAt((maybeMessage + BaseHeaderSize) + (((sqInt)((usqInt)(MessageSelectorIndex) << (shiftForWord())))));
		print(" ");
		printStringOf(methodSel);
	}
}


/*	Print all the stacks of all running processes, including those that are
	currently suspended.
 */

	/* StackInterpreter>>#printAllStacks */
void
printAllStacks(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt classIdx;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    sqInt mutexClass;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots2;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop2;
    sqInt objOop3;
    sqInt objOop4;
    usqInt p;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt pri;
    sqInt proc;
    sqInt processList;
    sqInt schedLists;
    sqInt semaphoreClass;
    sqInt tagBits;

	/* begin activeProcess */
	objOop2 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	objOop = longAt((objOop2 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	proc = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
	printNameOfClasscount((((tagBits = proc & (tagMask()))) != 0
		? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))
		: fetchClassOfNonImm(proc)), 5);
	/* begin space */
	putchar(' ');
	printHex(proc);
	print(" priority ");
	printNum(quickFetchIntegerofObject(PriorityIndex, proc));
	/* begin cr */
	printf("\n");
	printCallStackFP(GIV(framePointer));
	/* begin fetchPointer:ofObject: */
	objOop3 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	objOop1 = longAt((objOop3 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	schedLists = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ProcessListsIndex) << (shiftForWord())))));
	if (GIV(highestRunnableProcessPriority) == 0) {
		/* begin numSlotsOf: */
		assert((classIndexOf(schedLists)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(schedLists + 7);
		p = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(schedLists - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
	}
	else {
		p = GIV(highestRunnableProcessPriority);
	}
	for (pri = (p - 1); pri >= 0; pri += -1) {
		/* begin fetchPointer:ofObject: */
		processList = longAt((schedLists + BaseHeaderSize) + (((sqInt)((usqInt)(pri) << (shiftForWord())))));
		if (!((assert(!(isForwarded(processList))),
			(longAt((processList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))))) == GIV(nilObj)))) {
			/* begin cr */
			printf("\n");
			print("processes at priority ");
			printNum(pri + 1);
			printProcsOnList(processList);
		}
	}
	/* begin cr */
	printf("\n");
	print("suspended processes");
	/* begin fetchPointer:ofObject: */
	semaphoreClass = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord())))));
	/* begin fetchPointer:ofObject: */
	mutexClass = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassMutex) << (shiftForWord())))));
	assert((rawHashBitsOf(semaphoreClass)) != 0);
	semaphoreClass = (long32At(semaphoreClass + 4)) & (identityHashHalfWordMask());
	assert((rawHashBitsOf(mutexClass)) != 0);
	mutexClass = (long32At(mutexClass + 4)) & (identityHashHalfWordMask());
	/* begin allHeapEntitiesDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		/* begin classIndexOf: */
		classIdx = (longAt(objOop11)) & (classIndexMask());
		if ((classIdx == semaphoreClass)
		 || (classIdx == mutexClass)) {
			printProcsOnList(objOop11);
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l12;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l12:	/* end objectAfter:limit: */;
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots2 = byteAt(address + 7);
	objOop4 = (numSlots2 == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop4, limit)) {
		/* begin classIndexOf: */
		classIdx = (longAt(objOop4)) & (classIndexMask());
		if ((classIdx == semaphoreClass)
		 || (classIdx == mutexClass)) {
			printProcsOnList(objOop4);
		}
		prevPrevObj = prevObj;
		prevObj = objOop4;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop4);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop4 = limit;
			goto l14;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop4 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l14:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop4 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop4, GIV(freeStart))) {
		/* begin classIndexOf: */
		classIdx = (longAt(objOop4)) & (classIndexMask());
		if ((classIdx == semaphoreClass)
		 || (classIdx == mutexClass)) {
			printProcsOnList(objOop4);
		}
		prevPrevObj = prevObj;
		prevObj = objOop4;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop4);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop4 = GIV(freeStart);
			goto l16;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop4 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l16:	/* end objectAfter:limit: */;
	}
	
}

	/* StackInterpreter>>#printCallStack */
void
printCallStack(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (GIV(framePointer) == null) {
		printCallStackOf(fetchPointerofObject(SuspendedContextIndex, activeProcess()));
	}
	else {
		printCallStackFP(GIV(framePointer));
	}
}

	/* StackInterpreter>>#printCallStackFP: */
static sqInt NoDbgRegParms
printCallStackFP(char *theFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt context;

	context = shortReversePrintFrameAndCallers(theFP);
	while (!(context == GIV(nilObj))) {
		if (((((longAt((context + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
			if (!(checkIsStillMarriedContextcurrentFP(context, GIV(framePointer)))) {
				shortPrintContext(context);
				return null;
			}
			context = shortReversePrintFrameAndCallers(frameOfMarriedContext(context));
		}
		else {
			context = printContextCallStackOf(context);
		}
	}
	return 0;
}

	/* StackInterpreter>>#printCallStackOf: */
sqInt
printCallStackOf(sqInt aContextOrProcessOrFrame)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt context;

	if ((((((usqInt)aContextOrProcessOrFrame)) & (BytesPerWord - 1)) == 0)
	 && ((((((usqInt)aContextOrProcessOrFrame)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)aContextOrProcessOrFrame)) <= (((usqInt)GIV(pages))))))) {
		return printCallStackFP(((char *) aContextOrProcessOrFrame));
	}
	if (couldBeProcess(aContextOrProcessOrFrame)) {
		return printCallStackOf(longAt((aContextOrProcessOrFrame + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord()))))));
	}
	context = aContextOrProcessOrFrame;
	while (!(context == GIV(nilObj))) {
		if (((((longAt((context + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
			if (!(checkIsStillMarriedContextcurrentFP(context, GIV(framePointer)))) {
				shortPrintContext(context);
				return null;
			}
			context = shortReversePrintFrameAndCallers(frameOfMarriedContext(context));
		}
		else {
			context = printContextCallStackOf(context);
		}
	}
	return 0;
}

	/* StackInterpreter>>#printCallStackOf:currentFP: */
static sqInt NoDbgRegParms
printCallStackOfcurrentFP(sqInt aContext, char *currFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    sqInt ctxt;
    sqInt referent;
    sqInt senderOop;
    char *theFP;
    StackPage *thePage;
    StackPage *thePage1;

	ctxt = aContext;
	while (!(ctxt == GIV(nilObj))) {
		if (((((longAt((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
			/* begin frameOfMarriedContext: */
			senderOop = longAt((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
			assert((((senderOop) & 7) == 1));
			theFP = pointerForOop(senderOop - 1);
			if (checkIsStillMarriedContextcurrentFP(ctxt, currFP)) {
				/* begin stackPageFor: */
				thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
				pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
				if (isFree(thePage)) {
					/* begin printHexPtr: */
					printHex(oopForPointer(theFP));
					print(" is on a free page?!");
					/* begin cr */
					printf("\n");
					return null;
				}
				shortPrintFrameAndCallers(theFP);
				theFP = (thePage->baseFP);
				/* begin frameCallerContext: */
				assert(isBaseFrame(theFP));
				/* begin stackPageFor: */
				thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
				pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
				callerContextOrNil = longAt((thePage1->baseAddress));
				assert(addressCouldBeObj(callerContextOrNil));
				assert((callerContextOrNil == (nilObject()))
				 || (isContext(callerContextOrNil)));
				ctxt = callerContextOrNil;
				if (((longAt(ctxt)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					/* begin followForwarded: */
					assert(isUnambiguouslyForwarder(ctxt));
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((ctxt + BaseHeaderSize) + (0U << (shiftForWord())));
					while (((referent & (tagMask())) == 0)
					 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
					}
					ctxt = referent;
				}
			}
			else {
				print("widowed caller frame ");
				/* begin printHexPtr: */
				printHex(oopForPointer(theFP));
				/* begin cr */
				printf("\n");
				return null;
			}
		}
		else {
			shortPrintContext(ctxt);
			/* begin fetchPointer:ofObject: */
			ctxt = longAt((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		}
	}
	return 0;
}


/*	For testing in Smalltalk, this method should be overridden in a subclass. */

	/* StackInterpreter>>#printChar: */
void
printChar(sqInt aByte)
{
	putchar(aByte);
}


/*	Print the call stack of aContext until it links to a frame. */

	/* StackInterpreter>>#printContextCallStackOf: */
static sqInt NoDbgRegParms
printContextCallStackOf(sqInt aContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ctxt;

	ctxt = aContext;
	while (!((ctxt == GIV(nilObj))
	 || (((((longAt((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)))) {
		shortPrintContext(ctxt);
		/* begin fetchPointer:ofObject: */
		ctxt = longAt((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	}
	return ctxt;
}

	/* StackInterpreter>>#printContext: */
void
printContext(sqInt aContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt ip;
    sqInt meth;
    usqInt n;
    usqInt n1;
    sqInt sender;
    sqInt sp;

	shortPrintContext(aContext);
	/* begin fetchPointer:ofObject: */
	sender = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	/* begin fetchPointer:ofObject: */
	ip = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))));
	if ((((sender) & 7) == 1)) {
		if (checkIsStillMarriedContextcurrentFP(aContext, GIV(framePointer))) {
			print("married (assuming framePointer valid)");
			/* begin cr */
			printf("\n");
		}
		else {
			print("widowed (assuming framePointer valid)");
			/* begin cr */
			printf("\n");
		}
		print("sender   ");
		printNum(sender);
		print(" (");
		/* begin printHexPtr: */
		printHex(oopForPointer((assert((((sender) & 7) == 1)),
		pointerForOop(sender - 1))));
		/* begin printChar: */
		putchar(')');
		/* begin cr */
		printf("\n");
		print("ip       ");
		printNum(ip);
		print(" (");
		/* begin printHexPtr: */
		printHex(oopForPointer((assert((((ip) & 7) == 1)),
		pointerForOop(ip - 1))));
		/* begin printChar: */
		putchar(')');
		/* begin cr */
		printf("\n");
	}
	else {
		print("sender   ");
		shortPrintOop(sender);
		print("ip       ");
		if (ip == GIV(nilObj)) {
			shortPrintOop(ip);
		}
		else {
			printNum(ip);
			print(" (");
			printNum((ip >> 3));
			/* begin space */
			putchar(' ');
			printHex((ip >> 3));
			/* begin printChar: */
			putchar(')');
			/* begin cr */
			printf("\n");
		}
	}
	/* begin fetchPointer:ofObject: */
	sp = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
	sp = ((sp < ((lengthOfformat(aContext, (((usqInt) (longAt(aContext))) >> (formatShift())) & (formatMask()))) - ReceiverIndex)) ? sp : ((lengthOfformat(aContext, (((usqInt) (longAt(aContext))) >> (formatShift())) & (formatMask()))) - ReceiverIndex));
	print("sp       ");
	printNum(sp);
	print(" (");
	printNum((sp >> 3));
	/* begin printChar: */
	putchar(')');
	/* begin cr */
	printf("\n");
	print("method   ");
	/* begin printMethodFieldForPrintContext: */
	meth = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
	if (((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
		if ((assert(isNonImmediate(meth)),
		isCogMethodReference(longAt((meth + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
			/* begin printHexnp: */
			n = ((usqInt) (cogMethodOf(meth)));
			printf("0x%" PRIxSQINT "", n);
			/* begin space */
			putchar(' ');
		}
		shortPrintOop(meth);
	}
	else {
		shortPrintOop(meth);
		if ((assert(isNonImmediate(meth)),
		isCogMethodReference(longAt((meth + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))))))) {
			/* begin space */
			putchar(' ');
			/* begin printHexnp: */
			n1 = ((usqInt) (cogMethodOf(meth)));
			printf("0x%" PRIxSQINT "", n1);
		}
	}
	print("closure  ");
	shortPrintOop(longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(ClosureIndex) << (shiftForWord()))))));
	print("receiver ");
	shortPrintOop(longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(ReceiverIndex) << (shiftForWord()))))));
	sp = (sp >> 3);
	for (i = 1; i <= sp; i += 1) {
		print("       ");
		printNum(i);
		/* begin space */
		putchar(' ');
		shortPrintOop(longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)((ReceiverIndex + i)) << (shiftForWord()))))));
	}
}

	/* StackInterpreter>>#printDecodeMethodHeaderOop: */
static void NoDbgRegParms
printDecodeMethodHeaderOop(sqInt methodHeaderOop)
{
	printOopShort(methodHeaderOop);
	if ((/* begin alternateHeaderHasPrimitiveFlag: */
	methodHeaderOop & AlternateHeaderHasPrimFlag)) {
		print(" hasPrim");
	}
	if ((methodHeaderOop & LargeContextBit) != 0) {
		print(" largeFrame");
	}
	if (((methodHeaderOop >> 3)) < 0) {
		print(" altSet");
	}
	print(" nLits ");
	printNum((assert((((methodHeaderOop) & 7) == 1)),
	((methodHeaderOop >> 3)) & AlternateHeaderNumLiteralsMask));
	print(" nArgs ");
	printNum((((usqInt) methodHeaderOop) >> MethodHeaderArgCountShift) & 15);
	print(" nTemps ");
	printNum((((usqInt) methodHeaderOop) >> MethodHeaderTempCountShift) & 0x3F);
}

	/* StackInterpreter>>#printExternalHeadFrame */
void
printExternalHeadFrame(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	printFrameWithSP(GIV(framePointer), GIV(stackPointer));
}

	/* StackInterpreter>>#printFrameAndCallers:SP:short: */
static sqInt NoDbgRegParms
printFrameAndCallersSPshort(char *theFP, char *theSP, sqInt printShort)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
		 && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
		return null;
	}
	if (!((longAt(theFP + FoxSavedFP)) == 0)) {
		printFrameAndCallersSPshort(pointerForOop(longAt(theFP + FoxSavedFP)), (assert(!(isBaseFrame(theFP))),
		(theFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
	? ((mframeCogMethod(theFP))->cmNumArgs)
	: byteAt((theFP + FoxIFrameFlags) + 1))))) + BytesPerWord), printShort);
	}
	if (printShort) {
		shortPrintFrame(theFP);
		return null;
	}
	/* begin cr */
	printf("\n");
	printFrameWithSP(theFP, theSP);
	return 0;
}

	/* StackInterpreter>>#printFrameOop:at: */
static void NoDbgRegParms
printFrameOopat(char *name, char *address)
{
    sqInt i;
    sqInt iLimiT;
    sqInt it;

	it = longAt(address);
	/* begin printHexPtr: */
	printHex(oopForPointer(address));
	/* begin printChar: */
	putchar(':');
	for (i = 1, iLimiT = (12 - (strlen(name))); i <= iLimiT; i += 1) {
		/* begin printChar: */
		putchar(' ');
	}
	print(name);
	print(": ");
	printHex(it);
	/* begin tab */
	putchar('	');
	/* begin printChar: */
	putchar('=');
	printOopShort(it);
	/* begin cr */
	printf("\n");
}

	/* StackInterpreter>>#printFrameOop:index:at: */
static void NoDbgRegParms
printFrameOopindexat(char *name, sqInt idx, char *address)
{
    sqInt i;
    sqInt iLimiT;
    sqInt it;

	it = longAt(address);
	/* begin printHexPtr: */
	printHex(oopForPointer(address));
	/* begin printChar: */
	putchar(':');
	for (i = 1, iLimiT = ((11 - (strlen(name))) - (floor(log10(((idx < 1) ? 1 : idx))))); i <= iLimiT; i += 1) {
		/* begin printChar: */
		putchar(' ');
	}
	print(name);
	printNum(idx);
	print(": ");
	printHex(it);
	/* begin tab */
	putchar('	');
	/* begin printChar: */
	putchar('=');
	printOopShort(it);
	/* begin cr */
	printf("\n");
}


/*	use export: not api, so it won't be written to cointerp.h. cogit.c is
	unaware of StackPage
 */

	/* StackInterpreter>>#printFramesInPage: */
EXPORT(void)
printFramesInPage(StackPage *thePage)
{
	printFrameAndCallersSPshort((thePage->headFP), (thePage->headSP), 0);
}

	/* StackInterpreter>>#printFramesOnStackPageListInUse */
EXPORT(void)
printFramesOnStackPageListInUse(void)
{
    usqInt n;
    StackPage *page;

	page = mostRecentlyUsedPage();
	do {
		if (!(isFree(page))) {
			print("page ");
			/* begin printHexPtrnp: */
			n = oopForPointer(page);
			printf("0x%" PRIxSQINT "", n);
			/* begin cr */
			printf("\n");
			printFramesInPage(page);
			/* begin cr */
			printf("\n");
		}
	} while(((page = (page->prevPage))) != (mostRecentlyUsedPage()));
}

	/* StackInterpreter>>#printFrameThing:andFrame:at: */
static void NoDbgRegParms
printFrameThingandFrameat(char *name, char *theFP, char *address)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt it;
    sqInt len;

	it = longAt(address);
	/* begin printHexPtr: */
	printHex(oopForPointer(address));
	/* begin printChar: */
	putchar(':');
	len = strlen(name);
	for (i = 1; i <= (12 - len); i += 1) {
		/* begin space */
		putchar(' ');
	}
	print(name);
	print(": ");
	printHex(it);
	if (it != 0) {
		/* begin printChar: */
		putchar('=');
		if (it == GIV(nilObj)) {
			print("nil");
		}
		else {
			printNum(it);
		}
	}
	print(" frame: ");
	/* begin printHexPtr: */
	printHex(oopForPointer(theFP));
	/* begin cr */
	printf("\n");
}

	/* StackInterpreter>>#printFrameThing:at: */
static void NoDbgRegParms
printFrameThingat(char *name, char *address)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt it;
    sqInt len;

	it = longAt(address);
	/* begin printHexPtr: */
	printHex(oopForPointer(address));
	/* begin printChar: */
	putchar(':');
	len = strlen(name);
	for (i = 1; i <= (12 - len); i += 1) {
		/* begin space */
		putchar(' ');
	}
	print(name);
	print(": ");
	printHex(it);
	if (it != 0) {
		/* begin printChar: */
		putchar('=');
		if (it == GIV(nilObj)) {
			print("nil");
		}
		else {
			printNum(it);
		}
	}
	/* begin cr */
	printf("\n");
}

	/* StackInterpreter>>#printFrame: */
sqInt
printFrame(char *theFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *aFrame;
    char *frameAbove;
    char *prevFrame;
    char *startFrame;
    StackPage *thePage;
    char *theSP;

	if (!((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
		 && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
		if ((addressCouldBeObj(((sqInt)theFP)))
		 && ((isInMemory(((sqInt)theFP)))
		 && ((((longAt(((sqInt)theFP))) & (classIndexMask())) == ClassMethodContextCompactIndex)
		 && (checkIsStillMarriedContextcurrentFP(((sqInt)theFP), GIV(framePointer)))))) {
			return printFrame(frameOfMarriedContext(((sqInt)theFP)));
		}
		/* begin printHexPtr: */
		printHex(oopForPointer(theFP));
		print(" is not in the stack zone?!");
		/* begin cr */
		printf("\n");
		return null;
	}
	frameAbove = null;
	if (theFP == GIV(framePointer)) {
		theSP = GIV(stackPointer);
	}
	else {
		/* begin stackPageFor: */
		thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		if (isFree(thePage)) {
			/* begin printHexPtr: */
			printHex(oopForPointer(theFP));
			print(" is on a free page?!");
			/* begin cr */
			printf("\n");
			return null;
		}
		if ((thePage != GIV(stackPage))
		 && (theFP == ((thePage->headFP)))) {
			theSP = (thePage->headSP);
		}
		else {
			/* begin safeFindFrameAbove:on:startingFrom: */
			startFrame = ((thePage == GIV(stackPage))
			 && (((GIV(framePointer) >= ((thePage->realStackLimit))) && (GIV(framePointer) <= ((thePage->baseAddress)))))
				? GIV(framePointer)
				: (thePage->headFP));
			assert(!(isFree(thePage)));
			if (startFrame == theFP) {
				frameAbove = null;
				goto l2;
			}
			aFrame = startFrame;
			while (1) {
				prevFrame = aFrame;
				/* begin frameCallerFP: */
				aFrame = pointerForOop(longAt(aFrame + FoxSavedFP));
				if (!(aFrame != 0)) break;
				if (theFP == aFrame) {
					frameAbove = prevFrame;
					goto l2;
				}
			}
			frameAbove = null;
	l2:	/* end safeFindFrameAbove:on:startingFrom: */;
			theSP = (!(frameAbove == null)
				? (assert(!(isBaseFrame(frameAbove))),
					(frameAbove + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(frameAbove + FoxMethod)))) < (startOfMemory())
	? ((mframeCogMethod(frameAbove))->cmNumArgs)
	: byteAt((frameAbove + FoxIFrameFlags) + 1))))) + BytesPerWord)
				: 0);
		}
	}
	if (!(theSP)) {
		print("could not find sp; using bogus value");
		/* begin cr */
		printf("\n");
		theSP = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? theFP + FoxMFReceiver
			: theFP + FoxIFReceiver);
	}
	printFrameWithSP(theFP, theSP);
	if (!(frameAbove == null)) {
		printFrameThingat("frame pc", frameAbove + FoxCallerSavedIP);
	}
	return 0;
}


/*	Print n in hex, in the form '0x1234', unpadded */

	/* StackInterpreter>>#printHexnp: */
sqInt
printHexnp(usqInt n)
{
	return printf("0x%" PRIxSQINT "", n);
}


/*	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)  */

	/* StackInterpreter>>#printHex: */
void
printHex(usqInt n)
{
    char buf[37];
    sqInt len;


	/* large enough for a 64-bit value in hex plus the null plus 16 spaces */
	memset(buf,' ',36);
	len = sprintf(buf + 2 + 2 * BytesPerWord, "0x%" PRIxSQPTR, (usqIntptr_t)(n));
	printf("%s", buf + len);
	}


/*	Print all methods whose penultimate literal is either selector,
	or an object whose first inst var is the method and whose
	second is selector (e.g. an AdditionalMethodState). */

	/* StackInterpreter>>#printLikelyImplementorsOfSelector: */
void
printLikelyImplementorsOfSelector(sqInt selector)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aByte;
    sqInt aByte1;
    sqInt address;
    sqInt address1;
    sqInt classLookupKey;
    sqInt classOop;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    sqInt i;
    usqInt limit;
    sqInt methodClassAssociation;
    usqInt n;
    usqInt n1;
    usqInt n2;
    usqInt n3;
    char *name;
    sqInt nameLen;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop11;
    sqInt objOop12;
    sqInt offset;
    sqInt oop;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;
    sqInt referent;
    sqInt tagBits;
    sqInt theClass1;

	/* begin allObjectsDo: */
	
	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop12 = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop12, limit)) {
		assert(isEnumerableObjectNoAssert(objOop12));
		if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
		 && ((maybeSelectorOfMethod(objOop12)) == selector)) {

			/* try and print the key of the method class association (the name of the implementing class) */
			/* begin methodClassAssociationOf: */
			offset = (literalCountOfMethodHeader(methodHeaderOf(objOop12))) - 1;
			/* begin fetchPointer:ofObject: */
			methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
			/* begin printHexnp: */
			printf("0x%" PRIxSQINT "", objOop12);
			/* begin space */
			putchar(' ');
			/* begin printOopShortInner: */
			if ((((methodClassAssociation & (tagMask())) == 0)
			 && (((((usqInt) (longAt(methodClassAssociation))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
			 && ((numSlotsOf(methodClassAssociation)) >= 2)) {
				/* begin fetchPointer:ofObject: */
				oop = longAt((methodClassAssociation + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			else {
				oop = methodClassAssociation;
			}
			if (oop & (tagMask())) {
				if (oop & (characterTag())) {
					/* begin printChar: */
					putchar('$');
					/* begin printChar: */
					aByte = ((usqInt) (((usqInt)oop))) >> (numTagBits());
					putchar(aByte);
					/* begin printChar: */
					putchar('(');
					/* begin printHexnp: */
					n = ((usqInt) (((usqInt)oop))) >> (numTagBits());
					printf("0x%" PRIxSQINT "", n);
					/* begin printChar: */
					putchar(')');
					goto l27;
				}
				if ((((oop) & 7) == 1)) {
					printNum((oop >> 3));
					/* begin printChar: */
					putchar('(');
					/* begin printHexnp: */
					n1 = (oop >> 3);
					printf("0x%" PRIxSQINT "", n1);
					/* begin printChar: */
					putchar(')');
					goto l27;
				}
				if (oop & (smallFloatTag())) {
					printFloat(dbgFloatValueOf(oop));
					/* begin printChar: */
					putchar('(');
					/* begin printHexnp: */
					printf("0x%" PRIxSQINT "", oop);
					/* begin printChar: */
					putchar(')');
					goto l27;
				}
				print("unknown immediate ");
				/* begin printHexnp: */
				printf("0x%" PRIxSQINT "", oop);
				goto l27;
			}
			if (!(addressCouldBeObj(oop))) {
				print(((oop & (8 /* allocationUnit */ - 1)) != 0
					? " is misaligned"
					: whereIs(oop)));
				goto l27;
			}
			if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
				print(" is a free chunk");
				goto l27;
			}
			if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				print(" is a forwarder to ");
				/* begin printHexnp: */
				assert(isUnambiguouslyForwarder(oop));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent & (tagMask())) == 0)
				 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				n2 = referent;
				printf("0x%" PRIxSQINT "", n2);
				goto l27;
			}
			if ((((tagBits = oop & (tagMask()))) != 0
				? tagBits == (smallFloatTag())
				: ((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex)) {
				printFloat(dbgFloatValueOf(oop));
				goto l27;
			}
			classOop = fetchClassOfNonImm(oop);
			if (!(addressCouldBeObj(classOop))) {
				print("a ??");
				goto l27;
			}
			if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) {
				printNameOfClasscount(oop, 5);
				goto l27;
			}
			if (oop == GIV(nilObj)) {
				print("nil");
				goto l27;
			}
			if (oop == GIV(trueObj)) {
				print("true");
				goto l27;
			}
			if (oop == GIV(falseObj)) {
				print("false");
				goto l27;
			}
			nameLen = lengthOfNameOfClass(classOop);
			if (nameLen == 0) {
				print("a ??");
				goto l27;
			}
			name = nameOfClass(classOop);
			if (nameLen == 10) {
				if ((strncmp(name, "ByteString", 10)) == 0) {

					/* strncmp is weird */
					/* begin printChar: */
					putchar('\'');
					printStringOf(oop);
					/* begin printChar: */
					putchar('\'');
					goto l27;
				}
				if ((strncmp(name, "ByteSymbol", 10)) == 0) {

					/* strncmp is weird */
					/* begin printChar: */
					putchar('#');
					printStringOf(oop);
					goto l27;
				}
			}
			if ((nameLen == 9)
			 && ((strncmp(name, "Character", 9)) == 0)) {
				/* begin printChar: */
				putchar('$');
				/* begin printChar: */
				aByte1 = ((longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())))) >> 3);
				putchar(aByte1);
				goto l27;
			}
			print("a(n) ");
			for (i = 0; i < nameLen; i += 1) {
				/* begin printChar: */
				putchar(name[i]);
			}
			if ((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
			 && ((((assert(addressCouldBeClassObj(classOop)),
			(((longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (ValueIndex + 1))
			 && (isBytes(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(KeyIndex) << (shiftForWord()))))))))) {
				classLookupKey = fetchClassOfNonImm(splObj(SchedulerAssociation));
				while (1) {
					if (classLookupKey == GIV(nilObj)) {
						goto l27;
					}
					if (((assert(addressCouldBeClassObj(classLookupKey)),
					(((longAt((classLookupKey + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (KeyIndex + 1)) break;
					/* begin followField:ofObject: */
					objOop = longAt((classLookupKey + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
					if (((objOop & (tagMask())) == 0)
					 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classLookupKey, objOop);
					}
					classLookupKey = objOop;
				}
				if (classLookupKey == GIV(nilObj)) {
					goto l28;
				}
				theClass1 = classOop;
				while (1) {
					if (theClass1 == classLookupKey) {
						goto l26;
					}
					if (!(theClass1 != GIV(nilObj))) break;
					/* begin followField:ofObject: */
					objOop1 = longAt((theClass1 + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
					if (((objOop1 & (tagMask())) == 0)
					 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, theClass1, objOop1);
					}
					theClass1 = objOop1;
				}
	l26:	;
				/* begin space */
				putchar(' ');
				printOopShort(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(KeyIndex) << (shiftForWord()))))));
				print(" -> ");
				/* begin printHexnp: */
				n3 = longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
				printf("0x%" PRIxSQINT "", n3);
	l28:	;
			}
	l27:	/* end printOopShortInner: */;
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop12;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop12);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop12 = limit;
			goto l23;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop12 = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l23:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop12 = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop12, GIV(freeStart))) {
		assert(isEnumerableObjectNoAssert(objOop12));
		if ((((((usqInt) (longAt(objOop12))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
		 && ((maybeSelectorOfMethod(objOop12)) == selector)) {

			/* try and print the key of the method class association (the name of the implementing class) */
			/* begin methodClassAssociationOf: */
			offset = (literalCountOfMethodHeader(methodHeaderOf(objOop12))) - 1;
			/* begin fetchPointer:ofObject: */
			methodClassAssociation = longAt((objOop12 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
			/* begin printHexnp: */
			printf("0x%" PRIxSQINT "", objOop12);
			/* begin space */
			putchar(' ');
			/* begin printOopShortInner: */
			if ((((methodClassAssociation & (tagMask())) == 0)
			 && (((((usqInt) (longAt(methodClassAssociation))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
			 && ((numSlotsOf(methodClassAssociation)) >= 2)) {
				/* begin fetchPointer:ofObject: */
				oop = longAt((methodClassAssociation + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			else {
				oop = methodClassAssociation;
			}
			if (oop & (tagMask())) {
				if (oop & (characterTag())) {
					/* begin printChar: */
					putchar('$');
					/* begin printChar: */
					aByte = ((usqInt) (((usqInt)oop))) >> (numTagBits());
					putchar(aByte);
					/* begin printChar: */
					putchar('(');
					/* begin printHexnp: */
					n = ((usqInt) (((usqInt)oop))) >> (numTagBits());
					printf("0x%" PRIxSQINT "", n);
					/* begin printChar: */
					putchar(')');
					goto l30;
				}
				if ((((oop) & 7) == 1)) {
					printNum((oop >> 3));
					/* begin printChar: */
					putchar('(');
					/* begin printHexnp: */
					n1 = (oop >> 3);
					printf("0x%" PRIxSQINT "", n1);
					/* begin printChar: */
					putchar(')');
					goto l30;
				}
				if (oop & (smallFloatTag())) {
					printFloat(dbgFloatValueOf(oop));
					/* begin printChar: */
					putchar('(');
					/* begin printHexnp: */
					printf("0x%" PRIxSQINT "", oop);
					/* begin printChar: */
					putchar(')');
					goto l30;
				}
				print("unknown immediate ");
				/* begin printHexnp: */
				printf("0x%" PRIxSQINT "", oop);
				goto l30;
			}
			if (!(addressCouldBeObj(oop))) {
				print(((oop & (8 /* allocationUnit */ - 1)) != 0
					? " is misaligned"
					: whereIs(oop)));
				goto l30;
			}
			if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
				print(" is a free chunk");
				goto l30;
			}
			if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				print(" is a forwarder to ");
				/* begin printHexnp: */
				assert(isUnambiguouslyForwarder(oop));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent & (tagMask())) == 0)
				 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				n2 = referent;
				printf("0x%" PRIxSQINT "", n2);
				goto l30;
			}
			if ((((tagBits = oop & (tagMask()))) != 0
				? tagBits == (smallFloatTag())
				: ((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex)) {
				printFloat(dbgFloatValueOf(oop));
				goto l30;
			}
			classOop = fetchClassOfNonImm(oop);
			if (!(addressCouldBeObj(classOop))) {
				print("a ??");
				goto l30;
			}
			if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) {
				printNameOfClasscount(oop, 5);
				goto l30;
			}
			if (oop == GIV(nilObj)) {
				print("nil");
				goto l30;
			}
			if (oop == GIV(trueObj)) {
				print("true");
				goto l30;
			}
			if (oop == GIV(falseObj)) {
				print("false");
				goto l30;
			}
			nameLen = lengthOfNameOfClass(classOop);
			if (nameLen == 0) {
				print("a ??");
				goto l30;
			}
			name = nameOfClass(classOop);
			if (nameLen == 10) {
				if ((strncmp(name, "ByteString", 10)) == 0) {

					/* strncmp is weird */
					/* begin printChar: */
					putchar('\'');
					printStringOf(oop);
					/* begin printChar: */
					putchar('\'');
					goto l30;
				}
				if ((strncmp(name, "ByteSymbol", 10)) == 0) {

					/* strncmp is weird */
					/* begin printChar: */
					putchar('#');
					printStringOf(oop);
					goto l30;
				}
			}
			if ((nameLen == 9)
			 && ((strncmp(name, "Character", 9)) == 0)) {
				/* begin printChar: */
				putchar('$');
				/* begin printChar: */
				aByte1 = ((longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())))) >> 3);
				putchar(aByte1);
				goto l30;
			}
			print("a(n) ");
			for (i = 0; i < nameLen; i += 1) {
				/* begin printChar: */
				putchar(name[i]);
			}
			if ((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
			 && ((((assert(addressCouldBeClassObj(classOop)),
			(((longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (ValueIndex + 1))
			 && (isBytes(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(KeyIndex) << (shiftForWord()))))))))) {
				classLookupKey = fetchClassOfNonImm(splObj(SchedulerAssociation));
				while (1) {
					if (classLookupKey == GIV(nilObj)) {
						goto l30;
					}
					if (((assert(addressCouldBeClassObj(classLookupKey)),
					(((longAt((classLookupKey + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (KeyIndex + 1)) break;
					/* begin followField:ofObject: */
					objOop = longAt((classLookupKey + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
					if (((objOop & (tagMask())) == 0)
					 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classLookupKey, objOop);
					}
					classLookupKey = objOop;
				}
				if (classLookupKey == GIV(nilObj)) {
					goto l31;
				}
				theClass1 = classOop;
				while (1) {
					if (theClass1 == classLookupKey) {
						goto l29;
					}
					if (!(theClass1 != GIV(nilObj))) break;
					/* begin followField:ofObject: */
					objOop1 = longAt((theClass1 + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
					if (((objOop1 & (tagMask())) == 0)
					 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, theClass1, objOop1);
					}
					theClass1 = objOop1;
				}
	l29:	;
				/* begin space */
				putchar(' ');
				printOopShort(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(KeyIndex) << (shiftForWord()))))));
				print(" -> ");
				/* begin printHexnp: */
				n3 = longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
				printf("0x%" PRIxSQINT "", n3);
	l31:	;
			}
	l30:	/* end printOopShortInner: */;
			/* begin cr */
			printf("\n");
		}
		prevPrevObj = prevObj;
		prevObj = objOop12;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop12);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop12 = GIV(freeStart);
			goto l25;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop12 = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l25:	/* end objectAfter:limit: */;
	}
	/* begin allOldSpaceObjectsDo: */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop11 = GIV(nilObj);
	while (1) {
		assert((objOop11 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop11, GIV(endOfMemory)))) break;
		assert((long64At(objOop11)) != 0);
		if (isEnumerableObject(objOop11)) {
			if ((((((usqInt) (longAt(objOop11))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))
			 && ((maybeSelectorOfMethod(objOop11)) == selector)) {

				/* try and print the key of the method class association (the name of the implementing class) */
				/* begin methodClassAssociationOf: */
				offset = (literalCountOfMethodHeader(methodHeaderOf(objOop11))) - 1;
				/* begin fetchPointer:ofObject: */
				methodClassAssociation = longAt((objOop11 + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
				/* begin printHexnp: */
				printf("0x%" PRIxSQINT "", objOop11);
				/* begin space */
				putchar(' ');
				/* begin printOopShortInner: */
				if ((((methodClassAssociation & (tagMask())) == 0)
				 && (((((usqInt) (longAt(methodClassAssociation))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
				 && ((numSlotsOf(methodClassAssociation)) >= 2)) {
					/* begin fetchPointer:ofObject: */
					oop = longAt((methodClassAssociation + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				else {
					oop = methodClassAssociation;
				}
				if (oop & (tagMask())) {
					if (oop & (characterTag())) {
						/* begin printChar: */
						putchar('$');
						/* begin printChar: */
						aByte = ((usqInt) (((usqInt)oop))) >> (numTagBits());
						putchar(aByte);
						/* begin printChar: */
						putchar('(');
						/* begin printHexnp: */
						n = ((usqInt) (((usqInt)oop))) >> (numTagBits());
						printf("0x%" PRIxSQINT "", n);
						/* begin printChar: */
						putchar(')');
						goto l33;
					}
					if ((((oop) & 7) == 1)) {
						printNum((oop >> 3));
						/* begin printChar: */
						putchar('(');
						/* begin printHexnp: */
						n1 = (oop >> 3);
						printf("0x%" PRIxSQINT "", n1);
						/* begin printChar: */
						putchar(')');
						goto l33;
					}
					if (oop & (smallFloatTag())) {
						printFloat(dbgFloatValueOf(oop));
						/* begin printChar: */
						putchar('(');
						/* begin printHexnp: */
						printf("0x%" PRIxSQINT "", oop);
						/* begin printChar: */
						putchar(')');
						goto l33;
					}
					print("unknown immediate ");
					/* begin printHexnp: */
					printf("0x%" PRIxSQINT "", oop);
					goto l33;
				}
				if (!(addressCouldBeObj(oop))) {
					print(((oop & (8 /* allocationUnit */ - 1)) != 0
						? " is misaligned"
						: whereIs(oop)));
					goto l33;
				}
				if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
					print(" is a free chunk");
					goto l33;
				}
				if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					print(" is a forwarder to ");
					/* begin printHexnp: */
					assert(isUnambiguouslyForwarder(oop));
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
					while (((referent & (tagMask())) == 0)
					 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
					}
					n2 = referent;
					printf("0x%" PRIxSQINT "", n2);
					goto l33;
				}
				if ((((tagBits = oop & (tagMask()))) != 0
					? tagBits == (smallFloatTag())
					: ((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex)) {
					printFloat(dbgFloatValueOf(oop));
					goto l33;
				}
				classOop = fetchClassOfNonImm(oop);
				if (!(addressCouldBeObj(classOop))) {
					print("a ??");
					goto l33;
				}
				if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) {
					printNameOfClasscount(oop, 5);
					goto l33;
				}
				if (oop == GIV(nilObj)) {
					print("nil");
					goto l33;
				}
				if (oop == GIV(trueObj)) {
					print("true");
					goto l33;
				}
				if (oop == GIV(falseObj)) {
					print("false");
					goto l33;
				}
				nameLen = lengthOfNameOfClass(classOop);
				if (nameLen == 0) {
					print("a ??");
					goto l33;
				}
				name = nameOfClass(classOop);
				if (nameLen == 10) {
					if ((strncmp(name, "ByteString", 10)) == 0) {

						/* strncmp is weird */
						/* begin printChar: */
						putchar('\'');
						printStringOf(oop);
						/* begin printChar: */
						putchar('\'');
						goto l33;
					}
					if ((strncmp(name, "ByteSymbol", 10)) == 0) {

						/* strncmp is weird */
						/* begin printChar: */
						putchar('#');
						printStringOf(oop);
						goto l33;
					}
				}
				if ((nameLen == 9)
				 && ((strncmp(name, "Character", 9)) == 0)) {
					/* begin printChar: */
					putchar('$');
					/* begin printChar: */
					aByte1 = ((longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())))) >> 3);
					putchar(aByte1);
					goto l33;
				}
				print("a(n) ");
				for (i = 0; i < nameLen; i += 1) {
					/* begin printChar: */
					putchar(name[i]);
				}
				if ((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
				 && ((((assert(addressCouldBeClassObj(classOop)),
				(((longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (ValueIndex + 1))
				 && (isBytes(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(KeyIndex) << (shiftForWord()))))))))) {
					classLookupKey = fetchClassOfNonImm(splObj(SchedulerAssociation));
					while (1) {
						if (classLookupKey == GIV(nilObj)) {
							goto l33;
						}
						if (((assert(addressCouldBeClassObj(classLookupKey)),
						(((longAt((classLookupKey + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (KeyIndex + 1)) break;
						/* begin followField:ofObject: */
						objOop = longAt((classLookupKey + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
						if (((objOop & (tagMask())) == 0)
						 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
							objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classLookupKey, objOop);
						}
						classLookupKey = objOop;
					}
					if (classLookupKey == GIV(nilObj)) {
						goto l34;
					}
					theClass1 = classOop;
					while (1) {
						if (theClass1 == classLookupKey) {
							goto l32;
						}
						if (!(theClass1 != GIV(nilObj))) break;
						/* begin followField:ofObject: */
						objOop1 = longAt((theClass1 + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
						if (((objOop1 & (tagMask())) == 0)
						 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
							objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, theClass1, objOop1);
						}
						theClass1 = objOop1;
					}
	l32:	;
					/* begin space */
					putchar(' ');
					printOopShort(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(KeyIndex) << (shiftForWord()))))));
					print(" -> ");
					/* begin printHexnp: */
					n3 = longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
					printf("0x%" PRIxSQINT "", n3);
	l34:	;
				}
	l33:	/* end printOopShortInner: */;
				/* begin cr */
				printf("\n");
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop11;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop11);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop11 = GIV(endOfMemory);
			goto l21;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop11 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l21:	/* end objectAfter:limit: */;
	}
	}

	/* StackInterpreter>>#printMethodCache */
void
printMethodCache(void)
{
	printMethodCacheFor(-1);
}

	/* StackInterpreter>>#printMethodDictionaryOf: */
void
printMethodDictionaryOf(sqInt behavior)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt dictionary;
    sqInt index;
    sqInt indexLimiT;
    sqInt meth;
    sqInt methodArray;
    sqInt selector;

	/* begin printMethodDictionary: */
	dictionary = longAt((behavior + BaseHeaderSize) + (((sqInt)((usqInt)(MethodDictionaryIndex) << (shiftForWord())))));
	/* begin fetchPointer:ofObject: */
	methodArray = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
	for (index = SelectorStart, indexLimiT = ((numSlotsOf(dictionary)) - 1); index <= indexLimiT; index += 1) {
		/* begin fetchPointer:ofObject: */
		selector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
		if (selector != GIV(nilObj)) {
			/* begin fetchPointer:ofObject: */
			meth = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
			printOopShort(selector);
			print(" => ");
			printOopShort(meth);
			print(" (");
			printHex(selector);
			print(" => ");
			printHex(meth);
			putchar(')');
			/* begin cr */
			printf("\n");
		}
	}
}

	/* StackInterpreter>>#printMethodDictionary: */
void
printMethodDictionary(sqInt dictionary)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt index;
    sqInt indexLimiT;
    sqInt meth;
    sqInt methodArray;
    sqInt selector;

	/* begin fetchPointer:ofObject: */
	methodArray = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(MethodArrayIndex) << (shiftForWord())))));
	for (index = SelectorStart, indexLimiT = ((numSlotsOf(dictionary)) - 1); index <= indexLimiT; index += 1) {
		/* begin fetchPointer:ofObject: */
		selector = longAt((dictionary + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
		if (selector != GIV(nilObj)) {
			/* begin fetchPointer:ofObject: */
			meth = longAt((methodArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - SelectorStart)) << (shiftForWord())))));
			printOopShort(selector);
			print(" => ");
			printOopShort(meth);
			print(" (");
			printHex(selector);
			print(" => ");
			printHex(meth);
			putchar(')');
			/* begin cr */
			printf("\n");
		}
	}
}


/*	Details: The count argument is used to avoid a possible infinite recursion
	if classOop is a corrupted object.
 */

	/* StackInterpreter>>#printNameOfClass:count: */
static void NoDbgRegParms
printNameOfClasscount(sqInt classOop, sqInt cnt)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqInt numSlots;
    usqInt numSlots1;

	if (!(GIV(classNameIndex))) {
		print("??nil cnidx??");
		return;
	}
	if ((classOop == null)
	 || ((classOop == 0)
	 || (cnt <= 0))) {
		print("bad class");
		return;
	}
	/* begin numSlotsOf: */
	assert((classIndexOf(classOop)) > (isForwardedObjectClassIndexPun()));
	numSlots1 = byteAt(classOop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(classOop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if ((numSlots == GIV(metaclassNumSlots))
	 && (GIV(metaclassNumSlots) > GIV(thisClassIndex))) {
		printNameOfClasscount(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(thisClassIndex)) << (shiftForWord()))))), cnt - 1);
		print(" class");
	}
	else {
		if (numSlots <= GIV(classNameIndex)) {
			print("bad class");
		}
		else {
			printStringOf(longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(GIV(classNameIndex)) << (shiftForWord()))))));
		}
	}
}


/*	For testing in Smalltalk, this method should be overridden in a subclass. */

	/* StackInterpreter>>#printNum: */
static void NoDbgRegParms
printNum(sqInt n)
{
	printf("%ld", (long) n);
}

	/* StackInterpreter>>#printOopShort: */
static void NoDbgRegParms
printOopShort(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aByte;
    sqInt aByte1;
    sqInt classLookupKey;
    sqInt classOop;
    sqInt i;
    usqInt n;
    usqInt n1;
    usqInt n2;
    usqInt n3;
    char *name;
    sqInt nameLen;
    sqInt objOop;
    sqInt objOop1;
    sqInt referent;
    sqInt tagBits;
    sqInt theClass1;

	/* begin printOopShortInner: */
	if (oop & (tagMask())) {
		if (oop & (characterTag())) {
			/* begin printChar: */
			putchar('$');
			/* begin printChar: */
			aByte = ((usqInt) (((usqInt)oop))) >> (numTagBits());
			putchar(aByte);
			/* begin printChar: */
			putchar('(');
			/* begin printHexnp: */
			n = ((usqInt) (((usqInt)oop))) >> (numTagBits());
			printf("0x%" PRIxSQINT "", n);
			/* begin printChar: */
			putchar(')');
			goto l17;
		}
		if ((((oop) & 7) == 1)) {
			printNum((oop >> 3));
			/* begin printChar: */
			putchar('(');
			/* begin printHexnp: */
			n1 = (oop >> 3);
			printf("0x%" PRIxSQINT "", n1);
			/* begin printChar: */
			putchar(')');
			goto l17;
		}
		if (oop & (smallFloatTag())) {
			printFloat(dbgFloatValueOf(oop));
			/* begin printChar: */
			putchar('(');
			/* begin printHexnp: */
			printf("0x%" PRIxSQINT "", oop);
			/* begin printChar: */
			putchar(')');
			goto l17;
		}
		print("unknown immediate ");
		/* begin printHexnp: */
		printf("0x%" PRIxSQINT "", oop);
		goto l17;
	}
	if (!(addressCouldBeObj(oop))) {
		print(((oop & (8 /* allocationUnit */ - 1)) != 0
			? " is misaligned"
			: whereIs(oop)));
		goto l17;
	}
	if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
		print(" is a free chunk");
		goto l17;
	}
	if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		print(" is a forwarder to ");
		/* begin printHexnp: */
		assert(isUnambiguouslyForwarder(oop));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		n2 = referent;
		printf("0x%" PRIxSQINT "", n2);
		goto l17;
	}
	if ((((tagBits = oop & (tagMask()))) != 0
		? tagBits == (smallFloatTag())
		: ((longAt(oop)) & (classIndexMask())) == ClassFloatCompactIndex)) {
		printFloat(dbgFloatValueOf(oop));
		goto l17;
	}
	classOop = fetchClassOfNonImm(oop);
	if (!(addressCouldBeObj(classOop))) {
		print("a ??");
		goto l17;
	}
	if ((numSlotsOf(classOop)) == GIV(metaclassNumSlots)) {
		printNameOfClasscount(oop, 5);
		goto l17;
	}
	if (oop == GIV(nilObj)) {
		print("nil");
		goto l17;
	}
	if (oop == GIV(trueObj)) {
		print("true");
		goto l17;
	}
	if (oop == GIV(falseObj)) {
		print("false");
		goto l17;
	}
	nameLen = lengthOfNameOfClass(classOop);
	if (nameLen == 0) {
		print("a ??");
		goto l17;
	}
	name = nameOfClass(classOop);
	if (nameLen == 10) {
		if ((strncmp(name, "ByteString", 10)) == 0) {

			/* strncmp is weird */
			/* begin printChar: */
			putchar('\'');
			printStringOf(oop);
			/* begin printChar: */
			putchar('\'');
			goto l17;
		}
		if ((strncmp(name, "ByteSymbol", 10)) == 0) {

			/* strncmp is weird */
			/* begin printChar: */
			putchar('#');
			printStringOf(oop);
			goto l17;
		}
	}
	if ((nameLen == 9)
	 && ((strncmp(name, "Character", 9)) == 0)) {
		/* begin printChar: */
		putchar('$');
		/* begin printChar: */
		aByte1 = ((longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())))) >> 3);
		putchar(aByte1);
		goto l17;
	}
	print("a(n) ");
	for (i = 0; i < nameLen; i += 1) {
		/* begin printChar: */
		putchar(name[i]);
	}
	if ((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)
	 && ((((assert(addressCouldBeClassObj(classOop)),
	(((longAt((classOop + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (ValueIndex + 1))
	 && (isBytes(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(KeyIndex) << (shiftForWord()))))))))) {
		classLookupKey = fetchClassOfNonImm(splObj(SchedulerAssociation));
		while (1) {
			if (classLookupKey == GIV(nilObj)) {
				goto l17;
			}
			if (((assert(addressCouldBeClassObj(classLookupKey)),
			(((longAt((classLookupKey + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3)) & ((1U << (fixedFieldsFieldWidth())) - 1))) == (KeyIndex + 1)) break;
			/* begin followField:ofObject: */
			objOop = longAt((classLookupKey + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
			if (((objOop & (tagMask())) == 0)
			 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classLookupKey, objOop);
			}
			classLookupKey = objOop;
		}
		if (classLookupKey == GIV(nilObj)) {
			goto l7;
		}
		theClass1 = classOop;
		while (1) {
			if (theClass1 == classLookupKey) {
				goto l8;
			}
			if (!(theClass1 != GIV(nilObj))) break;
			/* begin followField:ofObject: */
			objOop1 = longAt((theClass1 + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
			if (((objOop1 & (tagMask())) == 0)
			 && (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				objOop1 = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, theClass1, objOop1);
			}
			theClass1 = objOop1;
		}
	l8:	;
		/* begin space */
		putchar(' ');
		printOopShort(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(KeyIndex) << (shiftForWord()))))));
		print(" -> ");
		/* begin printHexnp: */
		n3 = longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
		printf("0x%" PRIxSQINT "", n3);
	l7:	;
	}
	l17:	/* end printOopShortInner: */;
	flush();
}

	/* StackInterpreter>>#printOop: */
sqInt
printOop(sqInt oop)
{
    sqInt byte;
    sqInt bytecodesPerLine;
    sqInt cls;
    sqInt column;
    sqInt fmt;
    sqInt fmt1;
    sqInt index;
    sqInt lastIndex;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt startIP;

	if (oop & (tagMask())) {
		return shortPrintOop(oop);
	}
	printHex(oop);
	if (!(addressCouldBeObj(oop))) {
		return (print(((oop & (8 /* allocationUnit */ - 1)) != 0
					? " is misaligned"
					: whereIs(oop))),
			/* begin cr */
			printf("\n"));
	}
	if (((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun())) {
		print(" is a free chunk of size ");
		printNum((assert(isFreeObject(oop)),
		bytesInObject(oop)));
		print(" 0th: ");
		printHex(longAt((oop + BaseHeaderSize) + (0U << (shiftForWord()))));
		printHeaderTypeOf(oop);
		/* begin cr */
		printf("\n");
		return null;
	}
	if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		print(" is a forwarded object to ");
		printHex(followForwarded(oop));
		print(" of slot size ");
		printNum(numSlotsOfAny(oop));
		printHeaderTypeOf(oop);
		/* begin cr */
		printf("\n");
		return null;
	}
	print(": a(n) ");
	printNameOfClasscount((cls = fetchClassOfNonImm(oop)), 5);
	if (cls == (splObj(ClassFloat))) {
		return (/* begin cr */
			printf("\n"),
			printFloat(dbgFloatValueOf(oop)),
			/* begin cr */
			printf("\n"));
	}
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	if (fmt > 5 /* lastPointerFormat */) {
		print(" nbytes ");
		printNum(numBytesOf(oop));
	}
	/* begin cr */
	printf("\n");
	if (((fmt >= (firstLongFormat())) && (fmt <= ((firstCompiledMethodFormat()) - 1)))) {

		/* This will answer false if splObj: ClassAlien is nilObject */
		if (isKindOfClass(oop, splObj(ClassAlien))) {
			print(" datasize ");
			printNum(sizeOfAlienData(oop));
			print(((longAt(oop + BaseHeaderSize)) < 0
				? " indirect @ "
				: ((longAt(oop + BaseHeaderSize)) == 0
						? " pointer @ "
						: " direct @ ")));
			return (printHex(((usqInt)(startOfAlienData(oop)))),
				/* begin cr */
				printf("\n"));
		}
		if (((((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstLongFormat())) && (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= ((firstShortFormat()) - 1)))) {
			lastIndex = ((64 < ((numBytesOf(oop)) / BytesPerWord)) ? 64 : ((numBytesOf(oop)) / BytesPerWord));
			if (lastIndex > 0) {
				for (index = 1; index <= lastIndex; index += 1) {
					/* begin space */
					putchar(' ');
					printHex(((unsigned int) (long32At((oop + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 2)))))));
					if ((index % 5 /* elementsPerPrintOopLine */) == 0) {
						/* begin cr */
						printf("\n");
					}
				}
				if (!((lastIndex % 5 /* elementsPerPrintOopLine */) == 0)) {
					/* begin cr */
					printf("\n");
				}
			}
			return 0;
		}
		return (printStringOf(oop),
			/* begin cr */
			printf("\n"));
	}
	startIP = (((lastPointerOf(oop)) + BytesPerOop) - BaseHeaderSize) / BytesPerOop;
	lastIndex = ((256 < startIP) ? 256 : startIP);
	if (lastIndex > 0) {
		for (index = 1; index <= lastIndex; index += 1) {
			printHex(longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord()))))));
			/* begin space */
			putchar(' ');
			if ((index % 5 /* elementsPerPrintOopLine */) == 0) {
				/* begin cr */
				printf("\n");
			}
		}
		if (!((lastIndex % 5 /* elementsPerPrintOopLine */) == 0)) {
			/* begin cr */
			printf("\n");
		}
	}
	if (((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())) {
		startIP = (startIP * BytesPerWord) + 1;
		/* begin lengthOf:format: */
		fmt1 = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
		/* begin numSlotsOfAny: */
		numSlots1 = byteAt(oop + 7);
		numSlots = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		if (fmt1 <= 5 /* ephemeronFormat */) {
			lastIndex = numSlots;
			goto l3;
		}
		if (fmt1 >= (firstByteFormat())) {

			/* bytes, including CompiledMethod */
			lastIndex = (numSlots << (shiftForWord())) - (fmt1 & 7);
			goto l3;
		}
		if (fmt1 >= (firstShortFormat())) {
			lastIndex = (numSlots << ((shiftForWord()) - 1)) - (fmt1 & 3);
			goto l3;
		}
		if (fmt1 >= (firstLongFormat())) {
			lastIndex = (numSlots << ((shiftForWord()) - 2)) - (fmt1 & 1);
			goto l3;
		}
		if (fmt1 == (sixtyFourBitIndexableFormat())) {
			lastIndex = numSlots;
			goto l3;
		}
		lastIndex = 0;
	l3:	/* end lengthOf:format: */;
		if ((lastIndex - startIP) > 100) {
			lastIndex = startIP + 100;
		}
		bytecodesPerLine = 8;
		column = 1;
		for (index = startIP; index <= lastIndex; index += 1) {
			if (column == 1) {
				printf("0x%08" PRIxSQPTR ": ", (usqIntptr_t)(oop+BaseHeaderSize+index-1));
			}
			/* begin fetchByte:ofObject: */
			byte = byteAt((oop + BaseHeaderSize) + (index - 1));
			printf(" %02x/%-3d", (int)byte,(int)byte);
			column += 1;
			if (column > bytecodesPerLine) {
				column = 1;
				/* begin cr */
				printf("\n");
			}
		}
		if (!(column == 1)) {
			/* begin cr */
			printf("\n");
		}
	}
	else {
		if (startIP > 64) {
			print("...");
			/* begin cr */
			printf("\n");
		}
	}
	return 0;
}

	/* StackInterpreter>>#printProcessStack: */
void
printProcessStack(sqInt aProcess)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ctx;
    sqInt objOop;
    sqInt tagBits;

	/* begin cr */
	printf("\n");
	printNameOfClasscount((((tagBits = aProcess & (tagMask()))) != 0
		? longAt((GIV(classTableFirstPage) + BaseHeaderSize) + (((sqInt)((usqInt)(tagBits) << (shiftForWord())))))
		: fetchClassOfNonImm(aProcess)), 5);
	/* begin space */
	putchar(' ');
	printHex(aProcess);
	print(" priority ");
	printNum(quickFetchIntegerofObject(PriorityIndex, aProcess));
	/* begin cr */
	printf("\n");
	/* begin followField:ofObject: */
	objOop = longAt((aProcess + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop = fixFollowedFieldofObjectwithInitialValue(SuspendedContextIndex, aProcess, objOop);
	}
	ctx = objOop;
	if (!(ctx == GIV(nilObj))) {
		printCallStackOfcurrentFP(ctx, GIV(framePointer));
	}
}

	/* StackInterpreter>>#printProcsOnList: */
sqInt
printProcsOnList(sqInt procList)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstProc;
    sqInt objOop;
    sqInt proc;

	proc = (firstProc = followFieldofObject(FirstLinkIndex, procList));
	while (!(proc == GIV(nilObj))) {
		printProcessStack(proc);
		/* begin followField:ofObject: */
		objOop = longAt((proc + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))));
		if (((objOop & (tagMask())) == 0)
		 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			objOop = fixFollowedFieldofObjectwithInitialValue(NextLinkIndex, proc, objOop);
		}
		proc = objOop;
		if (proc == firstProc) {
			warning("circular process list!!");
			return null;
		}
	}
	return 0;
}

	/* StackInterpreter>>#printStackCallStackOf: */
sqInt
printStackCallStackOf(sqInt aContextOrProcessOrFrame)
{
    sqInt context;
    char *theFP;

	if (addressCouldBeObj(aContextOrProcessOrFrame)) {
		if ((((aContextOrProcessOrFrame & (tagMask())) == 0)
		 && (((longAt(aContextOrProcessOrFrame)) & (classIndexMask())) == ClassMethodContextCompactIndex))
		 && (checkIsStillMarriedContextcurrentFP(aContextOrProcessOrFrame, null))) {
			return printStackCallStackOf(((sqInt)(frameOfMarriedContext(aContextOrProcessOrFrame))));
		}
		if (couldBeProcess(aContextOrProcessOrFrame)) {
			return printCallStackOf(longAt((aContextOrProcessOrFrame + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord()))))));
		}
		return null;
	}
	theFP = ((void *)aContextOrProcessOrFrame);
	while(1) {
		context = shortReversePrintFrameAndCallers(theFP);
		if (!((((((longAt((context + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
			 && (((theFP = frameOfMarriedContext(context)),
			checkIsStillMarriedContextcurrentFP(context, theFP))))) {
			return null;
		}
	}
	return 0;
}

	/* StackInterpreter>>#printStackPageList */
void
printStackPageList(void)
{
    StackPage *page;

	page = mostRecentlyUsedPage();
	do {
		/* begin printStackPage: */
		printStackPageuseCount(page, -1);
		/* begin cr */
		printf("\n");
	} while(((page = (page->prevPage))) != (mostRecentlyUsedPage()));
}

	/* StackInterpreter>>#printStackPageListInUse */
void
printStackPageListInUse(void)
{
    sqInt n;
    StackPage *page;

	page = mostRecentlyUsedPage();
	n = 0;
	do {
		if (!(isFree(page))) {
			printStackPageuseCount(page, (n += 1));
			/* begin cr */
			printf("\n");
		}
	} while(((page = (page->prevPage))) != (mostRecentlyUsedPage()));
}

	/* StackInterpreter>>#printStackPages */
void
printStackPages(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    StackPage *page;

	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin printStackPage: */
		page = stackPageAtpages(i, GIV(pages));
		printStackPageuseCount(page, -1);
		/* begin cr */
		printf("\n");
	}
}

	/* StackInterpreter>>#printStackPagesInUse */
void
printStackPagesInUse(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt n;

	n = 0;
	for (i = 0; i < GIV(numStackPages); i += 1) {
		if (!(isFree(stackPageAt(i)))) {
			printStackPageuseCount(stackPageAt(i), (n += 1));
			/* begin cr */
			printf("\n");
		}
	}
}

	/* StackInterpreter>>#printStackPage:useCount: */
static void NoDbgRegParms
printStackPageuseCount(StackPage *page, sqInt n)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    void *p;
    void *p1;
    void *p2;
    void *p3;
    void *p4;
    void *p5;
    void *p6;
    void *p7;
    void *p8;

	print("page ");
	/* begin printHexPtr: */
	printHex(oopForPointer(page));
	print(" (");
	printNum((assert((((((char *) ((page->realStackLimit)))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) ((page->realStackLimit)))) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage((page->realStackLimit), GIV(stackBasePlus1), GIV(bytesPerPage))));
	if (n >= 0) {
		print(",");
		printNum(n);
	}
	print(")  (trace: ");
	printNum((page->trace));
	/* begin printChar: */
	putchar(')');
	if (isFree(page)) {
		print(" (free)");
	}
	if (page == (mostRecentlyUsedPage())) {
		print(" (MRU)");
	}
	if (((page->prevPage)) == (mostRecentlyUsedPage())) {
		print(" (LRU)");
	}
	/* begin cr */
	printf("\n");
	/* begin tab */
	putchar('	');
	print("ba: ");
	/* begin printHexPtr: */
	p3 = (page->baseAddress);
	printHex(oopForPointer(p3));
	print(" - sl: ");
	/* begin printHexPtr: */
	p4 = (page->realStackLimit);
	printHex(oopForPointer(p4));
	print(" - sl-so: ");
	/* begin printHexPtr: */
	p5 = ((page->realStackLimit)) - ((IFrameSlots + 64) * BytesPerWord);
	printHex(oopForPointer(p5));
	print(" - la:");
	/* begin printHexPtr: */
	p6 = (page->lastAddress);
	printHex(oopForPointer(p6));
	if (!(isFree(page))) {
		/* begin cr */
		printf("\n");
		/* begin tab */
		putchar('	');
		print("baseFP ");
		/* begin printHexPtr: */
		p = (page->baseFP);
		printHex(oopForPointer(p));
		/* begin tab */
		putchar('	');
		print("headFP ");
		/* begin printHexPtr: */
		p1 = (page->headFP);
		printHex(oopForPointer(p1));
		/* begin tab */
		putchar('	');
		print("headSP ");
		/* begin printHexPtr: */
		p2 = (page->headSP);
		printHex(oopForPointer(p2));
	}
	/* begin cr */
	printf("\n");
	/* begin tab */
	putchar('	');
	print("prev ");
	/* begin printHexPtr: */
	p7 = ((void *) (page->prevPage));
	printHex(oopForPointer(p7));
	print(" (");
	printNum((assert((((((char *) ((((page->prevPage))->realStackLimit)))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) ((((page->prevPage))->realStackLimit)))) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage((((page->prevPage))->realStackLimit), GIV(stackBasePlus1), GIV(bytesPerPage))));
	/* begin printChar: */
	putchar(')');
	/* begin tab */
	putchar('	');
	print("next ");
	/* begin printHexPtr: */
	p8 = ((void *) (page->nextPage));
	printHex(oopForPointer(p8));
	print(" (");
	printNum((assert((((((char *) ((((page->nextPage))->realStackLimit)))) >= (GIV(stackBasePlus1) - 1)) && ((((char *) ((((page->nextPage))->realStackLimit)))) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage((((page->nextPage))->realStackLimit), GIV(stackBasePlus1), GIV(bytesPerPage))));
	/* begin printChar: */
	putchar(')');
	/* begin cr */
	printf("\n");
}

	/* StackInterpreter>>#printStackReferencesTo: */
void
printStackReferencesTo(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *callerFP;
    sqInt i;
    char *theFP;
    StackPage *thePage;
    char *theSP;

	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		thePage = stackPageAtpages(i, GIV(pages));
		if (!(((thePage->baseFP)) == 0)) {
			theSP = (thePage->headSP);

			/* Skip the instruction pointer on top of stack of inactive pages. */
			theFP = (thePage->headFP);
			if (!(thePage == GIV(stackPage))) {
				theSP += BytesPerWord;
			}
			while (1) {
				while (theSP <= (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? theFP + FoxMFReceiver
					: theFP + FoxIFReceiver))) {
					if (oop == (longAt(theSP))) {
						print("FP: ");
						/* begin printHexnp: */
						printf("0x%" PRIxSQINT "", ((usqInt) theFP));
						print(" @ ");
						/* begin printHexnp: */
						printf("0x%" PRIxSQINT "", ((usqInt) theSP));
						/* begin cr */
						printf("\n");
					}
					theSP += BytesPerWord;
				}
				if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
					: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
					if (oop == (longAt(theFP + FoxThisContext))) {
						print("FP: ");
						/* begin printHexnp: */
						printf("0x%" PRIxSQINT "", ((usqInt) theFP));
						print(" CTXT");
						/* begin cr */
						printf("\n");
					}
				}
				if (oop == (longAt(theFP + FoxMethod))) {
					print("FP: ");
					/* begin printHexnp: */
					printf("0x%" PRIxSQINT "", ((usqInt) theFP));
					print(" MTHD");
					/* begin cr */
					printf("\n");
				}
				if (!(((callerFP = pointerForOop(longAt(theFP + FoxSavedFP)))) != 0)) break;
				theSP = (theFP + FoxCallerSavedIP) + BytesPerWord;
				theFP = callerFP;
			}

			/* a.k.a. FoxCallerContext */
			theSP = theFP + FoxCallerSavedIP;
			while (theSP <= ((thePage->baseAddress))) {
				if (oop == (longAt(theSP))) {
					print("FP: ");
					/* begin printHexnp: */
					printf("0x%" PRIxSQINT "", ((usqInt) theFP));
					print(" @ ");
					/* begin printHexnp: */
					printf("0x%" PRIxSQINT "", ((usqInt) theSP));
					/* begin cr */
					printf("\n");
				}
				theSP += BytesPerWord;
			}
		}
	}
}

	/* StackInterpreter>>#printStringOf: */
static void NoDbgRegParms
printStringOf(sqInt oop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aByte;
    sqInt cnt;
    sqInt fmt;
    sqInt i;
    sqInt len;
    sqInt max;

	if (oop & (tagMask())) {
		return;
	}
	if (!(addressCouldBeObj(oop))) {
		return;
	}
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	if (fmt < (firstByteFormat())) {
		return;
	}
	cnt = ((((max = 128)) < ((len = lengthOfformat(oop, (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))))) ? ((max = 128)) : ((len = lengthOfformat(oop, (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())))));
	i = 0;
	if ((isinstanceOfcompactClassIndex(oop, splObj(ClassByteArray), GIV(classByteArrayCompactIndex)))
	 || (((oop & (tagMask())) == 0)
	 && ((((usqInt)(((longAt(oop)) & (classIndexMask())) - ClassLargeNegativeIntegerCompactIndex))) <= 1))) {
		while (i < cnt) {
			printHex(byteAt((oop + BaseHeaderSize) + i));
			i += 1;
		}
	}
	else {
		while (i < cnt) {
			if ((byteAt((oop + BaseHeaderSize) + i)) == 13) {

				/* Character cr asInteger */
				print("<CR>");
				if ((i + 1) < len) {
					print("...");
				}
				return;
			}
			/* begin printChar: */
			aByte = byteAt((oop + BaseHeaderSize) + i);
			putchar(aByte);
			i += 1;
		}
	}
	if (len > max) {
		print("...");
	}
	flush();
}


/*	For testing in Smalltalk, this method should be overridden in a subclass. */

	/* StackInterpreter>>#print: */
void
print(char *s)
{
	fputs(s, stdout);
}

	/* StackInterpreter>>#pushBool: */
void
pushBool(sqInt trueOrFalse)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt object;
    char *sp;

	/* begin push: */
	object = (trueOrFalse
		? GIV(trueObj)
		: GIV(falseObj));
	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
}


/*	The receiver of a message send or the closure of a block activation is
	always on the stack above any arguments and the frame itself. See the
	diagram in StackInterpreter class>>initializeFrameIndices. */

	/* StackInterpreter>>#pushedReceiverOrClosureOfFrame: */
static sqInt NoDbgRegParms
pushedReceiverOrClosureOfFrame(char *theFP)
{
	return longAt(theFP + (frameStackedReceiverOffset(theFP)));
}

	/* StackInterpreter>>#pushFloat: */
void
pushFloat(double f)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt object;
    char *sp;

	/* begin push: */
	object = floatObjectOf(f);
	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
}

	/* StackInterpreter>>#pushInteger: */
sqInt
pushInteger(sqInt integerValue)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), (((usqInt)integerValue << 3) | 1));
	GIV(stackPointer) = sp;
	return null;
}


/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#push: */
void
push(sqInt object)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *sp;

	longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
	GIV(stackPointer) = sp;
}


/*	Append aLong to aFile in this platform's 'natural' byte order. aLong is
	either 32 or 64 bits,
	depending on ObjectMemory. (Bytes will be swapped, if necessary, when the
	image is read
	on a different platform.) Set successFlag to false if the write fails. */

	/* StackInterpreter>>#putLong:toFile: */
static void NoDbgRegParms
putLongtoFile(sqInt aLong, sqImageFile aFile)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objectsWritten;

	objectsWritten = sqImageFileWrite((&aLong), sizeof(sqInt), 1, aFile);
	/* begin success: */
	if (!(objectsWritten == 1)) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}


/*	Append the 16-bit aShort to aFile in this platform's 'natural' byte order.
	(Bytes will be swapped, if necessary, when the image is read on a
	different platform.) Set successFlag to false if the write fails. */

	/* StackInterpreter>>#putShort:toFile: */
static void NoDbgRegParms
putShorttoFile(short aShort, sqImageFile aFile)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objectsWritten;

	objectsWritten = sqImageFileWrite((&aShort), sizeof(short), 1, aFile);
	/* begin success: */
	if (!(objectsWritten == 1)) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}


/*	Save the given process on the scheduler process list for its priority,
	adding to the back if yieldImplicitly or to the front if not
	yieldImplicitly. 
 */

	/* StackInterpreter>>#putToSleep:yieldingIf: */
static void NoDbgRegParms
putToSleepyieldingIf(sqInt aProcess, sqInt yieldImplicitly)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstLink;
    sqInt objOop;
    sqInt objOop1;
    sqInt oop;
    sqInt priority;
    sqInt processList;
    sqInt processLists;

	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	/* begin quickFetchInteger:ofObject: */
	oop = longAt((aProcess + BaseHeaderSize) + (((sqInt)((usqInt)(PriorityIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	priority = (oop >> 3);
	if ((GIV(highestRunnableProcessPriority) != 0)
	 && (priority > GIV(highestRunnableProcessPriority))) {
		GIV(highestRunnableProcessPriority) = priority;
	}
	/* begin fetchPointer:ofObject: */
	objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	processLists = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ProcessListsIndex) << (shiftForWord())))));
	/* begin fetchPointer:ofObject: */
	processList = longAt((processLists + BaseHeaderSize) + (((sqInt)((usqInt)((priority - 1)) << (shiftForWord())))));
	if (yieldImplicitly) {
		addLastLinktoList(aProcess, processList);
	}
	else {
		/* begin addFirstLink:toList: */
		assert(!(isForwarded(processList)));
		assert((fetchPointerofObject(NextLinkIndex, aProcess)) == (nilObject()));
		/* begin fetchPointer:ofObject: */
		firstLink = longAt((processList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))));
		assert(firstLink != aProcess);
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(processList)));
		if ((assert(isNonImmediate(processList)),
		oopisGreaterThanOrEqualTo(processList, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((aProcess & (tagMask())) == 0)
			 && (oopisLessThan(aProcess, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(processList))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(processList);
				}
			}
		}
		longAtput((processList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))), aProcess);
		if (firstLink == GIV(nilObj)) {

			/* a.k.a. (self isEmptyList: aList) */
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(processList)));
			if ((assert(isNonImmediate(processList)),
			oopisGreaterThanOrEqualTo(processList, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((aProcess & (tagMask())) == 0)
				 && (oopisLessThan(aProcess, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(processList))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(processList);
					}
				}
			}
			longAtput((processList + BaseHeaderSize) + (((sqInt)((usqInt)(LastLinkIndex) << (shiftForWord())))), aProcess);
		}
		else {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(aProcess)));
			if ((assert(isNonImmediate(aProcess)),
			oopisGreaterThanOrEqualTo(aProcess, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((firstLink & (tagMask())) == 0)
				 && (oopisLessThan(firstLink, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(aProcess))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(aProcess);
					}
				}
			}
			longAtput((aProcess + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))), firstLink);
		}
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(aProcess)));
		if ((assert(isNonImmediate(aProcess)),
		oopisGreaterThanOrEqualTo(aProcess, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((processList & (tagMask())) == 0)
			 && (oopisLessThan(processList, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(aProcess))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(aProcess);
				}
			}
		}
		longAtput((aProcess + BaseHeaderSize) + (((sqInt)((usqInt)(MyListIndex) << (shiftForWord())))), processList);
	}
}


/*	Append aWord32 to aFile in this platform's 'natural' byte order. aWord32
	is 32 bits,
	depending on ObjectMemory. (Bytes will be swapped, if necessary, when the
	image is read
	on a different platform.) Set successFlag to false if the write fails. */

	/* StackInterpreter>>#putWord32:toFile: */
static void NoDbgRegParms
putWord32toFile(int aWord32, sqImageFile aFile)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objectsWritten;

	objectsWritten = sqImageFileWrite((&aWord32), 4, 1, aFile);
	/* begin success: */
	if (!(objectsWritten == 1)) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
}


/*	Return the integer value of the field without verifying that it is an
	integer value! For use in time-critical places where the integer-ness of
	the field can be guaranteed.
 */

	/* StackInterpreter>>#quickFetchInteger:ofObject: */
static sqInt NoDbgRegParms
quickFetchIntegerofObject(sqInt fieldIndex, sqInt objectPointer)
{
    sqInt oop;

	/* begin fetchPointer:ofObject: */
	oop = longAt((objectPointer + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))));
	assert((((oop) & 7) == 1));
	return (oop >> 3);
}


/*	Anwer true if images of the given format are readable by this interpreter.
	Allows a virtual machine to accept selected older image formats. */

	/* StackInterpreter>>#readableFormat: */
sqInt
readableFormat(sqInt imageVersion)
{
	return (imageVersion == 68021 /* imageFormatVersion */)
	 || (0);
}


/*	Assuming the primFailCode is non-zero, check if the method consumes the
	error code
	and if so, assign it through theSP. Then zero the primFailCode. This is
	infrequent code,
	so keep it out of the common path. */

	/* StackInterpreter>>#reapAndResetErrorCodeTo:header: */
static void NoDbgRegParms NeverInline
reapAndResetErrorCodeToheader(char *theSP, sqInt methodHeader)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt initialPC;

	assert(GIV(primFailCode) != 0);
	initialPC = ((GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize) + (3);
	if ((byteAt(initialPC)) == (
#  if MULTIPLEBYTECODESETS
		((((sqLong) methodHeader)) < 0
				? AltLongStoreBytecode
				: LongStoreBytecode)
#  else /* MULTIPLEBYTECODESETS */
		LongStoreBytecode
#  endif /* MULTIPLEBYTECODESETS */
		)) {
		longAtPointerput(theSP, getErrorObjectFromPrimFailCode());
	}
	GIV(primFailCode) = 0;
}


/*	callbackContext is an activation of
	invokeCallback:[stack:registers:jmpbuf:]. Its sender is the VM's state
	prior to the callback. Reestablish that state,
	and mark calloutContext as dead. */

	/* StackInterpreter>>#reestablishContextPriorToCallback: */
EXPORT(sqInt)
reestablishContextPriorToCallback(sqInt callbackContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt calloutContext;
    sqInt senderOop;
    sqInt senderOop1;
    char *sp;
    char *theFP;
    StackPage *thePage;
    sqInt top;
    sqInt valuePointer;
    sqInt valuePointer1;
    sqInt valuePointer11;
    sqInt valuePointer2;

	flag("obsolete");
	if (!(isLiveContext(callbackContext))) {
		return 0;
	}
	calloutContext = externalInstVarofContext(SenderIndex, callbackContext);
	if (!(isLiveContext(calloutContext))) {
		return 0;
	}
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp;
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if (isSingleContext(callbackContext)) {
		/* begin markContextAsDead: */
		assert(isContext(callbackContext));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = GIV(nilObj);
		assert(!(isOopForwarded(callbackContext)));
		longAtput((callbackContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer);
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer1 = GIV(nilObj);
		assert(!(isOopForwarded(callbackContext)));
		longAtput((callbackContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1);
	}
	else {
		/* begin frameOfMarriedContext: */
		senderOop = longAt((callbackContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop) & 7) == 1));
		theFP = pointerForOop(senderOop - 1);
		if (GIV(framePointer) == theFP) {

			/* common case */
			if ((longAt(theFP + FoxSavedFP)) == 0) {
				freeStackPage(GIV(stackPage));
			}
			else {

				/* calloutContext is immediately below on the same page.  Make it current. */
				GIV(instructionPointer) = ((usqInt)(pointerForOop(longAt(GIV(framePointer) + FoxCallerSavedIP))));
				GIV(stackPointer) = (GIV(framePointer) + (frameStackedReceiverOffset(GIV(framePointer)))) + BytesPerWord;
				/* begin frameCallerFP: */
				GIV(framePointer) = pointerForOop(longAt(GIV(framePointer) + FoxSavedFP));
				return 1;
			}
		}
		else {
			externalDivorceFrameandContext(theFP, callbackContext);
			/* begin markContextAsDead: */
			assert(isContext(callbackContext));
			/* begin storePointerUnchecked:ofObject:withValue: */
			valuePointer2 = GIV(nilObj);
			assert(!(isOopForwarded(callbackContext)));
			longAtput((callbackContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer2);
			/* begin storePointerUnchecked:ofObject:withValue: */
			valuePointer11 = GIV(nilObj);
			assert(!(isOopForwarded(callbackContext)));
			longAtput((callbackContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer11);
		}
	}
	if ((((((longAt((calloutContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(calloutContext)))) {
		/* begin frameOfMarriedContext: */
		senderOop1 = longAt((calloutContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop1) & 7) == 1));
		theFP = pointerForOop(senderOop1 - 1);
		/* begin stackPageFor: */
		thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		assert(thePage != GIV(stackPage));
		GIV(stackPointer) = (findSPOfon(theFP, thePage)) - BytesPerWord;
		GIV(framePointer) = theFP;
		assert(GIV(stackPointer) < GIV(framePointer));
	}
	else {
		thePage = makeBaseFrameFor(calloutContext);
		/* begin setStackPointersFromPage: */
		GIV(stackPointer) = (thePage->headSP);
		GIV(framePointer) = (thePage->headFP);
	}
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
	/* begin setStackPageAndLimit: */
	assert(thePage != 0);
	GIV(stackPage) = thePage;
	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
	}
	markStackPageMostRecentlyUsed(thePage);
	return 1;
}


/*	Remove the first process from the given linked list. */

	/* StackInterpreter>>#removeFirstLinkOfList: */
static sqInt NoDbgRegParms
removeFirstLinkOfList(sqInt aList)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt first;
    sqInt last;
    sqInt next;
    sqInt valuePointer;
    sqInt valuePointer1;
    sqInt valuePointer2;

	assert(!((isForwarded(aList))));
	/* begin fetchPointer:ofObject: */
	first = longAt((aList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))));
	/* begin fetchPointer:ofObject: */
	last = longAt((aList + BaseHeaderSize) + (((sqInt)((usqInt)(LastLinkIndex) << (shiftForWord())))));
	assert(!((isForwarded(first))));
	assert(!((isForwarded(last))));
	if (first == last) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = GIV(nilObj);
		assert(!(isOopForwarded(aList)));
		longAtput((aList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))), valuePointer);
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer1 = GIV(nilObj);
		assert(!(isOopForwarded(aList)));
		longAtput((aList + BaseHeaderSize) + (((sqInt)((usqInt)(LastLinkIndex) << (shiftForWord())))), valuePointer1);
	}
	else {
		/* begin fetchPointer:ofObject: */
		next = longAt((first + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))));
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(aList)));
		if ((assert(isNonImmediate(aList)),
		oopisGreaterThanOrEqualTo(aList, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((next & (tagMask())) == 0)
			 && (oopisLessThan(next, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(aList))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(aList);
				}
			}
		}
		longAtput((aList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))), next);
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer2 = GIV(nilObj);
	assert(!(isOopForwarded(first)));
	longAtput((first + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))), valuePointer2);
	return first;
}


/*	In Spur two cases of primitive failure are handled specially. A primitive
	may fail due to validation
	encountering a forwarder. On failure, check the accessorDepth for the
	primitive and if non-negative
	scan the args to the depth, following any forwarders. Retry the primitive
	if any are found. Hence
	lazily and transparently following forwarders on primtiive failure.
	Additionally a prmitive might fail
	due to an allocation failing. Retry if external primitives have failed
	with PrimErrNoMemory after running
	first the scavenger and then on a subsequent failure, the global
	mark-sweep collector. Hence lazily
	and transparently GC on memory exhaustion. */

	/* StackInterpreter>>#retryPrimitiveOnFailure */
static sqInt
retryPrimitiveOnFailure(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt accessorDepth;
    sqInt canRetry;
    sqInt firstBytecode;
    sqInt followDone;
    sqInt found;
    sqInt found1;
    sqInt gcDone;
    sqInt header;
    sqInt index;
    sqInt methodHeader;
    sqInt oop;
    sqInt primIndex;
    sqInt referent;
    sqInt retried;
    sqInt retry;
    sqInt scannedStackFrame;

	gcDone = 0;
	followDone = (canRetry = (retried = 0));
	while (1) {
		retry = 0;
		if (GIV(primFailCode) == PrimErrNoMemory) {
			if (((gcDone += 1)) == 1) {
				canRetry = (primitiveIndexOfMethodheader(GIV(newMethod), methodHeaderOf(GIV(newMethod)))) == PrimNumberExternalCall;
			}
			if (canRetry) {
				if (gcDone == 1) {
					/* begin scavengingGC */
					scavengingGCTenuringIf(TenureByAge);
				}
				if (gcDone == 2) {
					fullGC();
				}
				retry = gcDone <= 2;
			}
		}
		else {
			if (!followDone) {
				followDone = 1;
				/* begin checkForAndFollowForwardedPrimitiveState */
				if (recordPrimTrace()) {
					/* begin fastLogPrim: */
					GIV(primTraceLog)[GIV(primTraceLogIndex)] = TracePrimitiveFailure;
					primTraceLogIndex(GIV(primTraceLogIndex) + 1);
				}
				assert(failed());
				found1 = (scannedStackFrame = 0);
				/* begin primitiveIndexOfMethod:header: */
				assert(isCompiledMethod(GIV(newMethod)));
				header = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
				if ((((header) & 7) == 1)) {
					methodHeader = header;
				}
				else {
					assert((((usqInt)header)) < GIV(newSpaceStart));
					assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
					methodHeader = ((((CogMethod *) header))->methodHeader);
				}
				if (methodHeader & AlternateHeaderHasPrimFlag) {
					firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
					primIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)));
				}
				else {
					primIndex = 0;
				}
				assert((GIV(argumentCount) == (argumentCountOf(GIV(newMethod))))
				 || (isMetaPrimitiveIndex(primIndex)));
				if (((primIndex == PrimNumberDoPrimitive)
				 || (primIndex == PrimNumberDoExternalCall))
				 && (GIV(metaAccessorDepth) > -2)) {
					accessorDepth = GIV(metaAccessorDepth);
				}
				else {
					if ((primIndex == PrimNumberExternalCall)
					 && (primitiveFunctionPointer != primitiveExternalCall)) {
						accessorDepth = ((fetchPointerofObject(2, literalofMethod(0, GIV(newMethod)))) >> 3);
					}
					else {
						accessorDepth = primitiveAccessorDepthTable[primIndex];
					}
				}
				assert(saneFunctionPointerForFailureOfPrimIndex(primIndex));
				assert(((accessorDepth >= -1) && (accessorDepth <= 5)));
				if (accessorDepth >= 0) {
					for (index = 0; index <= GIV(argumentCount); index += 1) {
						oop = longAt(GIV(stackPointer) + (index * BytesPerWord));
						if ((oop & (tagMask())) == 0) {
							if (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
								assert(index < GIV(argumentCount));
								found1 = 1;
								/* begin followForwarded: */
								assert(isUnambiguouslyForwarder(oop));
								/* begin fetchPointer:ofMaybeForwardedObject: */
								referent = longAt((oop + BaseHeaderSize) + (0U << (shiftForWord())));
								while (((referent & (tagMask())) == 0)
								 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
									/* begin fetchPointer:ofMaybeForwardedObject: */
									referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
								}
								oop = referent;
								longAtput(GIV(stackPointer) + (index * BytesPerWord), oop);
								if (!scannedStackFrame) {
									scannedStackFrame = 1;
									followForwardedFrameContentsstackPointer(GIV(framePointer), GIV(stackPointer) + ((GIV(argumentCount) + 1) * BytesPerWord));
								}
							}
							if ((accessorDepth > 0)
							 && ((((oop & (tagMask())) == 0)
							 && (isAnyPointerFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))))
							 && (followForwardedObjectFieldstoDepth(oop, accessorDepth)))) {
								found1 = 1;
							}
						}
					}
				}
				found = found1;
				if (found
				 && (recordPrimTrace())) {
					/* begin fastLogPrim: */
					GIV(primTraceLog)[GIV(primTraceLogIndex)] = TracePrimitiveRetry;
					primTraceLogIndex(GIV(primTraceLogIndex) + 1);
				}
				retry = found;
			}
		}
		if (!(retry)) break;
		assert(GIV(primFailCode) != 0);
		retried = 1;
		/* begin initPrimCall */
		GIV(primFailCode) = 0;
		dispatchFunctionPointer(primitiveFunctionPointer);
	}
	return retried;
}


/*	callbackMethodContext is an activation of
	invokeCallback:[stack:registers:jmpbuf:]. Its sender is the VM's state
	prior to the callback. Reestablish that state (via longjmp),
	and mark callbackMethodContext as dead. */

	/* StackInterpreter>>#returnAs:ThroughCallback:Context: */
EXPORT(sqInt)
returnAsThroughCallbackContext(sqInt returnTypeOop, VMCallbackContext *vmCallbackContext, sqInt callbackMethodContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aMethodObj;
    sqInt aMethodObj1;
    sqInt calloutMethodContext;
    sqInt senderOop;
    sqInt senderOop1;
    char *sp;
    char *theFP;
    StackPage *thePage;
    sqInt top;
    sqInt valuePointer;
    sqInt valuePointer1;
    sqInt valuePointer11;
    sqInt valuePointer2;

	assert(GIV(primFailCode) == 0);
	assert((((returnTypeOop) & 7) == 1));
	assert(!(isImmediate(((sqInt)vmCallbackContext))));
	assert((addressCouldBeObj(callbackMethodContext))
	 && (isContext(callbackMethodContext)));
	assert(((debugCallbackPath = 0)) == 0);
	if (!(((((returnTypeOop) & 7) == 1))
		 && (isLiveContext(callbackMethodContext)))) {
		assert(((debugCallbackPath = 1)) == 1);
		return 0;
	}
	calloutMethodContext = externalInstVarofContext(SenderIndex, callbackMethodContext);
	if (!(isLiveContext(calloutMethodContext))) {
		assert(((debugCallbackPath = 2)) == 2);
		return 0;
	}
	assert(((debugCallbackReturns += 1)) > 0);
	/* begin push: */
	longAtput((sp = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp;
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if (isSingleContext(callbackMethodContext)) {
		assert(((debugCallbackPath = debugCallbackPath | 4)) > 0);
		/* begin markContextAsDead: */
		assert(isContext(callbackMethodContext));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = GIV(nilObj);
		assert(!(isOopForwarded(callbackMethodContext)));
		longAtput((callbackMethodContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer);
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer1 = GIV(nilObj);
		assert(!(isOopForwarded(callbackMethodContext)));
		longAtput((callbackMethodContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer1);
	}
	else {
		assert(((debugCallbackPath = debugCallbackPath | 8)) > 0);
		/* begin frameOfMarriedContext: */
		senderOop = longAt((callbackMethodContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop) & 7) == 1));
		theFP = pointerForOop(senderOop - 1);
		assert((frameReceiver(theFP)) == (splObj(ClassAlien)));
		if (GIV(framePointer) == theFP) {

			/* common case */
			assert(((debugCallbackPath = debugCallbackPath | 16)) > 0);
			if (!((longAt(theFP + FoxSavedFP)) == 0)) {

				/* calloutMethodContext is immediately below on the same page.  Make it current. */
				assert(((debugCallbackPath = debugCallbackPath | 32)) > 0);
				GIV(instructionPointer) = ((usqInt)(pointerForOop(longAt(theFP + FoxCallerSavedIP))));
				GIV(stackPointer) = (theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord;
				/* begin frameCallerFP: */
				GIV(framePointer) = pointerForOop(longAt(theFP + FoxSavedFP));
				/* begin setMethod: */
				aMethodObj = ((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
					? ((mframeHomeMethod(GIV(framePointer)))->methodObject)
					: longAt(GIV(framePointer) + FoxMethod));
				assert((((usqInt)aMethodObj)) >= (startOfMemory()));
				GIV(method) = aMethodObj;
				assert(isOopCompiledMethod(GIV(method)));
				
#        if MULTIPLEBYTECODESETS
				GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
					? 256
					: 0);
#        endif /* MULTIPLEBYTECODESETS */
				/* begin restoreCStackStateForCallbackContext: */
				setCStackPointer((vmCallbackContext->savedCStackPointer));
				setCFramePointer((vmCallbackContext->savedCFramePointer));
				memcpy(reenterInterpreter, ((void *)((vmCallbackContext->savedReenterInterpreter))), sizeof(jmp_buf));
				/* begin assertValidExecutionPointe:r:s: */
				assertValidExecutionPointersimbarline(GIV(instructionPointer), GIV(framePointer), GIV(stackPointer), !((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())), __LINE__);
				siglongjmp((vmCallbackContext->trampoline), (returnTypeOop >> 3));
				return 1;
			}
			freeStackPage(GIV(stackPage));
		}
		else {
			assert(((debugCallbackPath = debugCallbackPath | 64)) > 0);
			externalDivorceFrameandContext(theFP, callbackMethodContext);
			/* begin markContextAsDead: */
			assert(isContext(callbackMethodContext));
			/* begin storePointerUnchecked:ofObject:withValue: */
			valuePointer2 = GIV(nilObj);
			assert(!(isOopForwarded(callbackMethodContext)));
			longAtput((callbackMethodContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))), valuePointer2);
			/* begin storePointerUnchecked:ofObject:withValue: */
			valuePointer11 = GIV(nilObj);
			assert(!(isOopForwarded(callbackMethodContext)));
			longAtput((callbackMethodContext + BaseHeaderSize) + (((sqInt)((usqInt)(InstructionPointerIndex) << (shiftForWord())))), valuePointer11);
		}
	}
	if ((((((longAt((calloutMethodContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(calloutMethodContext)))) {
		assert(((debugCallbackPath = debugCallbackPath | 128)) > 0);
		/* begin frameOfMarriedContext: */
		senderOop1 = longAt((calloutMethodContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop1) & 7) == 1));
		theFP = pointerForOop(senderOop1 - 1);
		/* begin stackPageFor: */
		thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		assert(thePage != GIV(stackPage));
		GIV(stackPointer) = (((thePage->headFP)) == theFP
			? (thePage->headSP)
			: (findSPOfon(theFP, thePage)) - BytesPerWord);
		GIV(framePointer) = theFP;
		assert(GIV(stackPointer) < GIV(framePointer));
	}
	else {
		assert(((debugCallbackPath = debugCallbackPath | 256)) > 0);
		thePage = makeBaseFrameFor(calloutMethodContext);
		/* begin setStackPointersFromPage: */
		GIV(stackPointer) = (thePage->headSP);
		GIV(framePointer) = (thePage->headFP);
	}
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(instructionPointer) = top;
	/* begin setMethod: */
	aMethodObj1 = longAt((calloutMethodContext + BaseHeaderSize) + (((sqInt)((usqInt)(MethodIndex) << (shiftForWord())))));
	assert((((usqInt)aMethodObj1)) >= (startOfMemory()));
	GIV(method) = aMethodObj1;
	assert(isOopCompiledMethod(GIV(method)));
	
#  if MULTIPLEBYTECODESETS
	GIV(bytecodeSetSelector) = (headerIndicatesAlternateBytecodeSet(methodHeaderOf(GIV(method)))
		? 256
		: 0);
#  endif /* MULTIPLEBYTECODESETS */
	/* begin setStackPageAndLimit: */
	assert(thePage != 0);
	GIV(stackPage) = thePage;
	if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
		GIV(stackLimit) = (GIV(stackPage)->stackLimit);
	}
	markStackPageMostRecentlyUsed(thePage);
	/* begin restoreCStackStateForCallbackContext: */
	setCStackPointer((vmCallbackContext->savedCStackPointer));
	setCFramePointer((vmCallbackContext->savedCFramePointer));
	memcpy(reenterInterpreter, ((void *)((vmCallbackContext->savedReenterInterpreter))), sizeof(jmp_buf));

	/* N.B. siglongjmp is defined as _longjmp on non-win32 platforms.
	   This matches the use of _setjmp in ia32abicc.c. */
	primitiveFunctionPointer = (vmCallbackContext->savedPrimFunctionPointer);
	siglongjmp((vmCallbackContext->trampoline), (returnTypeOop >> 3));
	return 1;
}


/*	Reverse the given range of Display pixels, rounded to whole word boundary.
	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. */

	/* StackInterpreter>>#reverseDisplayFrom:to: */
static sqInt NoDbgRegParms
reverseDisplayFromto(sqInt startIndex, sqInt endIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt primFailCodeValue;
    sqInt ptr;
    unsigned int reversed;
    sqInt wordEndIndex;
    sqInt wordStartIndex;

	if (!(postGCUpdateDisplayBits())) {
		return 0;
	}
	if ((displayBits == 0)
	 || ((isImmediate(((sqInt)displayBits)))
	 || (displayDepth <= 0))) {
		return null;
	}
	wordStartIndex = ((((startIndex < 0) ? 0 : startIndex)) * displayDepth) / 32;
	wordEndIndex = ((((endIndex < displayWidth) ? endIndex : displayWidth)) * displayDepth) / 32;
	for (ptr = ((((sqInt)displayBits)) + (wordStartIndex * 4)); ptr <= ((((sqInt)displayBits)) + (wordEndIndex * 4)); ptr += 4) {
		reversed = (long32At(ptr)) ^ 0xFFFFFFFFU;
		long32Atput(ptr, reversed);
	}
	primFailCodeValue = GIV(primFailCode);
	/* begin initPrimCall */
	GIV(primFailCode) = 0;
	updateDisplayLeftTopRightBottom(0, 0, displayWidth, 1);
	ioForceDisplayUpdate();
	GIV(primFailCode) = primFailCodeValue;
	return 0;
}


/*	Safe version of methodClassOf: that deals with malformed compiled methods,
	etc, and does not fixup forwarding pointers.. */

	/* StackInterpreter>>#safeMethodClassOf: */
static sqInt NoDbgRegParms
safeMethodClassOf(sqInt methodPointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt literal;
    sqInt maybeClass;
    sqInt offset;
    sqInt referent;
    sqInt referent1;

	/* begin literal:ofMethod: */
	offset = (literalCountOfMethodHeader(methodHeaderOf(methodPointer))) - 1;
	/* begin fetchPointer:ofObject: */
	literal = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
	if (((literal & (tagMask())) == 0)
	 && (((longAt(literal)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(literal));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((literal + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		literal = referent;
	}
	if (!((((literal & (tagMask())) == 0)
		 && (((((usqInt) (longAt(literal))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */))
		 && ((numSlotsOf(literal)) > ValueIndex))) {
		/* begin nilObject */
		return GIV(nilObj);
	}
	/* begin fetchPointer:ofObject: */
	maybeClass = longAt((literal + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	if (((maybeClass & (tagMask())) == 0)
	 && (((longAt(maybeClass)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(maybeClass));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent1 = longAt((maybeClass + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent1 & (tagMask())) == 0)
		 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		maybeClass = referent1;
	}
	return maybeClass;
}

	/* StackInterpreter>>#saneFunctionPointerForFailureOfPrimIndex: */
static sqInt NoDbgRegParms
saneFunctionPointerForFailureOfPrimIndex(sqInt primIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    void (*basePrimitive)(void);
    sqInt theClass;

	/* begin functionPointerFor:inClass: */
	theClass = GIV(nilObj);
	basePrimitive = ((void (*)(void)) ((primIndex > MaxPrimitiveIndex
	? 0
	: primitiveTable[primIndex])));
	return (primitiveFunctionPointer == basePrimitive)
	 || (((basePrimitive == primitiveExternalCall)
	 && (!((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex)))
	 || (((primIndex == PrimNumberDoPrimitive)
	 || (primIndex == PrimNumberDoExternalCall))
	 && (GIV(metaAccessorDepth) > -2)));
}

	/* StackInterpreter>>#schedulerPointer */
static sqInt
schedulerPointer(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objOop;

	/* begin fetchPointer:ofObject: */
	objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	return longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
}

	/* StackInterpreter>>#setBreakMNUSelector: */
void
setBreakMNUSelector(char *aString)
{
	if (((breakSelector = aString)) == null) {

		/* nil's effective length is zero */
		breakSelectorLength = MinSmallInteger;
	}
	else {
		breakSelectorLength = -(strlen(aString));
	}
}

	/* StackInterpreter>>#setBreakSelector: */
void
setBreakSelector(char *aString)
{
	if (((breakSelector = aString)) == null) {

		/* nil's effective length is zero */
		breakSelectorLength = MinSmallInteger;
	}
	else {
		breakSelectorLength = strlen(aString);
	}
}

	/* StackInterpreter>>#setFullScreenFlag: */
void
setFullScreenFlag(sqInt value)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(fullScreenFlag) = value;
}

	/* StackInterpreter>>#setInterruptCheckChain: */
EXPORT(void (*setInterruptCheckChain(void (*aFunction)(void)))())

{
    void (*prevFunction)();

	prevFunction = interruptCheckChain;
	interruptCheckChain = aFunction;
	return prevFunction;
}

	/* StackInterpreter>>#setInterruptKeycode: */
void
setInterruptKeycode(sqInt value)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(interruptKeycode) = value;
}

	/* StackInterpreter>>#setInterruptPending: */
void
setInterruptPending(sqInt value)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	forceInterruptCheck();
	GIV(interruptPending) = value;
}

	/* StackInterpreter>>#setNextWakeupUsecs: */
void
setNextWakeupUsecs(usqLong value)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(nextWakeupUsecs) = value;
}

	/* StackInterpreter>>#setSavedWindowSize: */
void
setSavedWindowSize(sqInt value)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(savedWindowSize) = value;
}


/*	The low space semaphore is about to be signaled. Set the signalLowSpace
	flag, and force an interrupt check. Save the currently active process in
	the special
	objects array so that the low space handler will be able to determine the
	process that first triggered a low space condition. The image's low space
	handler is expected
	to nil out the special objects array slot when it handles the low space
	condition.  */

	/* StackInterpreter>>#setSignalLowSpaceFlagAndSaveProcess */
static void
setSignalLowSpaceFlagAndSaveProcess(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeProc;
    sqInt lastSavedProcess;
    sqInt objOop;
    sqInt objOop1;

	/* begin signalLowSpace: */
	GIV(signalLowSpace) = 1;
	/* begin lowSpaceThreshold: */

	/* N.B. The threshold > 0 guard eliminates a warning when
	   self lowSpaceThreshold: 0
	   is inlined into setSignalLowSpaceFlagAndSaveProcess */
	GIV(lowSpaceThreshold) = 0;
	assert(GIV(totalFreeOldSpace) >= GIV(lowSpaceThreshold));
	/* begin splObj: */
	lastSavedProcess = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ProcessSignalingLowSpace) << (shiftForWord())))));
	if (lastSavedProcess == GIV(nilObj)) {
		/* begin activeProcess */
		objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
		objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
		activeProc = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
		/* begin splObj:put: */
		assert(!(isForwarded(GIV(specialObjectsOop))));
		if ((assert(isNonImmediate(GIV(specialObjectsOop))),
		oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((activeProc & (tagMask())) == 0)
			 && (oopisLessThan(activeProc, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(GIV(specialObjectsOop));
				}
			}
		}
		longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ProcessSignalingLowSpace) << (shiftForWord())))), activeProc);
	}
	forceInterruptCheck();
}

	/* StackInterpreter>>#setTraceFlagOnContextsFramesPageIfNeeded: */
static void NoDbgRegParms
setTraceFlagOnContextsFramesPageIfNeeded(sqInt aContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    void *pointer;
    sqInt senderOop;
    StackPage *thePage;

	if ((((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContextDuringGC(aContext)))) {
		/* begin stackPageFor: */
		senderOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop) & 7) == 1));
		pointer = pointerForOop(senderOop - 1);
		/* begin stackPageAt: */
		thePage = stackPageAtpages((assert((((((char *) pointer)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) pointer)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(pointer, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		assert(((((thePage->trace)) >= StackPageUnreached) && (((thePage->trace)) <= StackPageTraced)));
		if (((thePage->trace)) == StackPageUnreached) {
			(thePage->trace = StackPageReachedButUntraced);
		}
	}
}

	/* StackInterpreter>>#shortPrintContext: */
static sqInt NoDbgRegParms
shortPrintContext(sqInt aContext)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt home;
    sqInt senderOop;
    char *theFP;

	if (!(((aContext & (tagMask())) == 0)
		 && (((longAt(aContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
		printHex(aContext);
		print(" is not a context");
		/* begin cr */
		printf("\n");
		return null;
	}
	printHex(aContext);
	if (((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
		if (checkIsStillMarriedContextcurrentFP(aContext, GIV(framePointer))) {
			/* begin frameOfMarriedContext: */
			senderOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
			assert((((senderOop) & 7) == 1));
			theFP = pointerForOop(senderOop - 1);
			if ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())) {
				print(" M (");
			}
			else {
				print(" I (");
			}
			printHex(((usqIntptr_t)theFP));
			print(") ");
		}
		else {
			print(" w ");
		}
	}
	else {
		print(" s ");
	}
	home = findHomeForContext(aContext);
	if (home == null) {
		print(" BOGUS CONTEXT (can't determine home)");
	}
	else {
		printActivationNameForreceiverisBlockfirstTemporary(fetchPointerofObject(MethodIndex, (!(home)
			? aContext
			: home)), (home == null
			? /* begin nilObject */ GIV(nilObj)
			: (longAt((home + BaseHeaderSize) + (((sqInt)((usqInt)(ReceiverIndex) << (shiftForWord()))))))), home != aContext, longAt((home + BaseHeaderSize) + (((sqInt)((usqInt)((0 + CtxtTempFrameStart)) << (shiftForWord()))))));
	}
	/* begin cr */
	printf("\n");
	return 0;
}

	/* StackInterpreter>>#shortPrintFrameAndCallers: */
static sqInt NoDbgRegParms
shortPrintFrameAndCallers(char *theFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if (!((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
		 && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
		return null;
	}
	shortPrintFrame(theFP);
	if (!((longAt(theFP + FoxSavedFP)) == 0)) {
		shortPrintFrameAndCallers(pointerForOop(longAt(theFP + FoxSavedFP)));
	}
	return 0;
}


/*	use export: not api, so it won't be written to cointerp.h. cogit.c is
	unaware of StackPage
 */

	/* StackInterpreter>>#shortPrintFramesInPage: */
EXPORT(void)
shortPrintFramesInPage(StackPage *thePage)
{
	printFrameAndCallersSPshort((thePage->headFP), (thePage->headSP), 1);
}

	/* StackInterpreter>>#shortPrintFramesOnStackPageListInUse */
EXPORT(void)
shortPrintFramesOnStackPageListInUse(void)
{
    usqInt n;
    StackPage *page;

	page = mostRecentlyUsedPage();
	do {
		if (!(isFree(page))) {
			print("page ");
			/* begin printHexPtrnp: */
			n = oopForPointer(page);
			printf("0x%" PRIxSQINT "", n);
			/* begin cr */
			printf("\n");
			shortPrintFramesInPage(page);
			/* begin cr */
			printf("\n");
		}
	} while(((page = (page->prevPage))) != (mostRecentlyUsedPage()));
}

	/* StackInterpreter>>#shortPrintFrame:AndNCallers: */
void
shortPrintFrameAndNCallers(char *theFP, sqInt n)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if ((n != 0)
	 && ((((((usqInt)theFP)) & (BytesPerWord - 1)) == 0)
	 && ((((((usqInt)theFP)) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)theFP)) <= (((usqInt)GIV(pages)))))))) {
		shortPrintFrame(theFP);
		shortPrintFrameAndNCallers(pointerForOop(longAt(theFP + FoxSavedFP)), n - 1);
	}
}

	/* StackInterpreter>>#shortPrintOop: */
static sqInt NoDbgRegParms
shortPrintOop(sqInt oop)
{
	/* begin printHexnp: */
	printf("0x%" PRIxSQINT "", oop);
	if (oop & (tagMask())) {
		if ((((oop) & 7) == 1)) {
			printf("=%ld\n", (long)integerValueOf(oop));
		}
		if (oop & (characterTag())) {
			printf("=$%ld ($%lc)\n", (long)characterValueOf(oop), (wint_t)characterValueOf(oop));
		}
		if (oop & (smallFloatTag())) {
			printf("=%g\n", floatValueOf(oop));
		}
		return 0;
	}
	if (!(addressCouldBeObj(oop))) {
		return (print(((oop & (8 /* allocationUnit */ - 1)) != 0
					? " is misaligned"
					: whereIs(oop))),
			/* begin cr */
			printf("\n"));
	}
	if ((((longAt(oop)) & (classIndexMask())) == (isFreeObjectClassIndexPun()))
	 || (((longAt(oop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		return printOop(oop);
	}
	print(": a(n) ");
	printNameOfClasscount(fetchClassOfNonImm(oop), 5);
	/* begin cr */
	printf("\n");
	return 0;
}

	/* StackInterpreter>>#shortReversePrintFrameAndCallers: */
static sqInt NoDbgRegParms
shortReversePrintFrameAndCallers(char *aFramePointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt caller;
    sqInt callerContextOrNil;
    char *callerFP;
    sqInt referent;
    char *theFP;
    StackPage *thePage;

	if (aFramePointer == 0) {
		/* begin nilObject */
		return GIV(nilObj);
	}
	theFP = aFramePointer;
	while (1) {
		shortPrintFrame(theFP);
		/* begin frameCallerFP: */
		callerFP = pointerForOop(longAt(theFP + FoxSavedFP));
		if (!(callerFP != 0)) break;
		theFP = callerFP;
	}
	/* begin frameCallerContext: */
	assert(isBaseFrame(theFP));
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	callerContextOrNil = longAt((thePage->baseAddress));
	assert(addressCouldBeObj(callerContextOrNil));
	assert((callerContextOrNil == (nilObject()))
	 || (isContext(callerContextOrNil)));
	caller = callerContextOrNil;
	if (((longAt(caller)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
		/* begin followForwarded: */
		assert(isUnambiguouslyForwarder(caller));
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((caller + BaseHeaderSize) + (0U << (shiftForWord())));
		while (((referent & (tagMask())) == 0)
		 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
		}
		caller = referent;
	}
	return caller;
}


/*	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.
 */

	/* StackInterpreter>>#showDisplayBits:Left:Top:Right:Bottom: */
sqInt
showDisplayBitsLeftTopRightBottom(sqInt aForm, sqInt l, sqInt t, sqInt r, sqInt b)
{
	if (deferDisplayUpdates
	 || (aForm != (splObj(TheDisplay)))) {
		return null;
	}
	updateDisplayLeftTopRightBottom(l, t, r, b);
	return 0;
}


/*	Signal all requested semaphores. Answer if a context switch has occurred. */

	/* StackInterpreter>>#signalExternalSemaphores */
static sqInt
signalExternalSemaphores(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt xArray;

	/* begin splObj: */
	xArray = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ExternalObjectsArray) << (shiftForWord())))));
	return doSignalExternalSemaphores(numSlotsOf(xArray));
}


/*	Answer the size of the CallPrimitive bytecode that may be used to store a
	method's primitive.
 */
/*	NewsqueakV4:	249	11111001	iiiiiiii	jjjjjjjj	Call Primitive #iiiiiiii +
	(jjjjjjjj * 256)
 */
/*	SistaV1:		248	11111000 iiiiiiii	mssjjjjj	Call Primitive #iiiiiiii + (
	jjjjj * 256) */
/*	V3+Closures:	139	11101111	iiiiiiii	jjjjjjjj	Call Primitive #iiiiiiii +
	(jjjjjjjj * 256)
 */

	/* StackInterpreter>>#sizeOfCallPrimitiveBytecode: */
sqInt
sizeOfCallPrimitiveBytecode(sqInt methodHeader)
{
	return 3;
}


/*	234		11101010	i i i i i i i i	Store Temporary Variable #iiiiiiii */
/*	129 10000001 jjkkkkkk Store (Receiver Variable, Temporary Location,
	Illegal, Literal Variable) [jj] #kkkkkk */

	/* StackInterpreter>>#sizeOfLongStoreTempBytecode: */
sqInt
sizeOfLongStoreTempBytecode(sqInt methodHeader)
{
	return 2;
}


/*	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. */

	/* StackInterpreter>>#sizeOfSTArrayFromCPrimitive: */
sqInt
sizeOfSTArrayFromCPrimitive(void *cPtr)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fmt;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt oop;

	oop = (oopForPointer(cPtr)) - BaseHeaderSize;
	if (!(((oop & (tagMask())) == 0)
		 && (isPureBitsFormat((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask()))))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	/* begin lengthOf:format: */
	fmt = (((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOfAny: */
	numSlots1 = byteAt(oop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		return numSlots;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		return (numSlots << (shiftForWord())) - (fmt & 7);
	}
	if (fmt >= (firstShortFormat())) {
		return (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
	}
	if (fmt >= (firstLongFormat())) {
		return (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		return numSlots;
	}
	return 0;
}


/*	update state of active context */

	/* StackInterpreter>>#snapshot: */
static sqInt NoDbgRegParms
snapshot(sqInt embedded)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt activeContext;
    sqInt activeProc;
    CogMethod *cogMethod;
    sqInt i;
    usqInt initialIP;
    sqInt methodHeader;
    sqInt numArgs;
    sqInt numTemps;
    sqInt object;
    sqInt object1;
    sqInt object2;
    sqInt objOop;
    sqInt objOop1;
    sqInt oop;
    sqInt rcvr;
    sqInt rcvr1;
    sqInt savedTenuringThreshold;
    void *setMacType;
    char *sp;
    char *sp1;
    char *sp10;
    char *sp11;
    char *sp2;
    char *sp21;
    char *sp3;
    char *sp4;
    char *sp5;
    char *sp6;
    char *sp7;
    char *sp8;
    char *sp9;
    sqInt stackIndex;
    sqInt valuePointer;


	/* For now the stack munging below doesn't deal with more than one argument.
	   It can, and should. */
	cogMethod = ((CogMethod *) 0);
	rcvr = 0;
	if (GIV(argumentCount) != 0) {
		/* begin primitiveFailFor: */
		return (GIV(primFailCode) = PrimErrBadNumArgs);
	}
	/* begin push: */
	longAtput((sp2 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
	GIV(stackPointer) = sp2;

	/* update state of active process */
	activeContext = voidVMStateForSnapshotFlushingExternalPrimitivesIf(1);
	/* begin activeProcess */
	objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	activeProc = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ActiveProcessIndex) << (shiftForWord())))));
	/* begin storePointer:ofObject:withValue: */
	assert(!(isForwarded(activeProc)));
	if ((assert(isNonImmediate(activeProc)),
	oopisGreaterThanOrEqualTo(activeProc, GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((activeContext & (tagMask())) == 0)
		 && (oopisLessThan(activeContext, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(activeProc))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(activeProc);
			}
		}
	}
	longAtput((activeProc + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord())))), activeContext);
	GIV(tempOop) = activeContext;
	/* begin garbageCollectForSnapshot */
	savedTenuringThreshold = GIV(tenureThreshold);
	/* begin setRawTenuringThreshold: */
	GIV(tenureThreshold) = GIV(newSpaceLimit);
	scavengingGCTenuringIf(TenureByAge);
	/* begin setRawTenuringThreshold: */
	GIV(tenureThreshold) = savedTenuringThreshold;
	assert((rememberedSetSize()) == 0);
	assert(GIV(pastSpaceStart) == (((pastSpace()).start)));
	assert(GIV(freeStart) == (((eden()).start)));
	flag("If we wanted to shrink the rememberedSet prior to snapshot this is the place to do it.");
	/* begin biasForSnapshot */
	GIV(biasForGC) = 0;
	fullGC();
	/* begin biasForGC */
	GIV(biasForGC) = 1;
	prepareForSnapshot();
	/* begin checkFreeSpace: */
	assert(bitsSetInFreeSpaceMaskForAllFreeLists());
	assert(GIV(totalFreeOldSpace) == (totalFreeListBytes()));
	if (((checkForLeaks & (GCModeFreeSpace | GCModeFull)) == (GCModeFreeSpace | GCModeFull))) {
		runLeakCheckerForFreeSpace(GCModeFreeSpace);
	}
	activeContext = GIV(tempOop);
	GIV(tempOop) = 0;
	if (!GIV(primFailCode)) {

		/* Without contexts or stacks simulate
		   rcvr := self popStack. ''pop rcvr''
		   self push: trueObj.
		   to arrange that the snapshot resumes with true.  N.B. stackIndex is one-relative. */
		/* begin quickFetchInteger:ofObject: */
		oop = longAt((activeContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
		assert((((oop) & 7) == 1));
		stackIndex = (oop >> 3);
		/* begin fetchPointer:ofObject: */
		rcvr = longAt((activeContext + BaseHeaderSize) + (((sqInt)((usqInt)(((stackIndex + CtxtTempFrameStart) - 1)) << (shiftForWord())))));
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = GIV(trueObj);
		assert(!(isOopForwarded(activeContext)));
		longAtput((activeContext + BaseHeaderSize) + (((sqInt)((usqInt)(((stackIndex + CtxtTempFrameStart) - 1)) << (shiftForWord())))), valuePointer);
		writeImageFileIO();
		if ((!GIV(primFailCode))
		 && (!embedded)) {

			/* set Mac file type and creator; this is a noop on other platforms */
			setMacType = ioLoadFunctionFrom("setMacFileTypeAndCreator", "FilePlugin");
			if (!(setMacType == 0)) {
				((sqInt (*)(char *, char *, char *))setMacType)(imageName, "STim", "FAST");
			}
		}
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(activeContext)));
		longAtput((activeContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))), (((usqInt)(stackIndex - 1) << 3) | 1));
	}
	postSnapshot();
	marryContextInNewStackPageAndInitializeInterpreterRegisters(activeContext);
	if (!GIV(primFailCode)) {
		/* begin push: */
		object = GIV(falseObj);
		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
		GIV(stackPointer) = sp;
	}
	else {
		/* begin push: */
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), rcvr);
		GIV(stackPointer) = sp1;
		/* begin justActivateNewMethod: */
		methodHeader = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if (0) {
			cogMethod = ((CogMethod *) methodHeader);
			methodHeader = (cogMethod->methodHeader);
		}
		numTemps = (((usqInt) methodHeader) >> MethodHeaderTempCountShift) & 0x3F;
		numArgs = (((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15;

		/* could new rcvr be set at point of send? */
		rcvr1 = longAt(GIV(stackPointer) + (numArgs * BytesPerWord));
		assert(!(isOopForwarded(rcvr1)));
		if ((cogMethod != null)
		 && ((((usqInt)GIV(instructionPointer))) >= (startOfMemory()))) {
			/* begin iframeSavedIP:put: */
			assert(!(isMachineCodeFrame(GIV(framePointer))));
			longAtput(GIV(framePointer) + FoxIFSavedIP, GIV(instructionPointer));
			GIV(instructionPointer) = ceReturnToInterpreterPC();
		}
		/* begin push: */
		longAtput((sp7 = GIV(stackPointer) - BytesPerWord), GIV(instructionPointer));
		GIV(stackPointer) = sp7;
		/* begin push: */
		longAtput((sp8 = GIV(stackPointer) - BytesPerWord), GIV(framePointer));
		GIV(stackPointer) = sp8;
		GIV(framePointer) = GIV(stackPointer);
		initialIP = (GIV(newMethod) + ((LiteralStart + ((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask))) * BytesPerOop)) + BaseHeaderSize;
		if (cogMethod == null) {
			/* begin push: */
			longAtput((sp10 = GIV(stackPointer) - BytesPerWord), GIV(newMethod));
			GIV(stackPointer) = sp10;
			/* begin setMethod:methodHeader: */
			GIV(method) = GIV(newMethod);
			assert(isOopCompiledMethod(GIV(method)));
			assert((methodHeaderOf(GIV(method))) == methodHeader);
			
#      if MULTIPLEBYTECODESETS
			GIV(bytecodeSetSelector) = ((((sqLong) methodHeader)) < 0
				? 256
				: 0);
#      endif /* MULTIPLEBYTECODESETS */
			/* begin push: */
			longAtput((sp11 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
			GIV(stackPointer) = sp11;
			/* begin push: */
			object2 = (VMBIGENDIAN
				? ((1 + (((sqInt)((usqInt)(numArgs) << ((BytesPerWord * 8) - 8))))) + (0)) + (0)
				: ((1 + (((sqInt)((usqInt)(numArgs) << 8)))) + (0)) + (0));
			longAtput((sp21 = GIV(stackPointer) - BytesPerWord), object2);
			GIV(stackPointer) = sp21;
			/* begin push: */
			longAtput((sp3 = GIV(stackPointer) - BytesPerWord), 0);
			GIV(stackPointer) = sp3;
			GIV(instructionPointer) = initialIP - 1;
		}
		else {
			/* begin push: */
			object1 = ((usqInt)cogMethod);
			longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object1);
			GIV(stackPointer) = sp4;
			/* begin push: */
			longAtput((sp5 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
			GIV(stackPointer) = sp5;
			GIV(instructionPointer) = (((usqInt)cogMethod)) + ((cogMethod->stackCheckOffset));
		}
		/* begin push: */
		longAtput((sp9 = GIV(stackPointer) - BytesPerWord), rcvr1);
		GIV(stackPointer) = sp9;
		for (i = (numArgs + 1); i <= numTemps; i += 1) {
			/* begin push: */
			longAtput((sp6 = GIV(stackPointer) - BytesPerWord), GIV(nilObj));
			GIV(stackPointer) = sp6;
		}
		if ((/* begin alternateHeaderHasPrimitiveFlag: */
		methodHeader & AlternateHeaderHasPrimFlag)) {

			/* Skip the CallPrimitive bytecode, if it's there, and store the error code if the method starts
			   with a long store temp.  Strictly no need to skip the store because it's effectively a noop. */
			if (!(cogMethod)) {
				GIV(instructionPointer) += 3;
			}
			if (GIV(primFailCode) != 0) {
				reapAndResetErrorCodeToheader(GIV(stackPointer), methodHeader);
			}
		}
	}
	return 0;
}

	/* StackInterpreter>>#space */
static void
space(void)
{
	/* begin printChar: */
	putchar(' ');
}

	/* StackInterpreter>>#specialSelector: */
sqInt
specialSelector(sqInt index)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt objOop;

	/* begin fetchPointer:ofObject: */
	objOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SpecialSelectors) << (shiftForWord())))));
	return longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)((index * 2)) << (shiftForWord())))));
}


/*	Insulate the stack zone from the effects of a become.
	All receivers must be unfollowed for two reasons:
	1. inst var access is direct with no read barrier
	2. super sends (always to the receiver) have no class check and so don't
	trap for forwarded receivers. This is an issue for primitives that assume
	their receiver
	is valid and don't validate.
	Super sends require an explicit check to ensure receivers in super sends
	are unforwarded.
	e.g. super doSomethingWith: (self become: other) forwards the receiver
	self pushed on the
	stack. So we could avoid following non-pointer receivers. But this is too
	tricky, Instead, we
	always follow receivers.
	Methods must be unfollowed since bytecode access is direct with no read
	barrier. But this only needs to be done if the becomeEffectsFlags indicate
	that a
	CompiledMethod was becommed.
	The scheduler state must be followed, but only if the becomeEffectsFlags
	indicate that a pointer object was becommed. */
/*	For VM profiling */

	/* StackInterpreter>>#spurPostBecomeAction: */
static void NoDbgRegParms
spurPostBecomeAction(sqInt theBecomeEffectsFlags)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqIntptr_t c;
    sqIntptr_t c1;
    sqInt first;
    sqInt i;
    sqInt i1;
    sqInt i2;
    sqInt i3;
    sqInt iLimiT;
    sqInt iLimiT1;
    sqInt last;
    sqInt list;
    sqIntptr_t m;
    sqInt next;
    sqInt obj;
    sqInt obj1;
    sqInt obj2;
    sqInt obj3;
    sqInt obj4;
    sqInt objOop;
    sqInt objOop1;
    sqInt objOop2;
    sqInt objOop3;
    sqInt objOop4;
    sqInt procLists;
    sqInt referent;
    sqInt referent1;
    sqInt referent11;
    sqInt referent2;
    sqInt referent21;
    sqInt referent3;
    sqInt referent31;
    sqInt referent4;
    sqInt referent5;
    sqInt referent6;
    sqIntptr_t s;
    sqIntptr_t s1;
    sqInt sched;
    sqInt schedAssoc;
    sqInt xArray;

	if (theBecomeEffectsFlags != 0) {
		if (theBecomeEffectsFlags & BecameCompiledMethodFlag) {
			/* begin followForwardedMethodsInMethodCache */
			for (i = 0; i < MethodCacheSize; i += MethodCacheEntrySize) {
				c = GIV(methodCache)[i + MethodCacheClass];
				s = GIV(methodCache)[i + MethodCacheSelector];
				m = GIV(methodCache)[i + MethodCacheMethod];
				if ((c != 0)
				 && ((s != 0)
				 && ((m != 0)
				 && (((m & (tagMask())) == 0)
				 && (((longAt(m)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))))) {
					/* begin followForwarded: */
					assert(isUnambiguouslyForwarder(m));
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent = longAt((m + BaseHeaderSize) + (0U << (shiftForWord())));
					while (((referent & (tagMask())) == 0)
					 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
					}
					m = referent;
					GIV(methodCache)[i + MethodCacheMethod] = m;
				}
			}
			/* begin followForwardedMethodsInMethodZone */
			followForwardedMethods();
		}
		if (theBecomeEffectsFlags & BecameActiveClassFlag) {
			/* begin flushBecommedClassesInMethodCache */
			for (i1 = 0; i1 < MethodCacheSize; i1 += MethodCacheEntrySize) {
				c1 = GIV(methodCache)[i1 + MethodCacheClass];
				s1 = GIV(methodCache)[i1 + MethodCacheSelector];
				if ((c1 != 0)
				 && ((s1 != 0)
				 && (isForwarded(classOrNilAtIndex(c1))))) {
					GIV(methodCache)[i1 + MethodCacheClass] = 0;
					GIV(methodCache)[i1 + MethodCacheSelector] = 0;
				}
			}
			/* begin flushBecommedClassesInMethodZone */
			unlinkSendsLinkedForInvalidClasses();
		}
		if (theBecomeEffectsFlags & BecamePointerObjectFlag) {
			/* begin followForwardingPointersInScheduler */
			schedAssoc = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
			assert(!(isForwarded(schedAssoc)));
			followForwardedObjectFieldstoDepth(schedAssoc, 1);
			/* begin fetchPointer:ofObject: */
			sched = longAt((schedAssoc + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
			/* begin followObjField:ofObject: */
			objOop4 = longAt((sched + BaseHeaderSize) + (((sqInt)((usqInt)(ProcessListsIndex) << (shiftForWord())))));
			assert(isNonImmediate(objOop4));
			if (((longAt(objOop4)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				objOop4 = fixFollowedFieldofObjectwithInitialValue(ProcessListsIndex, sched, objOop4);
			}
			procLists = objOop4;
			for (i2 = 0, iLimiT = ((numSlotsOf(procLists)) - 1); i2 <= iLimiT; i2 += 1) {
				/* begin followObjField:ofObject: */
				objOop1 = longAt((procLists + BaseHeaderSize) + (((sqInt)((usqInt)(i2) << (shiftForWord())))));
				assert(isNonImmediate(objOop1));
				if (((longAt(objOop1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					objOop1 = fixFollowedFieldofObjectwithInitialValue(i2, procLists, objOop1);
				}
				list = objOop1;
				/* begin followObjField:ofObject: */
				objOop2 = longAt((list + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))));
				assert(isNonImmediate(objOop2));
				if (((longAt(objOop2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					objOop2 = fixFollowedFieldofObjectwithInitialValue(FirstLinkIndex, list, objOop2);
				}
				first = objOop2;
				/* begin followObjField:ofObject: */
				objOop3 = longAt((list + BaseHeaderSize) + (((sqInt)((usqInt)(LastLinkIndex) << (shiftForWord())))));
				assert(isNonImmediate(objOop3));
				if (((longAt(objOop3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					objOop3 = fixFollowedFieldofObjectwithInitialValue(LastLinkIndex, list, objOop3);
				}
				last = objOop3;
				while (first != last) {
					/* begin followObjField:ofObject: */
					objOop = longAt((first + BaseHeaderSize) + (((sqInt)((usqInt)(NextLinkIndex) << (shiftForWord())))));
					assert(isNonImmediate(objOop));
					if (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
						objOop = fixFollowedFieldofObjectwithInitialValue(NextLinkIndex, first, objOop);
					}
					next = objOop;
					first = next;
				}
			}
			/* begin followForwardingPointersInSpecialObjectsArray */
			obj1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheLowSpaceSemaphore) << (shiftForWord())))));
			if (((longAt(obj1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(obj1));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent21 = longAt((obj1 + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent21 & (tagMask())) == 0)
				 && (((longAt(referent21)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent21 = longAt((referent21 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				obj1 = referent21;
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(GIV(specialObjectsOop))));
				if ((assert(isNonImmediate(GIV(specialObjectsOop))),
				oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((obj1 & (tagMask())) == 0)
					 && (oopisLessThan(obj1, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(GIV(specialObjectsOop));
						}
					}
				}
				longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheLowSpaceSemaphore) << (shiftForWord())))), obj1);
			}
			/* begin followSemaphoreIn:at: */
			obj2 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheInterruptSemaphore) << (shiftForWord())))));
			if (((longAt(obj2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(obj2));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent31 = longAt((obj2 + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent31 & (tagMask())) == 0)
				 && (((longAt(referent31)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent31 = longAt((referent31 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				obj2 = referent31;
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(GIV(specialObjectsOop))));
				if ((assert(isNonImmediate(GIV(specialObjectsOop))),
				oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((obj2 & (tagMask())) == 0)
					 && (oopisLessThan(obj2, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(GIV(specialObjectsOop));
						}
					}
				}
				longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheInterruptSemaphore) << (shiftForWord())))), obj2);
			}
			/* begin followSemaphoreIn:at: */
			obj3 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheTimerSemaphore) << (shiftForWord())))));
			if (((longAt(obj3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(obj3));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent4 = longAt((obj3 + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent4 & (tagMask())) == 0)
				 && (((longAt(referent4)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent4 = longAt((referent4 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				obj3 = referent4;
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(GIV(specialObjectsOop))));
				if ((assert(isNonImmediate(GIV(specialObjectsOop))),
				oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((obj3 & (tagMask())) == 0)
					 && (oopisLessThan(obj3, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(GIV(specialObjectsOop));
						}
					}
				}
				longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), obj3);
			}
			/* begin followSemaphoreIn:at: */
			obj4 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheFinalizationSemaphore) << (shiftForWord())))));
			if (((longAt(obj4)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(obj4));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent5 = longAt((obj4 + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent5 & (tagMask())) == 0)
				 && (((longAt(referent5)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent5 = longAt((referent5 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				obj4 = referent5;
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(GIV(specialObjectsOop))));
				if ((assert(isNonImmediate(GIV(specialObjectsOop))),
				oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((obj4 & (tagMask())) == 0)
					 && (oopisLessThan(obj4, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(GIV(specialObjectsOop));
						}
					}
				}
				longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheFinalizationSemaphore) << (shiftForWord())))), obj4);
			}
			/* begin splObj: */
			xArray = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ExternalObjectsArray) << (shiftForWord())))));
			if (((longAt(xArray)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(xArray));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent6 = longAt((xArray + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent6 & (tagMask())) == 0)
				 && (((longAt(referent6)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent6 = longAt((referent6 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				xArray = referent6;
				/* begin splObj:put: */
				assert(!(isForwarded(GIV(specialObjectsOop))));
				if ((assert(isNonImmediate(GIV(specialObjectsOop))),
				oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((xArray & (tagMask())) == 0)
					 && (oopisLessThan(xArray, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(GIV(specialObjectsOop));
						}
					}
				}
				longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ExternalObjectsArray) << (shiftForWord())))), xArray);
			}
			for (i3 = 0, iLimiT1 = ((numSlotsOf(xArray)) - 1); i3 <= iLimiT1; i3 += 1) {
				/* begin followSemaphoreIn:at: */
				obj = longAt((xArray + BaseHeaderSize) + (((sqInt)((usqInt)(i3) << (shiftForWord())))));
				if (((longAt(obj)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
					/* begin followForwarded: */
					assert(isUnambiguouslyForwarder(obj));
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent11 = longAt((obj + BaseHeaderSize) + (0U << (shiftForWord())));
					while (((referent11 & (tagMask())) == 0)
					 && (((longAt(referent11)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
						/* begin fetchPointer:ofMaybeForwardedObject: */
						referent11 = longAt((referent11 + BaseHeaderSize) + (0U << (shiftForWord())));
					}
					obj = referent11;
					/* begin storePointer:ofObject:withValue: */
					assert(!(isForwarded(xArray)));
					if ((assert(isNonImmediate(xArray)),
					oopisGreaterThanOrEqualTo(xArray, GIV(oldSpaceStart)))) {

						/* most stores into young objects */
						if (((obj & (tagMask())) == 0)
						 && (oopisLessThan(obj, GIV(newSpaceLimit)))) {
							/* begin possibleRootStoreInto: */
							if (!(((((usqInt) (longAt(xArray))) >> (rememberedBitShift())) & 1) != 0)) {
								remember(xArray);
							}
						}
					}
					longAtput((xArray + BaseHeaderSize) + (((sqInt)((usqInt)(i3) << (shiftForWord())))), obj);
				}
			}
		}
		if (theBecomeEffectsFlags & (BecamePointerObjectFlag + BecameCompiledMethodFlag)) {
			/* begin followForwardingPointersInProfileState */
			if (((longAt(GIV(profileProcess))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(GIV(profileProcess)));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent3 = longAt((GIV(profileProcess) + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent3 & (tagMask())) == 0)
				 && (((longAt(referent3)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent3 = longAt((referent3 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				GIV(profileProcess) = referent3;
			}
			if (((longAt(GIV(profileMethod))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(GIV(profileMethod)));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent1 = longAt((GIV(profileMethod) + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent1 & (tagMask())) == 0)
				 && (((longAt(referent1)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent1 = longAt((referent1 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				GIV(profileMethod) = referent1;
			}
			if (((longAt(GIV(profileProcess))) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0) {
				/* begin followForwarded: */
				assert(isUnambiguouslyForwarder(GIV(profileSemaphore)));
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent2 = longAt((GIV(profileSemaphore) + BaseHeaderSize) + (0U << (shiftForWord())));
				while (((referent2 & (tagMask())) == 0)
				 && (((longAt(referent2)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
					/* begin fetchPointer:ofMaybeForwardedObject: */
					referent2 = longAt((referent2 + BaseHeaderSize) + (0U << (shiftForWord())));
				}
				GIV(profileSemaphore) = referent2;
			}
		}
	}
	followForwardingPointersInStackZone(theBecomeEffectsFlags);
}


/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#stackFloatValue: */
double
stackFloatValue(sqInt offset)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return floatValueOf(longAt(GIV(stackPointer) + (offset * BytesPerWord)));
}


/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#stackIntegerValue: */
sqInt
stackIntegerValue(sqInt offset)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerPointer;

	integerPointer = longAt(GIV(stackPointer) + (offset * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		return (integerPointer >> 3);
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
}


/*	Answer the actual stackLimit offset in a page. Since stackPageByteSize may
	have chosen to shrink a page
	this may be less than stackPageFrameBytes, but it should be no more than
	stackPageFrameBytes. 
 */

	/* StackInterpreter>>#stackLimitBytes */
static sqInt
stackLimitBytes(void)
{
	return (((stackPageFrameBytes()) < (((stackPageByteSize()) - ((IFrameSlots + 64) * BytesPerWord)) - (osCogStackPageHeadroom()))) ? (stackPageFrameBytes()) : (((stackPageByteSize()) - ((IFrameSlots + 64) * BytesPerWord)) - (osCogStackPageHeadroom())));
}


/*	Ensures that the given object is a real object, not a SmallInteger. */
/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#stackObjectValue: */
sqInt
stackObjectValue(sqInt offset)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt oop;

	oop = longAt(GIV(stackPointer) + (offset * BytesPerWord));
	if (oop & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	return oop;
}


/*	Answer a page size that is a power-of-two and contains a useful number of
	frames. Room for 256 slots for frames gives around 40 frames a page which
	is a
	good compromise between overflow rate and latency in divorcing a page. */

	/* StackInterpreter>>#stackPageByteSize */
static sqInt
stackPageByteSize(void)
{
    int largeSize;
    sqInt pageBytes;
    int smallSize;

	pageBytes = ((stackPageFrameBytes()) + ((IFrameSlots + 64) * BytesPerWord)) + (osCogStackPageHeadroom());
	if ((pageBytes & (pageBytes - 1)) == 0) {

		/* = 0 => a power of two */
		return pageBytes;
	}
	largeSize = 1ULL << (highBit(pageBytes));
	smallSize = 1ULL << ((highBit(pageBytes)) - 1);
	assert((largeSize > pageBytes)
	 && (pageBytes > smallSize));
	return ((pageBytes - smallSize) <= (smallSize / 8)
		? smallSize
		: largeSize);
}


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

	/* StackInterpreter>>#stackPointerForMaybeMarriedContext: */
static sqInt NoDbgRegParms
stackPointerForMaybeMarriedContext(sqInt aContext)
{
    sqInt sp;
    sqInt sp1;

	if ((((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(aContext)))) {
		sp = stackPointerIndexForFrame(frameOfMarriedContext(aContext));
		assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(aContext)));
		return sp;
	}
	/* begin fetchStackPointerOf: */
	sp1 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
	if (!((((sp1) & 7) == 1))) {
		return 0;
	}
	assert((ReceiverIndex + ((sp1 >> 3))) < (lengthOf(aContext)));
	return (sp1 >> 3);
}


/*	Return the 0-based index rel to the given frame.
	(This is what stackPointer used to be before conversion to pointer) */
/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#stackPointerIndexForFrame: */
static sqInt NoDbgRegParms
stackPointerIndexForFrame(char *theFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    StackPage *thePage;
    char *theSP;

	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	theSP = findSPOfon(theFP, thePage);
	return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
		? (((usqInt) ((theFP + FoxMFReceiver) - theSP)) >> (shiftForWord())) + (((mframeCogMethod(theFP))->cmNumArgs))
		: (((usqInt) ((theFP + FoxIFReceiver) - theSP)) >> (shiftForWord())) + (byteAt((theFP + FoxIFrameFlags) + 1)));
}


/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#stackPositiveMachineIntegerValue: */
usqIntptr_t
stackPositiveMachineIntegerValue(sqInt offset)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bs;
    sqInt ccIndex;
    sqInt fmt;
    sqInt integerPointer;
    sqInt ok;
    sqInt value;

	integerPointer = longAt(GIV(stackPointer) + (offset * BytesPerWord));
	/* begin positiveMachineIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		value = (integerPointer >> 3);
		if (value < 0) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return null;
		}
		return value;
	}
	if (integerPointer & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(integerPointer)));
	/* begin classIndexOf: */
	ccIndex = (longAt(integerPointer)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
	goto l2;
	l2:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (!ok) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	/* begin numBytesOfBytes: */
	fmt = (((usqInt) (longAt(integerPointer))) >> (formatShift())) & (formatMask());
	assert(fmt >= (firstByteFormat()));
	bs = ((numSlotsOf(integerPointer)) << (shiftForWord())) - (fmt & 7);
	if (bs > (sizeof(usqIntptr_t))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return 0;
	}
	if (((sizeof(usqIntptr_t)) == 8)
	 && (bs > 4)) {
		return SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((integerPointer + BaseHeaderSize) + (0U << 3))));
	}
	else {
		return ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((integerPointer + BaseHeaderSize) + (0U << 2))))));
	}
}


/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#stackSignedMachineIntegerValue: */
sqIntptr_t
stackSignedMachineIntegerValue(sqInt offset)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerPointer;

	integerPointer = longAt(GIV(stackPointer) + (offset * BytesPerWord));
	return signedMachineIntegerValueOf(integerPointer);
}

	/* StackInterpreter>>#stackTop */
sqInt
stackTop(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return longAt(GIV(stackPointer));
}


/*	In the StackInterpreter stacks grow down. */

	/* StackInterpreter>>#stackValue: */
sqInt
stackValue(sqInt offset)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	return longAt(GIV(stackPointer) + (offset * BytesPerWord));
}


/*	Zero-relative version of CompiledMethod>>startpc. */

	/* StackInterpreter>>#startPCOfMethod: */
sqInt
startPCOfMethod(sqInt aCompiledMethod)
{
	return ((literalCountOfMethodHeader(methodHeaderOf(aCompiledMethod))) + LiteralStart) * BytesPerOop;
}


/*	Return what ST would return for <obj> at: index. */

	/* StackInterpreter>>#stObject:at: */
sqInt
stObjectat(sqInt array, sqInt index)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class;
    sqInt classFormat;
    sqInt fixedFields;
    usqLong fmt;
    sqLong hdr;
    unsigned int integerValue;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt reasonCode;
    sqInt sp;
    sqInt sp1;
    sqInt stSize;
    sqInt totalLength;

	/* begin baseHeader: */
	hdr = long64At(array);
	fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots1 = byteAt(array + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(array - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		totalLength = numSlots;
		goto l6;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l6;
	}
	if (fmt >= (firstShortFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l6;
	}
	if (fmt >= (firstLongFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l6;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		totalLength = numSlots;
		goto l6;
	}
	totalLength = 0;
	l6:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		fixedFields = 0;
		goto l7;
	}
	if (fmt < 2 /* arrayFormat */) {
		fixedFields = totalLength;
		goto l7;
	}
	class = fetchClassOfNonImm(array);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l7:	/* end fixedFieldsOf:format:length: */;
	if ((fmt == (indexablePointersFormat()))
	 && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		/* begin stackPointerForMaybeMarriedContext: */
		if ((((((longAt((array + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(array)))) {
			sp = stackPointerIndexForFrame(frameOfMarriedContext(array));
			assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(array)));
			stSize = sp;
			goto l4;
		}
		/* begin fetchStackPointerOf: */
		sp1 = longAt((array + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
		if (!((((sp1) & 7) == 1))) {
			stSize = 0;
			goto l4;
		}
		assert((ReceiverIndex + ((sp1 >> 3))) < (lengthOf(array)));
		stSize = (sp1 >> 3);
	l4:	/* end stackPointerForMaybeMarriedContext: */;
		if ((oopisGreaterThanOrEqualTo(index, 1))
		 && ((oopisLessThanOrEqualTo(index, stSize))
		 && ((((((longAt((array + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(array)))))) {
			return noInlineTemporaryin(index - 1, frameOfMarriedContext(array));
		}
	}
	else {
		stSize = totalLength - fixedFields;
	}
	if ((oopisGreaterThanOrEqualTo(index, (fmt >= (firstCompiledMethodFormat())
		? (((literalCountOf(array)) + LiteralStart) * BytesPerOop) + 1
		: 1)))
	 && (oopisLessThanOrEqualTo(index, stSize))) {
		/* begin subscript:with:format: */
		if (fmt <= 5 /* lastPointerFormat */) {
			/* begin fetchPointer:ofObject: */
			return longAt((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))));
		}
		if (fmt >= (firstByteFormat())) {
			return (((usqInt)(byteAt((array + BaseHeaderSize) + ((index + fixedFields) - 1))) << 3) | 1);
		}
		if (fmt >= (firstShortFormat())) {
			return (((usqInt)(((unsigned short) (shortAt((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 3) | 1);
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			return positive64BitIntegerFor(long64At((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3)))));
		}
		/* begin positive32BitIntegerFor: */
		integerValue = long32At((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))));
		return ((((((usqInt)integerValue)) & 0xFFFFFFFFU) << 3) | 1);
	}
	/* begin primitiveFailFor: */
	reasonCode = (fmt <= 1
		? PrimErrBadReceiver
		: PrimErrBadIndex);
	GIV(primFailCode) = reasonCode;
	return 0;
}


/*	Do what ST would return for <obj> at: index put: value. */

	/* StackInterpreter>>#stObject:at:put: */
sqInt
stObjectatput(sqInt array, sqInt index, sqInt value)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class;
    sqInt classFormat;
    sqInt fixedFields;
    usqLong fmt;
    sqLong hdr;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt reasonCode;
    sqInt signedValueToStore;
    sqInt sp;
    sqInt sp1;
    sqInt stSize;
    sqInt totalLength;
    usqLong unsigned64BitValueToStore;
    unsigned int unsignedValueToStore;

	/* begin baseHeader: */
	hdr = long64At(array);
	fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots1 = byteAt(array + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(array - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		totalLength = numSlots;
		goto l6;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l6;
	}
	if (fmt >= (firstShortFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l6;
	}
	if (fmt >= (firstLongFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l6;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		totalLength = numSlots;
		goto l6;
	}
	totalLength = 0;
	l6:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		fixedFields = 0;
		goto l7;
	}
	if (fmt < 2 /* arrayFormat */) {
		fixedFields = totalLength;
		goto l7;
	}
	class = fetchClassOfNonImm(array);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l7:	/* end fixedFieldsOf:format:length: */;
	if ((fmt == (indexablePointersFormat()))
	 && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		/* begin stackPointerForMaybeMarriedContext: */
		if ((((((longAt((array + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(array)))) {
			sp = stackPointerIndexForFrame(frameOfMarriedContext(array));
			assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(array)));
			stSize = sp;
			goto l4;
		}
		/* begin fetchStackPointerOf: */
		sp1 = longAt((array + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
		if (!((((sp1) & 7) == 1))) {
			stSize = 0;
			goto l4;
		}
		assert((ReceiverIndex + ((sp1 >> 3))) < (lengthOf(array)));
		stSize = (sp1 >> 3);
	l4:	/* end stackPointerForMaybeMarriedContext: */;
		if ((oopisGreaterThanOrEqualTo(index, 1))
		 && ((oopisLessThanOrEqualTo(index, stSize))
		 && ((((((longAt((array + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(array)))))) {
			return noInlineTemporaryinput(index - 1, frameOfMarriedContext(array), value);
		}
	}
	else {
		stSize = totalLength - fixedFields;
	}
	if ((oopisGreaterThanOrEqualTo(index, (fmt >= (firstCompiledMethodFormat())
		? (((literalCountOf(array)) + LiteralStart) * BytesPerOop) + 1
		: 1)))
	 && (oopisLessThanOrEqualTo(index, stSize))) {
		/* begin subscript:with:storing:format: */
		if (fmt <= 5 /* lastPointerFormat */) {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(array)));
			if ((assert(isNonImmediate(array)),
			oopisGreaterThanOrEqualTo(array, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((value & (tagMask())) == 0)
				 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(array))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(array);
					}
				}
			}
			longAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value);
			goto l13;
		}
		if (fmt >= (firstByteFormat())) {
			if (!((((value) & 7) == 1))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l13;
			}
			signedValueToStore = (value >> 3);
			if (!((signedValueToStore >= 0)
				 && (signedValueToStore <= 0xFF))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l13;
			}
			/* begin storeByte:ofObject:withValue: */
			byteAtput((array + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore);
			goto l13;
		}
		if (fmt >= (firstShortFormat())) {
			if (!((((value) & 7) == 1))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l13;
			}
			signedValueToStore = (value >> 3);
			if (!((signedValueToStore >= 0)
				 && (signedValueToStore <= 0xFFFF))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l13;
			}
			/* begin storeShort16:ofObject:withValue: */
			shortAtput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore);
			goto l13;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			unsigned64BitValueToStore = positive64BitValueOf(value);
			if (!GIV(primFailCode)) {
				/* begin storeLong64:ofObject:withValue: */
				long64Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore);
			}
			goto l13;
		}
		unsignedValueToStore = positive32BitValueOf(value);
		if (!GIV(primFailCode)) {
			/* begin storeLong32:ofObject:withValue: */
			long32Atput((array + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore);
		}
	l13:	/* end subscript:with:storing:format: */;
	}
	else {
		/* begin primitiveFailFor: */
		reasonCode = (fmt <= 1
			? PrimErrBadReceiver
			: PrimErrBadIndex);
		GIV(primFailCode) = reasonCode;
	}
	return value;
}


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

	/* StackInterpreter>>#storeInteger:ofObject:withValue: */
sqInt
storeIntegerofObjectwithValue(sqInt fieldIndex, sqInt objectPointer, sqInt integerValue)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	if ((((((usqInt) integerValue) >> 60) + 1) & 15) <= 1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(objectPointer)));
		longAtput((objectPointer + BaseHeaderSize) + (((sqInt)((usqInt)(fieldIndex) << (shiftForWord())))), (((usqInt)integerValue << 3) | 1));
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	return null;
}


/*	Set the sender of a frame. If the frame is a base frame then this is
	trivial; merely store into the FoxCallerSavedIP/FoxCallerContext field. If
	not, then
	split the stack at the frame, moving the frame and those hotter than it to
	a new stack page. In the new stack page the frame will be the base frame
	and storing trivial. Answer the possibly changed location of theFP. */

	/* StackInterpreter>>#storeSenderOfFrame:withValue: */
static char * NoDbgRegParms
storeSenderOfFramewithValue(char *theFP, sqInt anOop)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    char *callerFP;
    StackPage *lruOrFree;
    StackPage *newPage;
    int onCurrentPage;
    char *theMovedFP;
    StackPage *thePage;
    StackPage *thePage1;

	if ((longAt(theFP + FoxSavedFP)) == 0) {
		/* begin frameCallerContext:put: */
		assert((anOop == (nilObject()))
		 || (isContext(anOop)));
		assert(isBaseFrame(theFP));
		assert(((theFP + (frameStackedReceiverOffset(theFP))) + (2 * BytesPerWord)) == (((stackPageFor(theFP))->baseAddress)));
		assert((longAt((theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord)) == (frameContext(theFP)));
		longAtput((theFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
	? ((mframeCogMethod(theFP))->cmNumArgs)
	: byteAt((theFP + FoxIFrameFlags) + 1))))) + (2 * BytesPerWord), anOop);
		return theFP;
	}
	/* begin ensureCallerContext: */
	callerFP = pointerForOop(longAt(theFP + FoxSavedFP));
	if (callerFP == 0) {

		/* base frame, context in saved ip slot (or base of stack in Cog) */
		/* begin frameCallerContext: */
		assert(isBaseFrame(theFP));
		/* begin stackPageFor: */
		thePage1 = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		callerContextOrNil = longAt((thePage1->baseAddress));
		assert(addressCouldBeObj(callerContextOrNil));
		assert((callerContextOrNil == (nilObject()))
		 || (isContext(callerContextOrNil)));
		goto l5;
	}
	/* begin ensureFrameIsMarried:SP: */
	if (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory())
		? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
		: (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)) {
		assert(isContext(frameContext(callerFP)));
		longAt(callerFP + FoxThisContext);
		goto l5;
	}
	marryFrameSP(callerFP, (assert(!(isBaseFrame(theFP))),
	(theFP + (frameStackedReceiverOffset(theFP))) + BytesPerWord));
	l5:	/* end ensureCallerContext: */;
	/* begin stackPageFor: */
	thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
	pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	onCurrentPage = thePage == GIV(stackPage);
	if (!onCurrentPage) {

		/* Make sure the frame's page isn't divorced when a new page is allocated. */
		markStackPageNextMostRecentlyUsed(thePage);
	}
	/* begin newStackPage */
	lruOrFree = (GIV(mostRecentlyUsedPage)->nextPage);
	if (((lruOrFree->baseFP)) == 0) {
		newPage = lruOrFree;
		goto l1;
	}
	divorceFramesIn(lruOrFree);
	newPage = lruOrFree;
	l1:	/* end newStackPage */;
	theMovedFP = moveFramesInthroughtoPage(thePage, theFP, newPage);
	if (onCurrentPage) {
		/* begin setStackPageAndLimit: */
		assert(newPage != 0);
		GIV(stackPage) = newPage;
		if (GIV(stackLimit) != (((char *) (((usqInt) -1))))) {
			GIV(stackLimit) = (GIV(stackPage)->stackLimit);
		}
		markStackPageMostRecentlyUsed(newPage);
	}
	else {
		markStackPageMostRecentlyUsed(newPage);
	}
	assert(isBaseFrame(theMovedFP));
	/* begin frameCallerContext:put: */
	assert((anOop == (nilObject()))
	 || (isContext(anOop)));
	assert(isBaseFrame(theMovedFP));
	assert(((theMovedFP + (frameStackedReceiverOffset(theMovedFP))) + (2 * BytesPerWord)) == (((stackPageFor(theMovedFP))->baseAddress)));
	assert((longAt((theMovedFP + (frameStackedReceiverOffset(theMovedFP))) + BytesPerWord)) == (frameContext(theMovedFP)));
	longAtput((theMovedFP + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theMovedFP + FoxMethod)))) < (startOfMemory())
	? ((mframeCogMethod(theMovedFP))->cmNumArgs)
	: byteAt((theMovedFP + FoxIFrameFlags) + 1))))) + (2 * BytesPerWord), anOop);
	return theMovedFP;
}


/*	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! */

	/* StackInterpreter>>#stSizeOf: */
sqInt
stSizeOf(sqInt oop)
{
    sqInt class;
    sqInt classFormat;
    sqInt fixedFields;
    usqLong fmt;
    sqLong hdr;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt totalLength;

	/* begin baseHeader: */
	hdr = long64At(oop);
	fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots1 = byteAt(oop + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(oop - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		totalLength = numSlots;
		goto l3;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l3;
	}
	if (fmt >= (firstShortFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l3;
	}
	if (fmt >= (firstLongFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l3;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		totalLength = numSlots;
		goto l3;
	}
	totalLength = 0;
	l3:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		fixedFields = 0;
		goto l4;
	}
	if (fmt < 2 /* arrayFormat */) {
		fixedFields = totalLength;
		goto l4;
	}
	class = fetchClassOfNonImm(oop);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l4:	/* end fixedFieldsOf:format:length: */;
	if (fmt == (indexablePointersFormat())) {
		assert(!(isContextHeader(hdr)));
	}
	return totalLength - fixedFields;
}


/*	Using a read barrier here simplifies the become implementation and costs
	very little because the class index and superclass almost certainly share
	a cache line. */

	/* StackInterpreter>>#superclassOf: */
sqInt
superclassOf(sqInt classPointer)
{
    sqInt objOop;

	/* begin followField:ofObject: */
	objOop = longAt((classPointer + BaseHeaderSize) + (((sqInt)((usqInt)(SuperclassIndex) << (shiftForWord())))));
	if (((objOop & (tagMask())) == 0)
	 && (((longAt(objOop)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		objOop = fixFollowedFieldofObjectwithInitialValue(SuperclassIndex, classPointer, objOop);
	}
	return objOop;
}

	/* StackInterpreter>>#tempCountOf: */
sqInt
tempCountOf(sqInt methodPointer)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt header;
    sqInt header1;

	/* begin temporaryCountOfMethodHeader: */
	assert(isCompiledMethod(methodPointer));
	header1 = longAt((methodPointer + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	return (((usqInt) header) >> MethodHeaderTempCountShift) & 0x3F;
}

	/* StackInterpreter>>#temporaryCountOfMethodHeader: */
sqInt
temporaryCountOfMethodHeader(sqInt header)
{
	return (((usqInt) header) >> MethodHeaderTempCountShift) & 0x3F;
}

	/* StackInterpreter>>#ultimateLiteralOf: */
sqInt
ultimateLiteralOf(sqInt aMethodOop)
{
    sqInt offset;

	assert(isOopCompiledMethod(aMethodOop));
	/* begin literal:ofMethod: */
	offset = (literalCountOfMethodHeader(methodHeaderOf(aMethodOop))) - 1;
	/* begin fetchPointer:ofObject: */
	return longAt((aMethodOop + BaseHeaderSize) + (((sqInt)((usqInt)((offset + LiteralStart)) << (shiftForWord())))));
}


/*	So rare it mustn't bulk up the common path */

	/* StackInterpreter>>#unfollow:atIndex: */
static sqInt NoDbgRegParms NeverInline
unfollowatIndex(sqInt litVar, sqInt literalIndex)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt followed;
    sqInt referent;

	/* begin followForwarded: */
	assert(isUnambiguouslyForwarder(litVar));
	/* begin fetchPointer:ofMaybeForwardedObject: */
	referent = longAt((litVar + BaseHeaderSize) + (0U << (shiftForWord())));
	while (((referent & (tagMask())) == 0)
	 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin fetchPointer:ofMaybeForwardedObject: */
		referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
	}
	followed = referent;
	/* begin literal:ofMethod:put: */
	assert(!(isForwarded(GIV(method))));
	if ((assert(isNonImmediate(GIV(method))),
	oopisGreaterThanOrEqualTo(GIV(method), GIV(oldSpaceStart)))) {

		/* most stores into young objects */
		if (((followed & (tagMask())) == 0)
		 && (oopisLessThan(followed, GIV(newSpaceLimit)))) {
			/* begin possibleRootStoreInto: */
			if (!(((((usqInt) (longAt(GIV(method)))) >> (rememberedBitShift())) & 1) != 0)) {
				remember(GIV(method));
			}
		}
	}
	longAtput((GIV(method) + BaseHeaderSize) + (((sqInt)((usqInt)((literalIndex + LiteralStart)) << (shiftForWord())))), followed);
	return followed;
}


/*	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. */

	/* StackInterpreter>>#updateDisplayLeft:Top:Right:Bottom: */
static sqInt NoDbgRegParms
updateDisplayLeftTopRightBottom(sqInt l, sqInt t, sqInt r, sqInt b)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bottom;
    sqInt left;
    sqInt right;
    sqInt surfaceHandle;
    sqInt top;

	left = ((l < 0) ? 0 : l);
	right = ((r < displayWidth) ? r : displayWidth);
	top = ((t < 0) ? 0 : t);
	bottom = ((b < displayHeight) ? b : displayHeight);
	if (!((left <= right)
		 && (top <= bottom))) {
		return null;
	}
	if (((((((sqInt)displayBits))) & 7) == 1)) {
		surfaceHandle = ((((sqInt)displayBits)) >> 3);
		if (showSurfaceFn == 0) {
			showSurfaceFn = ioLoadFunctionFrom("ioShowSurface", "SurfacePlugin");
			if (showSurfaceFn == 0) {
				/* begin primitiveFailFor: */
				return (GIV(primFailCode) = PrimErrNotFound);
			}
		}
		showSurfaceFn(surfaceHandle, left, top, right - left, bottom - top);
	}
	else {
		assert(isNonImmediate(((sqInt)displayBits)));
		ioShowDisplay(((sqInt)displayBits), displayWidth, displayHeight, displayDepth, left, right, top, bottom);
	}
	return 0;
}


/*	Note that we accept anInstrPointer pointing to a callPrimitiveBytecode
	at the start of a method that contains a primitive. This because methods
	like Context(Part)>>reset have to be updated to skip the callPrimtiive
	bytecode otherwise. */

	/* StackInterpreter>>#validBCPC:inMethod: */
static sqInt NoDbgRegParms
validBCPCinMethod(sqInt thePC, usqInt aMethod)
{
	return (thePC >= (((literalCountOfMethodHeader(methodHeaderOf(aMethod))) + LiteralStart) * BytesPerOop))
	 && (thePC < (numBytesOfBytes(aMethod)));
}


/*	Note that we accept anInstrPointer pointing to a callPrimitiveBytecode
	at the start of a method that contains a primitive. This because methods
	like Context(Part)>>reset have to be updated to skip the callPrimtiive
	bytecode otherwise. */

	/* StackInterpreter>>#validInstructionPointer:inFrame: */
static sqInt NoDbgRegParms
validInstructionPointerinFrame(usqInt anInstrPointer, char *fp)
{
	return validInstructionPointerinMethodframePointer(anInstrPointer, ((((usqInt)(longAt(fp + FoxMethod)))) < (startOfMemory())
		? ((mframeHomeMethod(fp))->methodObject)
		: longAt(fp + FoxMethod)), fp);
}


/*	Check that the base frames in all in-use stack pages have a sender and a
	saved context.
 */

	/* StackInterpreter>>#validStackPageBaseFrames */
static sqInt
validStackPageBaseFrames(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    StackPage *aPage;
    sqInt i;

	for (i = 0; i < GIV(numStackPages); i += 1) {
		/* begin stackPageAt: */
		aPage = stackPageAtpages(i, GIV(pages));
		if (!(isFree(aPage))) {
			if (!(validStackPageBaseFrame(aPage))) {
				return 0;
			}
		}
	}
	return 1;
}


/*	Void the state associated with the long-running primitive check.
	This is done when a new semaphore is installed or when it appears
	that is longRunningPrimitiveCheckMethod is invalid, e.g. because it
	has eben sampled in the middle of a GC. */

	/* StackInterpreter>>#voidLongRunningPrimitive: */
static void NoDbgRegParms NeverInline
voidLongRunningPrimitive(char *reason)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	GIV(longRunningPrimitiveCheckMethod) = null;
	GIV(longRunningPrimitiveStartUsecs) = (GIV(longRunningPrimitiveStopUsecs) = 0);
	GIV(longRunningPrimitiveSignalUndelivered) = 1;
	sqLowLevelMFence();
}


/*	Return the highest priority process that is ready to run.
	To save time looking at many empty lists before finding a
	runnable process the VM maintains a variable holding the
	highest priority runnable process. If this variable is 0 then the
	VM does not know the highest priority and must search all lists.
	Note: It is a fatal VM error if there is no runnable process. */

	/* StackInterpreter>>#wakeHighestPriority */
static sqInt
wakeHighestPriority(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ctxt;
    usqInt numSlots;
    sqInt objOop;
    sqInt objOop1;
    sqInt p;
    sqInt proc;
    sqInt processList;
    sqInt schedLists;

	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	/* begin fetchPointer:ofObject: */
	objOop1 = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(SchedulerAssociation) << (shiftForWord())))));
	objOop = longAt((objOop1 + BaseHeaderSize) + (((sqInt)((usqInt)(ValueIndex) << (shiftForWord())))));
	schedLists = longAt((objOop + BaseHeaderSize) + (((sqInt)((usqInt)(ProcessListsIndex) << (shiftForWord())))));
	if (GIV(highestRunnableProcessPriority) == 0) {
		/* begin numSlotsOf: */
		assert((classIndexOf(schedLists)) > (isForwardedObjectClassIndexPun()));
		numSlots = byteAt(schedLists + 7);
		p = (numSlots == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(schedLists - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots);
	}
	else {
		p = GIV(highestRunnableProcessPriority);
	}
	while (((p -= 1)) >= 0) {
		/* begin fetchPointer:ofObject: */
		processList = longAt((schedLists + BaseHeaderSize) + (((sqInt)((usqInt)(p) << (shiftForWord())))));
		while (!((assert(!(isForwarded(processList))),
		(longAt((processList + BaseHeaderSize) + (((sqInt)((usqInt)(FirstLinkIndex) << (shiftForWord())))))) == GIV(nilObj)))) {

			/* Only answer processes with a runnable suspendedContext.
			   Discard those that aren't; the VM would crash otherwise. */
			proc = removeFirstLinkOfList(processList);
			/* begin fetchPointer:ofObject: */
			ctxt = longAt((proc + BaseHeaderSize) + (((sqInt)((usqInt)(SuspendedContextIndex) << (shiftForWord())))));
			if (isLiveContext(ctxt)) {
				GIV(highestRunnableProcessPriority) = p + 1;
				return proc;
			}
			
#      if SPURVM

			/* This is uncommon, so we can deal with forwarders here instead of assuming there isn't. */
			if (((ctxt & (tagMask())) == 0)
			 && (((longAt(ctxt)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				ctxt = fixFollowedFieldofObjectwithInitialValue(SuspendedContextIndex, proc, ctxt);
			}
			if (isLiveContext(ctxt)) {
				GIV(highestRunnableProcessPriority) = p + 1;
				return proc;
			}
#      endif /* SPURVM */
			warning("evicted zombie process from run queue");
		}
	}
	error("scheduler could not find a runnable process");
	return null;
}


/*	Write the image header and heap contents to imageFile for snapshot. c.f.
	writeImageFileIOSimulation. The game below is to maintain 64-bit alignment
	for all putLong:toFile: occurrences. */

	/* StackInterpreter>>#writeImageFileIO */
static sqInt NeverInline
writeImageFileIO(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bytesWritten;
    sqImageFile f;
    int headerSize;
    squeakFileOffsetType headerStart;
    sqInt i;
    sqInt imageBytes;
    extern char imageName[];
    sqInt okToWrite;
    void *sCWIfn;
    sqInt total;

	sCWIfn = ioLoadFunctionFrom("secCanWriteImage", "SecurityPlugin");
	if (sCWIfn != 0) {
		okToWrite = ((sqInt (*)(void))sCWIfn)();
		if (!okToWrite) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return null;
		}
	}
	headerStart = 0;

	/* header size in bytes; do not change! */
	headerSize = 128;
	f = sqImageFileOpen(imageName, "wb");
	if (f == null) {

		/* could not open the image file for writing */
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	assert(newSpaceIsEmpty());
	/* begin totalBytesInNonEmptySegments */
	total = 0;
	for (i = 0; i < GIV(numSegments); i += 1) {
		if ((((GIV(segments)[i]).segSize)) > (2 * BaseHeaderSize)) {
			total += ((GIV(segments)[i]).segSize);
		}
	}
	imageBytes = total;
	headerStart = sqImageFileStartLocation(f, imageName, headerSize + imageBytes);
	/* Note: on Unix systems one could put an exec command here, padded to 512 bytes */;
	sqImageFileSeek(f, headerStart);
	putWord32toFile(68021 /* imageFormatVersion */, f);
	putWord32toFile(headerSize, f);
	putLongtoFile(imageBytes, f);
	putLongtoFile(GIV(oldSpaceStart), f);
	putLongtoFile(GIV(specialObjectsOop), f);
	putLongtoFile(newObjectHash(), f);
	putLongtoFile(getSnapshotScreenSize(), f);
	putLongtoFile((((((GIV(fullScreenFlag) + ((VMBIGENDIAN
	? 0
	: 2))) + ((GIV(flagInterpretedMethods)
	? 8
	: 0))) + ((GIV(preemptionYields)
	? 0
	: 16))) + ((GIV(newFinalization)
	? 64
	: 0))) + ((sendWheelEvents
	? 128
	: 0))) + (((GIV(imageHeaderFlags) | 219) - 219)), f);
	putWord32toFile(extraVMMemory, f);
	putShorttoFile(desiredNumStackPages, f);
	putShorttoFile((desiredCogCodeSize + 0x3FF) / 1024, f);
	putWord32toFile(desiredEdenBytes, f);
	putShorttoFile((GIV(maxExtSemTabSizeSet)
		? ioGetMaxExtSemTableSize()
		: 0), f);
	putShorttoFile(GIV(the2ndUnknownShort), f);
	putLongtoFile(((GIV(segments)[0]).segSize), f);
	putLongtoFile(GIV(totalFreeOldSpace), f);
	putLongtoFile(0, f);
	putLongtoFile(0, f);
	putLongtoFile(0, f);
	putLongtoFile(0, f);
	putLongtoFile(0, f);
	assert((headerStart + headerSize) == (sqImageFilePosition(f)));
	sqImageFileSeek(f, headerStart + headerSize);
	if (GIV(primFailCode)) {

		/* file write or seek failure */
		sqImageFileClose(f);
		return null;
	}
	bytesWritten = writeImageSegmentsToFile(f);
	/* begin success: */
	if (!(bytesWritten == imageBytes)) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	sqImageFileClose(f);
	return 0;
}

	/* StackInterpreterPrimitives>>#cloneContext: */
static sqInt NoDbgRegParms
cloneContext(sqInt aContext)
{
    sqInt cloned;
    sqInt frameNumArgs;
    sqInt frameNumArgs1;
    sqInt i;
    usqInt numSlots;
    sqInt senderOop;
    sqInt sp;
    char *spouseFP;
    usqInt sz;
    sqInt valuePointer;
    sqInt valuePointer1;
    sqInt valuePointer2;
    sqInt valuePointer3;

	/* begin numSlotsOf: */
	assert((classIndexOf(aContext)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(aContext + 7);
	sz = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(aContext - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	cloned = allocateNewSpaceSlotsformatclassIndex(sz, indexablePointersFormat(), ClassMethodContextCompactIndex);
	if (cloned != 0) {
		for (i = 0; i <= StackPointerIndex; i += 1) {
			/* begin storePointerUnchecked:ofObject:withValue: */
			valuePointer = externalInstVarofContext(i, aContext);
			assert(!(isOopForwarded(cloned)));
			longAtput((cloned + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer);
		}
		for (i = MethodIndex; i <= ReceiverIndex; i += 1) {
			/* begin storePointerUnchecked:ofObject:withValue: */
			valuePointer1 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
			assert(!(isOopForwarded(cloned)));
			longAtput((cloned + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer1);
		}
		if ((((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(aContext)))) {
			/* begin frameOfMarriedContext: */
			senderOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
			assert((((senderOop) & 7) == 1));
			spouseFP = pointerForOop(senderOop - 1);
			sp = (stackPointerIndexForFrame(spouseFP)) - 1;
			for (i = 0; i <= sp; i += 1) {
				/* begin storePointerUnchecked:ofObject:withValue: */
				valuePointer2 = ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())
					? (i < ((frameNumArgs = ((mframeCogMethod(spouseFP))->cmNumArgs)))
							? longAt((spouseFP + FoxCallerSavedIP) + ((frameNumArgs - i) * BytesPerWord))
							: longAt(((spouseFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - i) * BytesPerWord)))
					: (i < ((frameNumArgs1 = byteAt((spouseFP + FoxIFrameFlags) + 1)))
							? longAt((spouseFP + FoxCallerSavedIP) + ((frameNumArgs1 - i) * BytesPerWord))
							: longAt(((spouseFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - i) * BytesPerWord))));
				assert(!(isOopForwarded(cloned)));
				longAtput((cloned + BaseHeaderSize) + (((sqInt)((usqInt)((i + CtxtTempFrameStart)) << (shiftForWord())))), valuePointer2);
			}
		}
		else {
			sp = (fetchStackPointerOf(aContext)) - 1;
			for (i = 0; i <= sp; i += 1) {
				/* begin storePointerUnchecked:ofObject:withValue: */
				valuePointer3 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)((i + CtxtTempFrameStart)) << (shiftForWord())))));
				assert(!(isOopForwarded(cloned)));
				longAtput((cloned + BaseHeaderSize) + (((sqInt)((usqInt)((i + CtxtTempFrameStart)) << (shiftForWord())))), valuePointer3);
			}
		}
	}
	return cloned;
}


/*	Arrange to answer naked frame pointers for unmarried
	senders to avoid reifying contexts in the search. */

	/* StackInterpreterPrimitives>>#fieldOrSenderFP:ofContext: */
static sqInt NoDbgRegParms
fieldOrSenderFPofContext(sqInt index, sqInt contextObj)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt senderOop;
    char *spouseFP;
    sqInt tempIndex;

	tempIndex = index - CtxtTempFrameStart;
	if (!((((((longAt((contextObj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(contextObj))))) {
		return (tempIndex >= (fetchStackPointerOf(contextObj))
			? /* begin nilObject */ GIV(nilObj)
			: (longAt((contextObj + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))))));
	}
	/* begin frameOfMarriedContext: */
	senderOop = longAt((contextObj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop) & 7) == 1));
	spouseFP = pointerForOop(senderOop - 1);
	if (tempIndex >= (stackPointerIndexForFrame(spouseFP))) {
		/* begin nilObject */
		return GIV(nilObj);
	}
	return fieldofFrame(index, spouseFP);
}


/*	Arrange to answer naked frame pointers for unmarried
	senders to avoid reifying contexts in the search. */

	/* StackInterpreterPrimitives>>#field:ofFrame: */
static sqInt NoDbgRegParms
fieldofFrame(sqInt index, char *theFP)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt callerContextOrNil;
    char *callerFP;
    sqInt frameNumArgs;
    sqInt frameNumArgs1;
    sqInt numArgs;
    StackPage *thePage;

	
	switch (index) {
	case SenderIndex:
		/* begin frameCallerFP: */
		callerFP = pointerForOop(longAt(theFP + FoxSavedFP));
		return (callerFP == 0
			? (/* begin frameCallerContext: */
				assert(isBaseFrame(theFP)),
				/* begin stackPageFor: */
				(thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
					pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages))),
				(callerContextOrNil = longAt((thePage->baseAddress))),
				assert(addressCouldBeObj(callerContextOrNil)),
				assert((callerContextOrNil == (nilObject()))
					 || (isContext(callerContextOrNil))),
				callerContextOrNil)
			: (((((usqInt)(longAt(callerFP + FoxMethod)))) < (startOfMemory())
					? ((longAt(callerFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
					: (byteAt((callerFP + FoxIFrameFlags) + 2)) != 0)
					? (assert(checkIsStillMarriedContextcurrentFP(frameContext(callerFP), null)),
						/* begin frameContext: */
						longAt(callerFP + FoxThisContext))
					: ((sqInt)callerFP)));

	case StackPointerIndex:
	case InstructionPointerIndex:
		return ConstZero;

	case MethodIndex:
		return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((mframeHomeMethod(theFP))->methodObject)
			: longAt(theFP + FoxMethod));

	case ClosureIndex:
		return (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((longAt(theFP + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
			: (byteAt((theFP + FoxIFrameFlags) + 3)) != 0)
			? (/* begin frameStackedReceiver:numArgs: */
				(numArgs = ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
						? ((mframeCogMethod(theFP))->cmNumArgs)
						: byteAt((theFP + FoxIFrameFlags) + 1))),
				longAt(theFP + ((FoxCallerSavedIP + BytesPerWord) + (((sqInt)((usqInt)(numArgs) << (shiftForWord())))))))
			: /* begin nilObject */ GIV(nilObj));

	case ReceiverIndex:
		return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? longAt(theFP + FoxMFReceiver)
			: longAt(theFP + FoxIFReceiver));

	default:
		assert((((index - CtxtTempFrameStart) >= 0) && ((index - CtxtTempFrameStart) <= (stackPointerIndexForFrame(theFP)))));
		return ((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
			? ((index - CtxtTempFrameStart) < ((frameNumArgs = ((mframeCogMethod(theFP))->cmNumArgs)))
					? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs - (index - CtxtTempFrameStart)) * BytesPerWord))
					: longAt(((theFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - (index - CtxtTempFrameStart)) * BytesPerWord)))
			: ((index - CtxtTempFrameStart) < ((frameNumArgs1 = byteAt((theFP + FoxIFrameFlags) + 1)))
					? longAt((theFP + FoxCallerSavedIP) + ((frameNumArgs1 - (index - CtxtTempFrameStart)) * BytesPerWord))
					: longAt(((theFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - (index - CtxtTempFrameStart)) * BytesPerWord))));

	}
}

	/* StackInterpreterPrimitives>>#isAppropriateForCopyObject: */
static sqInt NoDbgRegParms
isAppropriateForCopyObject(sqInt oop)
{
	if (!(((((usqInt) (longAt(oop))) >> (formatShift())) & (formatMask())) <= 5 /* lastPointerFormat */)) {
		return 0;
	}
	if (((oop & (tagMask())) == 0)
	 && (((longAt(oop)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		return !((((((longAt((oop + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(oop))));
	}
	return 1;
}

	/* StackInterpreterPrimitives>>#noInlineLoadFloatOrIntFrom: */
static double NoDbgRegParms NeverInline
noInlineLoadFloatOrIntFrom(sqInt floatOrInt)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong bits;
    double result;
    usqLong rot;
    sqInt shift;
    sqInt tagBits;
    double value;

	/* begin loadFloatOrIntFrom: */
	if (((tagBits = floatOrInt & (tagMask()))) != 0) {
		if (tagBits == (smallFloatTag())) {
			/* begin smallFloatValueOf: */
			assert(isImmediateFloat(floatOrInt));
			rot = ((usqInt) (((usqInt)floatOrInt))) >> (numTagBits());
			if (rot > 1) {

				/* a.k.a. ~= +/-0.0 */
				rot += ((sqInt)((usqInt)((smallFloatExponentOffset())) << ((smallFloatMantissaBits()) + 1)));
			}
			/* begin rotateRight: */
			rot = (rot << 0x3F) + (((usqInt) (((usqInt)rot))) >> 1);
			bits = rot;
			memcpy((&value), (&bits), sizeof(value));
			return value;
		}
		if ((tagBits == (smallIntegerTag()))
		 && (((shift = (64 - (numTagBits())) - (smallFloatMantissaBits())),
		(((sqInt) (((sqInt)((usqInt)(floatOrInt) << shift)))) >> shift) == floatOrInt))) {
			return ((double) ((floatOrInt >> 3)) );
		}
	}
	else {
		if (((longAt(floatOrInt)) & (classIndexMask())) == ClassFloatCompactIndex) {
			fetchFloatAtinto(floatOrInt + BaseHeaderSize, result);
			return result;
		}
	}
	/* begin primitiveFail */
	if (!GIV(primFailCode)) {
		GIV(primFailCode) = 1;
	}
	return 0.0;
}


/*	See primitiveVMParameter method comment */

	/* StackInterpreterPrimitives>>#primitiveAllVMParameters: */
static void NoDbgRegParms
primitiveAllVMParameters(sqInt paramsArraySize)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt result;
    char *sp;
    sqInt valuePointer1;
    sqInt valuePointer10;
    sqInt valuePointer11;
    sqInt valuePointer12;
    sqInt valuePointer13;
    sqInt valuePointer14;
    sqInt valuePointer15;
    sqInt valuePointer16;
    sqInt valuePointer17;
    sqInt valuePointer18;
    sqInt valuePointer19;
    sqInt valuePointer2;
    sqInt valuePointer20;
    sqInt valuePointer21;
    sqInt valuePointer22;
    sqInt valuePointer23;
    sqInt valuePointer24;
    sqInt valuePointer25;
    sqInt valuePointer26;
    sqInt valuePointer27;
    sqInt valuePointer28;
    sqInt valuePointer29;
    sqInt valuePointer3;
    sqInt valuePointer30;
    sqInt valuePointer31;
    sqInt valuePointer32;
    sqInt valuePointer33;
    sqInt valuePointer34;
    sqInt valuePointer35;
    sqInt valuePointer36;
    sqInt valuePointer37;
    sqInt valuePointer38;
    sqInt valuePointer39;
    sqInt valuePointer4;
    sqInt valuePointer40;
    sqInt valuePointer41;
    sqInt valuePointer42;
    sqInt valuePointer43;
    sqInt valuePointer44;
    sqInt valuePointer45;
    sqInt valuePointer46;
    sqInt valuePointer47;
    sqInt valuePointer48;
    sqInt valuePointer49;
    sqInt valuePointer5;
    sqInt valuePointer50;
    sqInt valuePointer51;
    sqInt valuePointer52;
    sqInt valuePointer53;
    sqInt valuePointer54;
    sqInt valuePointer55;
    sqInt valuePointer56;
    sqInt valuePointer57;
    sqInt valuePointer58;
    sqInt valuePointer59;
    sqInt valuePointer6;
    sqInt valuePointer7;
    sqInt valuePointer8;
    sqInt valuePointer9;

	result = instantiateClassindexableSize(splObj(ClassArray), paramsArraySize);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer9 = positiveMachineIntegerFor(totalBytesInSegments());
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer9);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer10 = (((usqInt)((GIV(freeStart) - (((eden()).start))) + (GIV(pastSpaceStart) - (((pastSpace()).start)))) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (1U << (shiftForWord())), valuePointer10);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer11 = positiveMachineIntegerFor((newSpaceCapacity()) + (totalBytesInSegments()));
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (2U << (shiftForWord())), valuePointer11);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer12 = (((usqInt)(((sqInt)(((scavengerTenuringThreshold()) * (((GIV(pastSpace).limit)) - ((GIV(pastSpace).start)))) / (8 * BytesPerOop)))) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (5U << (shiftForWord())), valuePointer12);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer13 = (((usqInt)GIV(statFullGCs) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (6U << (shiftForWord())), valuePointer13);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer14 = ((((GIV(statFullGCUsecs) + 500) / 1000) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (7U << (shiftForWord())), valuePointer14);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer15 = (((usqInt)(/* begin statScavenges */ GIV(statScavenges)) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (8U << (shiftForWord())), valuePointer15);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer16 = (((((/* begin statScavengeGCUsecs */ GIV(statScavengeGCUsecs)) + 500) / 1000) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (9U << (shiftForWord())), valuePointer16);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer17 = (((usqInt)GIV(statTenures) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (10U << (shiftForWord())), valuePointer17);
	for (i = 11; i <= 18; i += 1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(result)));
		longAtput((result + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), ConstZero);
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer18 = positive64BitIntegerFor(GIV(statIdleUsecs));
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (15U << (shiftForWord())), valuePointer18);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer1 = ((((GIV(statCompactionUsecs) + 500) / 1000) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (17U << (shiftForWord())), valuePointer1);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer2 = (((usqInt)(GIV(scavengeThreshold) - (((eden()).start))) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (18U << (shiftForWord())), valuePointer2);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer19 = positive64BitIntegerFor(ioUTCStartMicroseconds());
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (19U << (shiftForWord())), valuePointer19);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer20 = (((usqInt)(rootTableCount()) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (20U << (shiftForWord())), valuePointer20);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer21 = (((usqInt)GIV(statRootTableOverflows) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (21U << (shiftForWord())), valuePointer21);
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (22U << (shiftForWord())), (((usqInt)extraVMMemory << 3) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer22 = (((usqInt)GIV(shrinkThreshold) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (23U << (shiftForWord())), valuePointer22);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer23 = (((usqInt)GIV(growHeadroom) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (24U << (shiftForWord())), valuePointer23);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer24 = (((usqInt)(ioHeartbeatMilliseconds()) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (25U << (shiftForWord())), valuePointer24);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer25 = (((usqInt)GIV(statMarkCount) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (26U << (shiftForWord())), valuePointer25);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer26 = (((usqInt)0 /* statSweepCount */ << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (27U << (shiftForWord())), valuePointer26);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer27 = (((usqInt)0 /* statMkFwdCount */ << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (28U << (shiftForWord())), valuePointer27);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer28 = (((usqInt)GIV(statCompactPassCount) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (29U << (shiftForWord())), valuePointer28);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer29 = (((usqInt)GIV(statGrowMemory) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (30U << (shiftForWord())), valuePointer29);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer30 = (((usqInt)GIV(statShrinkMemory) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (0x1FU << (shiftForWord())), valuePointer30);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer31 = (((usqInt)GIV(statRootTableCount) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (32U << (shiftForWord())), valuePointer31);
	
	/* was statAllocationCount */
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer3 = positive64BitIntegerFor(currentAllocatedBytes());
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (33U << (shiftForWord())), valuePointer3);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer32 = (((usqInt)GIV(statSurvivorCount) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (34U << (shiftForWord())), valuePointer32);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer33 = ((((GIV(statGCEndUsecs) / 1000) & MillisecondClockMask) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (35U << (shiftForWord())), valuePointer33);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer34 = (((usqInt)0 /* statSpecialMarkCount */ << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (36U << (shiftForWord())), valuePointer34);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer35 = ((((GIV(statIGCDeltaUsecs) + 500) / 1000) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (37U << (shiftForWord())), valuePointer35);
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (38U << (shiftForWord())), (((usqInt)GIV(statPendingFinalizationSignals) << 3) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (39U << (shiftForWord())), (((usqInt)BytesPerWord << 3) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer36 = (((usqInt)68021 /* imageFormatVersion */ << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (40U << (shiftForWord())), valuePointer36);
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (41U << (shiftForWord())), (((usqInt)GIV(numStackPages) << 3) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (42U << (shiftForWord())), (((usqInt)desiredNumStackPages << 3) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer37 = (((usqInt)(((GIV(eden).limit)) - ((GIV(eden).start))) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (43U << (shiftForWord())), valuePointer37);
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (44U << (shiftForWord())), (((usqInt)desiredEdenBytes << 3) | 1));
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer38 = getCogCodeSize();
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (45U << (shiftForWord())), valuePointer38);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer39 = getDesiredCogCodeSize();
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (46U << (shiftForWord())), valuePointer39);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer40 = getCogVMFlags();
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (47U << (shiftForWord())), valuePointer40);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer41 = (((usqInt)(ioGetMaxExtSemTableSize()) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (48U << (shiftForWord())), valuePointer41);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer42 = (((usqInt)(rootTableCapacity()) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (51U << (shiftForWord())), valuePointer42);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer4 = (((usqInt)(numSegments()) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (52U << (shiftForWord())), valuePointer4);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer5 = ((GIV(totalFreeOldSpace) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (53U << (shiftForWord())), valuePointer5);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer6 = floatObjectOf(getHeapGrowthToSizeGCRatio());
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (54U << (shiftForWord())), valuePointer6);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer43 = positive64BitIntegerFor(GIV(statProcessSwitch));
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (55U << (shiftForWord())), valuePointer43);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer44 = positive64BitIntegerFor(GIV(statIOProcessEvents));
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (56U << (shiftForWord())), valuePointer44);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer45 = positive64BitIntegerFor(GIV(statForceInterruptCheck));
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (57U << (shiftForWord())), valuePointer45);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer46 = positive64BitIntegerFor(GIV(statCheckForEvents));
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (58U << (shiftForWord())), valuePointer46);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer47 = positive64BitIntegerFor(GIV(statStackOverflow));
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (59U << (shiftForWord())), valuePointer47);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer48 = positive64BitIntegerFor(GIV(statStackPageDivorce));
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (60U << (shiftForWord())), valuePointer48);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer49 = getCodeCompactionCount();
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (61U << (shiftForWord())), valuePointer49);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer50 = getCodeCompactionMSecs();
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (0x3EU << (shiftForWord())), valuePointer50);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer51 = (((usqInt)(numMethodsOfType(CMMethod)) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (0x3FU << (shiftForWord())), valuePointer51);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer52 = (((usqInt)(((1) + ((IMMUTABILITY
	? 2
	: 0))) + (
#if ITIMER_HEARTBEAT
	4
#else /* ITIMER_HEARTBEAT */
	0
#endif /* ITIMER_HEARTBEAT */
	)) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (64U << (shiftForWord())), valuePointer52);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer53 = (((usqInt)(stackPageByteSize()) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (65U << (shiftForWord())), valuePointer53);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer7 = (((maxOldSpaceSize()) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (66U << (shiftForWord())), valuePointer7);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer54 = floatObjectOf(statAverageLivePagesWhenMapping());
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (67U << (shiftForWord())), valuePointer54);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer55 = (((usqInt)(statMaxPageCountWhenMapping()) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (68U << (shiftForWord())), valuePointer55);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer56 = (((usqInt)(VM_PROXY_MAJOR) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (69U << (shiftForWord())), valuePointer56);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer57 = (((usqInt)(VM_PROXY_MINOR) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (70U << (shiftForWord())), valuePointer57);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer58 = ((((GIV(statMarkUsecs) + 500) / 1000) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (71U << (shiftForWord())), valuePointer58);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer59 = ((((GIV(statSweepUsecs) + 500) / 1000) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (72U << (shiftForWord())), valuePointer59);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer8 = (((usqInt)((GIV(statMaxAllocSegmentTime) + 500) / 1000) << 3) | 1);
	assert(!(isOopForwarded(result)));
	longAtput((result + BaseHeaderSize) + (73U << (shiftForWord())), valuePointer8);
	beRootIfOld(result);
	/* begin methodReturnValue: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result);
	GIV(stackPointer) = sp;
}


/*	Return a shallow copy of the receiver.
	Special-case non-single contexts (because of context-to-stack mapping).
	Can't fail for contexts cuz of image context instantiation code (sigh). */

	/* StackInterpreterPrimitives>>#primitiveClone */
static void
primitiveClone(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt newCopy;
    sqInt rcvr;
    char *sp;

	/* begin stackTop */
	rcvr = longAt(GIV(stackPointer));
	if (rcvr & (tagMask())) {
		newCopy = rcvr;
	}
	else {
		if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
			newCopy = cloneContext(rcvr);
		}
		else {
			if ((GIV(argumentCount) == 0)
			 || (!(((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
				newCopy = clone(rcvr);
			}
			else {
				newCopy = 0;
			}
		}
		if (newCopy == 0) {
			/* begin primitiveFailFor: */
			(GIV(primFailCode) = PrimErrNoMemory);
			return;
		}
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newCopy);
	GIV(stackPointer) = sp;
}


/*	Special version of primitiveAt for accessing contexts.
	Written to be varargs for use from mirror primitives. */

	/* StackInterpreterPrimitives>>#primitiveContextAt */
static void
primitiveContextAt(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aContext;
    sqInt class;
    sqInt class1;
    sqInt classFormat;
    sqInt classFormat1;
    sqInt fixedFields;
    sqInt fixedFields1;
    usqLong fmt;
    usqLong fmt1;
    sqInt frameNumArgs;
    sqInt frameNumArgs1;
    sqLong hdr;
    sqLong hdr1;
    sqInt index;
    unsigned int integerValue;
    unsigned int integerValue1;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    sqInt reasonCode;
    sqInt senderOop;
    char *sp;
    char *sp1;
    sqInt sp11;
    char *sp2;
    sqInt sp3;
    sqInt sp4;
    char *spouseFP;
    sqInt stSize;
    sqInt stSize1;
    sqInt totalLength;
    sqInt totalLength1;
    sqInt value;

	/* begin stackTop */
	index = longAt(GIV(stackPointer));
	if (!((((index) & 7) == 1))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	index = (index >> 3);
	/* begin stackValue: */
	aContext = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin baseHeader: */
	hdr = long64At(aContext);
	if (!((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) {

		/* might be an instance of a subclass */
		/* begin stObject:at: */
		hdr1 = long64At(aContext);
		fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask());
		/* begin lengthOf:format: */
		numSlots11 = byteAt(aContext + 7);
		numSlots2 = (numSlots11 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(aContext - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots11);
		if (fmt1 <= 5 /* ephemeronFormat */) {
			totalLength1 = numSlots2;
			goto l19;
		}
		if (fmt1 >= (firstByteFormat())) {

			/* bytes, including CompiledMethod */
			totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7);
			goto l19;
		}
		if (fmt1 >= (firstShortFormat())) {
			totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3);
			goto l19;
		}
		if (fmt1 >= (firstLongFormat())) {
			totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1);
			goto l19;
		}
		if (fmt1 == (sixtyFourBitIndexableFormat())) {
			totalLength1 = numSlots2;
			goto l19;
		}
		totalLength1 = 0;
	l19:	/* end lengthOf:format: */;
		/* begin fixedFieldsOf:format:length: */
		if ((fmt1 >= (sixtyFourBitIndexableFormat()))
		 || (fmt1 == 2 /* arrayFormat */)) {
			fixedFields1 = 0;
			goto l15;
		}
		if (fmt1 < 2 /* arrayFormat */) {
			fixedFields1 = totalLength1;
			goto l15;
		}
		class1 = fetchClassOfNonImm(aContext);
		/* begin fixedFieldsOfClassFormat: */
		classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
		fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1);
	l15:	/* end fixedFieldsOf:format:length: */;
		if ((fmt1 == (indexablePointersFormat()))
		 && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) {
			/* begin stackPointerForMaybeMarriedContext: */
			if ((((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
			 && (!(isWidowedContext(aContext)))) {
				sp4 = stackPointerIndexForFrame(frameOfMarriedContext(aContext));
				assert((ReceiverIndex + ((sp4 >> 3))) < (lengthOf(aContext)));
				stSize1 = sp4;
				goto l20;
			}
			/* begin fetchStackPointerOf: */
			sp11 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
			if (!((((sp11) & 7) == 1))) {
				stSize1 = 0;
				goto l20;
			}
			assert((ReceiverIndex + ((sp11 >> 3))) < (lengthOf(aContext)));
			stSize1 = (sp11 >> 3);
	l20:	/* end stackPointerForMaybeMarriedContext: */;
			if ((oopisGreaterThanOrEqualTo(index, 1))
			 && ((oopisLessThanOrEqualTo(index, stSize1))
			 && ((((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
			 && (!(isWidowedContext(aContext)))))) {
				value = noInlineTemporaryin(index - 1, frameOfMarriedContext(aContext));
				goto l22;
			}
		}
		else {
			stSize1 = totalLength1 - fixedFields1;
		}
		if ((oopisGreaterThanOrEqualTo(index, (fmt1 >= (firstCompiledMethodFormat())
			? (((literalCountOf(aContext)) + LiteralStart) * BytesPerOop) + 1
			: 1)))
		 && (oopisLessThanOrEqualTo(index, stSize1))) {
			/* begin subscript:with:format: */
			if (fmt1 <= 5 /* lastPointerFormat */) {
				/* begin fetchPointer:ofObject: */
				value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))));
				goto l22;
			}
			if (fmt1 >= (firstByteFormat())) {
				value = (((usqInt)(byteAt((aContext + BaseHeaderSize) + ((index + fixedFields1) - 1))) << 3) | 1);
				goto l22;
			}
			if (fmt1 >= (firstShortFormat())) {
				value = (((usqInt)(((unsigned short) (shortAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))))))) << 3) | 1);
				goto l22;
			}
			if (fmt1 == (sixtyFourBitIndexableFormat())) {
				value = positive64BitIntegerFor(long64At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3)))));
				goto l22;
			}
			/* begin positive32BitIntegerFor: */
			integerValue1 = long32At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))));
			value = ((((((usqInt)integerValue1)) & 0xFFFFFFFFU) << 3) | 1);
			goto l22;
		}
		/* begin primitiveFailFor: */
		reasonCode = (fmt1 <= 1
			? PrimErrBadReceiver
			: PrimErrBadIndex);
		GIV(primFailCode) = reasonCode;
		value = 0;
	l22:	/* end stObject:at: */;
		if (!GIV(primFailCode)) {
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value);
			GIV(stackPointer) = sp;
		}
		return;
	}
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if (!((((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(aContext))))) {
		fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
		/* begin lengthOf:format: */
		numSlots1 = byteAt(aContext + 7);
		numSlots = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(aContext - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		if (fmt <= 5 /* ephemeronFormat */) {
			totalLength = numSlots;
			goto l10;
		}
		if (fmt >= (firstByteFormat())) {

			/* bytes, including CompiledMethod */
			totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
			goto l10;
		}
		if (fmt >= (firstShortFormat())) {
			totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
			goto l10;
		}
		if (fmt >= (firstLongFormat())) {
			totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
			goto l10;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			totalLength = numSlots;
			goto l10;
		}
		totalLength = 0;
	l10:	/* end lengthOf:format: */;
		/* begin fixedFieldsOf:format:length: */
		if ((fmt >= (sixtyFourBitIndexableFormat()))
		 || (fmt == 2 /* arrayFormat */)) {
			fixedFields = 0;
			goto l11;
		}
		if (fmt < 2 /* arrayFormat */) {
			fixedFields = totalLength;
			goto l11;
		}
		class = fetchClassOfNonImm(aContext);
		/* begin fixedFieldsOfClassFormat: */
		classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
		fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l11:	/* end fixedFieldsOf:format:length: */;
		/* begin fetchStackPointerOf: */
		sp3 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
		if (!((((sp3) & 7) == 1))) {
			stSize = 0;
			goto l13;
		}
		assert((ReceiverIndex + ((sp3 >> 3))) < (lengthOf(aContext)));
		stSize = (sp3 >> 3);
	l13:	/* end fetchStackPointerOf: */;
		if (!(((index >= 1) && (index <= stSize)))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadIndex;
			return;
		}
		/* begin subscript:with:format: */
		if (fmt <= 5 /* lastPointerFormat */) {
			/* begin fetchPointer:ofObject: */
			value = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))));
			goto l14;
		}
		if (fmt >= (firstByteFormat())) {
			value = (((usqInt)(byteAt((aContext + BaseHeaderSize) + ((index + fixedFields) - 1))) << 3) | 1);
			goto l14;
		}
		if (fmt >= (firstShortFormat())) {
			value = (((usqInt)(((unsigned short) (shortAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))))))) << 3) | 1);
			goto l14;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			value = positive64BitIntegerFor(long64At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3)))));
			goto l14;
		}
		/* begin positive32BitIntegerFor: */
		integerValue = long32At((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))));
		value = ((((((usqInt)integerValue)) & 0xFFFFFFFFU) << 3) | 1);
		goto l14;
	l14:	/* end subscript:with:format: */;
		/* begin pop:thenPush: */
		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value);
		GIV(stackPointer) = sp1;
		return;
	}
	/* begin frameOfMarriedContext: */
	senderOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop) & 7) == 1));
	spouseFP = pointerForOop(senderOop - 1);
	if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		return;
	}
	value = ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())
		? ((index - 1) < ((frameNumArgs = ((mframeCogMethod(spouseFP))->cmNumArgs)))
				? longAt((spouseFP + FoxCallerSavedIP) + ((frameNumArgs - (index - 1)) * BytesPerWord))
				: longAt(((spouseFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - (index - 1)) * BytesPerWord)))
		: ((index - 1) < ((frameNumArgs1 = byteAt((spouseFP + FoxIFrameFlags) + 1)))
				? longAt((spouseFP + FoxCallerSavedIP) + ((frameNumArgs1 - (index - 1)) * BytesPerWord))
				: longAt(((spouseFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - (index - 1)) * BytesPerWord))));
	/* begin pop:thenPush: */
	longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value);
	GIV(stackPointer) = sp2;
}


/*	Special version of primitiveAtPut for accessing contexts.
	Written to be varargs for use from mirror primitives. */

	/* StackInterpreterPrimitives>>#primitiveContextAtPut */
static void
primitiveContextAtPut(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt aContext;
    sqInt class;
    sqInt class1;
    sqInt classFormat;
    sqInt classFormat1;
    sqInt fixedFields;
    sqInt fixedFields1;
    usqLong fmt;
    usqLong fmt1;
    sqInt frameNumArgs;
    sqInt frameNumArgs1;
    sqLong hdr;
    sqLong hdr1;
    sqInt index;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    sqInt reasonCode;
    sqInt senderOop;
    sqInt signedValueToStore;
    sqInt signedValueToStore1;
    char *sp;
    char *sp1;
    sqInt sp11;
    char *sp2;
    sqInt sp3;
    sqInt sp4;
    char *spouseFP;
    sqInt stSize;
    sqInt stSize1;
    sqInt totalLength;
    sqInt totalLength1;
    usqLong unsigned64BitValueToStore;
    usqLong unsigned64BitValueToStore1;
    unsigned int unsignedValueToStore;
    unsigned int unsignedValueToStore1;
    sqInt value;

	/* begin stackTop */
	value = longAt(GIV(stackPointer));
	/* begin stackValue: */
	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin stackValue: */
	aContext = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	if (!((((index) & 7) == 1))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	/* begin baseHeader: */
	hdr = long64At(aContext);
	index = (index >> 3);
	if (!((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) {

		/* might be an instance of a subclass */
		/* begin stObject:at:put: */
		hdr1 = long64At(aContext);
		fmt1 = (((unsigned sqLong)hdr1) >> (formatShift())) & (formatMask());
		/* begin lengthOf:format: */
		numSlots11 = byteAt(aContext + 7);
		numSlots2 = (numSlots11 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(aContext - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots11);
		if (fmt1 <= 5 /* ephemeronFormat */) {
			totalLength1 = numSlots2;
			goto l26;
		}
		if (fmt1 >= (firstByteFormat())) {

			/* bytes, including CompiledMethod */
			totalLength1 = (numSlots2 << (shiftForWord())) - (fmt1 & 7);
			goto l26;
		}
		if (fmt1 >= (firstShortFormat())) {
			totalLength1 = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3);
			goto l26;
		}
		if (fmt1 >= (firstLongFormat())) {
			totalLength1 = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1);
			goto l26;
		}
		if (fmt1 == (sixtyFourBitIndexableFormat())) {
			totalLength1 = numSlots2;
			goto l26;
		}
		totalLength1 = 0;
	l26:	/* end lengthOf:format: */;
		/* begin fixedFieldsOf:format:length: */
		if ((fmt1 >= (sixtyFourBitIndexableFormat()))
		 || (fmt1 == 2 /* arrayFormat */)) {
			fixedFields1 = 0;
			goto l21;
		}
		if (fmt1 < 2 /* arrayFormat */) {
			fixedFields1 = totalLength1;
			goto l21;
		}
		class1 = fetchClassOfNonImm(aContext);
		/* begin fixedFieldsOfClassFormat: */
		classFormat1 = ((longAt((class1 + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
		fixedFields1 = classFormat1 & ((1U << (fixedFieldsFieldWidth())) - 1);
	l21:	/* end fixedFieldsOf:format:length: */;
		if ((fmt1 == (indexablePointersFormat()))
		 && ((hdr1 & (classIndexMask())) == ClassMethodContextCompactIndex)) {
			/* begin stackPointerForMaybeMarriedContext: */
			if ((((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
			 && (!(isWidowedContext(aContext)))) {
				sp4 = stackPointerIndexForFrame(frameOfMarriedContext(aContext));
				assert((ReceiverIndex + ((sp4 >> 3))) < (lengthOf(aContext)));
				stSize1 = sp4;
				goto l22;
			}
			/* begin fetchStackPointerOf: */
			sp11 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
			if (!((((sp11) & 7) == 1))) {
				stSize1 = 0;
				goto l22;
			}
			assert((ReceiverIndex + ((sp11 >> 3))) < (lengthOf(aContext)));
			stSize1 = (sp11 >> 3);
	l22:	/* end stackPointerForMaybeMarriedContext: */;
			if ((oopisGreaterThanOrEqualTo(index, 1))
			 && ((oopisLessThanOrEqualTo(index, stSize1))
			 && ((((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
			 && (!(isWidowedContext(aContext)))))) {
				noInlineTemporaryinput(index - 1, frameOfMarriedContext(aContext), value);
				goto l34;
			}
		}
		else {
			stSize1 = totalLength1 - fixedFields1;
		}
		if ((oopisGreaterThanOrEqualTo(index, (fmt1 >= (firstCompiledMethodFormat())
			? (((literalCountOf(aContext)) + LiteralStart) * BytesPerOop) + 1
			: 1)))
		 && (oopisLessThanOrEqualTo(index, stSize1))) {
			/* begin subscript:with:storing:format: */
			if (fmt1 <= 5 /* lastPointerFormat */) {
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(aContext)));
				if ((assert(isNonImmediate(aContext)),
				oopisGreaterThanOrEqualTo(aContext, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((value & (tagMask())) == 0)
					 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(aContext))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(aContext);
						}
					}
				}
				longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << (shiftForWord())))), value);
				goto l33;
			}
			if (fmt1 >= (firstByteFormat())) {
				if (!((((value) & 7) == 1))) {
					GIV(primFailCode) = PrimErrBadArgument;
					goto l33;
				}
				signedValueToStore1 = (value >> 3);
				if (!((signedValueToStore1 >= 0)
					 && (signedValueToStore1 <= 0xFF))) {
					GIV(primFailCode) = PrimErrBadArgument;
					goto l33;
				}
				/* begin storeByte:ofObject:withValue: */
				byteAtput((aContext + BaseHeaderSize) + ((index + fixedFields1) - 1), signedValueToStore1);
				goto l33;
			}
			if (fmt1 >= (firstShortFormat())) {
				if (!((((value) & 7) == 1))) {
					GIV(primFailCode) = PrimErrBadArgument;
					goto l33;
				}
				signedValueToStore1 = (value >> 3);
				if (!((signedValueToStore1 >= 0)
					 && (signedValueToStore1 <= 0xFFFF))) {
					GIV(primFailCode) = PrimErrBadArgument;
					goto l33;
				}
				/* begin storeShort16:ofObject:withValue: */
				shortAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 1))), signedValueToStore1);
				goto l33;
			}
			if (fmt1 == (sixtyFourBitIndexableFormat())) {
				unsigned64BitValueToStore1 = positive64BitValueOf(value);
				if (!GIV(primFailCode)) {
					/* begin storeLong64:ofObject:withValue: */
					long64Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 3))), unsigned64BitValueToStore1);
				}
				goto l33;
			}
			unsignedValueToStore1 = positive32BitValueOf(value);
			if (!GIV(primFailCode)) {
				/* begin storeLong32:ofObject:withValue: */
				long32Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields1) - 1)) << 2))), unsignedValueToStore1);
			}
	l33:	/* end subscript:with:storing:format: */;
		}
		else {
			/* begin primitiveFailFor: */
			reasonCode = (fmt1 <= 1
				? PrimErrBadReceiver
				: PrimErrBadIndex);
			GIV(primFailCode) = reasonCode;
		}
	l34:	/* end stObject:at:put: */;
		if (!GIV(primFailCode)) {
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value);
			GIV(stackPointer) = sp;
		}
		return;
	}
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if (!((((((longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(aContext))))) {
		fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
		/* begin lengthOf:format: */
		numSlots1 = byteAt(aContext + 7);
		numSlots = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(aContext - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		if (fmt <= 5 /* ephemeronFormat */) {
			totalLength = numSlots;
			goto l11;
		}
		if (fmt >= (firstByteFormat())) {

			/* bytes, including CompiledMethod */
			totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
			goto l11;
		}
		if (fmt >= (firstShortFormat())) {
			totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
			goto l11;
		}
		if (fmt >= (firstLongFormat())) {
			totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
			goto l11;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			totalLength = numSlots;
			goto l11;
		}
		totalLength = 0;
	l11:	/* end lengthOf:format: */;
		/* begin fixedFieldsOf:format:length: */
		if ((fmt >= (sixtyFourBitIndexableFormat()))
		 || (fmt == 2 /* arrayFormat */)) {
			fixedFields = 0;
			goto l12;
		}
		if (fmt < 2 /* arrayFormat */) {
			fixedFields = totalLength;
			goto l12;
		}
		class = fetchClassOfNonImm(aContext);
		/* begin fixedFieldsOfClassFormat: */
		classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
		fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l12:	/* end fixedFieldsOf:format:length: */;
		/* begin fetchStackPointerOf: */
		sp3 = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
		if (!((((sp3) & 7) == 1))) {
			stSize = 0;
			goto l14;
		}
		assert((ReceiverIndex + ((sp3 >> 3))) < (lengthOf(aContext)));
		stSize = (sp3 >> 3);
	l14:	/* end fetchStackPointerOf: */;
		if (!(((index >= 1) && (index <= stSize)))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadIndex;
			return;
		}
		/* begin subscript:with:storing:format: */
		if (fmt <= 5 /* lastPointerFormat */) {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(aContext)));
			if ((assert(isNonImmediate(aContext)),
			oopisGreaterThanOrEqualTo(aContext, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((value & (tagMask())) == 0)
				 && (oopisLessThan(value, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(aContext))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(aContext);
					}
				}
			}
			longAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << (shiftForWord())))), value);
			goto l20;
		}
		if (fmt >= (firstByteFormat())) {
			if (!((((value) & 7) == 1))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l20;
			}
			signedValueToStore = (value >> 3);
			if (!((signedValueToStore >= 0)
				 && (signedValueToStore <= 0xFF))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l20;
			}
			/* begin storeByte:ofObject:withValue: */
			byteAtput((aContext + BaseHeaderSize) + ((index + fixedFields) - 1), signedValueToStore);
			goto l20;
		}
		if (fmt >= (firstShortFormat())) {
			if (!((((value) & 7) == 1))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l20;
			}
			signedValueToStore = (value >> 3);
			if (!((signedValueToStore >= 0)
				 && (signedValueToStore <= 0xFFFF))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l20;
			}
			/* begin storeShort16:ofObject:withValue: */
			shortAtput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 1))), signedValueToStore);
			goto l20;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			unsigned64BitValueToStore = positive64BitValueOf(value);
			if (!GIV(primFailCode)) {
				/* begin storeLong64:ofObject:withValue: */
				long64Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 3))), unsigned64BitValueToStore);
			}
			goto l20;
		}
		unsignedValueToStore = positive32BitValueOf(value);
		if (!GIV(primFailCode)) {
			/* begin storeLong32:ofObject:withValue: */
			long32Atput((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(((index + fixedFields) - 1)) << 2))), unsignedValueToStore);
		}
	l20:	/* end subscript:with:storing:format: */;
		/* begin pop:thenPush: */
		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value);
		GIV(stackPointer) = sp1;
		return;
	}
	/* begin frameOfMarriedContext: */
	senderOop = longAt((aContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
	assert((((senderOop) & 7) == 1));
	spouseFP = pointerForOop(senderOop - 1);
	if (!(((index >= 1) && (index <= (stackPointerIndexForFrame(spouseFP)))))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadIndex;
		return;
	}
	if ((((usqInt)(longAt(spouseFP + FoxMethod)))) < (startOfMemory())) {
		longAtput(((index - 1) < ((frameNumArgs = ((mframeCogMethod(spouseFP))->cmNumArgs)))
			? (spouseFP + FoxCallerSavedIP) + ((frameNumArgs - (index - 1)) * BytesPerWord)
			: ((spouseFP + FoxMFReceiver) - BytesPerWord) + ((frameNumArgs - (index - 1)) * BytesPerWord)), value);
	}
	else {
		if ((index - 1) < ((frameNumArgs1 = byteAt((spouseFP + FoxIFrameFlags) + 1)))) {
			longAtput((spouseFP + FoxCallerSavedIP) + ((frameNumArgs1 - (index - 1)) * BytesPerWord), value);
		}
		else {
			longAtput(((spouseFP + FoxIFReceiver) - BytesPerWord) + ((frameNumArgs1 - (index - 1)) * BytesPerWord), value);
		}
	}
	/* begin pop:thenPush: */
	longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value);
	GIV(stackPointer) = sp2;
}


/*	Special version of primitiveSize for accessing contexts.
	Written to be varargs for use from mirror primitives. */

	/* StackInterpreterPrimitives>>#primitiveContextSize */
static void
primitiveContextSize(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class;
    sqInt classFormat;
    sqInt fixedFields;
    usqLong fmt;
    sqLong hdr;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt rcvr;
    char *sp;
    sqInt sp1;
    sqInt sp2;
    sqInt sz;
    sqInt totalLength;

	/* begin stackTop */
	rcvr = longAt(GIV(stackPointer));
	/* begin baseHeader: */
	hdr = long64At(rcvr);
	fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots1 = byteAt(rcvr + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		totalLength = numSlots;
		goto l6;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l6;
	}
	if (fmt >= (firstShortFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l6;
	}
	if (fmt >= (firstLongFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l6;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		totalLength = numSlots;
		goto l6;
	}
	totalLength = 0;
	l6:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		fixedFields = 0;
		goto l7;
	}
	if (fmt < 2 /* arrayFormat */) {
		fixedFields = totalLength;
		goto l7;
	}
	class = fetchClassOfNonImm(rcvr);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l7:	/* end fixedFieldsOf:format:length: */;
	if ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex) {
		/* begin externalWriteBackHeadFramePointers */
		assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
		assert(GIV(stackPage) == (mostRecentlyUsedPage()));
		assert(!((isFree(GIV(stackPage)))));
		/* begin setHeadFP:andSP:inPage: */
		assert(GIV(stackPointer) < GIV(framePointer));
		assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
		assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
		 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
		(GIV(stackPage)->headFP = GIV(framePointer));
		(GIV(stackPage)->headSP = GIV(stackPointer));
		assert(pageListIsWellFormed());
		/* begin stackPointerForMaybeMarriedContext: */
		if ((((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
		 && (!(isWidowedContext(rcvr)))) {
			sp2 = stackPointerIndexForFrame(frameOfMarriedContext(rcvr));
			assert((ReceiverIndex + ((sp2 >> 3))) < (lengthOf(rcvr)));
			sz = sp2;
			goto l4;
		}
		/* begin fetchStackPointerOf: */
		sp1 = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
		if (!((((sp1) & 7) == 1))) {
			sz = 0;
			goto l4;
		}
		assert((ReceiverIndex + ((sp1 >> 3))) < (lengthOf(rcvr)));
		sz = (sp1 >> 3);
	l4:	/* end stackPointerForMaybeMarriedContext: */;
	}
	else {
		sz = totalLength - fixedFields;
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)sz << 3) | 1));
	GIV(stackPointer) = sp;
}


/*	Set or clear the flag that controls whether modifications of 
	the Display object are propagated to the underlying 
	platform's screen. */

	/* StackInterpreterPrimitives>>#primitiveDeferDisplayUpdates */
static void
primitiveDeferDisplayUpdates(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt flag;

	/* begin stackTop */
	flag = longAt(GIV(stackPointer));
	if (flag == GIV(trueObj)) {
		deferDisplayUpdates = 1;
	}
	else {
		if (flag == GIV(falseObj)) {
			deferDisplayUpdates = 0;
		}
		else {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return;
		}
	}
	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
}


/*	Simulate an primitiveExternalCall invocation (e.g. for the Debugger). Do
	not cache anything.
	e.g. ContextPart>>tryNamedPrimitiveIn: aCompiledMethod for: aReceiver
	withArgs: arguments */

	/* StackInterpreterPrimitives>>#primitiveDoNamedPrimitiveWithArgs */
static void
primitiveDoNamedPrimitiveWithArgs(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    void (*addr)();
    sqInt argumentArray;
    usqInt arraySize;
    sqInt ccIndex;
    sqInt classOop;
    sqInt firstBytecode;
    sqInt fmt;
    sqInt fmt1;
    sqInt functionLength;
    sqInt functionName;
    sqInt header;
    sqInt index;
    sqInt isArray;
    sqInt methodArg;
    sqInt methodHeader;
    sqInt moduleLength;
    sqInt moduleName;
    sqInt nItems;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    usqInt numSlots3;
    sqInt object;
    sqInt object1;
    sqInt object2;
    sqInt object3;
    sqInt object4;
    sqInt primRcvr;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    char *sp4;
    char *sp5;
    sqInt spec;
    sqInt successBoolean;
    sqInt successBoolean1;
    sqInt top;
    sqInt top1;
    sqInt val;
    sqInt valuePointer;
    sqInt valuePointer1;
    sqInt valuePointer2;
    sqInt valuePointer3;

	val = 0;
	
	/* See checkForAndFollowForwardedPrimitiveState */
	GIV(metaAccessorDepth) = -2;
	/* begin stackTop */
	argumentArray = longAt(GIV(stackPointer));
	/* begin stackValue: */
	methodArg = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	if (!((((argumentArray & (tagMask())) == 0)
		 && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && (((methodArg & (tagMask())) == 0)
		 && (((((usqInt) (longAt(methodArg))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat()))))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -2);
		return;
	}
	/* begin numSlotsOf: */
	assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(argumentArray + 7);
	arraySize = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(argumentArray - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	if (!(roomToPushNArgs(arraySize))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -2);
		return;
	}
	/* begin methodHeaderOf: */
	assert(isCompiledMethod(methodArg));
	header = longAt((methodArg + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	if (!(((assert((((methodHeader) & 7) == 1)),
		((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) > 2)) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -3);
		return;
	}
	/* begin fetchPointer:ofObject: */
	spec = longAt((methodArg + BaseHeaderSize) + (1U << (shiftForWord())));
	/* begin is:instanceOf:compactClassIndex: */
	classOop = longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassArray) << (shiftForWord())))));
	if (spec & (tagMask())) {
		isArray = 0;
		goto l15;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(spec)));
	/* begin classIndexOf: */
	ccIndex = (longAt(spec)) & (classIndexMask());
	isArray = ClassArrayCompactIndex == ccIndex;
	goto l15;
	l15:	/* end is:instanceOf:compactClassIndex: */;
	if (!(isArray
		 && (((numSlotsOf(spec)) == 4)
		 && (((methodHeader & AlternateHeaderHasPrimFlag
			? ((firstBytecode = (methodArg + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize),
				(byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8))))
			: 0)) == PrimNumberExternalCall)))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -3);
		return;
	}
	if (!(((((usqInt) methodHeader) >> MethodHeaderArgCountShift) & 15) == arraySize)) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -2);
		return;
	}
	/* begin fetchPointer:ofObject: */
	moduleName = longAt((spec + BaseHeaderSize) + (0U << (shiftForWord())));
	if (moduleName == GIV(nilObj)) {
		moduleLength = 0;
	}
	else {
		/* begin success: */
		successBoolean = ((moduleName & (tagMask())) == 0)
		 && (((((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()));
		if (!successBoolean) {

			/* Don't overwrite an error code that has already been set. */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
		}
		/* begin lengthOf:format: */
		fmt = (((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask());
		/* begin numSlotsOfAny: */
		numSlots1 = byteAt(moduleName + 7);
		numSlots2 = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(moduleName - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		if (fmt <= 5 /* ephemeronFormat */) {
			moduleLength = numSlots2;
			goto l13;
		}
		if (fmt >= (firstByteFormat())) {

			/* bytes, including CompiledMethod */
			moduleLength = (numSlots2 << (shiftForWord())) - (fmt & 7);
			goto l13;
		}
		if (fmt >= (firstShortFormat())) {
			moduleLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt & 3);
			goto l13;
		}
		if (fmt >= (firstLongFormat())) {
			moduleLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt & 1);
			goto l13;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			moduleLength = numSlots2;
			goto l13;
		}
		moduleLength = 0;
	l13:	/* end lengthOf:format: */;
	}
	/* begin fetchPointer:ofObject: */
	functionName = longAt((spec + BaseHeaderSize) + (1U << (shiftForWord())));
	/* begin success: */
	successBoolean1 = ((functionName & (tagMask())) == 0)
	 && (((((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask())) >= (firstByteFormat()));
	if (!successBoolean1) {

		/* Don't overwrite an error code that has already been set. */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
	}
	/* begin lengthOf:format: */
	fmt1 = (((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOfAny: */
	numSlots11 = byteAt(functionName + 7);
	numSlots3 = (numSlots11 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(functionName - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots11);
	if (fmt1 <= 5 /* ephemeronFormat */) {
		functionLength = numSlots3;
		goto l17;
	}
	if (fmt1 >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		functionLength = (numSlots3 << (shiftForWord())) - (fmt1 & 7);
		goto l17;
	}
	if (fmt1 >= (firstShortFormat())) {
		functionLength = (numSlots3 << ((shiftForWord()) - 1)) - (fmt1 & 3);
		goto l17;
	}
	if (fmt1 >= (firstLongFormat())) {
		functionLength = (numSlots3 << ((shiftForWord()) - 2)) - (fmt1 & 1);
		goto l17;
	}
	if (fmt1 == (sixtyFourBitIndexableFormat())) {
		functionLength = numSlots3;
		goto l17;
	}
	functionLength = 0;
	l17:	/* end lengthOf:format: */;
	if (GIV(primFailCode)) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -3);
		return;
	}
	addr = ioLoadExternalFunctionOfLengthFromModuleOfLengthAccessorDepthInto(functionName + BaseHeaderSize, functionLength, moduleName + BaseHeaderSize, moduleLength, (&GIV(metaAccessorDepth)));
	if (addr == 0) {
		GIV(metaAccessorDepth) = -2;
	}
	if (addr == 0) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -1);
		return;
	}
	/* begin eeInstantiateClassIndex:format:numSlots: */
	assert((knownClassAtIndex(ClassArrayCompactIndex)) != GIV(nilObj));
	assert((2 /* arrayFormat */) == (instSpecOfClass(knownClassAtIndex(ClassArrayCompactIndex))));
	GIV(tempOop) = allocateNewSpaceSlotsformatclassIndex(4, 2 /* arrayFormat */, ClassArrayCompactIndex);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer = (argumentArray = popStack());
	assert(!(isOopForwarded(GIV(tempOop))));
	longAtput((GIV(tempOop) + BaseHeaderSize) + (0U << (shiftForWord())), valuePointer);
	/* begin storePointerUnchecked:ofObject:withValue: */
	valuePointer1 = (primRcvr = popStack());
	assert(!(isOopForwarded(GIV(tempOop))));
	longAtput((GIV(tempOop) + BaseHeaderSize) + (1U << (shiftForWord())), valuePointer1);
	/* begin storePointerUnchecked:ofObject:withValue: */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	valuePointer2 = top;
	assert(!(isOopForwarded(GIV(tempOop))));
	longAtput((GIV(tempOop) + BaseHeaderSize) + (2U << (shiftForWord())), valuePointer2);
	/* begin storePointerUnchecked:ofObject:withValue: */
	top1 = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	valuePointer3 = top1;
	assert(!(isOopForwarded(GIV(tempOop))));
	longAtput((GIV(tempOop) + BaseHeaderSize) + (3U << (shiftForWord())), valuePointer3);
	/* begin push: */
	longAtput((sp5 = GIV(stackPointer) - BytesPerWord), primRcvr);
	GIV(stackPointer) = sp5;
	GIV(argumentCount) = arraySize;
	for (index = 1; index <= arraySize; index += 1) {
		/* begin push: */
		object = longAt((argumentArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))));
		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
		GIV(stackPointer) = sp;
	}
	/* begin callExternalPrimitive: */
	primitiveFunctionPointer = addr;
	dispatchFunctionPointer(addr);
	/* begin maybeFailForLastObjectOverwrite */
	if (checkAllocFiller) {
		if (((freeStart()) < GIV(scavengeThreshold))
		 && ((longAt(freeStart())) != (freeStart()))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrWritePastObject;
		}
	}
	if (GIV(primFailCode)) {

		/* If primitive failed, then restore state for failure code */
		/* begin pop: */
		nItems = arraySize + 1;
		GIV(stackPointer) += nItems * BytesPerWord;
		/* begin push: */
		object1 = longAt((GIV(tempOop) + BaseHeaderSize) + (3U << (shiftForWord())));
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object1);
		GIV(stackPointer) = sp1;
		/* begin push: */
		object2 = longAt((GIV(tempOop) + BaseHeaderSize) + (2U << (shiftForWord())));
		longAtput((sp2 = GIV(stackPointer) - BytesPerWord), object2);
		GIV(stackPointer) = sp2;
		/* begin push: */
		object3 = longAt((GIV(tempOop) + BaseHeaderSize) + (1U << (shiftForWord())));
		longAtput((sp3 = GIV(stackPointer) - BytesPerWord), object3);
		GIV(stackPointer) = sp3;
		/* begin push: */
		object4 = longAt((GIV(tempOop) + BaseHeaderSize) + (0U << (shiftForWord())));
		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), object4);
		GIV(stackPointer) = sp4;

		/* Must reset primitiveFunctionPointer for checkForAndFollowForwardedPrimitiveState */
		GIV(argumentCount) = 3;
		primitiveFunctionPointer = primitiveDoNamedPrimitiveWithArgs;
		if (GIV(primFailCode) == 1) {
			GIV(primFailCode) = -1;
		}
	}
}


/*	Implement either ProtoObject>>tryPrimitive: primIndex withArgs: argArray
	or Context>>receiver: anObject tryPrimitive: primIndex withArgs: argArray.
	If this primitive fails, arrange that its error code is a negative
	integer, to
	distinguish between this failing and the primitive it invokes failing. */

	/* StackInterpreterPrimitives>>#primitiveDoPrimitiveWithArgs */
static void
primitiveDoPrimitiveWithArgs(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt argumentArray;
    usqInt arraySize;
    sqInt index;
    sqInt nArgs;
    usqInt numSlots;
    sqInt object;
    sqInt primIdx;
    sqInt rcvr;
    sqInt referent;
    char *savedFramePointer;
    sqInt savedNumArgs;
    char *savedStackPointer;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    char *sp4;

	nArgs = 0;
	savedFramePointer = ((char *) 0);
	savedStackPointer = ((char *) 0);
	
	/* See checkForAndFollowForwardedPrimitiveState */
	GIV(metaAccessorDepth) = -2;
	if (!(((GIV(argumentCount) >= 2) && (GIV(argumentCount) <= 3)))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -PrimErrUnsupported);
		return;
	}
	/* begin stackTop */
	argumentArray = longAt(GIV(stackPointer));
	/* begin stackValue: */
	primIdx = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!((((argumentArray & (tagMask())) == 0)
		 && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
		 && ((((primIdx) & 7) == 1)))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -PrimErrBadArgument);
		return;
	}
	/* begin numSlotsOf: */
	assert((classIndexOf(argumentArray)) > (isForwardedObjectClassIndexPun()));
	numSlots = byteAt(argumentArray + 7);
	arraySize = (numSlots == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(argumentArray - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots);
	if (!(roomToPushNArgs(arraySize))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -PrimErrLimitExceeded);
		return;
	}
	primIdx = (primIdx >> 3);
	/* begin functionPointerFor:inClass: */
	primitiveFunctionPointer = ((void (*)(void)) ((primIdx > MaxPrimitiveIndex
	? 0
	: primitiveTable[primIdx])));
	if (primitiveFunctionPointer == 0) {
		primitiveFunctionPointer = primitiveDoPrimitiveWithArgs;
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = -PrimErrBadIndex);
		return;
	}
	if (((savedNumArgs = GIV(argumentCount))) == 3) {

		/* ...and receiver if the three arg form */
		/* begin stackValue: */
		GIV(tempOop2) = longAt(GIV(stackPointer) + (4 * BytesPerWord));
		/* begin stackValue: */
		rcvr = longAt(GIV(stackPointer) + (3 * BytesPerWord));
		if (((rcvr & (tagMask())) == 0)
		 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
			/* begin followForwarded: */
			assert(isUnambiguouslyForwarder(rcvr));
			/* begin fetchPointer:ofMaybeForwardedObject: */
			referent = longAt((rcvr + BaseHeaderSize) + (0U << (shiftForWord())));
			while (((referent & (tagMask())) == 0)
			 && (((longAt(referent)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
				/* begin fetchPointer:ofMaybeForwardedObject: */
				referent = longAt((referent + BaseHeaderSize) + (0U << (shiftForWord())));
			}
			rcvr = referent;
		}
		/* begin pop: */
		GIV(stackPointer) += 4 * BytesPerWord;
		/* begin push: */
		longAtput((sp = GIV(stackPointer) - BytesPerWord), rcvr);
		GIV(stackPointer) = sp;
	}
	else {
		/* begin pop: */
		GIV(stackPointer) += 2 * BytesPerWord;
	}
	GIV(argumentCount) = arraySize;
	index = 1;
	while (index <= arraySize) {
		/* begin push: */
		object = longAt((argumentArray + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))));
		longAtput((sp1 = GIV(stackPointer) - BytesPerWord), object);
		GIV(stackPointer) = sp1;
		index += 1;
	}
	if ((((usqIntptr_t) primitiveFunctionPointer)) <= MaxQuickPrimitiveIndex) {
		externalQuickPrimitiveResponse();
		GIV(tempOop2) = 0;
		return;
	}

	/* prim might alloc/gc */
	/* Run the primitive (sets primFailCode) */
	GIV(tempOop) = argumentArray;
	
	/* See checkForAndFollowForwardedPrimitiveState */
	GIV(metaAccessorDepth) = primitiveAccessorDepthTable[primIdx];
	/* begin slowPrimitiveResponse */
	if (recordPrimTrace()) {
		/* begin fastLogPrim: */
		GIV(primTraceLog)[GIV(primTraceLogIndex)] = GIV(messageSelector);
		primTraceLogIndex(GIV(primTraceLogIndex) + 1);
	}
	assert(!(isOopForwarded(stackValue(GIV(argumentCount)))));
	assert((remapBufferCount()) == 0);
	nArgs = GIV(argumentCount);
	savedStackPointer = GIV(stackPointer);
	savedFramePointer = GIV(framePointer);
	/* begin initPrimCall */
	GIV(primFailCode) = 0;
	dispatchFunctionPointer(primitiveFunctionPointer);
	assert(maybeLeakCheckExternalPrimCall(GIV(newMethod)));
	/* begin maybeRetryPrimitiveOnFailure */
	if (GIV(primFailCode)) {
		retryPrimitiveOnFailure();
	}
	/* begin maybeFailForLastObjectOverwrite */
	if (checkAllocFiller) {
		if (((freeStart()) < GIV(scavengeThreshold))
		 && ((longAt(freeStart())) != (freeStart()))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrWritePastObject;
		}
	}
	if ((!GIV(primFailCode))
	 && ((GIV(framePointer) == savedFramePointer)
	 && (!((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory()))))) {

		/* Don't fail if primitive has done something radical, e.g. perform: */
		if (GIV(stackPointer) != (savedStackPointer + (nArgs * BytesPerWord))) {
			flag("Would be nice to make this a message send of e.g. unbalancedPrimitive to the current process or context");
			failUnbalancedPrimitive();
			GIV(stackPointer) = savedStackPointer;
		}
	}
	if (GIV(nextProfileTick) > 0) {
		checkProfileTick(GIV(newMethod));
	}
	!GIV(primFailCode);
	if (GIV(primFailCode)) {

		/* If primitive failed, then restore state for failure code */
		/* begin pop: */
		GIV(stackPointer) += arraySize * BytesPerWord;
		if (savedNumArgs == 3) {
			/* begin stackTop */
			rcvr = longAt(GIV(stackPointer));
			/* begin stackTopPut: */
			longAtPointerput(GIV(stackPointer), GIV(tempOop2));
			/* begin push: */
			longAtput((sp2 = GIV(stackPointer) - BytesPerWord), rcvr);
			GIV(stackPointer) = sp2;
		}
		/* begin pushInteger: */
		longAtput((sp4 = GIV(stackPointer) - BytesPerWord), (((usqInt)primIdx << 3) | 1));
		GIV(stackPointer) = sp4;
		/* begin push: */
		longAtput((sp3 = GIV(stackPointer) - BytesPerWord), GIV(tempOop));
		GIV(stackPointer) = sp3;
		primitiveFunctionPointer = primitiveDoPrimitiveWithArgs;
		GIV(argumentCount) = savedNumArgs;
	}
	GIV(tempOop) = (GIV(tempOop2) = 0);
}


/*	receiver, args, then method are on top of stack. Execute method against
	receiver and args.
	Set primitiveFunctionPointer because no cache lookup has been done for the
	method, and
	hence primitiveFunctionPointer is stale. */

	/* StackInterpreterPrimitives>>#primitiveExecuteMethod */
static void
primitiveExecuteMethod(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt firstBytecode;
    sqInt header;
    sqInt methodArgument;
    sqInt methodHeader;
    sqInt primitiveIndex;
    sqInt top;

	/* begin stackTop */
	methodArgument = longAt(GIV(stackPointer));
	if (!(((methodArgument & (tagMask())) == 0)
		 && (((((usqInt) (longAt(methodArgument))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadArgument);
		return;
	}
	if (!((GIV(argumentCount) - 1) == (argumentCountOf(methodArgument)))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadNumArgs);
		return;
	}
	/* begin popStack */
	top = longAt(GIV(stackPointer));
	GIV(stackPointer) += BytesPerWord;
	GIV(newMethod) = top;
	/* begin primitiveIndexOfMethod:header: */
	assert(isCompiledMethod(GIV(newMethod)));
	header = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header) & 7) == 1)) {
		methodHeader = header;
	}
	else {
		assert((((usqInt)header)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header))->methodHeader);
	}
	if (methodHeader & AlternateHeaderHasPrimFlag) {
		firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
		primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)));
	}
	else {
		primitiveIndex = 0;
	}
	/* begin functionPointerFor:inClass: */
	primitiveFunctionPointer = ((void (*)(void)) ((primitiveIndex > MaxPrimitiveIndex
	? 0
	: primitiveTable[primitiveIndex])));
	GIV(argumentCount) -= 1;
	executeNewMethod();
	/* begin initPrimCall */
	GIV(primFailCode) = 0;
}


/*	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. */

	/* StackInterpreterPrimitives>>#primitiveExecuteMethodArgsArray */
static void
primitiveExecuteMethodArgsArray(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt argCnt;
    sqInt argumentArray;
    sqInt firstBytecode;
    sqInt header;
    sqInt header1;
    sqInt header2;
    sqInt i;
    sqInt methodArgument;
    sqInt methodHeader;
    sqInt object;
    sqInt primitiveIndex;
    sqInt rcvr;
    char *sp;

	/* begin stackTop */
	methodArgument = longAt(GIV(stackPointer));
	/* begin stackValue: */
	argumentArray = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!((((methodArgument & (tagMask())) == 0)
		 && (((((usqInt) (longAt(methodArgument))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))
		 && (((argumentArray & (tagMask())) == 0)
		 && (((((usqInt) (longAt(argumentArray))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */)))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadArgument);
		return;
	}
	/* begin argumentCountOf: */
	assert(isCompiledMethod(methodArgument));
	header1 = longAt((methodArgument + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header1) & 7) == 1)) {
		header = header1;
	}
	else {
		assert((((usqInt)header1)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		header = ((((CogMethod *) header1))->methodHeader);
	}
	argCnt = (((usqInt) header) >> MethodHeaderArgCountShift) & 15;
	if (!(argCnt == (numSlotsOf(argumentArray)))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadNumArgs);
		return;
	}
	if (GIV(argumentCount) > 2) {

		/* CompiledMethod class>>receiver:withArguments:executeMethod:
		   SqueakObjectPrimitives class>>receiver:withArguments:apply:
		   VMMirror>>ifFail:object:with:executeMethod: et al */
		/* begin stackValue: */
		rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord));
		if ((GIV(argumentCount) > 4)
		 || (((rcvr & (tagMask())) == 0)
		 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0))) {
			/* begin primitiveFailFor: */
			(GIV(primFailCode) = PrimErrUnsupported);
			return;
		}
		/* begin stackValue:put: */
		longAtput(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord), rcvr);
	}
	/* begin pop: */
	GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	for (i = 0; i < argCnt; i += 1) {
		/* begin push: */
		object = longAt((argumentArray + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		longAtput((sp = GIV(stackPointer) - BytesPerWord), object);
		GIV(stackPointer) = sp;
	}
	GIV(newMethod) = methodArgument;
	/* begin primitiveIndexOfMethod:header: */
	assert(isCompiledMethod(GIV(newMethod)));
	header2 = longAt((GIV(newMethod) + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
	if ((((header2) & 7) == 1)) {
		methodHeader = header2;
	}
	else {
		assert((((usqInt)header2)) < GIV(newSpaceStart));
		assert((((((CogMethod *) header2))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
		methodHeader = ((((CogMethod *) header2))->methodHeader);
	}
	if (methodHeader & AlternateHeaderHasPrimFlag) {
		firstBytecode = (GIV(newMethod) + ((LiteralStart + (((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) * BytesPerOop)) + BaseHeaderSize;
		primitiveIndex = (byteAt(firstBytecode + 1)) + (((sqInt)((usqInt)((byteAt(firstBytecode + 2))) << 8)));
	}
	else {
		primitiveIndex = 0;
	}
	/* begin functionPointerFor:inClass: */
	primitiveFunctionPointer = ((void (*)(void)) ((primitiveIndex > MaxPrimitiveIndex
	? 0
	: primitiveTable[primitiveIndex])));
	GIV(argumentCount) = argCnt;
	executeNewMethod();
	/* begin initPrimCall */
	GIV(primFailCode) = 0;
}


/*	Call an external primitive. External primitive methods first literals are
	an array of
	* The module name (String | Symbol)
	* The function name (String | Symbol)
	* The session ID (SmallInteger) [OBSOLETE], or in Spur, the accessorDepth
	(Integer) * The function index (Integer) in the externalPrimitiveTable
	For fast interpreter dispatch in subsequent invocations the
	primitiveFunctionPointer in the method cache is rewritten, either to the
	function itself, or to zero if the external
	function is not found. This allows for fast responses as long as the
	method stays in
	the cache. The cache rewrite relies on lastMethodCacheProbeWrite which is
	set in
	addNewMethodToCache:.
	Now that the VM flushes function addresses from its tables, the session ID
	is obsolete,
	but it is kept for backward compatibility. 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
	(i.e., the SmallInteger -1 to distinguish from 16rFFFFFFFF which may be
	returned from
	lookup), and the primitive fails with PrimErrNotFound.
 */

	/* StackInterpreterPrimitives>>#primitiveExternalCall */
static void
primitiveExternalCall(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt accessorDepth;
    void (*addr)();
    sqInt fmt;
    sqInt fmt1;
    sqInt functionLength;
    sqInt functionName;
    sqInt i;
    sqInt index;
    sqInt lit;
    sqInt moduleLength;
    sqInt moduleName;
    usqInt numSlots;
    usqInt numSlots1;
    usqInt numSlots11;
    usqInt numSlots2;
    sqInt val;


	/* Check for it being a method for primitiveDoPrimitiveWithArgs.
	   Fetch the first literal of the method; check its an Array of length 4.
	   Look at the function index in case it has been loaded before */
	accessorDepth = 0;
	val = 0;
	if (!((((GIV(newMethod) & (tagMask())) == 0)
		 && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))
		 && (((literalCountOfMethodHeader(methodHeaderOf(GIV(newMethod)))) > 0)
		 && (((lit = literalofMethod(0, GIV(newMethod))),
		(((lit & (tagMask())) == 0)
			 && (((((usqInt) (longAt(lit))) >> (formatShift())) & (formatMask())) == 2 /* arrayFormat */))
			 && (((numSlotsOf(lit)) == 4)
			 && (((index = longAt((lit + BaseHeaderSize) + (3U << (shiftForWord())))),
			(((index) & 7) == 1))))))))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadMethod);
		return;
	}

	/* Check if we have already looked up the function and failed. */
	index = (index >> 3);
	if (index < 0) {

		/* Function address was not found in this session,
		   Void the primitive function. */
		rewriteMethodCacheEntryForExternalPrimitiveToFunction(0);
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrNotFound);
		return;
	}
	if ((index > 0)
	 && (index <= MaxExternalPrimitiveTableSize)) {
		addr = externalPrimitiveTable[index - 1];
		if (addr != 0) {
			rewriteMethodCacheEntryForExternalPrimitiveToFunction(addr);
			/* begin callExternalPrimitive: */
			primitiveFunctionPointer = addr;
			dispatchFunctionPointer(addr);
			/* begin maybeFailForLastObjectOverwrite */
			if (checkAllocFiller) {
				if (((freeStart()) < GIV(scavengeThreshold))
				 && ((longAt(freeStart())) != (freeStart()))) {
					/* begin primitiveFailFor: */
					GIV(primFailCode) = PrimErrWritePastObject;
				}
			}
			/* begin maybeRetryPrimitiveOnFailure */
			if (GIV(primFailCode)) {
				retryPrimitiveOnFailure();
			}
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrNamedInternal);
		return;
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(lit)));
	longAtput((lit + BaseHeaderSize) + (2U << (shiftForWord())), ConstZero);
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(lit)));
	longAtput((lit + BaseHeaderSize) + (3U << (shiftForWord())), ConstZero);
	/* begin fetchPointer:ofObject: */
	moduleName = longAt((lit + BaseHeaderSize) + (0U << (shiftForWord())));
	if (moduleName == GIV(nilObj)) {
		moduleLength = 0;
	}
	else {
		if (!(((moduleName & (tagMask())) == 0)
			 && (((((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadMethod;
		}
		/* begin lengthOf:format: */
		fmt = (((usqInt) (longAt(moduleName))) >> (formatShift())) & (formatMask());
		/* begin numSlotsOfAny: */
		numSlots1 = byteAt(moduleName + 7);
		numSlots = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(moduleName - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		if (fmt <= 5 /* ephemeronFormat */) {
			moduleLength = numSlots;
			goto l14;
		}
		if (fmt >= (firstByteFormat())) {

			/* bytes, including CompiledMethod */
			moduleLength = (numSlots << (shiftForWord())) - (fmt & 7);
			goto l14;
		}
		if (fmt >= (firstShortFormat())) {
			moduleLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
			goto l14;
		}
		if (fmt >= (firstLongFormat())) {
			moduleLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
			goto l14;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			moduleLength = numSlots;
			goto l14;
		}
		moduleLength = 0;
	l14:	/* end lengthOf:format: */;
	}
	/* begin fetchPointer:ofObject: */
	functionName = longAt((lit + BaseHeaderSize) + (1U << (shiftForWord())));
	if (!(((functionName & (tagMask())) == 0)
		 && (((((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask())) >= (firstByteFormat())))) {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadMethod;
	}
	/* begin lengthOf:format: */
	fmt1 = (((usqInt) (longAt(functionName))) >> (formatShift())) & (formatMask());
	/* begin numSlotsOfAny: */
	numSlots11 = byteAt(functionName + 7);
	numSlots2 = (numSlots11 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(functionName - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots11);
	if (fmt1 <= 5 /* ephemeronFormat */) {
		functionLength = numSlots2;
		goto l17;
	}
	if (fmt1 >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		functionLength = (numSlots2 << (shiftForWord())) - (fmt1 & 7);
		goto l17;
	}
	if (fmt1 >= (firstShortFormat())) {
		functionLength = (numSlots2 << ((shiftForWord()) - 1)) - (fmt1 & 3);
		goto l17;
	}
	if (fmt1 >= (firstLongFormat())) {
		functionLength = (numSlots2 << ((shiftForWord()) - 2)) - (fmt1 & 1);
		goto l17;
	}
	if (fmt1 == (sixtyFourBitIndexableFormat())) {
		functionLength = numSlots2;
		goto l17;
	}
	functionLength = 0;
	l17:	/* end lengthOf:format: */;
	addr = ioLoadExternalFunctionOfLengthFromModuleOfLengthAccessorDepthInto(functionName + BaseHeaderSize, functionLength, moduleName + BaseHeaderSize, moduleLength, (&accessorDepth));
	if (addr == 0) {
		index = -1;
	}
	else {

		/* add the function to the external primitive table */
		/* begin addToExternalPrimitiveTable: */
		for (i = GIV(externalPrimitiveTableFirstFreeIndex); i < MaxExternalPrimitiveTableSize; i += 1) {
			if ((externalPrimitiveTable[i]) == 0) {
				externalPrimitiveTable[i] = (((void *) addr));
				index = (GIV(externalPrimitiveTableFirstFreeIndex) = i + 1);
				goto l3;
			}
		}
		index = 0;
	l3:	/* end addToExternalPrimitiveTable: */;
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(lit)));
		longAtput((lit + BaseHeaderSize) + (2U << (shiftForWord())), (((usqInt)accessorDepth << 3) | 1));
	}
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(lit)));
	longAtput((lit + BaseHeaderSize) + (3U << (shiftForWord())), (((usqInt)index << 3) | 1));
	if (index >= 0) {
		rewriteMethodCacheEntryForExternalPrimitiveToFunction(addr);
		/* begin callExternalPrimitive: */
		primitiveFunctionPointer = addr;
		dispatchFunctionPointer(addr);
		/* begin maybeFailForLastObjectOverwrite */
		if (checkAllocFiller) {
			if (((freeStart()) < GIV(scavengeThreshold))
			 && ((longAt(freeStart())) != (freeStart()))) {
				/* begin primitiveFailFor: */
				GIV(primFailCode) = PrimErrWritePastObject;
			}
		}
		/* begin maybeRetryPrimitiveOnFailure */
		if (GIV(primFailCode)) {
			retryPrimitiveOnFailure();
		}
	}
	else {

		/* Otherwise void the primitive function and fail */
		rewriteMethodCacheEntryForExternalPrimitiveToFunction(0);
		assert((fetchPointerofObject(2, lit)) == ConstZero);
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrNotFound;
	}
}


/*	Primitive. Search up the context stack for the next method context marked
	for exception handling starting at the receiver. Return nil if none found */

	/* StackInterpreterPrimitives>>#primitiveFindHandlerContext */
static void
primitiveFindHandlerContext(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt handlerOrNilOrZero;
    char *sp;

	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(199, longAt(GIV(stackPointer)), GIV(nilObj));
	if (handlerOrNilOrZero == 0) {
		/* begin nilObject */
		handlerOrNilOrZero = GIV(nilObj);
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), handlerOrNilOrZero);
	GIV(stackPointer) = sp;
}


/*	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.
 */

	/* StackInterpreterPrimitives>>#primitiveFindNextUnwindContext */
static void
primitiveFindNextUnwindContext(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt calleeContext;
    sqInt callerContextOrNil;
    sqInt handlerOrNilOrZero;
    sqInt senderContext;
    sqInt senderOop;
    char *sp;
    sqInt startContext;
    char *startFP;
    sqInt stopContext;
    char *theFP;
    char *theFP1;
    char *theFPAbove;
    sqInt theMethod;
    StackPage *thePage;
    char *theSP;

	/* begin stackTop */
	stopContext = longAt(GIV(stackPointer));
	/* begin stackValue: */
	calleeContext = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!((stopContext == GIV(nilObj))
		 || (((stopContext & (tagMask())) == 0)
		 && (((longAt(stopContext)) & (classIndexMask())) == ClassMethodContextCompactIndex)))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	assert(stopContext != calleeContext);
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if ((((((longAt((calleeContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(calleeContext)))) {
		/* begin frameOfMarriedContext: */
		senderOop = longAt((calleeContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop) & 7) == 1));
		theFP = pointerForOop(senderOop - 1);
		if ((longAt(theFP + FoxSavedFP)) == 0) {
			handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(198, frameCallerContext(theFP), stopContext);
		}
		else {
			/* begin findMethodWithPrimitive:FromFP:UpToContext: */
			startFP = pointerForOop(longAt(theFP + FoxSavedFP));
			theFP1 = startFP;
			theFPAbove = startFP;
			do {
				if ((((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
					? ((longAt(theFP1 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
					: (byteAt((theFP1 + FoxIFrameFlags) + 2)) != 0))
				 && (stopContext == (longAt(theFP1 + FoxThisContext)))) {
					handlerOrNilOrZero = 0;
					goto l9;
				}
				if (!(((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
						? ((longAt(theFP1 + FoxMethod)) & MFMethodFlagIsBlockFlag) != 0
						: (byteAt((theFP1 + FoxIFrameFlags) + 3)) != 0))) {
					theMethod = ((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
						? ((mframeHomeMethod(theFP1))->methodObject)
						: longAt(theFP1 + FoxMethod));
					if ((primitiveIndexOfMethodheader(theMethod, methodHeaderOf(theMethod))) == 198) {
						if (theFP1 == theFPAbove) {
							theSP = findSPOfon(theFP1, stackPageFor(theFP1));
						}
						else {
							assert(!(isBaseFrame(theFPAbove)));
							theSP = (theFPAbove + (frameStackedReceiverOffset(theFPAbove))) + BytesPerWord;
						}
						/* begin ensureFrameIsMarried:SP: */
						if (((((usqInt)(longAt(theFP1 + FoxMethod)))) < (startOfMemory())
							? ((longAt(theFP1 + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
							: (byteAt((theFP1 + FoxIFrameFlags) + 2)) != 0)) {
							assert(isContext(frameContext(theFP1)));
							handlerOrNilOrZero = longAt(theFP1 + FoxThisContext);
							goto l9;
						}
						handlerOrNilOrZero = marryFrameSP(theFP1, theSP);
						goto l9;
					}
				}
				theFPAbove = theFP1;
				theFP1 = pointerForOop(longAt(theFP1 + FoxSavedFP));
			} while(theFP1 != 0);
			/* begin frameCallerContext: */
			assert(isBaseFrame(theFPAbove));
			/* begin stackPageFor: */
			thePage = stackPageAtpages((assert((((((char *) theFPAbove)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFPAbove)) <= (((char *) GIV(pages)))))),
			pageIndexForstackBasePlus1bytesPerPage(theFPAbove, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
			callerContextOrNil = longAt((thePage->baseAddress));
			assert(addressCouldBeObj(callerContextOrNil));
			assert((callerContextOrNil == (nilObject()))
			 || (isContext(callerContextOrNil)));
			senderContext = callerContextOrNil;
			if (!(((senderContext & (tagMask())) == 0)
				 && (((longAt(senderContext)) & (classIndexMask())) == ClassMethodContextCompactIndex))) {
				/* begin nilObject */
				handlerOrNilOrZero = GIV(nilObj);
				goto l9;
			}
			handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(198, senderContext, stopContext);
	l9:	/* end findMethodWithPrimitive:FromFP:UpToContext: */;
		}
	}
	else {
		/* begin fetchPointer:ofObject: */
		startContext = longAt((calleeContext + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		if (((startContext & (tagMask())) == 0)
		 && (((longAt(startContext)) & (classIndexMask())) == ClassMethodContextCompactIndex)) {
			handlerOrNilOrZero = findMethodWithPrimitiveFromContextUpToContext(198, startContext, stopContext);
		}
		else {
			handlerOrNilOrZero = 0;
		}
	}
	if (handlerOrNilOrZero == 0) {
		/* begin nilObject */
		handlerOrNilOrZero = GIV(nilObj);
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), handlerOrNilOrZero);
	GIV(stackPointer) = sp;
}


/*	Do a full garbage collection. In SqueakV3ObjectMemory, answer the number
	of bytes available (including swap space if dynamic memory management is
	supported). In Spur, answer the size of the largest free chunk. */
/*	Do a full garbage collection. In SqueakV3ObjectMemory, answer the number
	of bytes available (including swap space if dynamic memory management is
	supported). In Spur, answer the size of the largest free chunk. */

	/* StackInterpreterPrimitives>>#primitiveFullGC */
static void
primitiveFullGC(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerVal;
    sqInt integerVal1;
    char *sp;
    char *sp1;

	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	/* begin pop:thenPushInteger: */
	integerVal = fullGC();
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)integerVal << 3) | 1));
	GIV(stackPointer) = sp;
	return;
	/* begin incrementalGC */
	error("shouldNotImplement");
	fullGC();
	/* begin pop:thenPushInteger: */
	integerVal1 = (((GIV(totalFreeOldSpace) + ((((eden()).limit)) - GIV(freeStart))) + ((((pastSpace()).limit)) - GIV(pastSpaceStart))) + ((((futureSpace()).limit)) - (((futureSpace()).limit)))) - (interpreterAllocationReserveBytes());
	longAtput((sp1 = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)integerVal1 << 3) | 1));
	GIV(stackPointer) = sp1;
}


/*	See primitiveVMParameter method comment.
	N.B. written as a returning case to avoid branch limits in the V3 bytecode
	set. 
 */

	/* StackInterpreterPrimitives>>#primitiveGetVMParameter: */
static sqInt NoDbgRegParms
primitiveGetVMParameter(sqInt arg)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	
	switch (arg) {
	case 1:
		return positiveMachineIntegerFor(totalBytesInSegments());

	case 2:
		return (((usqInt)((GIV(freeStart) - (((eden()).start))) + (GIV(pastSpaceStart) - (((pastSpace()).start)))) << 3) | 1);

	case 3:
		return positiveMachineIntegerFor((newSpaceCapacity()) + (totalBytesInSegments()));

	case 6:
		return (((usqInt)(((sqInt)(((scavengerTenuringThreshold()) * (((GIV(pastSpace).limit)) - ((GIV(pastSpace).start)))) / (8 * BytesPerOop)))) << 3) | 1);

	case 7:
		return (((usqInt)GIV(statFullGCs) << 3) | 1);

	case 8:
		return ((((GIV(statFullGCUsecs) + 500) / 1000) << 3) | 1);

	case 9:
		return (((usqInt)(/* begin statScavenges */ GIV(statScavenges)) << 3) | 1);

	case 10:
		return (((((/* begin statScavengeGCUsecs */ GIV(statScavengeGCUsecs)) + 500) / 1000) << 3) | 1);

	case 11:
		return (((usqInt)GIV(statTenures) << 3) | 1);

	case 12:
	case 13:
	case 14:
	case 15:
		return ConstZero;

	case 16:
		return positive64BitIntegerFor(GIV(statIdleUsecs));

	case 17:
		return ConstZero;

	case 18:
		return ((((GIV(statCompactionUsecs) + 500) / 1000) << 3) | 1);

	case 19:
		return (((usqInt)(GIV(scavengeThreshold) - (((eden()).start))) << 3) | 1);

	case 20:
		return positive64BitIntegerFor(ioUTCStartMicroseconds());

	case 21:
		return (((usqInt)(rootTableCount()) << 3) | 1);

	case 22:
		return (((usqInt)GIV(statRootTableOverflows) << 3) | 1);

	case 23:
		return (((usqInt)extraVMMemory << 3) | 1);

	case 24:
		return (((usqInt)GIV(shrinkThreshold) << 3) | 1);

	case 25:
		return (((usqInt)GIV(growHeadroom) << 3) | 1);

	case 26:
		return (((usqInt)(ioHeartbeatMilliseconds()) << 3) | 1);

	case 27:
		return (((usqInt)GIV(statMarkCount) << 3) | 1);

	case 28:
		return (((usqInt)0 /* statSweepCount */ << 3) | 1);

	case 29:
		return (((usqInt)0 /* statMkFwdCount */ << 3) | 1);

	case 30:
		return (((usqInt)GIV(statCompactPassCount) << 3) | 1);

	case 0x1F:
		return (((usqInt)GIV(statGrowMemory) << 3) | 1);

	case 32:
		return (((usqInt)GIV(statShrinkMemory) << 3) | 1);

	case 33:
		return (((usqInt)GIV(statRootTableCount) << 3) | 1);

	case 34:
		return positive64BitIntegerFor(currentAllocatedBytes());

	case 35:
		return (((usqInt)GIV(statSurvivorCount) << 3) | 1);

	case 36:
		return ((((GIV(statGCEndUsecs) / 1000) & MillisecondClockMask) << 3) | 1);

	case 37:
		return (((usqInt)0 /* statSpecialMarkCount */ << 3) | 1);

	case 38:
		return ((((GIV(statIGCDeltaUsecs) + 500) / 1000) << 3) | 1);

	case 39:
		return (((usqInt)GIV(statPendingFinalizationSignals) << 3) | 1);

	case 40:
		return (((usqInt)BytesPerWord << 3) | 1);

	case 41:
		return (((usqInt)68021 /* imageFormatVersion */ << 3) | 1);

	case 42:
		return (((usqInt)GIV(numStackPages) << 3) | 1);

	case 43:
		return (((usqInt)desiredNumStackPages << 3) | 1);

	case 44:
		return (((usqInt)(((GIV(eden).limit)) - ((GIV(eden).start))) << 3) | 1);

	case 45:
		return (((usqInt)desiredEdenBytes << 3) | 1);

	case 46:
		return getCogCodeSize();

	case 47:
		return getDesiredCogCodeSize();

	case 48:
		return getCogVMFlags();

	case 49:
		return (((usqInt)(ioGetMaxExtSemTableSize()) << 3) | 1);

	case 52:
		return (((usqInt)(rootTableCapacity()) << 3) | 1);

	case 53:
		return (((usqInt)(numSegments()) << 3) | 1);

	case 54:
		return ((GIV(totalFreeOldSpace) << 3) | 1);

	case 55:
		return floatObjectOf(getHeapGrowthToSizeGCRatio());

	case 56:
		return positive64BitIntegerFor(GIV(statProcessSwitch));

	case 57:
		return positive64BitIntegerFor(GIV(statIOProcessEvents));

	case 58:
		return positive64BitIntegerFor(GIV(statForceInterruptCheck));

	case 59:
		return positive64BitIntegerFor(GIV(statCheckForEvents));

	case 60:
		return positive64BitIntegerFor(GIV(statStackOverflow));

	case 61:
		return positive64BitIntegerFor(GIV(statStackPageDivorce));

	case 0x3E:
		return getCodeCompactionCount();

	case 0x3F:
		return getCodeCompactionMSecs();

	case 64:
		return (((usqInt)(numMethodsOfType(CMMethod)) << 3) | 1);

	case 65:
		return (((usqInt)(((1) + ((IMMUTABILITY
	? 2
	: 0))) + (
#if ITIMER_HEARTBEAT
	4
#else /* ITIMER_HEARTBEAT */
	0
#endif /* ITIMER_HEARTBEAT */
	)) << 3) | 1);

	case 66:
		return (((usqInt)(stackPageByteSize()) << 3) | 1);

	case 67:
		return (((maxOldSpaceSize()) << 3) | 1);

	case 68:
		return floatObjectOf(statAverageLivePagesWhenMapping());

	case 69:
		return (((usqInt)(statMaxPageCountWhenMapping()) << 3) | 1);

	case 70:
		return (((usqInt)(VM_PROXY_MAJOR) << 3) | 1);

	case 71:
		return (((usqInt)(VM_PROXY_MINOR) << 3) | 1);

	case 72:
		return ((((GIV(statMarkUsecs) + 500) / 1000) << 3) | 1);

	case 73:
		return ((((GIV(statSweepUsecs) + 500) / 1000) << 3) | 1);

	case 74:
		return (((usqInt)((GIV(statMaxAllocSegmentTime) + 500) / 1000) << 3) | 1);

	default:
		return null;

	}
	return 0;
}


/*	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. 
 */
/*	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. 
 */

	/* StackInterpreterPrimitives>>#primitiveIncrementalGC */
static void
primitiveIncrementalGC(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt integerVal;
    char *sp;

	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	/* begin scavengingGC */
	scavengingGCTenuringIf(TenureByAge);
	/* begin pop:thenPushInteger: */
	integerVal = (((GIV(totalFreeOldSpace) + ((((eden()).limit)) - GIV(freeStart))) + ((((pastSpace()).limit)) - GIV(pastSpaceStart))) + ((((futureSpace()).limit)) - (((futureSpace()).limit)))) - (interpreterAllocationReserveBytes());
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), (((usqInt)integerVal << 3) | 1));
	GIV(stackPointer) = sp;
}

	/* StackInterpreterPrimitives>>#primitiveInstVarAt */
static void
primitiveInstVarAt(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class;
    sqInt classFormat;
    sqInt fixedFields;
    usqLong fmt;
    sqLong hdr;
    sqInt index;
    unsigned int integerValue;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt rcvr;
    char *sp;
    sqInt totalLength;
    sqInt value;

	/* begin stackTop */
	index = longAt(GIV(stackPointer));
	/* begin stackValue: */
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (((index & (smallIntegerTag())) == 0)
	 || ((GIV(argumentCount) > 1)
	 && (((rcvr & (tagMask())) == 0)
	 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadArgument);
		return;
	}
	if (rcvr & (tagMask())) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrInappropriate);
		return;
	}
	index = (index >> 3);
	/* begin baseHeader: */
	hdr = long64At(rcvr);
	fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots1 = byteAt(rcvr + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		totalLength = numSlots;
		goto l5;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l5;
	}
	if (fmt >= (firstShortFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l5;
	}
	if (fmt >= (firstLongFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l5;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		totalLength = numSlots;
		goto l5;
	}
	totalLength = 0;
	l5:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		fixedFields = 0;
		goto l6;
	}
	if (fmt < 2 /* arrayFormat */) {
		fixedFields = totalLength;
		goto l6;
	}
	class = fetchClassOfNonImm(rcvr);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l6:	/* end fixedFieldsOf:format:length: */;
	if (!((index >= 1)
		 && (index <= fixedFields))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if ((fmt == (indexablePointersFormat()))
	 && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		value = externalInstVarofContext(index - 1, rcvr);
	}
	else {
		/* begin subscript:with:format: */
		if (fmt <= 5 /* lastPointerFormat */) {
			/* begin fetchPointer:ofObject: */
			value = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))));
			goto l7;
		}
		if (fmt >= (firstByteFormat())) {
			value = (((usqInt)(byteAt((rcvr + BaseHeaderSize) + (index - 1))) << 3) | 1);
			goto l7;
		}
		if (fmt >= (firstShortFormat())) {
			value = (((usqInt)(((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))))))) << 3) | 1);
			goto l7;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			value = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 3)))));
			goto l7;
		}
		/* begin positive32BitIntegerFor: */
		integerValue = long32At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 2))));
		value = ((((((usqInt)integerValue)) & 0xFFFFFFFFU) << 3) | 1);
		goto l7;
	l7:	/* end subscript:with:format: */;
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value);
	GIV(stackPointer) = sp;
}

	/* StackInterpreterPrimitives>>#primitiveInstVarAtPut */
static void
primitiveInstVarAtPut(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt class;
    sqInt classFormat;
    sqInt fixedFields;
    usqLong fmt;
    sqLong hdr;
    sqInt index;
    sqInt newValue;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt rcvr;
    sqInt signedValueToStore;
    char *sp;
    sqInt totalLength;
    usqLong unsigned64BitValueToStore;
    unsigned int unsignedValueToStore;

	/* begin stackTop */
	newValue = longAt(GIV(stackPointer));
	/* begin stackValue: */
	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin stackValue: */
	rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	if (((index & (smallIntegerTag())) == 0)
	 || ((GIV(argumentCount) > 2)
	 && (((rcvr & (tagMask())) == 0)
	 && (((longAt(rcvr)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadArgument);
		return;
	}
	if (rcvr & (tagMask())) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadReceiver);
		return;
	}
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrNoModification);
		return;
	}
	index = (index >> 3);
	/* begin baseHeader: */
	hdr = long64At(rcvr);
	fmt = (((unsigned sqLong)hdr) >> (formatShift())) & (formatMask());
	/* begin lengthOf:format: */
	numSlots1 = byteAt(rcvr + 7);
	numSlots = (numSlots1 == (numSlotsMask())
		? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
		: numSlots1);
	if (fmt <= 5 /* ephemeronFormat */) {
		totalLength = numSlots;
		goto l7;
	}
	if (fmt >= (firstByteFormat())) {

		/* bytes, including CompiledMethod */
		totalLength = (numSlots << (shiftForWord())) - (fmt & 7);
		goto l7;
	}
	if (fmt >= (firstShortFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 1)) - (fmt & 3);
		goto l7;
	}
	if (fmt >= (firstLongFormat())) {
		totalLength = (numSlots << ((shiftForWord()) - 2)) - (fmt & 1);
		goto l7;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		totalLength = numSlots;
		goto l7;
	}
	totalLength = 0;
	l7:	/* end lengthOf:format: */;
	/* begin fixedFieldsOf:format:length: */
	if ((fmt >= (sixtyFourBitIndexableFormat()))
	 || (fmt == 2 /* arrayFormat */)) {
		fixedFields = 0;
		goto l8;
	}
	if (fmt < 2 /* arrayFormat */) {
		fixedFields = totalLength;
		goto l8;
	}
	class = fetchClassOfNonImm(rcvr);
	/* begin fixedFieldsOfClassFormat: */
	classFormat = ((longAt((class + BaseHeaderSize) + (((sqInt)((usqInt)(InstanceSpecificationIndex) << (shiftForWord())))))) >> 3);
	fixedFields = classFormat & ((1U << (fixedFieldsFieldWidth())) - 1);
	l8:	/* end fixedFieldsOf:format:length: */;
	if (!((index >= 1)
		 && (index <= fixedFields))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if ((fmt == (indexablePointersFormat()))
	 && ((hdr & (classIndexMask())) == ClassMethodContextCompactIndex)) {
		externalInstVarofContextput(index - 1, rcvr, newValue);
	}
	else {
		/* begin subscript:with:storing:format: */
		if (fmt <= 5 /* lastPointerFormat */) {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(rcvr)));
			if ((assert(isNonImmediate(rcvr)),
			oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((newValue & (tagMask())) == 0)
				 && (oopisLessThan(newValue, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(rcvr);
					}
				}
			}
			longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << (shiftForWord())))), newValue);
			goto l14;
		}
		if (fmt >= (firstByteFormat())) {
			if (!((((newValue) & 7) == 1))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l14;
			}
			signedValueToStore = (newValue >> 3);
			if (!((signedValueToStore >= 0)
				 && (signedValueToStore <= 0xFF))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l14;
			}
			/* begin storeByte:ofObject:withValue: */
			byteAtput((rcvr + BaseHeaderSize) + (index - 1), signedValueToStore);
			goto l14;
		}
		if (fmt >= (firstShortFormat())) {
			if (!((((newValue) & 7) == 1))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l14;
			}
			signedValueToStore = (newValue >> 3);
			if (!((signedValueToStore >= 0)
				 && (signedValueToStore <= 0xFFFF))) {
				GIV(primFailCode) = PrimErrBadArgument;
				goto l14;
			}
			/* begin storeShort16:ofObject:withValue: */
			shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 1))), signedValueToStore);
			goto l14;
		}
		if (fmt == (sixtyFourBitIndexableFormat())) {
			unsigned64BitValueToStore = positive64BitValueOf(newValue);
			if (!GIV(primFailCode)) {
				/* begin storeLong64:ofObject:withValue: */
				long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 3))), unsigned64BitValueToStore);
			}
			goto l14;
		}
		unsignedValueToStore = positive32BitValueOf(newValue);
		if (!GIV(primFailCode)) {
			/* begin storeLong32:ofObject:withValue: */
			long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)((index - 1)) << 2))), unsignedValueToStore);
		}
	l14:	/* end subscript:with:storing:format: */;
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);
	GIV(stackPointer) = sp;
}


/*	Primitive. Answer an Array with the current long-running primitive method
	identified by
	the heartbeat, the minimum number of milliseconds it was active for, and
	the milliseconds
	of GC activity there-in, or nil if none. Since the
	longRunningPrimitiveCheckMethod is
	sampled at interrupt time be careful to validate it before returning it. */

	/* StackInterpreterPrimitives>>#primitiveLongRunningPrimitive */
EXPORT(sqInt)
primitiveLongRunningPrimitive(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong gcms;
    sqInt lrpcm;
    sqLong primms;
    sqInt result;
    char *sp;

	if (!(GIV(argumentCount) == 0)) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return null;
	}
	sqLowLevelMFence();
	if ((GIV(longRunningPrimitiveStopUsecs) > GIV(longRunningPrimitiveStartUsecs))
	 && ((((lrpcm = GIV(longRunningPrimitiveCheckMethod))) != null)
	 && ((addressCouldBeObj(lrpcm))
	 && ((!(((longAt(lrpcm)) & (classIndexMask())) == (isFreeObjectClassIndexPun())))
	 && (((((usqInt) (longAt(lrpcm))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))))) {
		result = instantiateClassindexableSize(splObj(ClassArray), 3);
		primms = ((GIV(longRunningPrimitiveStopUsecs) - GIV(longRunningPrimitiveStartUsecs)) + 500) / 1000;
		gcms = (GIV(longRunningPrimitiveGCUsecs) + 500) / 1000;
		/* begin storePointer:ofObject:withValue: */
		assert(!(isForwarded(result)));
		if ((assert(isNonImmediate(result)),
		oopisGreaterThanOrEqualTo(result, GIV(oldSpaceStart)))) {

			/* most stores into young objects */
			if (((lrpcm & (tagMask())) == 0)
			 && (oopisLessThan(lrpcm, GIV(newSpaceLimit)))) {
				/* begin possibleRootStoreInto: */
				if (!(((((usqInt) (longAt(result))) >> (rememberedBitShift())) & 1) != 0)) {
					remember(result);
				}
			}
		}
		longAtput((result + BaseHeaderSize) + (0U << (shiftForWord())), lrpcm);
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(result)));
		longAtput((result + BaseHeaderSize) + (1U << (shiftForWord())), (((usqInt)primms << 3) | 1));
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(result)));
		longAtput((result + BaseHeaderSize) + (2U << (shiftForWord())), ((gcms << 3) | 1));
	}
	else {
		/* begin nilObject */
		result = GIV(nilObj);
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + ((1 - 1) * BytesPerWord)), result);
	GIV(stackPointer) = sp;
	voidLongRunningPrimitive("get");
	return 0;
}


/*	This primitive is assumed to be fast (see e.g.
	MethodDictionary>>includesKey:) so make it so.
	N.B. Works forrectly for cogged methods too. */

	/* StackInterpreterPrimitives>>#primitiveObjectPointsTo */
static void
primitiveObjectPointsTo(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    usqLong fmt;
    sqLong header;
    sqInt header1;
    sqInt i;
    sqInt methodHeader;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt rcvr;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    char *sp4;
    char *sp5;
    sqInt thang;
    sqInt trueOrFalse;

	/* begin stackTop */
	thang = longAt(GIV(stackPointer));
	/* begin stackValue: */
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (rcvr & (tagMask())) {
		/* begin pop:thenPushBool: */
		longAtput((sp = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj));
		GIV(stackPointer) = sp;
		return;
	}
	/* begin baseHeader: */
	header = long64At(rcvr);
	fmt = (((unsigned sqLong)header) >> (formatShift())) & (formatMask());
	if (fmt <= 5 /* lastPointerFormat */) {
		if ((fmt == (indexablePointersFormat()))
		 && ((header & (classIndexMask())) == ClassMethodContextCompactIndex)) {
			if (((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1)) {
				/* begin externalWriteBackHeadFramePointers */
				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
				assert(GIV(stackPage) == (mostRecentlyUsedPage()));
				assert(!((isFree(GIV(stackPage)))));
				/* begin setHeadFP:andSP:inPage: */
				assert(GIV(stackPointer) < GIV(framePointer));
				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
				 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
				 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
				(GIV(stackPage)->headFP = GIV(framePointer));
				(GIV(stackPage)->headSP = GIV(stackPointer));
				assert(pageListIsWellFormed());
				if ((((((longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
				 && (!(isWidowedContext(rcvr)))) {
					/* begin pop:thenPushBool: */
					trueOrFalse = marriedContextpointsTostackDeltaForCurrentFrame(rcvr, thang, 2);
					longAtput((sp1 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), (trueOrFalse
						? GIV(trueObj)
						: GIV(falseObj)));
					GIV(stackPointer) = sp1;
					return;
				}
			}
			numSlots = CtxtTempFrameStart + (fetchStackPointerOf(rcvr));
		}
		else {
			/* begin numSlotsOf: */
			assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
			numSlots1 = byteAt(rcvr + 7);
			numSlots = (numSlots1 == (numSlotsMask())
				? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
				: numSlots1);
		}
	}
	else {
		if (fmt < (firstCompiledMethodFormat())) {

			/* no pointers */
			/* begin pop:thenPushBool: */
			longAtput((sp2 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj));
			GIV(stackPointer) = sp2;
			return;
		}
		/* begin methodHeaderOf: */
		assert(isCompiledMethod(rcvr));
		header1 = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(HeaderIndex) << (shiftForWord())))));
		if ((((header1) & 7) == 1)) {
			methodHeader = header1;
		}
		else {
			assert((((usqInt)header1)) < GIV(newSpaceStart));
			assert((((((CogMethod *) header1))->objectHeader)) == (nullHeaderForMachineCodeMethod()));
			methodHeader = ((((CogMethod *) header1))->methodHeader);
		}
		if (methodHeader == thang) {
			/* begin pop:thenPushBool: */
			longAtput((sp3 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(trueObj));
			GIV(stackPointer) = sp3;
			return;
		}
		numSlots = ((assert((((methodHeader) & 7) == 1)),
((methodHeader >> 3)) & AlternateHeaderNumLiteralsMask)) + LiteralStart;
	}
	assert((((numSlots - 1) * BytesPerOop) + BaseHeaderSize) == (lastPointerOf(rcvr)));
	for (i = BaseHeaderSize; i <= (((numSlots - 1) * BytesPerOop) + BaseHeaderSize); i += BytesPerOop) {
		if ((longAt(rcvr + i)) == thang) {
			/* begin pop:thenPushBool: */
			longAtput((sp4 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(trueObj));
			GIV(stackPointer) = sp4;
			return;
		}
	}
	/* begin pop:thenPushBool: */
	longAtput((sp5 = GIV(stackPointer) + ((2 - 1) * BytesPerWord)), GIV(falseObj));
	GIV(stackPointer) = sp5;
}

	/* StackInterpreterPrimitives>>#primitivePerform */
static void
primitivePerform(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt i;
    sqInt lookupClassTag;
    sqInt newReceiver;
    usqInt performMethod;
    sqInt tagBits;

	performMethod = GIV(newMethod);
	/* begin stackValue: */
	GIV(messageSelector) = longAt(GIV(stackPointer) + ((GIV(argumentCount) - 1) * BytesPerWord));
	/* begin stackValue: */
	newReceiver = longAt(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord));
	GIV(argumentCount) -= 1;
	for (i = GIV(argumentCount); i >= 1; i += -1) {
		longAtput(GIV(stackPointer) + (i * BytesPerWord), longAt(GIV(stackPointer) + ((i - 1) * BytesPerWord)));
	}
	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
	lookupClassTag = (((tagBits = newReceiver & (tagMask()))) != 0
		? tagBits
		: (longAt(newReceiver)) & (classIndexMask()));
	/* begin sendBreakpoint:receiver: */
	sendBreakpointreceiver(firstFixedFieldOfMaybeImmediate(GIV(messageSelector)), lengthOfMaybeImmediate(GIV(messageSelector)), newReceiver);
	if (printOnTrace()) {
		printActivationNameForSelectorstartClass(GIV(messageSelector), classAtIndex(lookupClassTag));
		/* begin cr */
		printf("\n");
	}
	findNewMethodInClassTag(lookupClassTag);
	if (!((((GIV(newMethod) & (tagMask())) == 0)
		 && (((((usqInt) (longAt(GIV(newMethod)))) >> (formatShift())) & (formatMask())) >= (firstCompiledMethodFormat())))
		 && ((argumentCountOf(GIV(newMethod))) == GIV(argumentCount)))) {

		/* Slide the args back up (sigh) and re-insert the selector. */
		/* begin unPop: */
		GIV(stackPointer) -= 1 * BytesPerWord;
		for (i = 1; i <= GIV(argumentCount); i += 1) {
			longAtput(GIV(stackPointer) + ((i - 1) * BytesPerWord), longAt(GIV(stackPointer) + (i * BytesPerWord)));
		}
		longAtput(GIV(stackPointer) + (GIV(argumentCount) * BytesPerWord), GIV(messageSelector));
		GIV(argumentCount) += 1;

		/* Must reset primitiveFunctionPointer for checkForAndFollowForwardedPrimitiveState */
		GIV(newMethod) = performMethod;
		primitiveFunctionPointer = primitivePerform;
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrBadNumArgs;
		return;
	}
	executeNewMethod();
	/* begin initPrimCall */
	GIV(primFailCode) = 0;
}


/*	Pin or unpin the receiver, i.e. make it immobile or mobile, based on the
	argument. Answer whether the object was already pinned. N.B. pinning does
	*not* prevent
	an object from being garbage collected. */

	/* StackInterpreterPrimitives>>#primitivePin */
static void
primitivePin(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt boolean;
    sqInt obj;
    char *sp;
    sqInt wasPinned;

	/* begin stackValue: */
	obj = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if ((obj & (tagMask()))
	 || (((longAt(obj)) & ((classIndexMask()) - (isForwardedObjectClassIndexPun()))) == 0)) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadReceiver);
		return;
	}
	/* begin stackTop */
	boolean = longAt(GIV(stackPointer));
	if (!((boolean == GIV(falseObj))
		 || (boolean == GIV(trueObj)))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadArgument);
		return;
	}
	if (((((usqInt) (longAt(obj))) >> (pinnedBitShift())) & 1) != 0) {
		/* begin trueObject */
		wasPinned = GIV(trueObj);
		if (boolean != wasPinned) {
			/* begin setIsPinnedOf:to: */
			longAtput(obj, (longAt(obj)) & (~(usqIntptr_t)(1U << (pinnedBitShift()))));
		}
	}
	else {
		/* begin falseObject */
		wasPinned = GIV(falseObj);
		if (boolean == GIV(trueObj)) {
			if ((((obj & (tagMask())) == 0)
			 && (((longAt(obj)) & (classIndexMask())) == ClassMethodContextCompactIndex))
			 && ((((((longAt((obj + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
			 && (!(isWidowedContext(obj))))) {
				/* begin primitiveFailFor: */
				(GIV(primFailCode) = PrimErrBadReceiver);
				return;
			}
			if ((pinObject(obj)) == 0) {
				/* begin primitiveFailFor: */
				(GIV(primFailCode) = PrimErrNoMemory);
				return;
			}
		}
	}
	/* begin pop:thenPush: */
	longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), wasPinned);
	GIV(stackPointer) = sp;
}


/*	Primitive. Indicate the semaphore to be signalled for upon garbage
	collection 
 */

	/* StackInterpreterPrimitives>>#primitiveSetGCSemaphore */
EXPORT(void)
primitiveSetGCSemaphore(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt index;
    sqInt integerPointer;

	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		index = (integerPointer >> 3);
		goto l2;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		index = 0;
		goto l2;
	}
	l2:	/* end stackIntegerValue: */;
	if (!GIV(primFailCode)) {
		GIV(gcSemaphoreIndex) = index;
		/* begin pop: */
		GIV(stackPointer) += GIV(argumentCount) * BytesPerWord;
	}
}


/*	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. */

	/* StackInterpreterPrimitives>>#primitiveSignalAtMilliseconds */
static void
primitiveSignalAtMilliseconds(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqLong deltaMsecs;
    usqInt msecs;
    sqInt msecsObj;
    sqInt sema;

	/* begin stackTop */
	msecsObj = longAt(GIV(stackPointer));
	/* begin stackValue: */
	sema = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	msecs = positive32BitValueOf(msecsObj);
	if (!GIV(primFailCode)) {
		if (((sema & (tagMask())) == 0)
		 && (((longAt(sema)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord()))))))))) {
			/* begin splObj:put: */
			assert(!(isForwarded(GIV(specialObjectsOop))));
			if ((assert(isNonImmediate(GIV(specialObjectsOop))),
			oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((sema & (tagMask())) == 0)
				 && (oopisLessThan(sema, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(GIV(specialObjectsOop));
					}
				}
			}
			longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), sema);
			deltaMsecs = msecs - ((ioMSecs()) & MillisecondClockMask);
			if (deltaMsecs < 0) {
				deltaMsecs = (deltaMsecs + MillisecondClockMask) + 1;
			}
			GIV(nextWakeupUsecs) = (ioUTCMicroseconds()) + (deltaMsecs * 1000);
			/* begin pop: */
			GIV(stackPointer) += 2 * BytesPerWord;
			return;
		}
		if (sema == GIV(nilObj)) {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(GIV(specialObjectsOop))));
			if ((assert(isNonImmediate(GIV(specialObjectsOop))),
			oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((GIV(nilObj) & (tagMask())) == 0)
				 && (oopisLessThan(GIV(nilObj), GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(GIV(specialObjectsOop));
					}
				}
			}
			longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), GIV(nilObj));
			GIV(nextWakeupUsecs) = 0;
			/* begin pop: */
			GIV(stackPointer) += 2 * BytesPerWord;
			return;
		}
	}
	/* begin primitiveFailFor: */
	GIV(primFailCode) = PrimErrBadArgument;
}


/*	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. */

	/* StackInterpreterPrimitives>>#primitiveSignalAtUTCMicroseconds */
static void
primitiveSignalAtUTCMicroseconds(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt sema;
    usqLong usecs;
    sqInt usecsObj;

	/* begin stackTop */
	usecsObj = longAt(GIV(stackPointer));
	/* begin stackValue: */
	sema = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	usecs = positive64BitValueOf(usecsObj);
	if (!GIV(primFailCode)) {
		if (((sema & (tagMask())) == 0)
		 && (((longAt(sema)) & (classIndexMask())) == (rawHashBitsOf(longAt((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(ClassSemaphore) << (shiftForWord()))))))))) {
			/* begin splObj:put: */
			assert(!(isForwarded(GIV(specialObjectsOop))));
			if ((assert(isNonImmediate(GIV(specialObjectsOop))),
			oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((sema & (tagMask())) == 0)
				 && (oopisLessThan(sema, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(GIV(specialObjectsOop));
					}
				}
			}
			longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), sema);
			GIV(nextWakeupUsecs) = usecs;
			/* begin pop: */
			GIV(stackPointer) += 2 * BytesPerWord;
			return;
		}
		if (sema == GIV(nilObj)) {
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(GIV(specialObjectsOop))));
			if ((assert(isNonImmediate(GIV(specialObjectsOop))),
			oopisGreaterThanOrEqualTo(GIV(specialObjectsOop), GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((GIV(nilObj) & (tagMask())) == 0)
				 && (oopisLessThan(GIV(nilObj), GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(GIV(specialObjectsOop)))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(GIV(specialObjectsOop));
					}
				}
			}
			longAtput((GIV(specialObjectsOop) + BaseHeaderSize) + (((sqInt)((usqInt)(TheTimerSemaphore) << (shiftForWord())))), GIV(nilObj));
			GIV(nextWakeupUsecs) = 0;
			/* begin pop: */
			GIV(stackPointer) += 2 * BytesPerWord;
			return;
		}
	}
	/* begin primitiveFailFor: */
	GIV(primFailCode) = PrimErrBadArgument;
}


/*	Answer a slot in an object. This numbers all slots from 1, ignoring the
	distinction between
	named and indexed inst vars. In objects with both named and indexed inst
	vars, the named
	inst vars precede the indexed ones. In non-object indexed objects (objects
	that contain
	bits, not object references) this primitive answers the raw integral value
	at each slot. 
	e.g. for Strings it answers the character code, not the Character object
	at each slot. */

	/* StackInterpreterPrimitives>>#primitiveSlotAt */
static void
primitiveSlotAt(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt fmt;
    sqInt fmt1;
    sqInt index;
    sqInt integerVal;
    unsigned int integerValue;
    sqInt numLiveSlots;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt oop;
    sqInt oop1;
    sqInt rcvr;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    char *sp4;
    sqInt value;

	/* begin stackTop */
	index = longAt(GIV(stackPointer));
	/* begin stackValue: */
	rcvr = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	if (!((((index) & 7) == 1))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadArgument);
		return;
	}
	if (rcvr & (tagMask())) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadReceiver);
		return;
	}
	fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
	index = ((index >> 3)) - 1;
	if (fmt <= 5 /* lastPointerFormat */) {
		/* begin numSlotsOf: */
		assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
		numSlots1 = byteAt(rcvr + 7);
		numSlots = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		if ((((usqInt)index)) < numSlots) {
			if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
				/* begin externalWriteBackHeadFramePointers */
				assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
				assert(GIV(stackPage) == (mostRecentlyUsedPage()));
				assert(!((isFree(GIV(stackPage)))));
				/* begin setHeadFP:andSP:inPage: */
				assert(GIV(stackPointer) < GIV(framePointer));
				assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
				 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
				assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
				 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
				(GIV(stackPage)->headFP = GIV(framePointer));
				(GIV(stackPage)->headSP = GIV(stackPointer));
				assert(pageListIsWellFormed());
				numLiveSlots = (stackPointerForMaybeMarriedContext(rcvr)) + CtxtTempFrameStart;
				if ((((usqInt)index)) < numLiveSlots) {
					value = externalInstVarofContext(index, rcvr);
				}
				else {
					/* begin nilObject */
					value = GIV(nilObj);
				}
			}
			else {
				/* begin fetchPointer:ofObject: */
				value = longAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))));
			}
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), value);
			GIV(stackPointer) = sp;
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if (fmt >= (firstByteFormat())) {
		if (fmt >= (firstCompiledMethodFormat())) {
			/* begin primitiveFailFor: */
			(GIV(primFailCode) = PrimErrUnsupported);
			return;
		}
		/* begin numBytesOfBytes: */
		fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
		assert(fmt1 >= (firstByteFormat()));
		numSlots = ((numSlotsOf(rcvr)) << (shiftForWord())) - (fmt1 & 7);
		if ((((usqInt)index)) < numSlots) {
			/* begin pop:thenPushInteger: */
			longAtput((sp3 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)(byteAt((rcvr + BaseHeaderSize) + index)) << 3) | 1));
			GIV(stackPointer) = sp3;
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if (fmt >= (firstShortFormat())) {
		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1;
		if ((((usqInt)index)) < numSlots) {
			/* begin pop:thenPushInteger: */
			integerVal = ((unsigned short) (shortAt((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1))))));
			longAtput((sp4 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), (((usqInt)integerVal << 3) | 1));
			GIV(stackPointer) = sp4;
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 3;
		if ((((usqInt)index)) < numSlots) {
			/* begin pop:thenPush: */
			oop = positive64BitIntegerFor(long64At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 3)))));
			longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
			GIV(stackPointer) = sp1;
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if (fmt >= (firstLongFormat())) {
		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2;
		if ((((usqInt)index)) < numSlots) {
			/* begin pop:thenPush: */
			integerValue = long32At((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 2))));
			oop1 = ((((((usqInt)integerValue)) & 0xFFFFFFFFU) << 3) | 1);
			goto l7;
	l7:	/* end positive32BitIntegerFor: */;
			longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop1);
			GIV(stackPointer) = sp2;
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	/* begin primitiveFailFor: */
	(GIV(primFailCode) = PrimErrBadReceiver);
	return;
}


/*	Assign a slot in an object. This numbers all slots from 1, ignoring the
	distinction between
	named and indexed inst vars. In objects with both named and indexed inst
	vars, the named
	inst vars precede the indexed ones. In non-object indexed objects (objects
	that contain
	bits, not object references) this primitive assigns a raw integral value
	at each slot. */

	/* StackInterpreterPrimitives>>#primitiveSlotAtPut */
static void
primitiveSlotAtPut(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt bs;
    sqInt ccIndex;
    sqInt fmt;
    sqInt fmt1;
    sqInt fmt2;
    sqInt index;
    sqInt newValue;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt ok;
    sqInt rcvr;
    char *sp;
    char *sp1;
    char *sp2;
    char *sp3;
    char *sp4;
    usqIntptr_t value;
    sqInt value1;

	/* begin stackTop */
	newValue = longAt(GIV(stackPointer));
	/* begin stackValue: */
	index = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin stackValue: */
	rcvr = longAt(GIV(stackPointer) + (2 * BytesPerWord));
	if (!((((index) & 7) == 1))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadArgument);
		return;
	}
	if (rcvr & (tagMask())) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadReceiver);
		return;
	}
	if (
#  if IMMUTABILITY
		(/* begin isImmutable: */
			((((usqInt) (longAt(rcvr))) >> (immutableBitShift())) & 1) != 0)
#  else /* IMMUTABILITY */
		0
#  endif /* IMMUTABILITY */
		) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrNoModification);
		return;
	}
	fmt = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
	index = ((index >> 3)) - 1;
	if (fmt <= 5 /* lastPointerFormat */) {
		/* begin numSlotsOf: */
		assert((classIndexOf(rcvr)) > (isForwardedObjectClassIndexPun()));
		numSlots1 = byteAt(rcvr + 7);
		numSlots = (numSlots1 == (numSlotsMask())
			? ((usqInt) (((usqInt)(((sqInt)((usqInt)((longAt(rcvr - BaseHeaderSize))) << 8)))))) >> 8
			: numSlots1);
		if ((((usqInt)index)) < numSlots) {
			if (((longAt(rcvr)) & (classIndexMask())) == ClassMethodContextCompactIndex) {
				externalInstVarofContextput(index, rcvr, newValue);
			}
			else {
				/* begin storePointer:ofObject:withValue: */
				assert(!(isForwarded(rcvr)));
				if ((assert(isNonImmediate(rcvr)),
				oopisGreaterThanOrEqualTo(rcvr, GIV(oldSpaceStart)))) {

					/* most stores into young objects */
					if (((newValue & (tagMask())) == 0)
					 && (oopisLessThan(newValue, GIV(newSpaceLimit)))) {
						/* begin possibleRootStoreInto: */
						if (!(((((usqInt) (longAt(rcvr))) >> (rememberedBitShift())) & 1) != 0)) {
							remember(rcvr);
						}
					}
				}
				longAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << (shiftForWord())))), newValue);
			}
			/* begin pop:thenPush: */
			longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);
			GIV(stackPointer) = sp;
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	/* begin positiveMachineIntegerValueOf: */
	if ((((newValue) & 7) == 1)) {
		value1 = (newValue >> 3);
		if (value1 < 0) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			value = null;
			goto l15;
		}
		value = value1;
		goto l15;
	}
	if (newValue & (tagMask())) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		value = 0;
		goto l15;
	}
	/* begin isClassOfNonImm:equalTo:compactClassIndex: */
	assert(!(isImmediate(newValue)));
	/* begin classIndexOf: */
	ccIndex = (longAt(newValue)) & (classIndexMask());
	ok = ClassLargePositiveIntegerCompactIndex == ccIndex;
	goto l14;
	l14:	/* end isClassOfNonImm:equalTo:compactClassIndex: */;
	if (!ok) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		value = 0;
		goto l15;
	}
	/* begin numBytesOfBytes: */
	fmt2 = (((usqInt) (longAt(newValue))) >> (formatShift())) & (formatMask());
	assert(fmt2 >= (firstByteFormat()));
	bs = ((numSlotsOf(newValue)) << (shiftForWord())) - (fmt2 & 7);
	if (bs > (sizeof(usqIntptr_t))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		value = 0;
		goto l15;
	}
	if (((sizeof(usqIntptr_t)) == 8)
	 && (bs > 4)) {
		value = SQ_SWAP_8_BYTES_IF_BIGENDIAN((long64At((newValue + BaseHeaderSize) + (0U << 3))));
		goto l15;
	}
	else {
		value = ((unsigned int) (SQ_SWAP_4_BYTES_IF_BIGENDIAN((long32At((newValue + BaseHeaderSize) + (0U << 2))))));
		goto l15;
	}
	l15:	/* end positiveMachineIntegerValueOf: */;
	if (GIV(primFailCode)) {
		GIV(primFailCode) = PrimErrBadArgument;
		return;
	}
	if (fmt >= (firstByteFormat())) {
		if (fmt >= (firstCompiledMethodFormat())) {
			/* begin primitiveFailFor: */
			(GIV(primFailCode) = PrimErrUnsupported);
			return;
		}
		if ((((usqInt)value)) > 0xFF) {
			/* begin primitiveFailFor: */
			(GIV(primFailCode) = PrimErrBadArgument);
			return;
		}
		/* begin numBytesOfBytes: */
		fmt1 = (((usqInt) (longAt(rcvr))) >> (formatShift())) & (formatMask());
		assert(fmt1 >= (firstByteFormat()));
		numSlots = ((numSlotsOf(rcvr)) << (shiftForWord())) - (fmt1 & 7);
		if ((((usqInt)index)) < numSlots) {
			/* begin storeByte:ofObject:withValue: */
			byteAtput((rcvr + BaseHeaderSize) + index, value);
			/* begin pop:thenPush: */
			longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);
			GIV(stackPointer) = sp1;
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if (fmt >= (firstShortFormat())) {
		if ((((usqInt)value)) > 0xFFFF) {
			/* begin primitiveFailFor: */
			(GIV(primFailCode) = PrimErrBadArgument);
			return;
		}
		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 1;
		if ((((usqInt)index)) < numSlots) {
			/* begin storeShort16:ofObject:withValue: */
			shortAtput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 1))), value);
			/* begin pop:thenPush: */
			longAtput((sp2 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);
			GIV(stackPointer) = sp2;
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if (fmt == (sixtyFourBitIndexableFormat())) {
		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 3;
		if ((((usqInt)index)) < numSlots) {
			/* begin storeLong64:ofObject:withValue: */
			long64Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 3))), value);
			/* begin pop:thenPush: */
			longAtput((sp3 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);
			GIV(stackPointer) = sp3;
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if (fmt >= (firstLongFormat())) {
		if ((((usqInt)value)) > 0xFFFFFFFFU) {
			/* begin primitiveFailFor: */
			(GIV(primFailCode) = PrimErrBadArgument);
			return;
		}
		numSlots = ((usqInt) (numBytesOf(rcvr))) >> 2;
		if ((((usqInt)index)) < numSlots) {
			/* begin storeLong32:ofObject:withValue: */
			long32Atput((rcvr + BaseHeaderSize) + (((sqInt)((usqInt)(index) << 2))), value);
			/* begin pop:thenPush: */
			longAtput((sp4 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), newValue);
			GIV(stackPointer) = sp4;
			return;
		}
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	/* begin primitiveFailFor: */
	(GIV(primFailCode) = PrimErrBadReceiver);
	return;
}


/*	Atomic store into context stackPointer. 
	Also ensures that any newly accessible cells are initialized to nil */

	/* StackInterpreterPrimitives>>#primitiveStoreStackp */
static void
primitiveStoreStackp(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt ctxt;
    sqInt i;
    sqInt integerPointer;
    sqInt newStackp;
    int onCurrentPage;
    sqInt senderOop;
    sqInt sp;
    sqInt stackp;
    char *theFP;
    StackPage *thePage;
    sqInt valuePointer;

	/* begin stackValue: */
	ctxt = longAt(GIV(stackPointer) + (1 * BytesPerWord));
	/* begin stackIntegerValue: */
	integerPointer = longAt(GIV(stackPointer) + (0 * BytesPerWord));
	/* begin checkedIntegerValueOf: */
	if ((((integerPointer) & 7) == 1)) {
		newStackp = (integerPointer >> 3);
		goto l7;
	}
	else {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		newStackp = 0;
		goto l7;
	}
	l7:	/* end stackIntegerValue: */;
	if (!((!GIV(primFailCode))
		 && (((newStackp >= 0) && (newStackp <= ((numSlotsOf(ctxt)) - CtxtTempFrameStart)))))) {
		/* begin primitiveFail */
		if (!GIV(primFailCode)) {
			GIV(primFailCode) = 1;
		}
		return;
	}
	/* begin externalWriteBackHeadFramePointers */
	assert((GIV(framePointer) - GIV(stackPointer)) < (LargeContextSlots * BytesPerOop));
	assert(GIV(stackPage) == (mostRecentlyUsedPage()));
	assert(!((isFree(GIV(stackPage)))));
	/* begin setHeadFP:andSP:inPage: */
	assert(GIV(stackPointer) < GIV(framePointer));
	assert((GIV(stackPointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(stackPointer) > (((GIV(stackPage)->realStackLimit)) - (LargeContextSlots * BytesPerOop))));
	assert((GIV(framePointer) < ((GIV(stackPage)->baseAddress)))
	 && (GIV(framePointer) > (((GIV(stackPage)->realStackLimit)) - ((LargeContextSlots * BytesPerOop) / 2))));
	(GIV(stackPage)->headFP = GIV(framePointer));
	(GIV(stackPage)->headSP = GIV(stackPointer));
	assert(pageListIsWellFormed());
	if ((((((longAt((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord()))))))) & 7) == 1))
	 && (!(isWidowedContext(ctxt)))) {
		/* begin frameOfMarriedContext: */
		senderOop = longAt((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(SenderIndex) << (shiftForWord())))));
		assert((((senderOop) & 7) == 1));
		theFP = pointerForOop(senderOop - 1);
		/* begin stackPageFor: */
		thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
		pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
		if (((onCurrentPage = thePage == GIV(stackPage)))
		 && (theFP == GIV(framePointer))) {
			/* begin primitiveFail */
			if (!GIV(primFailCode)) {
				GIV(primFailCode) = 1;
			}
			return;
		}
		externalDivorceFrameandContext(theFP, ctxt);
		if (onCurrentPage) {
			/* begin setStackPointersFromPage: */
			GIV(stackPointer) = (GIV(stackPage)->headSP);
			GIV(framePointer) = (GIV(stackPage)->headFP);
		}
		else {
			assert(GIV(stackPage) == (stackPageFor(GIV(framePointer))));
			markStackPageMostRecentlyUsed(GIV(stackPage));
		}
	}
	/* begin fetchStackPointerOf: */
	sp = longAt((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))));
	if (!((((sp) & 7) == 1))) {
		stackp = 0;
		goto l9;
	}
	assert((ReceiverIndex + ((sp >> 3))) < (lengthOf(ctxt)));
	stackp = (sp >> 3);
	l9:	/* end fetchStackPointerOf: */;
	for (i = (stackp + 1); i <= newStackp; i += 1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = GIV(nilObj);
		assert(!(isOopForwarded(ctxt)));
		longAtput((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(((i + CtxtTempFrameStart) - 1)) << (shiftForWord())))), valuePointer);
	}
	/* begin storeStackPointerValue:inContext: */
	assert((ReceiverIndex + newStackp) < (lengthOf(ctxt)));
	/* begin storePointerUnchecked:ofObject:withValue: */
	assert(!(isOopForwarded(ctxt)));
	longAtput((ctxt + BaseHeaderSize) + (((sqInt)((usqInt)(StackPointerIndex) << (shiftForWord())))), (((usqInt)newStackp << 3) | 1));
	ensureContextIsExecutionSafeAfterAssignToStackPointer(ctxt);
	/* begin pop: */
	GIV(stackPointer) += 1 * BytesPerWord;
}


/*	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 (v3)/size(Spur) of old-space (0-based, read-only)
	2	end (v3)/size(Spur) of young/new-space (read-only)
	3	end (v3)/size(Spur) of heap (read-only)
	4	nil (was allocationCount (read-only))
	5	nil (was 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 (SqueakV3) or scavenges (Spur) since startup (read-only)
	10	total milliseconds in incremental GCs (SqueakV3) or scavenges (Spur)
	since startup (read-only)
	11	tenures of surving objects since startup or reset (read-write)
	12-20 were specific to ikp's JITTER VM, now 12-15 are open for use
	16	total microseconds at idle since start-up (if non-zero)
	17	fraction of the code zone to use (Sista only; used to control code zone
	use to preserve sendAndBranchData on counter tripped callback)
	18	total milliseconds in compaction phase of full GC since start-up (Spur
	only) 19	scavenge threshold, the effective size of eden. When eden fills
	to the threshold a scavenge is scheduled. Newer Spur VMs only.
	20	utc microseconds at VM start-up (actually at time initialization, which
	precedes image load).
	21	root/remembered table size (occupancy) (read-only)
	22	root table overflows since startup (read-only)
	23	bytes of extra memory to reserve for VM buffers, plugins, etc (stored
	in image file header).
	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
	(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	Spur: bytes allocated in total since start-up or reset (read-write)
	(Used to be 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	BytesPerOop for this image
	41	imageFormatVersion for the VM
	42	number of stack pages in use
	43	desired number of stack pages (stored in image file header, max 65535)
	44	size of eden, in bytes
	45	desired size of eden, in bytes (stored in image file header)
	46	machine code zone size, in bytes (Cog only; otherwise nil)
	47	desired machine code zone size (stored in image file header; Cog only;
	otherwise nil)
	48	various header flags. See getCogVMFlags.
	49	max size the image promises to grow the external semaphore table to (0
	sets to default, which is 256 as of writing)
	50-51 nil; reserved for VM parameters that persist in the image (such as
	eden above)
	52	root/remembered table capacity
	53	number of segments (Spur only; otherwise nil)
	54	total size of free old space (Spur only, otherwise nil)
	55	ratio of growth and image size at or above which a GC will be performed
	post scavenge
	56	number of process switches since startup (read-only)
	57	number of ioProcessEvents calls since startup (read-only)
	58	number of ForceInterruptCheck calls since startup (read-only)
	59	number of check event calls since startup (read-only)
	60	number of stack page overflows since startup (read-only)
	61	number of stack page divorces since startup (read-only)
	62	compiled code compactions since startup (read-only; Cog only; otherwise
	nil) 63	total milliseconds in compiled code compactions since startup
	(read-only; Cog only; otherwise nil)
	64	the number of methods that currently have jitted machine-code
	65	whether the VM supports a certain feature, MULTIPLE_BYTECODE_SETS is
	bit 0, IMMUTABILITY is bit 1
	66	the byte size of a stack page
	67	the max allowed size of old space (Spur only; nil otherwise; 0 implies
	no limit except that of the underlying platform)
	68	the average number of live stack pages when scanned by GC (at
	scavenge/gc/become et al) (read-write)
	69	the maximum number of live stack pages when scanned by GC (at
	scavenge/gc/become et al) (read-write)
	70	the vmProxyMajorVersion (the interpreterProxy VM_MAJOR_VERSION)
	71	the vmProxyMinorVersion (the interpreterProxy VM_MINOR_VERSION)
	72 total milliseconds in full GCs Mark phase since startup (read-only)
	73 total milliseconds in full GCs Sweep phase since startup (read-only,
	can be 0 depending on compactors)
	74 maximum pause time due to segment allocation
	
	Note: Thanks to Ian Piumarta for this primitive. */

	/* StackInterpreterPrimitives>>#primitiveVMParameter */
static void
primitiveVMParameter(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    double aDouble;
    double aFloat;
    double aProportion;
    sqInt arg;
    sqInt argOop;
    sqLong delta;
    sqInt index;
    sqInt offset;
    sqInt oop;
    sqInt paramsArraySize;
    sqInt result;
    sqInt result1;
    char *sp;
    char *sp1;
    sqInt tagBits;

	arg = 0;
	paramsArraySize = 74;
	if (GIV(argumentCount) == 0) {
		primitiveAllVMParameters(paramsArraySize);
		return;
	}
	if (GIV(argumentCount) > 2) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadNumArgs);
		return;
	}
	/* begin stackValue: */
	offset = (GIV(argumentCount) == 1
		? 0
		: 1);
	index = longAt(GIV(stackPointer) + (offset * BytesPerWord));
	if (!((((index) & 7) == 1))) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadArgument);
		return;
	}
	index = (index >> 3);
	if ((index < 1)
	 || (index > paramsArraySize)) {
		/* begin primitiveFailFor: */
		(GIV(primFailCode) = PrimErrBadIndex);
		return;
	}
	if (GIV(argumentCount) == 1) {

		/* read VM parameter; written this way to avoid branch limits in V3 bytecode set */
		result = primitiveGetVMParameter(index);
		/* begin methodReturnValue: */
		oop = (!(result)
			? /* begin nilObject */ GIV(nilObj)
			: result);
		longAtput((sp = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), oop);
		GIV(stackPointer) = sp;
		return;
	}
	/* begin primitiveSetVMParameter:arg: */
	argOop = longAt(GIV(stackPointer));
	if ((index == 17)
	 || ((index == 55)
	 || (index == 68))) {
		if (!(((((tagBits = argOop & (tagMask()))) != 0
				? tagBits == (smallFloatTag())
				: ((longAt(argOop)) & (classIndexMask())) == ClassFloatCompactIndex))
			 || ((((argOop) & 7) == 1)))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadArgument;
			goto l12;
		}
	}
	else {
		if (!((((argOop) & 7) == 1))) {
			/* begin primitiveFailFor: */
			GIV(primFailCode) = PrimErrBadArgument;
			goto l12;
		}
		arg = (argOop >> 3);
	}
	/* begin primitiveFailFor: */
	GIV(primFailCode) = PrimErrBadArgument;
	
	switch (index) {
	case 5:
				break;
	case 6:
		result1 = (((usqInt)(((sqInt)(((scavengerTenuringThreshold()) * (((GIV(pastSpace).limit)) - ((GIV(pastSpace).start)))) / (8 * BytesPerOop)))) << 3) | 1);
		/* begin tenuringThreshold: */
		if (arg < 0) {
			GIV(primFailCode) = PrimErrBadArgument;
			goto l8;
		}
		/* begin scavengerTenuringThreshold: */
		aProportion = (((double) (arg * (8 * BytesPerOop)) )) / (((double) (((GIV(pastSpace).limit)) - ((GIV(pastSpace).start))) ));
		GIV(tenuringProportion) = aProportion;
		GIV(tenureThreshold) = (aProportion == 0.0
			? 0
			: (round(((((GIV(pastSpace).limit)) - ((GIV(pastSpace).start))) * (1.0 - aProportion)))) + ((GIV(pastSpace).start)));
		GIV(primFailCode) = 0;
	l8:	/* end tenuringThreshold: */;
		break;
	case 11:
		if (arg >= 0) {
			result1 = (((usqInt)GIV(statTenures) << 3) | 1);
			/* begin statTenures: */
			GIV(statTenures) = arg;
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
		}
		break;
	case 17:
				break;
	case 23:
		result1 = (((usqInt)extraVMMemory << 3) | 1);
		extraVMMemory = arg;
		/* begin initPrimCall */
		GIV(primFailCode) = 0;
		break;
	case 24:
		if (arg > 0) {
			result1 = (((usqInt)GIV(shrinkThreshold) << 3) | 1);
			/* begin shrinkThreshold: */
			GIV(shrinkThreshold) = arg;
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
		}
		break;
	case 25:
		if (arg > 0) {
			result1 = (((usqInt)GIV(growHeadroom) << 3) | 1);
			/* begin growHeadroom: */
			GIV(growHeadroom) = arg;
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
		}
		break;
	case 26:
		if (arg >= 0) {

			/* 0 turns off the heartbeat */
			result1 = (((usqInt)(ioHeartbeatMilliseconds()) << 3) | 1);
			ioSetHeartbeatMilliseconds(arg);
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
		}
		break;
	case 34:
		if (arg >= 0) {
			result1 = positive64BitIntegerFor(currentAllocatedBytes());
			/* begin setCurrentAllocatedBytesTo: */
			delta = (currentAllocatedBytes()) - GIV(statAllocatedBytes);
			GIV(statAllocatedBytes) = arg;
			GIV(oldSpaceUsePriorToScavenge) += delta;
			assert((currentAllocatedBytes()) == arg);
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
		}
		break;
	case 43:
		if (((arg >= 0) && (arg <= 0xFFFF))) {
			result1 = (((usqInt)desiredNumStackPages << 3) | 1);
			desiredNumStackPages = arg;
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
		}
		break;
	case 45:
		if (arg >= 0) {
			result1 = (((usqInt)desiredEdenBytes << 3) | 1);
			desiredEdenBytes = arg;
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
		}
		break;
	case 47:
		if (((arg >= 0) && (arg <= (maxCogCodeSize())))) {
			result1 = (((usqInt)(getDesiredCogCodeSize()) << 3) | 1);
			/* begin setDesiredCogCodeSize: */
			desiredCogCodeSize = arg;
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
		}
		break;
	case 48:
		if (arg >= 0) {
			result1 = (((usqInt)(getCogVMFlags()) << 3) | 1);
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
			/* begin setCogVMFlags: */
			if ((((usqInt)arg)) > 0x3F) {
				GIV(primFailCode) = PrimErrUnsupported;
				goto l3;
			}
			GIV(flagInterpretedMethods) = arg & 2;

			/* noThreadingOfGUIThread := flags anyMask: 8.. specific to CoInterpreterMT */
			GIV(preemptionYields) = (arg & 4) == 0;
			GIV(newFinalization) = arg & 16;
			sendWheelEvents = arg & 32;
	l3:	/* end setCogVMFlags: */;
		}
		break;
	case 49:
		if (((arg >= 0) && (arg <= 0xFFFF))) {
			result1 = (((usqInt)(ioGetMaxExtSemTableSize()) << 3) | 1);
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
			/* begin setMaxExtSemSizeTo: */
			GIV(maxExtSemTabSizeSet) = 1;
			ioSetMaxExtSemTableSize(arg);
		}
		break;
	case 55:
		result1 = floatObjectOf(getHeapGrowthToSizeGCRatio());
		/* begin setHeapGrowthToSizeGCRatio: */
		aDouble = noInlineLoadFloatOrIntFrom(argOop);
		GIV(heapGrowthToSizeGCRatio) = aDouble;
		GIV(primFailCode) = 0;
		break;
	case 67:
		if ((arg >= 0)
		 && (1)) {
			result1 = (((maxOldSpaceSize()) << 3) | 1);
			/* begin setMaxOldSpaceSize: */
			maxOldSpaceSize = arg;
			GIV(primFailCode) = 0;
		}
		break;
	case 68:
		result1 = floatObjectOf(statAverageLivePagesWhenMapping());
		/* begin initPrimCall */
		GIV(primFailCode) = 0;
		/* begin statAverageLivePagesWhenMapping: */
		aFloat = noInlineLoadFloatOrIntFrom(argOop);
		if (aFloat == 0.0) {
			GIV(statPageCountWhenMappingSum) = (GIV(statNumMaps) = 0);
		}
		else {
			GIV(primFailCode) = PrimErrBadArgument;
		}
		break;
	case 69:
		if (arg >= 0) {
			result1 = (((usqInt)(statMaxPageCountWhenMapping()) << 3) | 1);
			/* begin statMaxPageCountWhenMapping: */
			GIV(statMaxPageCountWhenMapping) = arg;
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
		}
		break;
	case 74:
		if ((arg >= 0)
		 && (1)) {
			result1 = (((usqInt)((GIV(statMaxAllocSegmentTime) + 500) / 1000) << 3) | 1);
			/* begin statMaxAllocSegmentTime: */
			GIV(statMaxAllocSegmentTime) = arg;
			/* begin initPrimCall */
			GIV(primFailCode) = 0;
		}
		break;
	default:
		;
	}
	if (!GIV(primFailCode)) {
		/* begin methodReturnValue: */
		longAtput((sp1 = GIV(stackPointer) + (((GIV(argumentCount) + 1) - 1) * BytesPerWord)), result1);
		GIV(stackPointer) = sp1;
	}
	else {
		/* begin primitiveFailFor: */
		GIV(primFailCode) = PrimErrInappropriate;
	}
	l12:	/* end primitiveSetVMParameter:arg: */;
}


/*	Potentially crash the VM by voiding the receiver. A subsequent inst var
	access in the caller's frame should indirect through a null pointer. */

	/* StackInterpreterPrimitives>>#primitiveVoidReceiver */
EXPORT(void)
primitiveVoidReceiver(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
	longAtPointerput(((((usqInt)(longAt(GIV(framePointer) + FoxMethod)))) < (startOfMemory())
		? GIV(framePointer) + FoxMFReceiver
		: GIV(framePointer) + FoxIFReceiver), 0);
}


/*	Prune the stack to contain only the path, removing stacked indices
	and mapping frame pointers to contexts The issue here is that a
	GC can occur during ensureFrameIsMarried:SP:, but frame pointers
	are not valid objects. So first prune back to objects and framePointers
	as integers, and then replace frame pointers as integers by contexts. */

	/* StackInterpreterPrimitives>>#pruneStack:stackp: */
static void NoDbgRegParms
pruneStackstackp(sqInt stack, sqInt stackp)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    char *callerFP;
    sqInt finger;
    char *fp;
    sqInt i;
    sqInt iLimiT;
    sqInt objOrFP;
    sqInt oop;
    sqInt oop1;
    char *theFP;
    char *theFPAbove;
    StackPage *thePage;
    sqInt theStack;
    sqInt valuePointer;

	finger = 1;
	for (i = 2; i < stackp; i += 2) {
		/* begin fetchPointer:ofObject: */
		objOrFP = longAt((stack + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if ((((((usqInt)(((char *) objOrFP)))) & (BytesPerWord - 1)) == 0)
		 && ((((((usqInt)(((char *) objOrFP)))) >= (((usqInt)(GIV(stackBasePlus1) - 1)))) && ((((usqInt)(((char *) objOrFP)))) <= (((usqInt)GIV(pages))))))) {
			/* begin withSmallIntegerTags: */
			assert(((oopForPointer(((char *) objOrFP))) & (BytesPerWord - 1)) == 0);
			objOrFP = (oopForPointer(((char *) objOrFP))) + (smallIntegerTag());
		}
		/* begin storePointerUnchecked:ofObject:withValue: */
		assert(!(isOopForwarded(stack)));
		longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(finger) << (shiftForWord())))), objOrFP);
		finger += 1;
	}
	for (i = finger, iLimiT = ((lengthOfformat(stack, (((usqInt) (longAt(stack))) >> (formatShift())) & (formatMask()))) - 1); i <= iLimiT; i += 1) {
		/* begin storePointerUnchecked:ofObject:withValue: */
		valuePointer = GIV(nilObj);
		assert(!(isOopForwarded(stack)));
		longAtput((stack + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))), valuePointer);
	}
	/* begin pushRemappableOop: */
	oop = (theStack = stack);
	assert(addressCouldBeOop(oop));
	GIV(remapBuffer)[(GIV(remapBufferCount) += 1)] = oop;
	if (!(GIV(remapBufferCount) <= RemapBufferSize)) {
		error("remapBuffer overflow");
	}
	for (i = 1; i < finger; i += 1) {
		/* begin fetchPointer:ofObject: */
		objOrFP = longAt((theStack + BaseHeaderSize) + (((sqInt)((usqInt)(i) << (shiftForWord())))));
		if ((((objOrFP) & 7) == 1)) {
			/* begin withoutSmallIntegerTags: */
			assert((((objOrFP) & 7) == 1));
			theFP = pointerForOop(objOrFP - 1);
			/* begin stackPageFor: */
			thePage = stackPageAtpages((assert((((((char *) theFP)) >= (GIV(stackBasePlus1) - 1)) && ((((char *) theFP)) <= (((char *) GIV(pages)))))),
			pageIndexForstackBasePlus1bytesPerPage(theFP, GIV(stackBasePlus1), GIV(bytesPerPage))), GIV(pages));
			/* begin findFrameAbove:inPage: */
			fp = (thePage->headFP);
			if (fp == theFP) {
				theFPAbove = 0;
				goto l6;
			}
			while (((callerFP = pointerForOop(longAt(fp + FoxSavedFP)))) != 0) {
				if (callerFP == theFP) {
					theFPAbove = fp;
					goto l6;
				}
				fp = callerFP;
			}
			error("did not find theFP in stack page");
			theFPAbove = 0;
	l6:	/* end findFrameAbove:inPage: */;
			/* begin ensureFrameIsMarried:SP: */
			if (((((usqInt)(longAt(theFP + FoxMethod)))) < (startOfMemory())
				? ((longAt(theFP + FoxMethod)) & MFMethodFlagHasContextFlag) != 0
				: (byteAt((theFP + FoxIFrameFlags) + 2)) != 0)) {
				assert(isContext(frameContext(theFP)));
				objOrFP = longAt(theFP + FoxThisContext);
				goto l11;
			}
			objOrFP = marryFrameSP(theFP, (assert(!(isBaseFrame(theFPAbove))),
			(theFPAbove + (frameStackedReceiverOffsetNumArgs(((((usqInt)(longAt(theFPAbove + FoxMethod)))) < (startOfMemory())
	? ((mframeCogMethod(theFPAbove))->cmNumArgs)
	: byteAt((theFPAbove + FoxIFrameFlags) + 1))))) + BytesPerWord));
	l11:	/* end ensureFrameIsMarried:SP: */;
			/* begin topRemappableOop */
			theStack = GIV(remapBuffer)[GIV(remapBufferCount)];
			/* begin storePointer:ofObject:withValue: */
			assert(!(isForwarded(theStack)));
			if ((assert(isNonImmediate(theStack)),
			oopisGreaterThanOrEqualTo(theStack, GIV(oldSpaceStart)))) {

				/* most stores into young objects */
				if (((objOrFP & (tagMask())) == 0)
				 && (oopisLessThan(objOrFP, GIV(newSpaceLimit)))) {
					/* begin possibleRootStoreInto: */
					if (!(((((usqInt) (longAt(theStack))) >> (rememberedBitShift())) & 1) != 0)) {
						remember(theStack);
					}
				}
			}
			longAtput((theStack + BaseHeaderSize) + (((sqInt)((usqInt)(finger) << (shiftForWord())))), objOrFP);
		}
	}
	/* begin popRemappableOop */
	oop1 = GIV(remapBuffer)[GIV(remapBufferCount)];
	GIV(remapBufferCount) -= 1;
}

	/* StackInterpreterPrimitives>>#unmarkAfterPathTo */
static void
unmarkAfterPathTo(void)
{   DECL_MAYBE_SQ_GLOBAL_STRUCT
    sqInt address;
    sqInt address1;
    sqInt followingWord;
    sqInt followingWord1;
    sqInt followingWord2;
    usqInt followingWordAddress;
    usqInt followingWordAddress1;
    usqInt followingWordAddress2;
    usqInt limit;
    usqInt numSlots;
    usqInt numSlots1;
    sqInt objOop;
    sqInt objOop1;
    sqInt prevObj;
    sqInt prevObj1;
    sqInt prevPrevObj;
    sqInt prevPrevObj1;

	unmarkAllFrames();
	/* begin unmarkAllObjects */
	assert(isOldObject(GIV(nilObj)));
	prevPrevObj1 = (prevObj1 = null);
	objOop1 = GIV(nilObj);
	while (1) {
		assert((objOop1 % (allocationUnit())) == 0);
		if (!(oopisLessThan(objOop1, GIV(endOfMemory)))) break;
		assert((long64At(objOop1)) != 0);
		if (((((usqInt) (longAt(objOop1))) >> (markedBitFullShift())) & 1) != 0) {
			if (((longAt(objOop1)) & (classIndexMask())) > (lastClassIndexPun())) {
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(objOop1)));
				longAtput(objOop1, (longAt(objOop1)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			}
			else {
				if (!(((longAt(objOop1)) & (classIndexMask())) == (segmentBridgePun()))) {
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(objOop1)));
					longAtput(objOop1, (longAt(objOop1)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
				}
			}
		}
		prevPrevObj1 = prevObj1;
		prevObj1 = objOop1;
		/* begin objectAfter:limit: */
		followingWordAddress2 = addressAfter(objOop1);
		if (oopisGreaterThanOrEqualTo(followingWordAddress2, GIV(endOfMemory))) {
			objOop1 = GIV(endOfMemory);
			goto l5;
		}
		flag("endianness");
		followingWord2 = longAt(followingWordAddress2);
		objOop1 = ((((usqInt) followingWord2) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress2 + BaseHeaderSize
			: followingWordAddress2);
	l5:	/* end objectAfter:limit: */;
	}
	/* begin allNewSpaceEntitiesDo: */

	/* After a scavenge eden is empty, futureSpace is empty, and all newSpace objects are
	   in pastSpace.  Objects are allocated in eden.  So enumerate only pastSpace and eden. */
	prevPrevObj = (prevObj = null);
	assert((((pastSpace()).start)) < (((eden()).start)));
	/* begin objectStartingAt: */
	address = ((pastSpace()).start);
	numSlots = byteAt(address + 7);
	objOop = (numSlots == (numSlotsMask())
		? address + BaseHeaderSize
		: address);
	limit = GIV(pastSpaceStart);
	while (oopisLessThan(objOop, limit)) {
		if (((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0) {
			if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) {
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(objOop)));
				longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			}
			else {
				if (!(((longAt(objOop)) & (classIndexMask())) == (segmentBridgePun()))) {
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(objOop)));
					longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress, limit)) {
			objOop = limit;
			goto l1;
		}
		flag("endianness");
		followingWord = longAt(followingWordAddress);
		objOop = ((((usqInt) followingWord) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress + BaseHeaderSize
			: followingWordAddress);
	l1:	/* end objectAfter:limit: */;
	}
	/* begin objectStartingAt: */
	address1 = ((eden()).start);
	numSlots1 = byteAt(address1 + 7);
	objOop = (numSlots1 == (numSlotsMask())
		? address1 + BaseHeaderSize
		: address1);
	while (oopisLessThan(objOop, GIV(freeStart))) {
		if (((((usqInt) (longAt(objOop))) >> (markedBitFullShift())) & 1) != 0) {
			if (((longAt(objOop)) & (classIndexMask())) > (lastClassIndexPun())) {
				/* begin setIsMarkedOf:to: */
				assert(!(isFreeObject(objOop)));
				longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
			}
			else {
				if (!(((longAt(objOop)) & (classIndexMask())) == (segmentBridgePun()))) {
					/* begin setIsMarkedOf:to: */
					assert(!(isFreeObject(objOop)));
					longAtput(objOop, (longAt(objOop)) & (~(usqIntptr_t)(1ULL << (markedBitFullShift()))));
				}
			}
		}
		prevPrevObj = prevObj;
		prevObj = objOop;
		/* begin objectAfter:limit: */
		followingWordAddress1 = addressAfter(objOop);
		if (oopisGreaterThanOrEqualTo(followingWordAddress1, GIV(freeStart))) {
			objOop = GIV(freeStart);
			goto l2;
		}
		flag("endianness");
		followingWord1 = longAt(followingWordAddress1);
		objOop = ((((usqInt) followingWord1) >> (numSlotsFullShift())) == (numSlotsMask())
			? followingWordAddress1 + BaseHeaderSize
			: followingWordAddress1);
	l2:	/* end objectAfter:limit: */;
	}
	}


static char _m[] = "";
void* vm_exports[][3] = {
	{(void*)_m, "callbackEnter", (void*)callbackEnter},
	{(void*)_m, "callbackLeave", (void*)callbackLeave},
	{(void*)_m, "moduleUnloaded", (void*)moduleUnloaded},
	{(void*)_m, "primitiveAddLargeIntegers\000\377", (void*)primitiveAddLargeIntegers},
	{(void*)_m, "primitiveAllInstances\000\377", (void*)primitiveAllInstances},
	{(void*)_m, "primitiveAllObjects\000\377", (void*)primitiveAllObjects},
	{(void*)_m, "primitiveBitAndLargeIntegers\000\377", (void*)primitiveBitAndLargeIntegers},
	{(void*)_m, "primitiveBitOrLargeIntegers\000\377", (void*)primitiveBitOrLargeIntegers},
	{(void*)_m, "primitiveBitShiftLargeIntegers\000\377", (void*)primitiveBitShiftLargeIntegers},
	{(void*)_m, "primitiveBitXorLargeIntegers\000\377", (void*)primitiveBitXorLargeIntegers},
	{(void*)_m, "primitiveClockLogAddresses\000\377", (void*)primitiveClockLogAddresses},
	{(void*)_m, "primitiveCompareBytes\000\377", (void*)primitiveCompareBytes},
	{(void*)_m, "primitiveCompareWith\000\377", (void*)primitiveCompareWith},
	{(void*)_m, "primitiveCrashVM\000\377", (void*)primitiveCrashVM},
	{(void*)_m, "primitiveDisablePowerManager\000\377", (void*)primitiveDisablePowerManager},
	{(void*)_m, "primitiveDivideLargeIntegers\000\377", (void*)primitiveDivideLargeIntegers},
	{(void*)_m, "primitiveDivLargeIntegers\000\377", (void*)primitiveDivLargeIntegers},
	{(void*)_m, "primitiveEqualLargeIntegers\000\377", (void*)primitiveEqualLargeIntegers},
	{(void*)_m, "primitiveEventProcessingControl\000\377", (void*)primitiveEventProcessingControl},
	{(void*)_m, "primitiveGetenv\000\377", (void*)primitiveGetenv},
	{(void*)_m, "primitiveGetLogDirectory\000\377", (void*)primitiveGetLogDirectory},
	{(void*)_m, "primitiveGetWindowLabel\000\377", (void*)primitiveGetWindowLabel},
	{(void*)_m, "primitiveGetWindowSize\000\377", (void*)primitiveGetWindowSize},
	{(void*)_m, "primitiveGreaterOrEqualLargeIntegers\000\377", (void*)primitiveGreaterOrEqualLargeIntegers},
	{(void*)_m, "primitiveGreaterThanLargeIntegers\000\377", (void*)primitiveGreaterThanLargeIntegers},
	{(void*)_m, "primitiveHeartbeatFrequency\000\377", (void*)primitiveHeartbeatFrequency},
	{(void*)_m, "primitiveHighResClock\000\377", (void*)primitiveHighResClock},
	{(void*)_m, "primitiveImageFormatVersion\000\377", (void*)primitiveImageFormatVersion},
	{(void*)_m, "primitiveInterruptChecksPerMSec\000\377", (void*)primitiveInterruptChecksPerMSec},
	{(void*)_m, "primitiveIsBigEnder\000\377", (void*)primitiveIsBigEnder},
	{(void*)_m, "primitiveIsWindowObscured\000\377", (void*)primitiveIsWindowObscured},
	{(void*)_m, "primitiveLessOrEqualLargeIntegers\000\377", (void*)primitiveLessOrEqualLargeIntegers},
	{(void*)_m, "primitiveLessThanLargeIntegers\000\377", (void*)primitiveLessThanLargeIntegers},
	{(void*)_m, "primitiveLongRunningPrimitive\000\377", (void*)primitiveLongRunningPrimitive},
	{(void*)_m, "primitiveLongRunningPrimitiveSemaphore\000\377", (void*)primitiveLongRunningPrimitiveSemaphore},
	{(void*)_m, "primitiveMethodPCData\000\377", (void*)primitiveMethodPCData},
	{(void*)_m, "primitiveMillisecondClockMask\000\377", (void*)primitiveMillisecondClockMask},
	{(void*)_m, "primitiveMinimumUnusedHeadroom\000\377", (void*)primitiveMinimumUnusedHeadroom},
	{(void*)_m, "primitiveModLargeIntegers\000\377", (void*)primitiveModLargeIntegers},
	{(void*)_m, "primitiveMultiplyLargeIntegers\000\377", (void*)primitiveMultiplyLargeIntegers},
	{(void*)_m, "primitiveNotEqualLargeIntegers\000\377", (void*)primitiveNotEqualLargeIntegers},
	{(void*)_m, "primitivePathToUsing\000\377", (void*)primitivePathToUsing},
	{(void*)_m, "primitiveProfilePrimitive\000\377", (void*)primitiveProfilePrimitive},
	{(void*)_m, "primitiveProfileSample\000\377", (void*)primitiveProfileSample},
	{(void*)_m, "primitiveProfileSemaphore\000\377", (void*)primitiveProfileSemaphore},
	{(void*)_m, "primitiveProfileStart\000\377", (void*)primitiveProfileStart},
	{(void*)_m, "primitiveQuoLargeIntegers\000\377", (void*)primitiveQuoLargeIntegers},
	{(void*)_m, "primitiveRemLargeIntegers\000\377", (void*)primitiveRemLargeIntegers},
	{(void*)_m, "primitiveScreenDepth\000\377", (void*)primitiveScreenDepth},
	{(void*)_m, "primitiveScreenScaleFactor\000\377", (void*)primitiveScreenScaleFactor},
	{(void*)_m, "primitiveSetGCSemaphore\000\377", (void*)primitiveSetGCSemaphore},
	{(void*)_m, "primitiveSetLogDirectory\000\377", (void*)primitiveSetLogDirectory},
	{(void*)_m, "primitiveSetWindowLabel\000\377", (void*)primitiveSetWindowLabel},
	{(void*)_m, "primitiveSetWindowSize\000\377", (void*)primitiveSetWindowSize},
	{(void*)_m, "primitiveSubtractLargeIntegers\000\377", (void*)primitiveSubtractLargeIntegers},
	{(void*)_m, "primitiveUtcWithOffset\000\377", (void*)primitiveUtcWithOffset},
	{(void*)_m, "primitiveVoidReceiver\000\377", (void*)primitiveVoidReceiver},
	{(void*)_m, "printFramesInPage", (void*)printFramesInPage},
	{(void*)_m, "printFramesOnStackPageListInUse\000\377", (void*)printFramesOnStackPageListInUse},
	{(void*)_m, "reestablishContextPriorToCallback", (void*)reestablishContextPriorToCallback},
	{(void*)_m, "returnAsThroughCallbackContext", (void*)returnAsThroughCallbackContext},
	{(void*)_m, "segmentContainingObj", (void*)segmentContainingObj},
	{(void*)_m, "sendInvokeCallbackContext", (void*)sendInvokeCallbackContext},
	{(void*)_m, "sendInvokeCallbackStackRegistersJmpbuf", (void*)sendInvokeCallbackStackRegistersJmpbuf},
	{(void*)_m, "setInterruptCheckChain", (void*)setInterruptCheckChain},
	{(void*)_m, "shortPrintFramesInPage", (void*)shortPrintFramesInPage},
	{(void*)_m, "shortPrintFramesOnStackPageListInUse\000\377", (void*)shortPrintFramesOnStackPageListInUse},
	{(void*)_m, "statNumGCs\000\377", (void*)statNumGCs},
	{NULL, NULL, NULL}
};

void initGlobalStructure(void) {
#if SQ_USE_GLOBAL_STRUCT_REG
foo = &fum;
#endif
}
