public static int goalHashCode(ControlFrame frame) {
    { Proposition proposition = frame.proposition;
      Surrogate operator = Proposition.cachedGoalOperator(proposition);
      Vector arguments = proposition.arguments;
      int code = 0;

      code = ((Context)(Stella.$CONTEXT$.get())).hashCode_();
      if (frame.reversePolarityP) {
        code = (((((code & 1) == 0) ? (code >>> 1) : (((code >> 1)) | Stella.$INTEGER_MSB_MASK$))) ^ 8312004);
      }
      code = (((((code & 1) == 0) ? (code >>> 1) : (((code >> 1)) | Stella.$INTEGER_MSB_MASK$))) ^ (Stella_Object.safeHashCode(operator)));
      { Stella_Object arg = null;
        Vector vector000 = arguments;
        int index000 = 0;
        int length000 = vector000.length();
        Stella_Object argvalue = null;
        Cons iter000 = frame.goalBindings;

        loop000 : for (;(index000 < length000) &&
                  (!(iter000 == Stella.NIL)); index000 = index000 + 1, iter000 = iter000.rest) {
          arg = (vector000.theArray)[index000];
          argvalue = iter000.value;
          if (argvalue == null) {
            argvalue = (((QueryIterator)(Logic.$QUERYITERATOR$.get())).currentPatternRecord.variableBindings.theArray)[(((PatternVariable)(arg)).boundToOffset)];
            if (argvalue == null) {
              code = PatternVariable.hashUnboundGoalVariable(((PatternVariable)(arg)), arguments, code);
              continue loop000;
            }
          }
          code = Logic.hashGoalArgument(argvalue, code);
        }
      }
      return (code);
    }
  }