public static boolean bindToSurrogateP(Stella_Object self, String name, boolean clipoldvalueP, boolean askforpermissionP, Object [] MV_returnarray) {
    { Surrogate oldsurrogate = Surrogate.lookupSurrogate(name);
      Stella_Object oldvalue = ((oldsurrogate != null) ? oldsurrogate.surrogateValue : ((Stella_Object)(null)));
      Surrogate surrogate = Stella.shadowSurrogate(name);
      Module oldmodule = null;

      if (oldvalue == null) {
        surrogate.surrogateValue = self;
        { boolean _return_temp = true;

          MV_returnarray[0] = null;
          MV_returnarray[1] = surrogate;
          return (_return_temp);
        }
      }
      if (Stella_Object.eqlP(oldvalue, self)) {
        { boolean _return_temp = true;

          MV_returnarray[0] = null;
          MV_returnarray[1] = surrogate;
          return (_return_temp);
        }
      }
      oldmodule = ((Module)(oldsurrogate.homeContext));
      if (!(oldmodule == ((Module)(Stella.$MODULE$.get())))) {
        surrogate.surrogateValue = self;
        if (askforpermissionP) {
          Stella.STANDARD_WARNING.nativeStream.println("Warning: Shadowing the `" + self.primaryType().symbolName + "' named `" + name + "'");
          {
            System.out.println("CAUTION: Automatic shadowing can be dangerous, because forward ");
            System.out.println("   references to a shadowed object may be bound to the now-shadowed ");
            System.out.println("   object.  Suggestion: Explicitly shadow the name using");
            System.out.println("   DEFMODULE's `:shadow' option.");
          }
;
          if (Stella.yesOrNoP("Do it anyway? ")) {
            surrogate.surrogateValue = self;
            { boolean _return_temp = true;

              MV_returnarray[0] = oldvalue;
              MV_returnarray[1] = surrogate;
              return (_return_temp);
            }
          }
        }
        { boolean _return_temp = true;

          MV_returnarray[0] = null;
          MV_returnarray[1] = surrogate;
          return (_return_temp);
        }
      }
      else if (clipoldvalueP) {
        if (((Boolean)(Stella.$WARNIFREDEFINEp$.get())).booleanValue()) {
          System.out.println("Redefining the `" + self.primaryType().symbolName + "' named `" + name + "'");
        }
        surrogate.surrogateValue = self;
        if (!(self.primaryType() == oldvalue.primaryType())) {
          oldvalue = null;
        }
        { boolean _return_temp = true;

          MV_returnarray[0] = oldvalue;
          MV_returnarray[1] = surrogate;
          return (_return_temp);
        }
      }
      else {
        if (askforpermissionP) {
          {
            Stella.STANDARD_WARNING.nativeStream.println("Warning: Can't define the `" + self.primaryType().symbolName + "' named `" + name + "' in module `" + ((Module)(Stella.$MODULE$.get())) + "'");
            Stella.STANDARD_WARNING.nativeStream.println("   because that term is already bound to `" + oldvalue + "'");
            Stella.STANDARD_WARNING.nativeStream.println();
          }
;
          if (Stella.yesOrNoP("Do it anyway? ")) {
            surrogate.surrogateValue = self;
            { boolean _return_temp = true;

              MV_returnarray[0] = oldvalue;
              MV_returnarray[1] = surrogate;
              return (_return_temp);
            }
          }
        }
        { boolean _return_temp = false;

          MV_returnarray[0] = null;
          MV_returnarray[1] = surrogate;
          return (_return_temp);
        }
      }
    }
  }