      SUBROUTINE MAIN
      LOGICAL*1 BUF(512)
      INTEGER GETARG, OPEN
      INTEGER I
      CALL QUERY(25Husage:  expand [file] ...)
      I=1
23000 IF (.NOT.(GETARG(I, BUF, 512) .NE. -1))GOTO 23002
      IF (.NOT.(BUF(1) .EQ. 45 .AND. BUF(2) .EQ. 0))GOTO 23003
      INT = 1
      GOTO 23004
23003 CONTINUE
      INT = OPEN(BUF,1)
      IF (.NOT.(INT .EQ. -3))GOTO 23005
      CALL CANT(BUF)
23005 CONTINUE
23004 CONTINUE
      CALL XPD (INT)
      IF (.NOT.(INT .NE. 1))GOTO 23007
      CALL CLOSE(INT)
23007 CONTINUE
23001 I=I+1
      GOTO 23000
23002 CONTINUE
      IF (.NOT.(I .EQ. 1))GOTO 23009
      CALL XPD(1)
23009 CONTINUE
      RETURN
      END
      SUBROUTINE XPD (INT)
      LOGICAL*1 GETCH
      LOGICAL*1 C, CODE
23011 IF (.NOT.(GETCH(CODE,INT) .NE. -1))GOTO 23012
      IF (.NOT.(CODE .EQ. 125))GOTO 23013
      IF (.NOT.(GETCH(C,INT) .EQ. -1))GOTO 23015
      GOTO 23012
23015 CONTINUE
      IF (.NOT.(GETCH(CODE,INT) .EQ. -1))GOTO 23017
      GOTO 23012
23017 CONTINUE
      CODE = CODE - 32
23019 IF (.NOT.(CODE .GT.0))GOTO 23021
      CALL PUTCH(C,2)
23020 CODE = CODE - 1
      GOTO 23019
23021 CONTINUE
      GOTO 23014
23013 CONTINUE
      CODE = CODE - 32
23022 IF (.NOT.(CODE .GT. 0))GOTO 23024
      IF (.NOT.(GETCH(C,INT) .EQ. -1))GOTO 23025
      GOTO 23024
23025 CONTINUE
      CALL PUTCH(C,2)
23023 CODE = CODE - 1
      GOTO 23022
23024 CONTINUE
      IF (.NOT.(C .EQ. -1))GOTO 23027
      GOTO 23012
23027 CONTINUE
23014 CONTINUE
      GOTO 23011
23012 CONTINUE
      RETURN
      END
