public static Module lookupFunctionHomeModule(Symbol functionsymbol) {
    functionsymbol = functionsymbol.softPermanentify();
    { StandardObject function = ((StandardObject)(Stella.$FUNCTION_LOOKUP_TABLE$.lookup(functionsymbol)));

      if (function == null) {
        return (null);
      }
      { Surrogate testValue000 = function.primaryType();

        if (testValue000 == Stella.SGT_STELLA_VECTOR) {
          return (Stella.getStellaModule(((StringWrapper)((((Vector)(function)).theArray)[2])).wrapperValue, true));
        }
        else if (testValue000 == Stella.SGT_STELLA_METHOD_SLOT) {
          return (function.homeModule());
        }
        else {
          return (null);
        }
      }
    }
  }