C   07/06/96 606071849  MEMBER NAME  IBFL     (S4)          FORTRAN
      FUNCTION IBFL(NA,NB,NC,ND)
#include "acs.for"
      COMMON/BCS/IW(1)
#include "star.for"
      IGOTO=1
      GOTO 10
      ENTRY IBLC(NA,NB,NC,ND)
      IGOTO=2
      GOTO 10
      ENTRY IBCR(NA,NB,NC,ND)
      IGOTO=3
      GOTO 10
      ENTRY IBRN(NA,NB,BC,ND)
      IGOTO=4
   10 IW(INAMV)=NA
      LFDI=MOD(IABS(NAME),NPRIM)+NAMAX1
   12 K=LFDI
      LFDI=IW(K+IPLST)
      IF(IW(LFDI+INAMV).NE.IW(INAMV)) GOTO 12
      IF(LFDI.NE.0) GOTO 14
      IF(NCI.GE.NAMAX) GOTO 200
      NCI=NCI+1
      LFDI=NCI
      IW(INAMV+LFDI)=NAME
      IW(K+IPLST)=LFDI
   14 IF(IGOTO.NE.1) GOTO 20
      IBFL=LFDI
      GOTO 100
   20 LFDK=LFDI+1
      LFDI=IW(LFDI)
      GOTO 23
   22 LFDK=LFDI
      LFDI=IW(LFDI-1)
   23 IF(LFDI.EQ.0)      GOTO 30
      IF(IW(LFDI-2)-NR) 22,24,30
   24 IF(IGOTO.NE.2) GOTO 100
      IBFL=LFDI
      GOTO 100
   30 IBFL=0
      IF(IGOTO.EQ.2) GOTO 100
C     CREATE (NOT YET EXISTING)
      IF(NEXT+NC+4.GE.NLST) GOTO 110
      INAME=NA
      IF(NOTLOW(XNAME)) GOTO 34
      IF(NCPL+NC+4.GE.NSPL) GOTO 120
      NCPL=NCPL+NC+4
   34 IND=NEXT+3
      ISV=IW(LFDK-1)
      IW(IND-3)=NA
      IW(IND-2)=NB
      IW(IND-1)=ISV
      IW(IND  )=NC
      IW(LFDK-1)=IND
      NEXT=NEXT+4+NC
      LIND=IND
      IBFL=IND
      GOTO 100
   90 IBFL=0
  100 RETURN
  110 NHISTH(11)=NHISTH(11)+1
      GOTO 90
  120 NHISTL(11)=NHISTL(11)+1
      GOTO 90
  200 STOP
      END
