public static Slot lookupVisibleSlot(Stella_Class renamed_Class, Stella_Object slotName) {
    { Slot slot = null;
      String slotnamestring = null;
      Module module = ((Module)(Stella.$MODULE$.get()));

      { Surrogate testValue000 = Stella_Object.safePrimaryType(slotName);

        if (Surrogate.subtypeOfSymbolP(testValue000)) {
          { Symbol slotName000 = ((Symbol)(slotName));

            slot = Stella_Class.lookupSlot(renamed_Class, slotName000);
            if (slot != null) {
              return (slot);
            }
            slotnamestring = slotName000.symbolName;
            module = ((Module)(slotName000.homeContext));
          }
        }
        else if (Surrogate.subtypeOfSurrogateP(testValue000)) {
          { Surrogate slotName000 = ((Surrogate)(slotName));

            slotnamestring = slotName000.symbolName;
            module = ((Module)(slotName000.homeContext));
          }
        }
        else if (Surrogate.subtypeOfKeywordP(testValue000)) {
          { Keyword slotName000 = ((Keyword)(slotName));

            slotnamestring = slotName000.symbolName;
          }
        }
        else if (Surrogate.subtypeOfStringP(testValue000)) {
          { StringWrapper slotName000 = ((StringWrapper)(slotName));

            slotnamestring = slotName000.wrapperValue;
          }
        }
        else {
          { OutputStringStream stream000 = OutputStringStream.newOutputStringStream();

            stream000.nativeStream.print("Illegal slot name: `" + slotName + "'");
            throw ((StellaException)(StellaException.newStellaException(stream000.theStringReader()).fillInStackTrace()));
          }
        }
      }
      { Symbol symbol = null;
        Cons iter000 = Stella.lookupVisibleSymbolsInModule(slotnamestring, module, true);

        for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
          symbol = ((Symbol)(iter000.value));
          slot = Stella_Class.lookupSlot(renamed_Class, symbol);
          if (slot != null) {
            return (slot);
          }
        }
      }
      return (null);
    }
  }