      SUBROUTINE MAIN
      LOGICAL*1 BUF(400)
      INTEGER GETARG, OPEN, INDEX
      INTEGER I, FILE(2), J
      COMMON /CCOMM/ ONE, TWO, THREE
      INTEGER ONE
      INTEGER TWO
      INTEGER THREE
      ONE = 1
      TWO = 1
      THREE = 1
      J = 0
      I=1
23000 IF(.NOT.(GETARG(I,BUF,400).NE.-1))GOTO 23002
      IF(.NOT.(BUF(1) .EQ. 63 .AND. BUF(2) .EQ. 0))GOTO 23003
      CALL ERROR (27Husage:  [-123] file1 file2.)
23003 CONTINUE
      IF(.NOT.(J .EQ. 2))GOTO 23005
      GOTO 23002
23005 CONTINUE
      IF(.NOT.(BUF(1) .EQ. 45 .AND. BUF(2) .NE. 0))GOTO 23007
      IF(.NOT.(INDEX(BUF, 49) .EQ. 0))GOTO 23009
      ONE = 0
23009 CONTINUE
      IF(.NOT.(INDEX(BUF, 50) .EQ. 0))GOTO 23011
      TWO = 0
23011 CONTINUE
      IF(.NOT.(INDEX(BUF, 51) .EQ. 0))GOTO 23013
      THREE = 0
23013 CONTINUE
      GOTO 23008
23007 CONTINUE
      IF(.NOT.(BUF(1) .EQ. 45))GOTO 23015
      J = J + 1
      FILE(J) = 1
      GOTO 23016
23015 CONTINUE
      J = J + 1
      FILE(J) = OPEN(BUF,1)
      IF(.NOT.(FILE(J) .EQ. -3))GOTO 23017
      CALL CANT(BUF)
23017 CONTINUE
23016 CONTINUE
23008 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      IF(.NOT.(J .EQ. 0))GOTO 23019
      CALL ERROR (32Husage:  comm [-123] file1 file2.)
23019 CONTINUE
      IF(.NOT.(J .EQ. 1))GOTO 23021
      FILE(2) = 1
23021 CONTINUE
      CALL COMMON(FILE(1), FILE(2))
      RETURN
      END
      SUBROUTINE COMMON(FILE1, FILE2)
      INTEGER FILE1, FILE2, K, STAT1, STAT2
      INTEGER GETLIN
      LOGICAL*1 BUF1(400), BUF2(400)
      INTEGER CMPAR
      STAT1 = GETLIN(BUF1,FILE1)
      STAT2 = GETLIN(BUF2,FILE2)
23023 CONTINUE
      IF(.NOT.(STAT1 .EQ. -1 .OR. STAT2 .EQ. -1))GOTO 23026
      GOTO 23025
23026 CONTINUE
      K = CMPAR(BUF1, BUF2)
      IF(.NOT.(K .LT. 0))GOTO 23028
      CALL COL1(BUF1)
      STAT1 = GETLIN(BUF1, FILE1)
      GOTO 23029
23028 CONTINUE
      IF(.NOT.(K .GT. 0))GOTO 23030
      CALL COL2(BUF2)
      STAT2 = GETLIN(BUF2, FILE2)
      GOTO 23031
23030 CONTINUE
      CALL COL3(BUF1)
      STAT1 = GETLIN(BUF1, FILE1)
      STAT2 = GETLIN(BUF2, FILE2)
23031 CONTINUE
23029 CONTINUE
23024 GOTO 23023
23025 CONTINUE
      IF(.NOT.(STAT1 .EQ. -1 .AND. TWO .EQ. 1))GOTO 23032
23034 IF(.NOT.(STAT2 .NE. -1))GOTO 23035
      CALL COL2(BUF2)
      STAT2 = GETLIN(BUF2, FILE2)
      GOTO 23034
23035 CONTINUE
      GOTO 23033
23032 CONTINUE
      IF(.NOT.(STAT2 .EQ. -1 .AND. ONE .EQ. 1))GOTO 23036
23038 IF(.NOT.(STAT1 .NE. -1))GOTO 23039
      CALL COL1(BUF1)
      STAT1 = GETLIN(BUF1, FILE1)
      GOTO 23038
23039 CONTINUE
23036 CONTINUE
23033 CONTINUE
      RETURN
      END
      INTEGER FUNCTION CMPAR(LIN1, LIN2)
      LOGICAL*1 LIN1(100), LIN2(100)
      INTEGER I
      I=1
23040 IF(.NOT.(LIN1(I) .EQ. LIN2(I)))GOTO 23042
      IF(.NOT.(LIN1(I) .EQ. 0))GOTO 23043
      CMPAR = 0
      RETURN
23043 CONTINUE
23041 I=I+1
      GOTO 23040
23042 CONTINUE
      IF(.NOT.(LIN1(I) .LT. LIN2(I)))GOTO 23045
      CMPAR = -1
      GOTO 23046
23045 CONTINUE
      CMPAR = + 1
23046 CONTINUE
      RETURN
      END
      SUBROUTINE COL1 (BUF)
      LOGICAL*1 BUF(100)
      COMMON /CCOMM/ ONE, TWO, THREE
      INTEGER ONE
      INTEGER TWO
      INTEGER THREE
      IF(.NOT.(ONE .EQ. 0))GOTO 23047
      RETURN
23047 CONTINUE
      I = 1
      CALL SKIPBL (BUF, I)
      CALL PUTLIN(BUF(I), 2)
      RETURN
      END
      SUBROUTINE COL2 (BUF)
      LOGICAL*1 BUF(100)
      INTEGER I
      COMMON /CCOMM/ ONE, TWO, THREE
      INTEGER ONE
      INTEGER TWO
      INTEGER THREE
      IF(.NOT.(TWO .EQ. 0))GOTO 23049
      RETURN
23049 CONTINUE
      IF(.NOT.(ONE .EQ. 1))GOTO 23051
      I=1
23053 IF(.NOT.(I.LE.15))GOTO 23055
      CALL PUTC(32)
23054 I=I+1
      GOTO 23053
23055 CONTINUE
23051 CONTINUE
      I = 1
      CALL SKIPBL (BUF, I)
      CALL PUTLIN(BUF(I), 2)
      RETURN
      END
      SUBROUTINE COL3(BUF)
      LOGICAL*1 BUF(100)
      INTEGER I
      COMMON /CCOMM/ ONE, TWO, THREE
      INTEGER ONE
      INTEGER TWO
      INTEGER THREE
      IF(.NOT.(THREE .EQ. 0))GOTO 23056
      RETURN
23056 CONTINUE
      IF(.NOT.(ONE .EQ. 1))GOTO 23058
      I=1
23060 IF(.NOT.(I.LE.10))GOTO 23062
      CALL PUTC(32)
23061 I=I+1
      GOTO 23060
23062 CONTINUE
23058 CONTINUE
      IF(.NOT.(TWO .EQ. 1))GOTO 23063
      I=1
23065 IF(.NOT.(I.LE.15))GOTO 23067
      CALL PUTC(32)
23066 I=I+1
      GOTO 23065
23067 CONTINUE
23063 CONTINUE
      I = 1
      CALL SKIPBL(BUF, I)
      CALL PUTLIN(BUF(I), 2)
      RETURN
      END
