      SUBROUTINE MAIN
      LOGICAL*1 BUF(400)
      INTEGER GETARG, OPEN
      INTEGER I
      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(26Husage:  expand [file ...].)
      GOTO 23004
23003 CONTINUE
      IF(.NOT.(BUF(1) .EQ. 45 .AND. BUF(2) .EQ. 0))GOTO 23005
      INT = 1
      GOTO 23006
23005 CONTINUE
      INT = OPEN(BUF,1)
      IF(.NOT.(INT .EQ. -3))GOTO 23007
      CALL CANT(BUF)
23007 CONTINUE
23006 CONTINUE
23004 CONTINUE
      CALL XPD (INT)
      IF(.NOT.(INT .NE. 1))GOTO 23009
      CALL CLOSE(INT)
23009 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      IF(.NOT.(I .EQ. 1))GOTO 23011
      CALL XPD(1)
23011 CONTINUE
      RETURN
      END
      SUBROUTINE XPD (INT)
      LOGICAL*1 GETCH
      LOGICAL*1 C, CODE
23013 IF(.NOT.(GETCH(CODE,INT) .NE. -1))GOTO 23014
      IF(.NOT.(CODE .EQ. 125))GOTO 23015
      IF(.NOT.(GETCH(C,INT) .EQ. -1))GOTO 23017
      GOTO 23014
23017 CONTINUE
      IF(.NOT.(GETCH(CODE,INT) .EQ. -1))GOTO 23019
      GOTO 23014
23019 CONTINUE
23021 IF(.NOT.(CODE .GT.0))GOTO 23023
      CALL PUTC(C)
23022 CODE = CODE - 1
      GOTO 23021
23023 CONTINUE
      GOTO 23016
23015 CONTINUE
23024 IF(.NOT.(CODE .GT. 0))GOTO 23026
      IF(.NOT.(GETCH(C,INT) .EQ. -1))GOTO 23027
      GOTO 23026
23027 CONTINUE
      CALL PUTC(C)
23025 CODE = CODE - 1
      GOTO 23024
23026 CONTINUE
      IF(.NOT.(C .EQ. -1))GOTO 23029
      GOTO 23014
23029 CONTINUE
23016 CONTINUE
      GOTO 23013
23014 CONTINUE
      RETURN
      END
