public static int findReferenceStart(String input, int start, int end) {
    if (end == Stella.NULL_INTEGER) {
      end = input.length() - 1;
    }
    { int i = Stella.NULL_INTEGER;
      int iter000 = start;
      int upperBound000 = end;
      boolean unboundedP000 = upperBound000 == Stella.NULL_INTEGER;

      for (;unboundedP000 ||
                (iter000 <= upperBound000); iter000 = iter000 + 1) {
        i = iter000;
        if ((input.charAt(i) == '&') ||
            (input.charAt(i) == '%')) {
          return (i);
        }
      }
    }
    return (Stella.NULL_INTEGER);
  }