public static Stella_Object lookupObjectFromSpecification(Stella_Object specification) {
    { Stella_Object renamed_Object = null;

      { Surrogate testValue000 = Stella_Object.safePrimaryType(specification);

        if (Surrogate.subtypeOfSurrogateP(testValue000)) {
          { Surrogate specification000 = ((Surrogate)(specification));

            renamed_Object = ((Stella_Class)(specification000.surrogateValue));
          }
        }
        else if (Surrogate.subtypeOfSymbolP(testValue000)) {
          { Symbol specification000 = ((Symbol)(specification));

            renamed_Object = Symbol.lookupFunction(specification000);
            if (renamed_Object == null) {
              renamed_Object = specification000.lookupGlobalVariable();
            }
            if (renamed_Object == null) {
              renamed_Object = specification000.lookupClass();
            }
            if (renamed_Object == null) {
              renamed_Object = Stella.string_getObject(specification000.symbolName, null);
            }
          }
        }
        else if (testValue000 == Utilities.SGT_STELLA_CONS) {
          { Cons specification000 = ((Cons)(specification));

            { Symbol classsymbol = ((Symbol)(specification000.rest.value));
              Stella_Class renamed_Class = null;

              { Object old$Module$000 = Stella.$MODULE$.get();
                Object old$Context$000 = Stella.$CONTEXT$.get();

                try {
                  Native.setSpecial(Stella.$MODULE$, ((Module)(classsymbol.homeContext)));
                  Native.setSpecial(Stella.$CONTEXT$, ((Module)(Stella.$MODULE$.get())));
                  renamed_Class = ((Symbol)(specification000.rest.value)).getStellaClass(false);

                } finally {
                  Stella.$CONTEXT$.set(old$Context$000);
                  Stella.$MODULE$.set(old$Module$000);
                }
              }
              if (renamed_Class == null) {
                System.out.print("Can't find a class named " + specification000.rest.value);
                return (null);
              }
              return (Stella_Class.lookupSlot(renamed_Class, ((Symbol)(specification000.value))));
            }
          }
        }
        else if (Surrogate.subtypeOfStringP(testValue000)) {
          { StringWrapper specification000 = ((StringWrapper)(specification));

            renamed_Object = Stella.getStellaModule(specification000.wrapperValue, false);
          }
        }
        else {
        }
      }
      return (renamed_Object);
    }
  }