ResetDefglobalAction

decompiled_code:
__int64 __fastcall ResetDefglobalAction(__int64 a1, __int64 a2)
{
_WORD v3[8]; // [rsp+0h] [rbp-48h] BYREF
__int64 v4; // [rsp+10h] [rbp-38h]

if ( (unsigned int)EvaluateExpression(a1, *(_QWORD *)(a2 + 112), v3) )
{
v3[4] = 2;
v4 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 392LL) + 8LL);
}
return QSetDefglobalValue(a1, a2, v3, 0LL);
}

canonical_decompiled_code:
__int64 __fastcall func6(__int64 a1, __int64 a2)
{
_WORD v3[8]; // [rsp+0h] [rbp-48h] BYREF
__int64 v4; // [rsp+10h] [rbp-38h]

if ( (unsigned int)EvaluateExpression(a1, *(_QWORD *)(a2 + 112), v3) )
{
v3[4] = 2;
v4 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 392LL) + 8LL);
}
return QSetDefglobalValue(a1, a2, v3, 0LL);
}

original_code:
static void ResetDefglobalAction(
  void *theEnv,
  struct constructHeader *theConstruct,
  void *buffer)
  {
   struct defglobal *theDefglobal = (struct defglobal *) theConstruct;
   DATA_OBJECT assignValue;
   if (EvaluateExpression(theEnv,theDefglobal->initial,&assignValue))
     {
      assignValue.type = 2;
      assignValue.value = ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->FalseSymbolHN;
     }
   QSetDefglobalValue(theEnv,theDefglobal,&assignValue,0);
  }

canonical_original_code:
static void ResetDefglobalAction(void *theEnv, struct constructHeader *theConstruct, void *buffer)
  {
   struct defglobal *theDefglobal = (struct defglobal *) theConstruct;
   struct dataObject assignValue;
   if (EvaluateExpression(theEnv,theDefglobal->initial,&assignValue))
     {
      assignValue.type = 2;
      assignValue.value = ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->FalseSymbolHN;
     }
   QSetDefglobalValue(theEnv,theDefglobal,&assignValue,0);
  }

variable_types: struct constructHeader { struct symbolHashNode { struct symbolHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededSymbol; unsigned int bucket; char *contents; } *name; char *ppForm; struct defmoduleItemHeader { struct defmodule { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader **itemsArray; struct portItem { struct symbolHashNode *moduleName; struct symbolHashNode *constructType; struct symbolHashNode *constructName; struct portItem *next; } *importList; struct portItem *exportList; unsigned int visitedFlag; long bsaveID; struct userData { unsigned char dataID; struct userData *next; } *usrData; struct defmodule *next; } *theModule; struct constructHeader *firstItem; struct constructHeader *lastItem; } *whichModule; long bsaveID; struct constructHeader *next; struct userData *usrData; } *

variable_types:
buffer
void *

variable_types: struct defglobal { struct constructHeader { struct symbolHashNode { struct symbolHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededSymbol; unsigned int bucket; char *contents; } *name; char *ppForm; struct defmoduleItemHeader { struct defmodule { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader **itemsArray; struct portItem { struct symbolHashNode *moduleName; struct symbolHashNode *constructType; struct symbolHashNode *constructName; struct portItem *next; } *importList; struct portItem *exportList; unsigned int visitedFlag; long bsaveID; struct userData { unsigned char dataID; struct userData *next; } *usrData; struct defmodule *next; } *theModule; struct constructHeader *firstItem; struct constructHeader *lastItem; } *whichModule; long bsaveID; struct constructHeader *next; struct userData *usrData; } header; unsigned int watch; unsigned int inScope; long busyCount; struct dataObject { void *supplementalInfo; unsigned short type; void *value; long begin; long end; struct dataObject *next; } current; struct expr { unsigned short type; void *value; struct expr *argList; struct expr *nextArg; } *initial; } *

user_defined_types: struct symbolData { void *TrueSymbolHN; void *FalseSymbolHN; void *PositiveInfinity; void *NegativeInfinity; void *Zero; struct symbolHashNode **SymbolTable; struct floatHashNode **FloatTable; struct integerHashNode **IntegerTable; struct bitMapHashNode **BitMapTable; struct ephemeron *EphemeralSymbolList; struct ephemeron *EphemeralFloatList; struct ephemeron *EphemeralIntegerList; struct ephemeron *EphemeralBitMapList; long NumberOfSymbols; long NumberOfFloats; long NumberOfIntegers; long NumberOfBitMaps; struct symbolHashNode **SymbolArray; struct floatHashNode **FloatArray; struct integerHashNode **IntegerArray; struct bitMapHashNode **BitMapArray; }

user_defined_types: struct environmentData { unsigned int initialized; unsigned long environmentIndex; void *context; void *routerContext; void **theData; void (**cleanupFunctions)(void *); struct environmentCleanupFunction *listOfCleanupEnvironmentFunctions; struct environmentData *next; }

user_defined_types: struct ephemeron { struct genericHashNode *associatedValue; struct ephemeron *next; }

user_defined_types: struct environmentCleanupFunction { char *name; void (*func)(void *); int priority; struct environmentCleanupFunction *next; }

user_defined_types: struct floatHashNode { struct floatHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededFloat; unsigned int bucket; double contents; }

user_defined_types: struct integerHashNode { struct integerHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededInteger; unsigned int bucket; long contents; }

user_defined_types: struct bitMapHashNode { struct bitMapHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededBitMap; unsigned int bucket; char *contents; unsigned short size; }

user_defined_types: struct genericHashNode { struct genericHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int needed; unsigned int bucket; }


DefglobalBasicCommands

repo: jarcec/rbclips

decompiled_code:
__int64 __fastcall DefglobalBasicCommands(__int64 a1)
{
AddSaveFunction(a1, "defglobal", SaveDefglobals, 40LL);
EnvAddResetFunction(a1, "defglobal", ResetDefglobals, 50LL);
EnvDefineFunction2(a1, "get-defglobal-list", 109LL, GetDefglobalListFunction, "GetDefglobalListFunction", "01w");
EnvDefineFunction2(a1, "undefglobal", 118LL, UndefglobalCommand, "UndefglobalCommand", "11w");
EnvDefineFunction2(a1, "defglobal-module", 119LL, DefglobalModuleFunction, "DefglobalModuleFunction", "11w");
EnvDefineFunction2(a1, "list-defglobals", 118LL, ListDefglobalsCommand, "ListDefglobalsCommand", "01w");
EnvDefineFunction2(a1, "ppdefglobal", 118LL, PPDefglobalCommand, "PPDefglobalCommand", "11w");
AddWatchItem(a1, "globals", 0LL, &WatchGlobals, 0LL, DefglobalWatchAccess, DefglobalWatchPrint);
DefglobalBinarySetup(a1);
return ((__int64 (__fastcall *)(__int64, const char *))DefglobalCompilerSetup)(a1, "globals");
}

canonical_decompiled_code:
__int64 __fastcall func12(__int64 a1)
{
AddSaveFunction(a1, "defglobal", SaveDefglobals, 40LL);
EnvAddResetFunction(a1, "defglobal", ResetDefglobals, 50LL);
EnvDefineFunction2(a1, "get-defglobal-list", 109LL, GetDefglobalListFunction, "GetDefglobalListFunction", "01w");
EnvDefineFunction2(a1, "undefglobal", 118LL, UndefglobalCommand, "UndefglobalCommand", "11w");
EnvDefineFunction2(a1, "defglobal-module", 119LL, DefglobalModuleFunction, "DefglobalModuleFunction", "11w");
EnvDefineFunction2(a1, "list-defglobals", 118LL, ListDefglobalsCommand, "ListDefglobalsCommand", "01w");
EnvDefineFunction2(a1, "ppdefglobal", 118LL, PPDefglobalCommand, "PPDefglobalCommand", "11w");
AddWatchItem(a1, "globals", 0LL, &WatchGlobals, 0LL, DefglobalWatchAccess, DefglobalWatchPrint);
DefglobalBinarySetup(a1);
return ((__int64 (__fastcall *)(__int64, const char *))DefglobalCompilerSetup)(a1, "globals");
}

original_code:
void DefglobalBasicCommands(
  void *theEnv)
  {
   AddSaveFunction(theEnv,"defglobal",SaveDefglobals,40);
   EnvAddResetFunction(theEnv,"defglobal",ResetDefglobals,50);
   EnvDefineFunction2(theEnv,"get-defglobal-list",'m',(int (*)(void *)) GetDefglobalListFunction,"GetDefglobalListFunction","01w");
   EnvDefineFunction2(theEnv,"undefglobal",'v',(int (*)(void *)) UndefglobalCommand,"UndefglobalCommand","11w");
   EnvDefineFunction2(theEnv,"defglobal-module",'w',(int (*)(void *)) DefglobalModuleFunction,"DefglobalModuleFunction","11w");
   EnvDefineFunction2(theEnv,"list-defglobals",'v', (int (*)(void *)) ListDefglobalsCommand,"ListDefglobalsCommand","01w");
   EnvDefineFunction2(theEnv,"ppdefglobal",'v',(int (*)(void *)) PPDefglobalCommand,"PPDefglobalCommand","11w");
   AddWatchItem(theEnv,"globals",0,&WatchGlobals,0,DefglobalWatchAccess,DefglobalWatchPrint);
   DefglobalBinarySetup(theEnv);
   DefglobalCompilerSetup(theEnv);
  }

canonical_original_code:
void DefglobalBasicCommands(void *theEnv)
  {
   AddSaveFunction(theEnv,"defglobal",SaveDefglobals,40);
   EnvAddResetFunction(theEnv,"defglobal",ResetDefglobals,50);
   EnvDefineFunction2(theEnv,"get-defglobal-list",'m',(int (*)(void *)) GetDefglobalListFunction,"GetDefglobalListFunction","01w");
   EnvDefineFunction2(theEnv,"undefglobal",'v',(int (*)(void *)) UndefglobalCommand,"UndefglobalCommand","11w");
   EnvDefineFunction2(theEnv,"defglobal-module",'w',(int (*)(void *)) DefglobalModuleFunction,"DefglobalModuleFunction","11w");
   EnvDefineFunction2(theEnv,"list-defglobals",'v', (int (*)(void *)) ListDefglobalsCommand,"ListDefglobalsCommand","01w");
   EnvDefineFunction2(theEnv,"ppdefglobal",'v',(int (*)(void *)) PPDefglobalCommand,"PPDefglobalCommand","11w");
   AddWatchItem(theEnv,"globals",0,&WatchGlobals,0,DefglobalWatchAccess,DefglobalWatchPrint);
   DefglobalBinarySetup(theEnv);
   DefglobalCompilerSetup(theEnv);
  }

variable_types:
theEnv
void *

return_type: void


RemoveIntranetworkLink

decompiled_code:
__int64 __fastcall RemoveIntranetworkLink(__int64 a1, __int64 a2)
{
__int64 v2; // rdx
__int64 result; // rax
__int64 v4; // rdx

v2 = *(_QWORD *)(a2 + 32);
result = *(_QWORD *)(v2 + 16);
if ( !result )
return DetachPattern(a1, (*(_WORD *)a2 >> 6) & 7);
if ( a2 == result )
{
result = *(_QWORD *)(a2 + 64);
*(_QWORD *)(v2 + 16) = result;
if ( result )
return result;
return DetachPattern(a1, (*(_WORD *)a2 >> 6) & 7);
}
while ( 1 )
{
v4 = result;
result = *(_QWORD *)(result + 64);
if ( !result )
break;
if ( a2 == result )
{
result = *(_QWORD *)(a2 + 64);
*(_QWORD *)(v4 + 64) = result;
return result;
}
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1, __int64 a2)
{
__int64 v2; // rdx
__int64 result; // rax
__int64 v4; // rdx

v2 = *(_QWORD *)(a2 + 32);
result = *(_QWORD *)(v2 + 16);
if ( !result )
return DetachPattern(a1, (*(_WORD *)a2 >> 6) & 7);
if ( a2 == result )
{
result = *(_QWORD *)(a2 + 64);
*(_QWORD *)(v2 + 16) = result;
if ( result )
return result;
return DetachPattern(a1, (*(_WORD *)a2 >> 6) & 7);
}
while ( 1 )
{
v4 = result;
result = *(_QWORD *)(result + 64);
if ( !result )
break;
if ( a2 == result )
{
result = *(_QWORD *)(a2 + 64);
*(_QWORD *)(v4 + 64) = result;
return result;
}
}
return result;
}

original_code:
static void RemoveIntranetworkLink(
  void *theEnv,
  struct joinNode *join)
  {
   struct patternNodeHeader *patternPtr;
   struct joinNode *joinPtr, *lastJoin;
   patternPtr = (struct patternNodeHeader *) join->rightSideEntryStructure;
   joinPtr = patternPtr->entryJoin;
   lastJoin = ((void *)0);
   while (joinPtr != ((void *)0))
     {
      if (joinPtr == join)
        {
         if (lastJoin == ((void *)0))
           { patternPtr->entryJoin = joinPtr->rightMatchNode; }
         else
           { lastJoin->rightMatchNode = joinPtr->rightMatchNode; }
         joinPtr = ((void *)0);
        }
      else
        {
         lastJoin = joinPtr;
         joinPtr = joinPtr->rightMatchNode;
        }
     }
   if (patternPtr->entryJoin == ((void *)0))
     { DetachPattern(theEnv,(int) join->rhsType,patternPtr); }
  }

canonical_original_code:
static void RemoveIntranetworkLink(void *theEnv, struct joinNode *join)
  {
   struct patternNodeHeader *patternPtr;
   struct joinNode *joinPtr; struct joinNode *lastJoin;
   patternPtr = (struct patternNodeHeader *) join->rightSideEntryStructure;
   joinPtr = patternPtr->entryJoin;
   lastJoin = ((void *)0);
   while (joinPtr != ((void *)0))
     {
      if (joinPtr == join)
        {
         if (lastJoin == ((void *)0))
           { patternPtr->entryJoin = joinPtr->rightMatchNode; }
         else
           { lastJoin->rightMatchNode = joinPtr->rightMatchNode; }
         joinPtr = ((void *)0);
        }
      else
        {
         lastJoin = joinPtr;
         joinPtr = joinPtr->rightMatchNode;
        }
     }
   if (patternPtr->entryJoin == ((void *)0))
     { DetachPattern(theEnv,(int) join->rhsType,patternPtr); }
  }

variable_types: struct joinNode { unsigned int firstJoin; unsigned int logicalJoin; unsigned int joinFromTheRight; unsigned int patternIsNegated; unsigned int initialize; unsigned int marked; unsigned int rhsType; unsigned int depth; long bsaveID; struct partialMatch { unsigned int betaMemory; unsigned int busy; unsigned int activationf; unsigned int dependentsf; unsigned int notOriginf; unsigned int counterf; unsigned int bcount; struct partialMatch *next; struct genericMatch { union { void *theValue; struct alphaMatch { struct patternEntity { struct patternEntityRecord { struct entityRecord { char *name; unsigned int type; unsigned int copyToEvaluate; unsigned int bitMap; unsigned int addsToRuleComplexity; void (*shortPrintFunction)(void *, char *, void *); void (*longPrintFunction)(void *, char *, void *); int (*deleteFunction)(void *, void *); int (*evaluateFunction)(void *, void *, struct dataObject { void *supplementalInfo; unsigned short type; void *value; long begin; long end; struct dataObject *next; } *); void *(*getNextFunction)(void *, void *); void (*decrementBusyCount)(void *, void *); void (*incrementBusyCount)(void *, void *); void (*propagateDepth)(void *, void *); void (*markNeeded)(void *, void *); void (*install)(void *, void *); void (*deinstall)(void *, void *); struct userData { unsigned char dataID; struct userData *next; } *usrData; } base; void (*decrementBasisCount)(void *, void *); void (*incrementBasisCount)(void *, void *); void (*matchFunction)(void *, void *); int (*synchronized)(void *, void *); } *theInfo; void *dependents; unsigned int busyCount; long timeTag; } *matchingItem; struct multifieldMarker { int whichField; union { void *whichSlot; short whichSlotNumber; } where; long startPosition; long endPosition; struct multifieldMarker *next; } *markers; struct alphaMatch *next; } *theMatch; } gm; } binds[1]; } *beta; struct expr { unsigned short type; void *value; struct expr *argList; struct expr *nextArg; } *networkTest; void *rightSideEntryStructure; struct joinNode *nextLevel; struct joinNode *lastLevel; struct joinNode *rightDriveNode; struct joinNode *rightMatchNode; struct defrule { struct constructHeader { struct symbolHashNode { struct symbolHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededSymbol; unsigned int bucket; char *contents; } *name; char *ppForm; struct defmoduleItemHeader { struct defmodule { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader **itemsArray; struct portItem { struct symbolHashNode *moduleName; struct symbolHashNode *constructType; struct symbolHashNode *constructName; struct portItem *next; } *importList; struct portItem *exportList; unsigned int visitedFlag; long bsaveID; struct userData *usrData; struct defmodule *next; } *theModule; struct constructHeader *firstItem; struct constructHeader *lastItem; } *whichModule; long bsaveID; struct constructHeader *next; struct userData *usrData; } header; int salience; int localVarCnt; unsigned int complexity; unsigned int afterBreakpoint; unsigned int watchActivation; unsigned int watchFiring; unsigned int autoFocus; unsigned int executing; struct expr *dynamicSalience; struct expr *actions; struct joinNode *logicalJoin; struct joinNode *lastJoin; struct defrule *disjunct; } *ruleToActivate; } *

variable_types: struct patternNodeHeader { struct partialMatch { unsigned int betaMemory; unsigned int busy; unsigned int activationf; unsigned int dependentsf; unsigned int notOriginf; unsigned int counterf; unsigned int bcount; struct partialMatch *next; struct genericMatch { union { void *theValue; struct alphaMatch { struct patternEntity { struct patternEntityRecord { struct entityRecord { char *name; unsigned int type; unsigned int copyToEvaluate; unsigned int bitMap; unsigned int addsToRuleComplexity; void (*shortPrintFunction)(void *, char *, void *); void (*longPrintFunction)(void *, char *, void *); int (*deleteFunction)(void *, void *); int (*evaluateFunction)(void *, void *, struct dataObject { void *supplementalInfo; unsigned short type; void *value; long begin; long end; struct dataObject *next; } *); void *(*getNextFunction)(void *, void *); void (*decrementBusyCount)(void *, void *); void (*incrementBusyCount)(void *, void *); void (*propagateDepth)(void *, void *); void (*markNeeded)(void *, void *); void (*install)(void *, void *); void (*deinstall)(void *, void *); struct userData { unsigned char dataID; struct userData *next; } *usrData; } base; void (*decrementBasisCount)(void *, void *); void (*incrementBasisCount)(void *, void *); void (*matchFunction)(void *, void *); int (*synchronized)(void *, void *); } *theInfo; void *dependents; unsigned int busyCount; long timeTag; } *matchingItem; struct multifieldMarker { int whichField; union { void *whichSlot; short whichSlotNumber; } where; long startPosition; long endPosition; struct multifieldMarker *next; } *markers; struct alphaMatch *next; } *theMatch; } gm; } binds[1]; } *alphaMemory; struct partialMatch *endOfQueue; struct joinNode { unsigned int firstJoin; unsigned int logicalJoin; unsigned int joinFromTheRight; unsigned int patternIsNegated; unsigned int initialize; unsigned int marked; unsigned int rhsType; unsigned int depth; long bsaveID; struct partialMatch *beta; struct expr { unsigned short type; void *value; struct expr *argList; struct expr *nextArg; } *networkTest; void *rightSideEntryStructure; struct joinNode *nextLevel; struct joinNode *lastLevel; struct joinNode *rightDriveNode; struct joinNode *rightMatchNode; struct defrule { struct constructHeader { struct symbolHashNode { struct symbolHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededSymbol; unsigned int bucket; char *contents; } *name; char *ppForm; struct defmoduleItemHeader { struct defmodule { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader **itemsArray; struct portItem { struct symbolHashNode *moduleName; struct symbolHashNode *constructType; struct symbolHashNode *constructName; struct portItem *next; } *importList; struct portItem *exportList; unsigned int visitedFlag; long bsaveID; struct userData *usrData; struct defmodule *next; } *theModule; struct constructHeader *firstItem; struct constructHeader *lastItem; } *whichModule; long bsaveID; struct constructHeader *next; struct userData *usrData; } header; int salience; int localVarCnt; unsigned int complexity; unsigned int afterBreakpoint; unsigned int watchActivation; unsigned int watchFiring; unsigned int autoFocus; unsigned int executing; struct expr *dynamicSalience; struct expr *actions; struct joinNode *logicalJoin; struct joinNode *lastJoin; struct defrule *disjunct; } *ruleToActivate; } *entryJoin; unsigned int singlefieldNode; unsigned int multifieldNode; unsigned int stopNode; unsigned int initialize; unsigned int marked; unsigned int beginSlot; unsigned int endSlot; } *

user_defined_types: struct joinNode { unsigned int firstJoin; unsigned int logicalJoin; unsigned int joinFromTheRight; unsigned int patternIsNegated; unsigned int initialize; unsigned int marked; unsigned int rhsType; unsigned int depth; long bsaveID; struct partialMatch *beta; struct expr *networkTest; void *rightSideEntryStructure; struct joinNode *nextLevel; struct joinNode *lastLevel; struct joinNode *rightDriveNode; struct joinNode *rightMatchNode; struct defrule *ruleToActivate; }

user_defined_types: struct patternNodeHeader { struct partialMatch *alphaMemory; struct partialMatch *endOfQueue; struct joinNode *entryJoin; unsigned int singlefieldNode; unsigned int multifieldNode; unsigned int stopNode; unsigned int initialize; unsigned int marked; unsigned int beginSlot; unsigned int endSlot; }

user_defined_types: struct partialMatch { unsigned int betaMemory; unsigned int busy; unsigned int activationf; unsigned int dependentsf; unsigned int notOriginf; unsigned int counterf; unsigned int bcount; struct partialMatch *next; struct genericMatch binds[1]; }

user_defined_types: struct defrule { struct constructHeader header; int salience; int localVarCnt; unsigned int complexity; unsigned int afterBreakpoint; unsigned int watchActivation; unsigned int watchFiring; unsigned int autoFocus; unsigned int executing; struct expr *dynamicSalience; struct expr *actions; struct joinNode *logicalJoin; struct joinNode *lastJoin; struct defrule *disjunct; }

user_defined_types: struct constructHeader { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader *whichModule; long bsaveID; struct constructHeader *next; struct userData *usrData; }

user_defined_types: struct genericMatch { union { void *theValue; struct alphaMatch *theMatch; } gm; }

user_defined_types: struct defmoduleItemHeader { struct defmodule *theModule; struct constructHeader *firstItem; struct constructHeader *lastItem; }

user_defined_types: struct alphaMatch { struct patternEntity *matchingItem; struct multifieldMarker *markers; struct alphaMatch *next; }

user_defined_types: struct defmodule { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader **itemsArray; struct portItem *importList; struct portItem *exportList; unsigned int visitedFlag; long bsaveID; struct userData *usrData; struct defmodule *next; }

user_defined_types: struct patternEntity { struct patternEntityRecord *theInfo; void *dependents; unsigned int busyCount; long timeTag; }

user_defined_types: struct patternEntityRecord { struct entityRecord base; void (*decrementBasisCount)(void *, void *); void (*incrementBasisCount)(void *, void *); void (*matchFunction)(void *, void *); int (*synchronized)(void *, void *); }

user_defined_types: struct entityRecord { char *name; unsigned int type; unsigned int copyToEvaluate; unsigned int bitMap; unsigned int addsToRuleComplexity; void (*shortPrintFunction)(void *, char *, void *); void (*longPrintFunction)(void *, char *, void *); int (*deleteFunction)(void *, void *); int (*evaluateFunction)(void *, void *, struct dataObject *); void *(*getNextFunction)(void *, void *); void (*decrementBusyCount)(void *, void *); void (*incrementBusyCount)(void *, void *); void (*propagateDepth)(void *, void *); void (*markNeeded)(void *, void *); void (*install)(void *, void *); void (*deinstall)(void *, void *); struct userData *usrData; }


DestroyDefrule

original_code:
void DestroyDefrule(
  void *theEnv,
  void *vTheDefrule)
  {
   struct defrule *theDefrule = (struct defrule *) vTheDefrule;
   struct defrule *nextDisjunct;
   int first = 1;
   if (theDefrule == ((void *)0)) return;
   while (theDefrule != ((void *)0))
     {
      DetachJoins(theEnv,theDefrule,1);
      if (first)
        {
         if (theDefrule->dynamicSalience != ((void *)0))
           { ReturnPackedExpression(theEnv,theDefrule->dynamicSalience); }
         if (theDefrule->header.ppForm != ((void *)0))
           { rm(theEnv,theDefrule->header.ppForm,strlen(theDefrule->header.ppForm) + 1); }
         first = 0;
        }
      if (theDefrule->header.usrData != ((void *)0))
        { ClearUserDataList(theEnv,theDefrule->header.usrData); }
      if (theDefrule->actions != ((void *)0))
        { ReturnPackedExpression(theEnv,theDefrule->actions); }
      nextDisjunct = theDefrule->disjunct;
      (((struct memoryData *) (((struct environmentData *) theEnv)->theData[59]))->TempMemoryPtr = (struct memoryPtr *) theDefrule, ((struct memoryData *) (((struct environmentData *) theEnv)->theData[59]))->TempMemoryPtr->next = ((struct memoryData *) (((struct environmentData *) theEnv)->theData[59]))->MemoryTable[sizeof(struct defrule)], ((struct memoryData *) (((struct environmentData *) theEnv)->theData[59]))->MemoryTable[sizeof(struct defrule)] = ((struct memoryData *) (((struct environmentData *) theEnv)->theData[59]))->TempMemoryPtr);
      theDefrule = nextDisjunct;
     }
  }

canonical_original_code:
void DestroyDefrule(void *theEnv, void *vTheDefrule)
  {
   struct defrule *theDefrule = (struct defrule *) vTheDefrule;
   struct defrule *nextDisjunct;
   int first = 1;
   if (theDefrule == ((void *)0)) return;
   while (theDefrule != ((void *)0))
     {
      DetachJoins(theEnv,theDefrule,1);
      if (first)
        {
         if (theDefrule->dynamicSalience != ((void *)0))
           { ReturnPackedExpression(theEnv,theDefrule->dynamicSalience); }
         if (theDefrule->header.ppForm != ((void *)0))
           { rm(theEnv,theDefrule->header.ppForm,strlen(theDefrule->header.ppForm) + 1); }
         first = 0;
        }
      if (theDefrule->header.usrData != ((void *)0))
        { ClearUserDataList(theEnv,theDefrule->header.usrData); }
      if (theDefrule->actions != ((void *)0))
        { ReturnPackedExpression(theEnv,theDefrule->actions); }
      nextDisjunct = theDefrule->disjunct;
      (((struct memoryData *) (((struct environmentData *) theEnv)->theData[59]))->TempMemoryPtr = (struct memoryPtr *) theDefrule, ((struct memoryData *) (((struct environmentData *) theEnv)->theData[59]))->TempMemoryPtr->next = ((struct memoryData *) (((struct environmentData *) theEnv)->theData[59]))->MemoryTable[sizeof(struct defrule)], ((struct memoryData *) (((struct environmentData *) theEnv)->theData[59]))->MemoryTable[sizeof(struct defrule)] = ((struct memoryData *) (((struct environmentData *) theEnv)->theData[59]))->TempMemoryPtr);
      theDefrule = nextDisjunct;
     }
  }

variable_types:
vTheDefrule
void *

variable_types: struct defrule { struct constructHeader { struct symbolHashNode { struct symbolHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededSymbol; unsigned int bucket; char *contents; } *name; char *ppForm; struct defmoduleItemHeader { struct defmodule { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader **itemsArray; struct portItem { struct symbolHashNode *moduleName; struct symbolHashNode *constructType; struct symbolHashNode *constructName; struct portItem *next; } *importList; struct portItem *exportList; unsigned int visitedFlag; long bsaveID; struct userData { unsigned char dataID; struct userData *next; } *usrData; struct defmodule *next; } *theModule; struct constructHeader *firstItem; struct constructHeader *lastItem; } *whichModule; long bsaveID; struct constructHeader *next; struct userData *usrData; } header; int salience; int localVarCnt; unsigned int complexity; unsigned int afterBreakpoint; unsigned int watchActivation; unsigned int watchFiring; unsigned int autoFocus; unsigned int executing; struct expr { unsigned short type; void *value; struct expr *argList; struct expr *nextArg; } *dynamicSalience; struct expr *actions; struct joinNode { unsigned int firstJoin; unsigned int logicalJoin; unsigned int joinFromTheRight; unsigned int patternIsNegated; unsigned int initialize; unsigned int marked; unsigned int rhsType; unsigned int depth; long bsaveID; struct partialMatch { unsigned int betaMemory; unsigned int busy; unsigned int activationf; unsigned int dependentsf; unsigned int notOriginf; unsigned int counterf; unsigned int bcount; struct partialMatch *next; struct genericMatch { union { void *theValue; struct alphaMatch { struct patternEntity { struct patternEntityRecord { struct entityRecord { char *name; unsigned int type; unsigned int copyToEvaluate; unsigned int bitMap; unsigned int addsToRuleComplexity; void (*shortPrintFunction)(void *, char *, void *); void (*longPrintFunction)(void *, char *, void *); int (*deleteFunction)(void *, void *); int (*evaluateFunction)(void *, void *, struct dataObject { void *supplementalInfo; unsigned short type; void *value; long begin; long end; struct dataObject *next; } *); void *(*getNextFunction)(void *, void *); void (*decrementBusyCount)(void *, void *); void (*incrementBusyCount)(void *, void *); void (*propagateDepth)(void *, void *); void (*markNeeded)(void *, void *); void (*install)(void *, void *); void (*deinstall)(void *, void *); struct userData *usrData; } base; void (*decrementBasisCount)(void *, void *); void (*incrementBasisCount)(void *, void *); void (*matchFunction)(void *, void *); int (*synchronized)(void *, void *); } *theInfo; void *dependents; unsigned int busyCount; long timeTag; } *matchingItem; struct multifieldMarker { int whichField; union { void *whichSlot; short whichSlotNumber; } where; long startPosition; long endPosition; struct multifieldMarker *next; } *markers; struct alphaMatch *next; } *theMatch; } gm; } binds[1]; } *beta; struct expr *networkTest; void *rightSideEntryStructure; struct joinNode *nextLevel; struct joinNode *lastLevel; struct joinNode *rightDriveNode; struct joinNode *rightMatchNode; struct defrule *ruleToActivate; } *logicalJoin; struct joinNode *lastJoin; struct defrule *disjunct; } *

variable_types: first int

user_defined_types: struct memoryData { long MemoryAmount; long MemoryCalls; int ConserveMemory; int (*OutOfMemoryFunction)(void *, unsigned long); struct memoryPtr *TempMemoryPtr; struct memoryPtr **MemoryTable; unsigned int TempSize; unsigned long TempSize2; }

user_defined_types: struct environmentData { unsigned int initialized; unsigned long environmentIndex; void *context; void *routerContext; void **theData; void (**cleanupFunctions)(void *); struct environmentCleanupFunction *listOfCleanupEnvironmentFunctions; struct environmentData *next; }

user_defined_types: struct memoryPtr { struct memoryPtr *next; }

user_defined_types: struct environmentCleanupFunction { char *name; void (*func)(void *); int priority; struct environmentCleanupFunction *next; }


InitializeUserDataData

decompiled_code:
__int64 __fastcall InitializeUserDataData(__int64 a1)
{
return AllocateEnvironmentData(a1, 56LL, 808LL, 0LL);
}

canonical_decompiled_code:
__int64 __fastcall func0(__int64 a1)
{
return AllocateEnvironmentData(a1, 56LL, 808LL, 0LL);
}

original_code:
void InitializeUserDataData(
  void *theEnv)
  {
   AllocateEnvironmentData(theEnv,56,sizeof(struct userDataData),((void *)0));
  }

canonical_original_code:
void InitializeUserDataData(void *theEnv)
  {
   AllocateEnvironmentData(theEnv,56,sizeof(struct userDataData),((void *)0));
  }

user_defined_types: struct userDataData { struct userDataRecord *UserDataRecordArray[100]; unsigned char UserDataRecordCount; }

user_defined_types: struct userDataRecord { unsigned char dataID; void *(*createUserData)(void *); void (*deleteUserData)(void *, void *); }


InstallUserDataRecord

original_code:
unsigned char InstallUserDataRecord(
  void *theEnv,
  struct userDataRecord *theRecord)
  {
   theRecord->dataID = ((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordCount;
   ((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordArray[((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordCount] = theRecord;
   return(((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordCount++);
  }

canonical_original_code:
unsigned char InstallUserDataRecord(void *theEnv, struct userDataRecord *theRecord)
  {
   theRecord->dataID = ((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordCount;
   ((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordArray[((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordCount] = theRecord;
   return(((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordCount++);
  }

variable_types: struct userDataRecord { unsigned char dataID; void *(*createUserData)(void *); void (*deleteUserData)(void *, void *); } *

return_type: unsigned char


FetchUserData

decompiled_code:
__int64 __fastcall FetchUserData(__int64 a1, unsigned __int8 a2, __int64 *a3)
{
__int64 result; // rax

result = *a3;
if ( *a3 )
{
while ( *(_BYTE *)result != a2 )
{
result = *(_QWORD *)(result + 8);
if ( !result )
goto LABEL_6;
}
}
else
{
LABEL_6:
result = (*(__int64 (**)(void))(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 448LL) + 8LL * a2) + 8LL))();
*(_BYTE *)result = a2;
*(_QWORD *)(result + 8) = *a3;
*a3 = result;
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1, unsigned __int8 a2, __int64 *a3)
{
__int64 result; // rax

result = *a3;
if ( *a3 )
{
while ( *(_BYTE *)result != a2 )
{
result = *(_QWORD *)(result + 8);
if ( !result )
goto LABEL_6;
}
}
else
{
LABEL_6:
result = (*(__int64 (**)(void))(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 448LL) + 8LL * a2) + 8LL))();
*(_BYTE *)result = a2;
*(_QWORD *)(result + 8) = *a3;
*a3 = result;
}
return result;
}

original_code:
struct userData *FetchUserData(
  void *theEnv,
  unsigned char userDataID,
  struct userData **theList)
  {
   struct userData *theData;
   for (theData = *theList;
        theData != ((void *)0);
        theData = theData->next)
     {
      if (theData->dataID == userDataID)
        { return(theData); }
     }
   theData = (struct userData *) (*((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordArray[userDataID]->createUserData)(theEnv);
   theData->dataID = userDataID;
   theData->next = *theList;
   *theList = theData;
   return(theData);
  }

canonical_original_code:
struct userData *FetchUserData(void *theEnv, unsigned char userDataID, struct userData **theList)
  {
   struct userData *theData;
   for (theData = *theList;
        theData != ((void *)0);
        theData = theData->next)
     {
      if (theData->dataID == userDataID)
        { return(theData); }
     }
   theData = (struct userData *) (*((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordArray[userDataID]->createUserData)(theEnv);
   theData->dataID = userDataID;
   theData->next = *theList;
   *theList = theData;
   return(theData);
  }

variable_types:
userDataID
unsigned char

variable_types:
theList
struct userData **

variable_types: struct userData { unsigned char dataID; struct userData *next; } *


TestUserData

decompiled_code:
__int64 __fastcall TestUserData(char a1, __int64 a2)
{
while ( 1 )
{
if ( !a2 )
return 0LL;
if ( *(_BYTE *)a2 == a1 )
break;
a2 = *(_QWORD *)(a2 + 8);
}
return a2;
}

canonical_decompiled_code:
__int64 __fastcall func3(char a1, __int64 a2)
{
while ( 1 )
{
if ( !a2 )
return 0LL;
if ( *(_BYTE *)a2 == a1 )
break;
a2 = *(_QWORD *)(a2 + 8);
}
return a2;
}

original_code:
struct userData *TestUserData(
  unsigned char userDataID,
  struct userData *theList)
  {
   struct userData *theData;
   for (theData = theList;
        theData != ((void *)0);
        theData = theData->next)
     {
      if (theData->dataID == userDataID)
        { return(theData); }
     }
   return(((void *)0));
  }

canonical_original_code:
struct userData *TestUserData(unsigned char userDataID, struct userData *theList)
  {
   struct userData *theData;
   for (theData = theList;
        theData != ((void *)0);
        theData = theData->next)
     {
      if (theData->dataID == userDataID)
        { return(theData); }
     }
   return(((void *)0));
  }

variable_types:
theList
struct userData *

return_type: struct userData { unsigned char dataID; struct userData *next; } *


ClearUserDataList

decompiled_code:
__int64 __fastcall ClearUserDataList(__int64 a1, unsigned __int8 *a2)
{
unsigned __int8 *v2; // rbx
unsigned __int8 *v3; // rsi
__int64 result; // rax

if ( a2 )
{
v2 = a2;
do
{
v3 = v2;
v2 = (unsigned __int8 *)*((_QWORD *)v2 + 1);
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 448LL) + 8LL * *v3)
+ 16LL))(a1);
}
while ( v2 );
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func4(__int64 a1, unsigned __int8 *a2)
{
unsigned __int8 *v2; // rbx
unsigned __int8 *v3; // rsi
__int64 result; // rax

if ( a2 )
{
v2 = a2;
do
{
v3 = v2;
v2 = (unsigned __int8 *)*((_QWORD *)v2 + 1);
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 448LL) + 8LL * *v3)
+ 16LL))(a1);
}
while ( v2 );
}
return result;
}

original_code:
void ClearUserDataList(
  void *theEnv,
  struct userData *theList)
  {
   struct userData *nextData;
   while (theList != ((void *)0))
     {
      nextData = theList->next;
      (*((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordArray[theList->dataID]->deleteUserData)(theEnv,theList);
      theList = nextData;
     }
  }

canonical_original_code:
void ClearUserDataList(void *theEnv, struct userData *theList)
  {
   struct userData *nextData;
   while (theList != ((void *)0))
     {
      nextData = theList->next;
      (*((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordArray[theList->dataID]->deleteUserData)(theEnv,theList);
      theList = nextData;
     }
  }

user_defined_types: struct userData { unsigned char dataID; struct userData *next; }


DeleteUserData

original_code:
struct userData *DeleteUserData(
  void *theEnv,
  unsigned char userDataID,
  struct userData *theList)
  {
   struct userData *theData, *lastData = ((void *)0);
   for (theData = theList;
        theData != ((void *)0);
        theData = theData->next)
     {
      if (theData->dataID == userDataID)
        {
         if (lastData == ((void *)0))
           { theList = theData->next; }
         else
           { lastData->next = theData->next; }
         (*((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordArray[userDataID]->deleteUserData)(theEnv,theData);
         return(theList);
        }
      lastData = theData;
     }
   return(theList);
  }

canonical_original_code:
struct userData *DeleteUserData(void *theEnv, unsigned char userDataID, struct userData *theList)
  {
   struct userData *theData; struct userData *lastData = ((void *)0);
   for (theData = theList;
        theData != ((void *)0);
        theData = theData->next)
     {
      if (theData->dataID == userDataID)
        {
         if (lastData == ((void *)0))
           { theList = theData->next; }
         else
           { lastData->next = theData->next; }
         (*((struct userDataData *) (((struct environmentData *) theEnv)->theData[56]))->UserDataRecordArray[userDataID]->deleteUserData)(theEnv,theData);
         return(theList);
        }
      lastData = theData;
     }
   return(theList);
  }


ReadNeededBitMaps

original_code:
static void ReadNeededBitMaps(
  void *theEnv)
  {
   char *bitMapStorage, *bitMapPtr;
   unsigned long space;
   long i;
   GenReadBinary(theEnv,(void *) &((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfBitMaps,(unsigned long) sizeof(long int));
   GenReadBinary(theEnv,&space,(unsigned long) sizeof(unsigned long int));
   if (((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfBitMaps == 0)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->BitMapArray = ((void *)0);
      return;
     }
   bitMapStorage = (char *) gm3(theEnv,(long) space);
   GenReadBinary(theEnv,(void *) bitMapStorage,space);
   ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->BitMapArray = (BITMAP_HN **)
                 gm3(theEnv,(long) sizeof(BITMAP_HN *) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfBitMaps);
   bitMapPtr = bitMapStorage;
   for (i = 0; i < ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfBitMaps; i++)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->BitMapArray[i] = (BITMAP_HN *) AddBitMap(theEnv,bitMapPtr+1,*bitMapPtr);
      bitMapPtr += *bitMapPtr + 1;
     }
   rm3(theEnv,(void *) bitMapStorage,(long) space);
  }

canonical_original_code:
static void ReadNeededBitMaps(void *theEnv)
  {
   char *bitMapStorage; char *bitMapPtr;
   unsigned long space;
   long i;
   GenReadBinary(theEnv,(void *) &((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfBitMaps,(unsigned long) sizeof(long));
   GenReadBinary(theEnv,&space,(unsigned long) sizeof(unsigned long));
   if (((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfBitMaps == 0)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->BitMapArray = ((void *)0);
      return;
     }
   bitMapStorage = (char *) gm3(theEnv,(long) space);
   GenReadBinary(theEnv,(void *) bitMapStorage,space);
   ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->BitMapArray = (struct bitMapHashNode **)
                 gm3(theEnv,(long) sizeof(struct bitMapHashNode *) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfBitMaps);
   bitMapPtr = bitMapStorage;
   for (i = 0; i < ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfBitMaps; i++)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->BitMapArray[i] = (struct bitMapHashNode *) AddBitMap(theEnv,bitMapPtr+1,*bitMapPtr);
      bitMapPtr += *bitMapPtr + 1;
     }
   rm3(theEnv,(void *) bitMapStorage,(long) space);
  }

variable_types:
bitMapStorage
char *

variable_types:
bitMapPtr
char *

variable_types:
space
unsigned long

variable_types: i long

user_defined_types: struct symbolData { void *TrueSymbolHN; void *FalseSymbolHN; void *PositiveInfinity; void *NegativeInfinity; void *Zero; struct symbolHashNode **SymbolTable; struct floatHashNode **FloatTable; struct integerHashNode **IntegerTable; struct bitMapHashNode **BitMapTable; struct ephemeron *EphemeralSymbolList; struct ephemeron *EphemeralFloatList; struct ephemeron *EphemeralIntegerList; struct ephemeron *EphemeralBitMapList; long NumberOfSymbols; long NumberOfFloats; long NumberOfIntegers; long NumberOfBitMaps; struct symbolHashNode **SymbolArray; struct floatHashNode **FloatArray; struct integerHashNode **IntegerArray; struct bitMapHashNode **BitMapArray; }

user_defined_types: struct bitMapHashNode { struct bitMapHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededBitMap; unsigned int bucket; char *contents; unsigned short size; }

user_defined_types: struct ephemeron { struct genericHashNode *associatedValue; struct ephemeron *next; }

user_defined_types: struct symbolHashNode { struct symbolHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededSymbol; unsigned int bucket; char *contents; }

user_defined_types: struct floatHashNode { struct floatHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededFloat; unsigned int bucket; double contents; }

user_defined_types: struct integerHashNode { struct integerHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededInteger; unsigned int bucket; long contents; }

user_defined_types: struct genericHashNode { struct genericHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int needed; unsigned int bucket; }


ReadNeededSymbols

original_code:
void ReadNeededSymbols(
  void *theEnv)
  {
   char *symbolNames, *namePtr;
   unsigned long space;
   long i;
   GenReadBinary(theEnv,(void *) &((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfSymbols,(unsigned long) sizeof(long int));
   GenReadBinary(theEnv,&space,(unsigned long) sizeof(unsigned long int));
   if (((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfSymbols == 0)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->SymbolArray = ((void *)0);
      return;
     }
   symbolNames = (char *) gm3(theEnv,(long) space);
   GenReadBinary(theEnv,(void *) symbolNames,space);
   ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->SymbolArray = (SYMBOL_HN **)
                 gm3(theEnv,(long) sizeof(SYMBOL_HN *) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfSymbols);
   namePtr = symbolNames;
   for (i = 0; i < ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfSymbols; i++)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->SymbolArray[i] = (SYMBOL_HN *) EnvAddSymbol(theEnv,namePtr);
      namePtr += strlen(namePtr) + 1;
     }
   rm3(theEnv,(void *) symbolNames,(long) space);
  }

canonical_original_code:
void ReadNeededSymbols(void *theEnv)
  {
   char *symbolNames; char *namePtr;
   unsigned long space;
   long i;
   GenReadBinary(theEnv,(void *) &((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfSymbols,(unsigned long) sizeof(long));
   GenReadBinary(theEnv,&space,(unsigned long) sizeof(unsigned long));
   if (((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfSymbols == 0)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->SymbolArray = ((void *)0);
      return;
     }
   symbolNames = (char *) gm3(theEnv,(long) space);
   GenReadBinary(theEnv,(void *) symbolNames,space);
   ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->SymbolArray = (struct symbolHashNode **)
                 gm3(theEnv,(long) sizeof(struct symbolHashNode *) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfSymbols);
   namePtr = symbolNames;
   for (i = 0; i < ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfSymbols; i++)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->SymbolArray[i] = (struct symbolHashNode *) EnvAddSymbol(theEnv,namePtr);
      namePtr += strlen(namePtr) + 1;
     }
   rm3(theEnv,(void *) symbolNames,(long) space);
  }

variable_types:
symbolNames
char *

variable_types:
namePtr
char *


ReadNeededFloats

original_code:
void ReadNeededFloats(
  void *theEnv)
  {
   double *floatValues;
   long i;
   GenReadBinary(theEnv,&((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats,(unsigned long) sizeof(long int));
   if (((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats == 0)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->FloatArray = ((void *)0);
      return;
     }
   floatValues = (double *) gm3(theEnv,(long) sizeof(double) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats);
   GenReadBinary(theEnv,(void *) floatValues,(unsigned long) (sizeof(double) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats));
   ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->FloatArray = (FLOAT_HN **)
               gm3(theEnv,(long) sizeof(FLOAT_HN *) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats);
   for (i = 0; i < ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats; i++)
     { ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->FloatArray[i] = (FLOAT_HN *) EnvAddDouble(theEnv,floatValues[i]); }
   rm3(theEnv,(void *) floatValues,(long) (sizeof(double) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats));
  }

canonical_original_code:
void ReadNeededFloats(void *theEnv)
  {
   double *floatValues;
   long i;
   GenReadBinary(theEnv,&((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats,(unsigned long) sizeof(long));
   if (((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats == 0)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->FloatArray = ((void *)0);
      return;
     }
   floatValues = (double *) gm3(theEnv,(long) sizeof(double) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats);
   GenReadBinary(theEnv,(void *) floatValues,(unsigned long) (sizeof(double) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats));
   ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->FloatArray = (struct floatHashNode **)
               gm3(theEnv,(long) sizeof(struct floatHashNode *) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats);
   for (i = 0; i < ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats; i++)
     { ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->FloatArray[i] = (struct floatHashNode *) EnvAddDouble(theEnv,floatValues[i]); }
   rm3(theEnv,(void *) floatValues,(long) (sizeof(double) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfFloats));
  }

variable_types:
theEnv
void *

variable_types:
floatValues
double *


ReadNeededIntegers

original_code:
void ReadNeededIntegers(
  void *theEnv)
  {
   long int *integerValues;
   long i;
   GenReadBinary(theEnv,&((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers,(unsigned long) sizeof(unsigned long int));
   if (((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers == 0)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->IntegerArray = ((void *)0);
      return;
     }
   integerValues = (long *) gm3(theEnv,(long) (sizeof(long) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers));
   GenReadBinary(theEnv,(void *) integerValues,(unsigned long) (sizeof(long) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers));
   ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->IntegerArray = (INTEGER_HN **)
           gm3(theEnv,(long) (sizeof(INTEGER_HN *) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers));
   for (i = 0; i < ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers; i++)
     { ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->IntegerArray[i] = (INTEGER_HN *) EnvAddLong(theEnv,integerValues[i]); }
   rm3(theEnv,(void *) integerValues,(long) (sizeof(long int) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers));
  }

canonical_original_code:
void ReadNeededIntegers(void *theEnv)
  {
   long *integerValues;
   long i;
   GenReadBinary(theEnv,&((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers,(unsigned long) sizeof(unsigned long));
   if (((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers == 0)
     {
      ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->IntegerArray = ((void *)0);
      return;
     }
   integerValues = (long *) gm3(theEnv,(long) (sizeof(long) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers));
   GenReadBinary(theEnv,(void *) integerValues,(unsigned long) (sizeof(long) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers));
   ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->IntegerArray = (struct integerHashNode **)
           gm3(theEnv,(long) (sizeof(struct integerHashNode *) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers));
   for (i = 0; i < ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers; i++)
     { ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->IntegerArray[i] = (struct integerHashNode *) EnvAddLong(theEnv,integerValues[i]); }
   rm3(theEnv,(void *) integerValues,(long) (sizeof(long) * ((struct symbolData *) (((struct environmentData *) theEnv)->theData[49]))->NumberOfIntegers));
  }

variable_types:
integerValues
long *


ReadNeededAtomicValues

decompiled_code:
__int64 __fastcall ReadNeededAtomicValues(__int64 a1)
{
ReadNeededSymbols(a1);
ReadNeededFloats(a1);
ReadNeededIntegers(a1);
return ReadNeededBitMaps(a1);
}

canonical_decompiled_code:
__int64 __fastcall func9(__int64 a1)
{
func6(a1);
func7(a1);
func8(a1);
return func1(a1);
}

original_code:
void ReadNeededAtomicValues(
  void *theEnv)
  {
   ReadNeededSymbols(theEnv);
   ReadNeededFloats(theEnv);
   ReadNeededIntegers(theEnv);
   ReadNeededBitMaps(theEnv);
  }

canonical_original_code:
void ReadNeededAtomicValues(void *theEnv)
  {
   ReadNeededSymbols(theEnv);
   ReadNeededFloats(theEnv);
   ReadNeededIntegers(theEnv);
   ReadNeededBitMaps(theEnv);
  }


UpdatePattern

original_code:
static void UpdatePattern(
  void *theEnv,
  void *buf,
  long obji)
  {
   BSAVE_OBJECT_PATTERN_NODE *bop;
   OBJECT_PATTERN_NODE *op;
   bop = (BSAVE_OBJECT_PATTERN_NODE *) buf;
   op = (OBJECT_PATTERN_NODE *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[obji];
   op->blocked = 0;
   op->multifieldNode = bop->multifieldNode;
   op->whichField = bop->whichField;
   op->leaveFields = bop->leaveFields;
   op->endSlot = bop->endSlot;
   op->matchTimeTag = 0L;
   op->slotNameID = bop->slotNameID;
   op->networkTest = ((struct expr *) (((bop->networkTest) == -1L) ? ((void *)0) : &((struct expressionData *) (((struct environmentData *) theEnv)->theData[45]))->ExpressionArray[bop->networkTest]));
   op->nextLevel = ((bop->nextLevel == -1L) ? ((void *)0) : (OBJECT_PATTERN_NODE *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[bop->nextLevel]);
   op->lastLevel = ((bop->lastLevel == -1L) ? ((void *)0) : (OBJECT_PATTERN_NODE *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[bop->lastLevel]);
   op->leftNode = ((bop->leftNode == -1L) ? ((void *)0) : (OBJECT_PATTERN_NODE *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[bop->leftNode]);
   op->rightNode = ((bop->rightNode == -1L) ? ((void *)0) : (OBJECT_PATTERN_NODE *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[bop->rightNode]);
   op->alphaNode = ((bop->alphaNode == -1L) ? ((void *)0) : (OBJECT_ALPHA_NODE *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray[bop->alphaNode]);
   op->bsaveID = 0L;
  }

canonical_original_code:
static void UpdatePattern(void *theEnv, void *buf, long obji)
  {
   struct bsaveObjectPatternNode *bop;
   struct objectPatternNode *op;
   bop = (struct bsaveObjectPatternNode *) buf;
   op = (struct objectPatternNode *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[obji];
   op->blocked = 0;
   op->multifieldNode = bop->multifieldNode;
   op->whichField = bop->whichField;
   op->leaveFields = bop->leaveFields;
   op->endSlot = bop->endSlot;
   op->matchTimeTag = 0L;
   op->slotNameID = bop->slotNameID;
   op->networkTest = ((struct expr *) (((bop->networkTest) == -1L) ? ((void *)0) : &((struct expressionData *) (((struct environmentData *) theEnv)->theData[45]))->ExpressionArray[bop->networkTest]));
   op->nextLevel = ((bop->nextLevel == -1L) ? ((void *)0) : (struct objectPatternNode *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[bop->nextLevel]);
   op->lastLevel = ((bop->lastLevel == -1L) ? ((void *)0) : (struct objectPatternNode *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[bop->lastLevel]);
   op->leftNode = ((bop->leftNode == -1L) ? ((void *)0) : (struct objectPatternNode *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[bop->leftNode]);
   op->rightNode = ((bop->rightNode == -1L) ? ((void *)0) : (struct objectPatternNode *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[bop->rightNode]);
   op->alphaNode = ((bop->alphaNode == -1L) ? ((void *)0) : (struct objectAlphaNode *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray[bop->alphaNode]);
   op->bsaveID = 0L;
  }

variable_types:
buf
void *

variable_types: obji long

variable_types: struct bsaveObjectPatternNode { unsigned int multifieldNode; unsigned int endSlot; unsigned int whichField; unsigned int leaveFields; unsigned int slotNameID; long networkTest; } *

variable_types: struct objectPatternNode { unsigned int blocked; unsigned int multifieldNode; unsigned int endSlot; unsigned int whichField; unsigned int leaveFields; unsigned long matchTimeTag; unsigned int slotNameID; struct expr { unsigned short type; void *value; struct expr *argList; struct expr *nextArg; } *networkTest; struct objectPatternNode *nextLevel; struct objectPatternNode *lastLevel; struct objectPatternNode *leftNode; struct objectPatternNode *rightNode; struct objectAlphaNode { struct patternNodeHeader { struct partialMatch { unsigned int betaMemory; unsigned int busy; unsigned int activationf; unsigned int dependentsf; unsigned int notOriginf; unsigned int counterf; unsigned int bcount; struct partialMatch *next; struct genericMatch { union { void *theValue; struct alphaMatch { struct patternEntity { struct patternEntityRecord { struct entityRecord { char *name; unsigned int type; unsigned int copyToEvaluate; unsigned int bitMap; unsigned int addsToRuleComplexity; void (*shortPrintFunction)(void *, char *, void *); void (*longPrintFunction)(void *, char *, void *); int (*deleteFunction)(void *, void *); int (*evaluateFunction)(void *, void *, struct dataObject { void *supplementalInfo; unsigned short type; void *value; long begin; long end; struct dataObject *next; } *); void *(*getNextFunction)(void *, void *); void (*decrementBusyCount)(void *, void *); void (*incrementBusyCount)(void *, void *); void (*propagateDepth)(void *, void *); void (*markNeeded)(void *, void *); void (*install)(void *, void *); void (*deinstall)(void *, void *); struct userData { unsigned char dataID; struct userData *next; } *usrData; } base; void (*decrementBasisCount)(void *, void *); void (*incrementBasisCount)(void *, void *); void (*matchFunction)(void *, void *); int (*synchronized)(void *, void *); } *theInfo; void *dependents; unsigned int busyCount; long timeTag; } *matchingItem; struct multifieldMarker { int whichField; union { void *whichSlot; short whichSlotNumber; } where; long startPosition; long endPosition; struct multifieldMarker *next; } *markers; struct alphaMatch *next; } *theMatch; } gm; } binds[1]; } *alphaMemory; struct partialMatch *endOfQueue; struct joinNode { unsigned int firstJoin; unsigned int logicalJoin; unsigned int joinFromTheRight; unsigned int patternIsNegated; unsigned int initialize; unsigned int marked; unsigned int rhsType; unsigned int depth; long bsaveID; struct partialMatch *beta; struct expr *networkTest; void *rightSideEntryStructure; struct joinNode *nextLevel; struct joinNode *lastLevel; struct joinNode *rightDriveNode; struct joinNode *rightMatchNode; struct defrule { struct constructHeader { struct symbolHashNode { struct symbolHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededSymbol; unsigned int bucket; char *contents; } *name; char *ppForm; struct defmoduleItemHeader { struct defmodule { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader **itemsArray; struct portItem { struct symbolHashNode *moduleName; struct symbolHashNode *constructType; struct symbolHashNode *constructName; struct portItem *next; } *importList; struct portItem *exportList; unsigned int visitedFlag; long bsaveID; struct userData *usrData; struct defmodule *next; } *theModule; struct constructHeader *firstItem; struct constructHeader *lastItem; } *whichModule; long bsaveID; struct constructHeader *next; struct userData *usrData; } header; int salience; int localVarCnt; unsigned int complexity; unsigned int afterBreakpoint; unsigned int watchActivation; unsigned int watchFiring; unsigned int autoFocus; unsigned int executing; struct expr *dynamicSalience; struct expr *actions; struct joinNode *logicalJoin; struct joinNode *lastJoin; struct defrule *disjunct; } *ruleToActivate; } *entryJoin; unsigned int singlefieldNode; unsigned int multifieldNode; unsigned int stopNode; unsigned int initialize; unsigned int marked; unsigned int beginSlot; unsigned int endSlot; } header; unsigned long matchTimeTag; struct bitMapHashNode { struct bitMapHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededBitMap; unsigned int bucket; char *contents; unsigned short size; } *classbmp; struct objectPatternNode *patternNode; struct objectAlphaNode *nxtInGroup; long bsaveID; } *alphaNode; long bsaveID; } *

user_defined_types: struct objectPatternNode { unsigned int blocked; unsigned int multifieldNode; unsigned int endSlot; unsigned int whichField; unsigned int leaveFields; unsigned long matchTimeTag; unsigned int slotNameID; struct expr *networkTest; struct objectPatternNode *nextLevel; struct objectPatternNode *lastLevel; struct objectPatternNode *leftNode; struct objectPatternNode *rightNode; struct objectAlphaNode *alphaNode; long bsaveID; }

user_defined_types: struct objectReteBinaryData { long AlphaNodeCount; long PatternNodeCount; struct objectAlphaNode *AlphaArray; struct objectPatternNode *PatternArray; }

user_defined_types: struct expressionData { void *PTR_AND; void *PTR_OR; void *PTR_EQ; void *PTR_NEQ; void *PTR_NOT; struct exprHashNode **ExpressionHashTable; long NumberOfExpressions; struct expr *ExpressionArray; long ExpressionCount; struct saved_contexts *svContexts; int ReturnContext; int BreakContext; int SequenceOpMode; }

user_defined_types: struct objectAlphaNode { struct patternNodeHeader header; unsigned long matchTimeTag; struct bitMapHashNode *classbmp; struct objectPatternNode *patternNode; struct objectAlphaNode *nxtInGroup; long bsaveID; }

user_defined_types: struct patternNodeHeader { struct partialMatch *alphaMemory; struct partialMatch *endOfQueue; struct joinNode *entryJoin; unsigned int singlefieldNode; unsigned int multifieldNode; unsigned int stopNode; unsigned int initialize; unsigned int marked; unsigned int beginSlot; unsigned int endSlot; }

user_defined_types: struct saved_contexts { int rtn; int brk; struct saved_contexts *nxt; }

user_defined_types: struct exprHashNode { unsigned int hashval; unsigned int count; struct expr *exp; struct exprHashNode *next; long bsaveID; }

user_defined_types: struct partialMatch { unsigned int betaMemory; unsigned int busy; unsigned int activationf; unsigned int dependentsf; unsigned int notOriginf; unsigned int counterf; unsigned int bcount; struct partialMatch *next; struct genericMatch binds[1]; }

user_defined_types: struct joinNode { unsigned int firstJoin; unsigned int logicalJoin; unsigned int joinFromTheRight; unsigned int patternIsNegated; unsigned int initialize; unsigned int marked; unsigned int rhsType; unsigned int depth; long bsaveID; struct partialMatch *beta; struct expr *networkTest; void *rightSideEntryStructure; struct joinNode *nextLevel; struct joinNode *lastLevel; struct joinNode *rightDriveNode; struct joinNode *rightMatchNode; struct defrule *ruleToActivate; }

user_defined_types: struct genericMatch { union { void *theValue; struct alphaMatch *theMatch; } gm; }

user_defined_types: struct defrule { struct constructHeader header; int salience; int localVarCnt; unsigned int complexity; unsigned int afterBreakpoint; unsigned int watchActivation; unsigned int watchFiring; unsigned int autoFocus; unsigned int executing; struct expr *dynamicSalience; struct expr *actions; struct joinNode *logicalJoin; struct joinNode *lastJoin; struct defrule *disjunct; }

user_defined_types: struct constructHeader { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader *whichModule; long bsaveID; struct constructHeader *next; struct userData *usrData; }

user_defined_types: struct alphaMatch { struct patternEntity *matchingItem; struct multifieldMarker *markers; struct alphaMatch *next; }

user_defined_types: struct defmoduleItemHeader { struct defmodule *theModule; struct constructHeader *firstItem; struct constructHeader *lastItem; }

user_defined_types: struct patternEntity { struct patternEntityRecord *theInfo; void *dependents; unsigned int busyCount; long timeTag; }

user_defined_types: struct defmodule { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader **itemsArray; struct portItem *importList; struct portItem *exportList; unsigned int visitedFlag; long bsaveID; struct userData *usrData; struct defmodule *next; }


ClearBloadObjectPatterns

original_code:
static void ClearBloadObjectPatterns(
  void *theEnv)
  {
   UNLN space;
   register long i;
   for (i = 0L ; i < ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount ; i++)
     {
      DecrementBitMapCount(theEnv,((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray[i].classbmp);
      if (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray[i].slotbmp != ((void *)0))
        DecrementBitMapCount(theEnv,((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray[i].slotbmp);
     }
   if (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount != 0L)
     {
      space = (UNLN) (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount * sizeof(OBJECT_ALPHA_NODE));
      genlongfree(theEnv,(void *) ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray,space);
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray = ((void *)0);
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount = 0;
      space = (UNLN) (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount * sizeof(OBJECT_PATTERN_NODE));
      genlongfree(theEnv,(void *) ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray,space);
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray = ((void *)0);
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount = 0;
     }
   SetObjectNetworkTerminalPointer(theEnv,((void *)0));
   SetObjectNetworkPointer(theEnv,((void *)0));
  }

canonical_original_code:
static void ClearBloadObjectPatterns(void *theEnv)
  {
   unsigned long space;
   register long i;
   for (i = 0L ; i < ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount ; i++)
     {
      DecrementBitMapCount(theEnv,((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray[i].classbmp);
      if (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray[i].slotbmp != ((void *)0))
        DecrementBitMapCount(theEnv,((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray[i].slotbmp);
     }
   if (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount != 0L)
     {
      space = (UNLN) (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount * sizeof(OBJECT_ALPHA_NODE));
      genlongfree(theEnv,(void *) ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray,space);
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray = ((void *)0);
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount = 0;
      space = (UNLN) (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount * sizeof(OBJECT_PATTERN_NODE));
      genlongfree(theEnv,(void *) ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray,space);
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray = ((void *)0);
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount = 0;
     }
   SetObjectNetworkTerminalPointer(theEnv,((void *)0));
   SetObjectNetworkPointer(theEnv,((void *)0));
  }

user_defined_types: struct environmentData { unsigned int initialized; unsigned long environmentIndex; void *context; void *routerContext; void **theData; void (**cleanupFunctions)(void *); struct environmentCleanupFunction *listOfCleanupEnvironmentFunctions; struct environmentData *next; }

user_defined_types: struct environmentCleanupFunction { char *name; void (*func)(void *); int priority; struct environmentCleanupFunction *next; }

user_defined_types: struct bitMapHashNode { struct bitMapHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededBitMap; unsigned int bucket; char *contents; unsigned short size; }

user_defined_types: struct expr { unsigned short type; void *value; struct expr *argList; struct expr *nextArg; }

user_defined_types: struct symbolHashNode { struct symbolHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededSymbol; unsigned int bucket; char *contents; }

user_defined_types: struct multifieldMarker { int whichField; union { void *whichSlot; short whichSlotNumber; } where; long startPosition; long endPosition; struct multifieldMarker *next; }

user_defined_types: struct patternEntityRecord { struct entityRecord base; void (*decrementBasisCount)(void *, void *); void (*incrementBasisCount)(void *, void *); void (*matchFunction)(void *, void *); int (*synchronized)(void *, void *); }

user_defined_types: struct portItem { struct symbolHashNode *moduleName; struct symbolHashNode *constructType; struct symbolHashNode *constructName; struct portItem *next; }

user_defined_types: struct entityRecord { char *name; unsigned int type; unsigned int copyToEvaluate; unsigned int bitMap; unsigned int addsToRuleComplexity; void (*shortPrintFunction)(void *, char *, void *); void (*longPrintFunction)(void *, char *, void *); int (*deleteFunction)(void *, void *); int (*evaluateFunction)(void *, void *, struct dataObject *); void *(*getNextFunction)(void *, void *); void (*decrementBusyCount)(void *, void *); void (*incrementBusyCount)(void *, void *); void (*propagateDepth)(void *, void *); void (*markNeeded)(void *, void *); void (*install)(void *, void *); void (*deinstall)(void *, void *); struct userData *usrData; }

user_defined_types: struct userData { unsigned char dataID; struct userData *next; }

user_defined_types: struct dataObject { void *supplementalInfo; unsigned short type; void *value; long begin; long end; struct dataObject *next; }


BloadObjectPatterns

decompiled_code:
__int64 __fastcall BloadObjectPatterns(__int64 a1)
{
__int64 result; // rax
__int64 v2; // [rsp+8h] [rbp-10h] BYREF

result = GenReadBinary(a1, &v2, 8LL);
if ( v2 )
{
BloadandRefresh(a1, **(_QWORD **)(*(_QWORD *)(a1 + 32) + 272LL), 56LL, UpdateAlpha);
BloadandRefresh(a1, *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 272LL) + 8LL), 56LL, UpdatePattern);
SetObjectNetworkTerminalPointer(a1, *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 272LL) + 16LL));
result = SetObjectNetworkPointer(a1, *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 272LL) + 24LL));
}
return result;
}

canonical_decompiled_code:
__int64 __fastcall func2(__int64 a1)
{
__int64 result; // rax
__int64 v2; // [rsp+8h] [rbp-10h] BYREF

result = GenReadBinary(a1, &v2, 8LL);
if ( v2 )
{
BloadandRefresh(a1, **(_QWORD **)(*(_QWORD *)(a1 + 32) + 272LL), 56LL, UpdateAlpha);
BloadandRefresh(a1, *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 272LL) + 8LL), 56LL, UpdatePattern);
SetObjectNetworkTerminalPointer(a1, *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 272LL) + 16LL));
result = SetObjectNetworkPointer(a1, *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 272LL) + 24LL));
}
return result;
}

original_code:
static void BloadObjectPatterns(
  void *theEnv)
  {
   UNLN space;
   GenReadBinary(theEnv,(void *) &space,(UNLN) sizeof(UNLN));
   if (space == 0L)
     return;
   BloadandRefresh(theEnv,((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount,(unsigned) sizeof(BSAVE_OBJECT_ALPHA_NODE),UpdateAlpha);
   BloadandRefresh(theEnv,((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount,(unsigned) sizeof(BSAVE_OBJECT_PATTERN_NODE),UpdatePattern);
   SetObjectNetworkTerminalPointer(theEnv,(OBJECT_ALPHA_NODE *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray[0]);
   SetObjectNetworkPointer(theEnv,(OBJECT_PATTERN_NODE *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[0]);
  }

canonical_original_code:
static void BloadObjectPatterns(void *theEnv)
  {
   unsigned long space;
   GenReadBinary(theEnv,(void *) &space,(unsigned long) sizeof(UNLN));
   if (space == 0L)
     return;
   BloadandRefresh(theEnv,((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount,(unsigned int) sizeof(BSAVE_OBJECT_ALPHA_NODE),UpdateAlpha);
   BloadandRefresh(theEnv,((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount,(unsigned int) sizeof(BSAVE_OBJECT_PATTERN_NODE),UpdatePattern);
   SetObjectNetworkTerminalPointer(theEnv,(struct objectAlphaNode *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray[0]);
   SetObjectNetworkPointer(theEnv,(struct objectPatternNode *) &((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray[0]);
  }

user_defined_types: struct objectReteBinaryData { long AlphaNodeCount; long PatternNodeCount; struct objectAlphaNode *AlphaArray; struct objectPatternNode *PatternArray; }

user_defined_types: struct objectAlphaNode { struct patternNodeHeader header; unsigned long matchTimeTag; struct bitMapHashNode *classbmp; struct objectPatternNode *patternNode; struct objectAlphaNode *nxtInGroup; long bsaveID; }

user_defined_types: struct objectPatternNode { unsigned int blocked; unsigned int multifieldNode; unsigned int endSlot; unsigned int whichField; unsigned int leaveFields; unsigned long matchTimeTag; unsigned int slotNameID; struct expr *networkTest; struct objectPatternNode *nextLevel; struct objectPatternNode *lastLevel; struct objectPatternNode *leftNode; struct objectPatternNode *rightNode; struct objectAlphaNode *alphaNode; long bsaveID; }

user_defined_types: struct patternNodeHeader { struct partialMatch *alphaMemory; struct partialMatch *endOfQueue; struct joinNode *entryJoin; unsigned int singlefieldNode; unsigned int multifieldNode; unsigned int stopNode; unsigned int initialize; unsigned int marked; unsigned int beginSlot; unsigned int endSlot; }

user_defined_types: struct partialMatch { unsigned int betaMemory; unsigned int busy; unsigned int activationf; unsigned int dependentsf; unsigned int notOriginf; unsigned int counterf; unsigned int bcount; struct partialMatch *next; struct genericMatch binds[1]; }

user_defined_types: struct joinNode { unsigned int firstJoin; unsigned int logicalJoin; unsigned int joinFromTheRight; unsigned int patternIsNegated; unsigned int initialize; unsigned int marked; unsigned int rhsType; unsigned int depth; long bsaveID; struct partialMatch *beta; struct expr *networkTest; void *rightSideEntryStructure; struct joinNode *nextLevel; struct joinNode *lastLevel; struct joinNode *rightDriveNode; struct joinNode *rightMatchNode; struct defrule *ruleToActivate; }

user_defined_types: struct genericMatch { union { void *theValue; struct alphaMatch *theMatch; } gm; }

user_defined_types: struct defrule { struct constructHeader header; int salience; int localVarCnt; unsigned int complexity; unsigned int afterBreakpoint; unsigned int watchActivation; unsigned int watchFiring; unsigned int autoFocus; unsigned int executing; struct expr *dynamicSalience; struct expr *actions; struct joinNode *logicalJoin; struct joinNode *lastJoin; struct defrule *disjunct; }


BloadStorageObjectPatterns

decompiled_code:
__int64 __fastcall BloadStorageObjectPatterns(__int64 a1)
{
__int64 v1; // rdx
__int64 v2; // rax
__int64 v3; // rcx
_QWORD *v4; // rbx
__int64 v5; // rbx
__int64 result; // rax
__int64 v7; // rax
__int64 v8; // rdx
__int64 v9; // [rsp+8h] [rbp-30h] BYREF
__int64 v10[5]; // [rsp+10h] [rbp-28h] BYREF

GenReadBinary(a1, &v9, 8LL);
GenReadBinary(a1, v10, v9);
v1 = *(_QWORD *)(a1 + 32);
v2 = v10[0];
v3 = v10[1];
v4 = *(_QWORD **)(v1 + 272);
*v4 = v10[0];
v4[1] = v3;
if ( v2 )
{
v9 = 88 * v2;
v7 = genlongalloc(a1);
v8 = *(_QWORD *)(a1 + 32);
v4[2] = v7;
v5 = *(_QWORD *)(v8 + 272);
result = *(_QWORD *)(v5 + 8);
if ( !result )
goto LABEL_3;
}
else
{
v4[2] = 0LL;
v5 = *(_QWORD *)(v1 + 272);
result = *(_QWORD *)(v5 + 8);
if ( !result )
{
LABEL_3:
*(_QWORD *)(v5 + 24) = 0LL;
return result;
}
}
v9 = 80 * result;
result = genlongalloc(a1);
*(_QWORD *)(v5 + 24) = result;
return result;
}

original_code:
static void BloadStorageObjectPatterns(
  void *theEnv)
  {
   UNLN space;
   long counts[2];
   GenReadBinary(theEnv,(void *) &space,(UNLN) sizeof(UNLN));
   GenReadBinary(theEnv,(void *) counts,space);
   ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount = counts[0];
   ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount = counts[1];
   if (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount == 0L)
     ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray = ((void *)0);
   else
     {
      space = (UNLN) (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount * sizeof(OBJECT_ALPHA_NODE));
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray = (OBJECT_ALPHA_NODE *) genlongalloc(theEnv,space);
     }
   if (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount == 0L)
     ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray = ((void *)0);
   else
     {
      space = (UNLN) (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount * sizeof(OBJECT_PATTERN_NODE));
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray = (OBJECT_PATTERN_NODE *) genlongalloc(theEnv,space);
     }
  }

canonical_original_code:
static void BloadStorageObjectPatterns(void *theEnv)
  {
   unsigned long space;
   long counts[2];
   GenReadBinary(theEnv,(void *) &space,(unsigned long) sizeof(UNLN));
   GenReadBinary(theEnv,(void *) counts,space);
   ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount = counts[0];
   ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount = counts[1];
   if (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount == 0L)
     ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray = ((void *)0);
   else
     {
      space = (UNLN) (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaNodeCount * sizeof(OBJECT_ALPHA_NODE));
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->AlphaArray = (struct objectAlphaNode *) genlongalloc(theEnv,space);
     }
   if (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount == 0L)
     ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray = ((void *)0);
   else
     {
      space = (UNLN) (((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternNodeCount * sizeof(OBJECT_PATTERN_NODE));
      ((struct objectReteBinaryData *) (((struct environmentData *) theEnv)->theData[34]))->PatternArray = (struct objectPatternNode *) genlongalloc(theEnv,space);
     }
  }

variable_types:
counts
long [2]

user_defined_types: struct environmentData { unsigned int initialized; unsigned long environmentIndex; void *context; void *routerContext; void **theData; void (**cleanupFunctions)(void *); struct environmentCleanupFunction *listOfCleanupEnvironmentFunctions; struct environmentData *next; }

user_defined_types: struct environmentCleanupFunction { char *name; void (*func)(void *); int priority; struct environmentCleanupFunction *next; }

user_defined_types: struct bitMapHashNode { struct bitMapHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededBitMap; unsigned int bucket; char *contents; unsigned short size; }

user_defined_types: struct constructHeader { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader *whichModule; long bsaveID; struct constructHeader *next; struct userData *usrData; }

user_defined_types: struct alphaMatch { struct patternEntity *matchingItem; struct multifieldMarker *markers; struct alphaMatch *next; }

user_defined_types: struct defmoduleItemHeader { struct defmodule *theModule; struct constructHeader *firstItem; struct constructHeader *lastItem; }

user_defined_types: struct patternEntity { struct patternEntityRecord *theInfo; void *dependents; unsigned int busyCount; long timeTag; }

user_defined_types: struct defmodule { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader **itemsArray; struct portItem *importList; struct portItem *exportList; unsigned int visitedFlag; long bsaveID; struct userData *usrData; struct defmodule *next; }


SetupObjectPatternsBload

decompiled_code:
__int64 __fastcall SetupObjectPatternsBload(__int64 a1)
{
AllocateEnvironmentData(a1, 34LL, 32LL, DeallocateObjectReteBinaryData);
return AddBinaryItem(
a1,
"object patterns",
0LL,
BsaveObjectPatternsFind,
0LL,
BsaveStorageObjectPatterns,
BsaveObjectPatterns,
BloadStorageObjectPatterns,
BloadObjectPatterns,
ClearBloadObjectPatterns);
}

canonical_decompiled_code:
__int64 __fastcall func8(__int64 a1)
{
AllocateEnvironmentData(a1, 34LL, 32LL, DeallocateObjectReteBinaryData);
return AddBinaryItem(
a1,
"object patterns",
0LL,
BsaveObjectPatternsFind,
0LL,
BsaveStorageObjectPatterns,
BsaveObjectPatterns,
BloadStorageObjectPatterns,
BloadObjectPatterns,
ClearBloadObjectPatterns);
}

original_code:
void SetupObjectPatternsBload(
  void *theEnv)
  {
   AllocateEnvironmentData(theEnv,34,sizeof(struct objectReteBinaryData),DeallocateObjectReteBinaryData);
   AddBinaryItem(theEnv,"object patterns",0,BsaveObjectPatternsFind,((void *)0),
                             BsaveStorageObjectPatterns,BsaveObjectPatterns,
                             BloadStorageObjectPatterns,BloadObjectPatterns,
                             ClearBloadObjectPatterns);
  }

canonical_original_code:
void SetupObjectPatternsBload(void *theEnv)
  {
   AllocateEnvironmentData(theEnv,34,sizeof(struct objectReteBinaryData),DeallocateObjectReteBinaryData);
   AddBinaryItem(theEnv,"object patterns",0,BsaveObjectPatternsFind,((void *)0),
                             BsaveStorageObjectPatterns,BsaveObjectPatterns,
                             BloadStorageObjectPatterns,BloadObjectPatterns,
                             ClearBloadObjectPatterns);
  }

user_defined_types: struct expr { unsigned short type; void *value; struct expr *argList; struct expr *nextArg; }

user_defined_types: struct symbolHashNode { struct symbolHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededSymbol; unsigned int bucket; char *contents; }

user_defined_types: struct multifieldMarker { int whichField; union { void *whichSlot; short whichSlotNumber; } where; long startPosition; long endPosition; struct multifieldMarker *next; }

user_defined_types: struct patternEntityRecord { struct entityRecord base; void (*decrementBasisCount)(void *, void *); void (*incrementBasisCount)(void *, void *); void (*matchFunction)(void *, void *); int (*synchronized)(void *, void *); }

user_defined_types: struct portItem { struct symbolHashNode *moduleName; struct symbolHashNode *constructType; struct symbolHashNode *constructName; struct portItem *next; }

user_defined_types: struct entityRecord { char *name; unsigned int type; unsigned int copyToEvaluate; unsigned int bitMap; unsigned int addsToRuleComplexity; void (*shortPrintFunction)(void *, char *, void *); void (*longPrintFunction)(void *, char *, void *); int (*deleteFunction)(void *, void *); int (*evaluateFunction)(void *, void *, struct dataObject *); void *(*getNextFunction)(void *, void *); void (*decrementBusyCount)(void *, void *); void (*incrementBusyCount)(void *, void *); void (*propagateDepth)(void *, void *); void (*markNeeded)(void *, void *); void (*install)(void *, void *); void (*deinstall)(void *, void *); struct userData *usrData; }

user_defined_types: struct userData { unsigned char dataID; struct userData *next; }

user_defined_types: struct dataObject { void *supplementalInfo; unsigned short type; void *value; long begin; long end; struct dataObject *next; }


TestJoinForReuse

original_code:
static int TestJoinForReuse(
  struct joinNode *testJoin,
  unsigned firstJoin,
  unsigned negatedRHS,
  int isLogical,
  struct expr *joinTest,
  int endDepth,
  int currentDepth,
  int lastIteration,
  struct joinNode **nandReconnect)
  {
   if (testJoin->firstJoin != firstJoin) return(0);
   if (testJoin->patternIsNegated != negatedRHS) return(0);
   if ((isLogical == 1) &&
       (testJoin->logicalJoin == 0) &&
       (testJoin->beta != ((void *)0)))
     { return(0); }
   if (IdenticalExpression(testJoin->networkTest,joinTest) != 1)
     { return(0); }
   for (; endDepth < currentDepth; currentDepth--)
     {
      testJoin = testJoin->nextLevel;
      if (testJoin == ((void *)0)) return(0);
      if (testJoin->joinFromTheRight == 0)
        { return(0); }
      else if (nandReconnect[currentDepth-2] != testJoin->lastLevel)
        { return(0); }
     }
   if (lastIteration)
     {
      if (testJoin->ruleToActivate != ((void *)0)) return(0);
      if (testJoin->beta != ((void *)0)) return(0);
     }
   if ((! lastIteration) && (testJoin->nextLevel != ((void *)0)))
     {
      if (testJoin->nextLevel->joinFromTheRight == 1)
        {
         if (((struct joinNode *) testJoin->nextLevel->rightSideEntryStructure) == testJoin)
           { return(0); }
        }
     }
   return(1);
  }

canonical_original_code:
static int TestJoinForReuse(struct joinNode *testJoin, unsigned int firstJoin, unsigned int negatedRHS, int isLogical, struct expr *joinTest, int endDepth, int currentDepth, int lastIteration, struct joinNode **nandReconnect)
  {
   if (testJoin->firstJoin != firstJoin) return(0);
   if (testJoin->patternIsNegated != negatedRHS) return(0);
   if ((isLogical == 1) &&
       (testJoin->logicalJoin == 0) &&
       (testJoin->beta != ((void *)0)))
     { return(0); }
   if (IdenticalExpression(testJoin->networkTest,joinTest) != 1)
     { return(0); }
   for (; endDepth < currentDepth; currentDepth--)
     {
      testJoin = testJoin->nextLevel;
      if (testJoin == ((void *)0)) return(0);
      if (testJoin->joinFromTheRight == 0)
        { return(0); }
      else if (nandReconnect[currentDepth-2] != testJoin->lastLevel)
        { return(0); }
     }
   if (lastIteration)
     {
      if (testJoin->ruleToActivate != ((void *)0)) return(0);
      if (testJoin->beta != ((void *)0)) return(0);
     }
   if ((! lastIteration) && (testJoin->nextLevel != ((void *)0)))
     {
      if (testJoin->nextLevel->joinFromTheRight == 1)
        {
         if (((struct joinNode *) testJoin->nextLevel->rightSideEntryStructure) == testJoin)
           { return(0); }
        }
     }
   return(1);
  }

variable_types: struct joinNode { unsigned int firstJoin; unsigned int logicalJoin; unsigned int joinFromTheRight; unsigned int patternIsNegated; unsigned int initialize; unsigned int marked; unsigned int rhsType; unsigned int depth; long bsaveID; struct partialMatch { unsigned int betaMemory; unsigned int busy; unsigned int activationf; unsigned int dependentsf; unsigned int notOriginf; unsigned int counterf; unsigned int bcount; struct partialMatch *next; struct genericMatch { union { void *theValue; struct alphaMatch { struct patternEntity { struct patternEntityRecord { struct entityRecord { char *name; unsigned int type; unsigned int copyToEvaluate; unsigned int bitMap; unsigned int addsToRuleComplexity; void (*shortPrintFunction)(void *, char *, void *); void (*longPrintFunction)(void *, char *, void *); int (*deleteFunction)(void *, void *); int (*evaluateFunction)(void *, void *, struct dataObject { void *supplementalInfo; unsigned short type; void *value; long begin; long end; struct dataObject *next; } *); void *(*getNextFunction)(void *, void *); void (*decrementBusyCount)(void *, void *); void (*incrementBusyCount)(void *, void *); void (*propagateDepth)(void *, void *); void (*markNeeded)(void *, void *); void (*install)(void *, void *); void (*deinstall)(void *, void *); struct userData { unsigned char dataID; struct userData *next; } *usrData; } base; void (*decrementBasisCount)(void *, void *); void (*incrementBasisCount)(void *, void *); void (*matchFunction)(void *, void *); int (*synchronized)(void *, void *); } *theInfo; void *dependents; unsigned int busyCount; long timeTag; } *matchingItem; struct multifieldMarker { int whichField; union { void *whichSlot; short whichSlotNumber; } where; long startPosition; long endPosition; struct multifieldMarker *next; } *markers; struct alphaMatch *next; } *theMatch; } gm; } binds[1]; } *beta; struct expr { unsigned short type; void *value; struct expr *argList; struct expr *nextArg; } *networkTest; void *rightSideEntryStructure; struct joinNode *nextLevel; struct joinNode *lastLevel; struct joinNode *rightDriveNode; struct joinNode *rightMatchNode; struct defrule { struct constructHeader { struct symbolHashNode { struct symbolHashNode *next; long count; int depth; unsigned int permanent; unsigned int markedEphemeral; unsigned int neededSymbol; unsigned int bucket; char *contents; } *name; char *ppForm; struct defmoduleItemHeader { struct defmodule { struct symbolHashNode *name; char *ppForm; struct defmoduleItemHeader **itemsArray; struct portItem { struct symbolHashNode *moduleName; struct symbolHashNode *constructType; struct symbolHashNode *constructName; struct portItem *next; } *importList; struct portItem *exportList; unsigned int visitedFlag; long bsaveID; struct userData *usrData; struct defmodule *next; } *theModule; struct constructHeader *firstItem; struct constructHeader *lastItem; } *whichModule; long bsaveID; struct constructHeader *next; struct userData *usrData; } header; int salience; int localVarCnt; unsigned int complexity; unsigned int afterBreakpoint; unsigned int watchActivation; unsigned int watchFiring; unsigned int autoFocus; unsigned int executing; struct expr *dynamicSalience; struct expr *actions; struct joinNode *logicalJoin; struct joinNode *lastJoin; struct defrule *disjunct; } *ruleToActivate; } *

variable_types:
firstJoin
unsigned int

variable_types:
negatedRHS
unsigned int

variable_types: isLogical int

variable_types:
joinTest
struct expr *

variable_types: endDepth int

variable_types: currentDepth int

variable_types: lastIteration int

variable_types:
nandReconnect
struct joinNode **

return_type: int

user_defined_types: struct joinNode { unsigned int firstJoin; unsigned int logicalJoin; unsigned int joinFromTheRight; unsigned int patternIsNegated; unsigned int initialize; unsigned int marked; unsigned int rhsType; unsigned int depth; long bsaveID; struct partialMatch *beta; struct expr *networkTest; void *rightSideEntryStructure; struct joinNode *nextLevel; struct joinNode *lastLevel; struct joinNode *rightDriveNode; struct joinNode *rightMatchNode; struct defrule *ruleToActivate; }

user_defined_types: struct partialMatch { unsigned int betaMemory; unsigned int busy; unsigned int activationf; unsigned int dependentsf; unsigned int notOriginf; unsigned int counterf; unsigned int bcount; struct partialMatch *next; struct genericMatch binds[1]; }

user_defined_types: struct defrule { struct constructHeader header; int salience; int localVarCnt; unsigned int complexity; unsigned int afterBreakpoint; unsigned int watchActivation; unsigned int watchFiring; unsigned int autoFocus; unsigned int executing; struct expr *dynamicSalience; struct expr *actions; struct joinNode *logicalJoin; struct joinNode *lastJoin; struct defrule *disjunct; }

user_defined_types: struct genericMatch { union { void *theValue; struct alphaMatch *theMatch; } gm; }