public static Stella_Object lookupVariableInBindings(Stella_Object obj1, Stella_Object obj2, List bindings) {
    { Cons bind = null;
      Cons iter000 = bindings.theConsList;

      for (;!(iter000 == Stella.NIL); iter000 = iter000.rest) {
        bind = ((Cons)(iter000.value));
        if (Stella_Object.equalConsTreesP(bind.value, obj1) &&
            Stella_Object.equalConsTreesP(bind.rest.value, obj2)) {
          return (bind.rest.rest.value);
        }
      }
    }
    if (Stella_Object.consP(obj1) &&
        Stella_Object.consP(obj2)) {
      { Cons answer = Stella.NIL;
        Stella_Object bind = null;

        { Stella_Object arg1 = null;
          Cons iter001 = ((Cons)(obj1));
          Stella_Object arg2 = null;
          Cons iter002 = ((Cons)(obj2));

          for (;(!(iter001 == Stella.NIL)) &&
                    (!(iter002 == Stella.NIL)); iter001 = iter001.rest, iter002 = iter002.rest) {
            arg1 = iter001.value;
            arg2 = iter002.value;
            if (Stella_Object.eqlP(arg1, arg2)) {
              answer = Cons.cons(arg1, answer);
            }
            else {
              {
                bind = Logic.lookupVariableInBindings(arg1, arg2, bindings);
                if (bind == null) {
                  return (null);
                }
                answer = Cons.cons(bind, answer);
              }
            }
          }
        }
        return (answer.reverse());
      }
    }
    return (null);
  }