public static Cons yieldContextSensitiveSlotValueTree(StorageSlot slot, Stella_Object objectref, StandardObject returntype, Cons csoptions, Object [] MV_returnarray) {
    { boolean contextsensitiveP = !((csoptions != null) &&
          (Cons.searchPlist(csoptions, Stella.KWD_CONTEXT_SENSITIVEp) == Stella.SYM_STELLA_FALSE));
      Symbol dontinheritP = (((csoptions != null) &&
          (Cons.searchPlist(csoptions, Stella.KWD_DONT_INHERITp) == Stella.SYM_STELLA_TRUE)) ? Stella.SYM_STELLA_TRUE : Stella.SYM_STELLA_FALSE);
      Stella_Object objectrefcopy = objectref;
      boolean onceonlywrapperP = contextsensitiveP &&
          (!Stella_Object.sideEffectFreeExpressionP(objectref));
      boolean literalslotP = Slot.slotValueIsBareLiteralP(slot);
      Surrogate realbasetype = slot.slotBaseType;
      CompoundTypeSpecifier realtypespec = ((CompoundTypeSpecifier)(KeyValueList.dynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_TYPE_SPECIFIER, null)));
      Stella_Object oldvaluetree = null;
      Symbol oldvalueref = Stella.localGensym("OLD-VALUE");
      Cons accesstree = null;

      if (onceonlywrapperP) {
        objectref = Stella.localGensym("OBJECT");
        Symbol.pushVariableBinding(((Symbol)(objectref)), slot.slotOwner);
      }
      else {
        objectref = Stella_Object.sysTree(Stella_Object.walkWithoutTypeTree(objectref), slot.slotOwner, new Object[1]);
      }
      slot.slotBaseType = Stella.SGT_STELLA_OBJECT;
      if (realtypespec != null) {
        KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_TYPE_SPECIFIER, null, null);
      }
      slot.slotContextSensitiveP = false;
      oldvaluetree = Stella_Object.sysTree(Stella_Object.walkWithoutTypeTree(Cons.list$(Cons.cons(Stella.SYM_STELLA_SLOT_VALUE, Cons.cons((contextsensitiveP ? Stella_Object.copyConsTree(objectref) : objectref), Cons.cons(Cons.cons(slot.slotName, Stella.NIL), Stella.NIL))))), Stella.SGT_STELLA_OBJECT, new Object[1]);
      slot.slotBaseType = realbasetype;
      if (realtypespec != null) {
        KeyValueList.setDynamicSlotValue(slot.dynamicSlots, Stella.SYM_STELLA_SLOT_TYPE_SPECIFIER, realtypespec, null);
      }
      slot.slotContextSensitiveP = true;
      if (!contextsensitiveP) {
        { Cons _return_temp = ((Cons)(oldvaluetree));

          MV_returnarray[0] = Stella.SGT_STELLA_OBJECT;
          return (_return_temp);
        }
      }
      if (onceonlywrapperP) {
        Stella.popVariableBinding();
      }
      accesstree = Cons.list$(Cons.cons(Stella.SYM_STELLA_SAFE_CAST, Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_ACCESS_IN_CONTEXT, Cons.cons((onceonlywrapperP ? oldvalueref : oldvaluetree), Cons.cons(Cons.list$(Cons.cons(Cons.list$(Cons.cons(Stella.SYM_STELLA_HOME_CONTEXT, Cons.cons(objectref, Cons.cons(Stella.NIL, Stella.NIL)))), Cons.cons(dontinheritP, Cons.cons(Stella.NIL, Stella.NIL)))), Stella.NIL)))), Cons.cons(StandardObject.yieldTypeSpecTree((literalslotP ? slot.type().typeToWrappedType() : ((StandardObject)(returntype)))), Cons.cons(Stella.NIL, Stella.NIL)))));
      if (literalslotP) {
        accesstree = Cons.list$(Cons.cons(Stella.SYM_STELLA_WRAPPER_VALUE, Cons.cons(accesstree, Cons.cons(Stella.NIL, Stella.NIL))));
      }
      if (onceonlywrapperP) {
        { Cons _return_temp = Cons.list$(Cons.cons(Stella.SYM_STELLA_VRLET, Cons.cons(Cons.list$(Cons.cons(Cons.cons(objectref, Cons.cons(objectrefcopy, Stella.NIL)), Cons.cons(Cons.cons(oldvalueref, Cons.cons(oldvaluetree, Stella.NIL)), Cons.cons(Stella.NIL, Stella.NIL)))), Cons.cons(accesstree, Cons.cons(Stella.NIL, Stella.NIL)))));

          MV_returnarray[0] = returntype;
          return (_return_temp);
        }
      }
      else {
        { Cons _return_temp = ((Cons)(Stella_Object.walkWithoutTypeTree(accesstree)));

          MV_returnarray[0] = returntype;
          return (_return_temp);
        }
      }
    }
  }