      SUBROUTINE BENCH
      DIMENSION INP(2100),IOP(2100),IOB(2100)
        COMMON INP,IOP,IOB
      ICL=2**14
      DO 200 K=1,2048
      IOP(K)=K
200   CONTINUE
      IA=0
108   ICN=0
      IA=IA+1
      IB=2**IA
      DO 120 I=1,2048,IB
      IC=I+IB-1
      DO 104 K=1,IB
      JA=I
      DO 106 J=I,IC
      IF(IOP(J)-ICL)130,106,106
130   IF(IOP(JA)-ICL)107,109,109
107   K1=IOP(JA)
      K2=IOP(J)
      IF(INP(K1)-INP(K2))106,106,109
109   JA=J
106   CONTINUE
      ICN=ICN+1
      IOB(ICN)=IOP(JA)
      IOP(JA)=ICL
104   CONTINUE
120   CONTINUE
      DO 105 JJ=1,ICN
      IOP(JJ)=IOB(JJ)
105   CONTINUE
      IF(IB-2048)108,400,400
400   DO 110 M=1,ICN
      K=IOP(M)
      IOB(M)=INP(K)
110   CONTINUE
      RETURN
      END
