public static void registerUnfinalizedObject(Stella_Object renamed_Object) {
    { Surrogate testValue000 = Stella_Object.safePrimaryType(renamed_Object);

      if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_LOGIC_OBJECT)) {
        { LogicObject object000 = ((LogicObject)(renamed_Object));

          Logic.$UNFINALIZED_OBJECTS$.push(object000);
        }
      }
      else if (Surrogate.subtypeOfP(testValue000, Logic.SGT_LOGIC_PROPOSITION)) {
        { Proposition object000 = ((Proposition)(renamed_Object));

          Logic.$UNFINALIZED_OBJECTS$.push(object000);
        }
      }
      else {
        { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

          stream000.nativeStream.print("INTERNAL ERROR: can't register objects of type `" + renamed_Object.primaryType() + "' for finalization");
          throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
        }
      }
    }
    if (((Boolean)(Logic.$FINALIZEOBJECTSIMMEDIATELYp$.get())).booleanValue()) {
      Logic.finalizeObjects();
    }
  }