public static Stella_Object expandMacro(Cons tree) {
    { Symbol macroname = ((Symbol)(tree.value));
      MethodSlot expanderobject = Symbol.lookupMacro(macroname);
      java.lang.reflect.Method expandercode = expanderobject.functionCode;
      Cons args = tree.rest;
      Stella_Object expansion = null;

      if (expandercode == null) {
        { Object old$PrintreadablyP$000 = Stella.$PRINTREADABLYp$.get();

          try {
            Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
            Stella.signalTranslationError();
            if (!(Stella.suppressWarningsP())) {
              Stella.printErrorContext(">> ERROR: ", Stella.STANDARD_ERROR);
              {
                Stella.STANDARD_ERROR.nativeStream.println();
                Stella.STANDARD_ERROR.nativeStream.println(" Macro expander code for `" + Stella_Object.deUglifyParseTree(macroname) + "' is not available.");
              }
;
            }

          } finally {
            Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$000);
          }
        }
        return (Stella_Object.walkDontCallMeTree(tree, Stella.SGT_STELLA_UNKNOWN, new Object[1]));
      }
      if (((BooleanWrapper)(KeyValueList.dynamicSlotValue(expanderobject.dynamicSlots, Stella.SYM_STELLA_METHOD_BODY_ARGUMENTp, Stella.FALSE_WRAPPER))).wrapperValue) {
        switch (expanderobject.methodArgumentCount()) {
          case 1: 
            expansion = ((Stella_Object)(edu.isi.stella.javalib.Native.funcall(expandercode, null, new java.lang.Object [] {args})));
            tree.rest = Stella.NIL;
          break;
          case 2: 
            expansion = ((Stella_Object)(edu.isi.stella.javalib.Native.funcall(expandercode, null, new java.lang.Object [] {args.value, args.rest})));
            args.rest = Stella.NIL;
          break;
          case 3: 
            expansion = ((Stella_Object)(edu.isi.stella.javalib.Native.funcall(expandercode, null, new java.lang.Object [] {args.value, args.rest.value, args.rest.rest})));
            args.rest.rest = Stella.NIL;
          break;
          case 4: 
            expansion = ((Stella_Object)(edu.isi.stella.javalib.Native.funcall(expandercode, null, new java.lang.Object [] {args.value, args.rest.value, args.rest.rest.value, args.nthRest(3)})));
            args.nthRestSetter(Stella.NIL, 3);
          break;
          case 5: 
            expansion = ((Stella_Object)(edu.isi.stella.javalib.Native.funcall(expandercode, null, new java.lang.Object [] {args.value, args.rest.value, args.rest.rest.value, args.fourth(), args.nthRest(4)})));
            args.nthRestSetter(Stella.NIL, 4);
          break;
          default:
            { Object old$PrintreadablyP$001 = Stella.$PRINTREADABLYp$.get();

              try {
                Native.setBooleanSpecial(Stella.$PRINTREADABLYp$, true);
                Stella.signalTranslationError();
                if (!(Stella.suppressWarningsP())) {
                  Stella.printErrorContext(">> ERROR: ", Stella.STANDARD_ERROR);
                  {
                    Stella.STANDARD_ERROR.nativeStream.println();
                    Stella.STANDARD_ERROR.nativeStream.println(" Too many arguments in definition of macro `" + Stella_Object.deUglifyParseTree(macroname) + "'.");
                  }
;
                }

              } finally {
                Stella.$PRINTREADABLYp$.set(old$PrintreadablyP$001);
              }
            }
            return (Stella_Object.walkDontCallMeTree(tree, Stella.SGT_STELLA_UNKNOWN, new Object[1]));
        }
      }
      else {
        expansion = Stella.apply(expandercode, tree.rest);
      }
      return (expansion);
    }
  }