public static void transferDemonsFromOldclass(Stella_Class oldclass, Stella_Class newclass) {
    { Slot newslot = null;

      { Slot oldslot = null;
        Cons iter000 = oldclass.classLocalSlots.theConsList;

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          oldslot = ((Slot)(iter000.value));
          { 
            newslot = Stella_Class.lookupLocalSlot(newclass, oldslot.slotName);
            if (newslot != null) {
              if (Surrogate.subtypeOfStorageSlotP(Stella_Object.safePrimaryType(oldslot))) {
                { StorageSlot oldslot000 = ((StorageSlot)(oldslot));

                  if (Surrogate.subtypeOfStorageSlotP(Stella_Object.safePrimaryType(newslot))) {
                    { StorageSlot newslot000 = ((StorageSlot)(newslot));

                      KeyValueList.setDynamicSlotValue(newslot000.dynamicSlots, Stella.SYM_STELLA_SLOT_GUARD_DEMONS, oldslot000.slotGuardDemons(), null);
                      KeyValueList.setDynamicSlotValue(oldslot000.dynamicSlots, Stella.SYM_STELLA_SLOT_GUARD_DEMONS, null, null);
                      KeyValueList.setDynamicSlotValue(newslot000.dynamicSlots, Stella.SYM_STELLA_SLOT_DEMONS, oldslot000.slotDemons(), null);
                      KeyValueList.setDynamicSlotValue(oldslot000.dynamicSlots, Stella.SYM_STELLA_SLOT_DEMONS, null, null);
                    }
                  }
                  else {
                  }
                }
              }
              else {
              }
            }
          }
        }
      }
    }
    KeyValueList.setDynamicSlotValue(newclass.dynamicSlots, Stella.SYM_STELLA_CLASS_CONSTRUCTOR_DEMONS, oldclass.classConstructorDemons(), null);
    KeyValueList.setDynamicSlotValue(oldclass.dynamicSlots, Stella.SYM_STELLA_CLASS_CONSTRUCTOR_DEMONS, null, null);
    KeyValueList.setDynamicSlotValue(newclass.dynamicSlots, Stella.SYM_STELLA_CLASS_GUARD_CONSTRUCTOR_DEMONS, oldclass.classGuardConstructorDemons(), null);
    KeyValueList.setDynamicSlotValue(oldclass.dynamicSlots, Stella.SYM_STELLA_CLASS_GUARD_CONSTRUCTOR_DEMONS, null, null);
    KeyValueList.setDynamicSlotValue(newclass.dynamicSlots, Stella.SYM_STELLA_CLASS_DESTRUCTOR_DEMONS, oldclass.classDestructorDemons(), null);
    KeyValueList.setDynamicSlotValue(oldclass.dynamicSlots, Stella.SYM_STELLA_CLASS_DESTRUCTOR_DEMONS, null, null);
    KeyValueList.setDynamicSlotValue(newclass.dynamicSlots, Stella.SYM_STELLA_CLASS_GUARD_DESTRUCTOR_DEMONS, oldclass.classGuardDestructorDemons(), null);
    KeyValueList.setDynamicSlotValue(oldclass.dynamicSlots, Stella.SYM_STELLA_CLASS_GUARD_DESTRUCTOR_DEMONS, null, null);
  }