
	.section	".text",#alloc,#execinstr
	.align	8
	.skip	16

	! block 0

	.global	unbyte_
	.type	unbyte_,2
unbyte_:
	save	%sp,-112,%sp
	st	%i2,[%fp+76]
	st	%i1,[%fp+72]
	st	%i0,[%fp+68]

	! block 1
.L32:
	ld	[%fp+68],%l0
	add	%l0,-4,%l0
	st	%l0,[%fp-4]
	ld	[%fp+76],%l0
	add	%l0,-4,%l0
	st	%l0,[%fp-8]

	! block 2
.L14:

! File unbyte.f:
!    1	c    unbyte converts a byte string into a
!    2	c    string of integers in the array "output".
!    3	c    The integers represent the bytes moving from
!    4	c	 most significant to least significant and from word 1 to
!    5	c	the last word in "input". Blame ajl June 25, 1987.
!    6	c
!    7	      subroutine unbyte(input, length, output)
!    8	      integer length, output(1024), input(256), alen, newlen
!    9	c
!   10	c	Form a mask of all 1's for the least sig. byte.
!   11	      integer lsbyte 
!   12	      data lsbyte/255/
!   13	c	We work from the ls byte to the msb, masking the ls byte
!   14	c       then shifting the word 8 bits to the right and repeating.
!   15	c       Since the output array starts with the ms byte, there are 
!   16	c       some horrible indexing problems.  Length is the number of
!   17	c       output integers and input bytes.  It need not be a multiple
!   18	c       of 4 and we form 'newlen' which allows us to start with the ls
!   19	c       byte anyhow (even though it may be empty).
!   20	      alen = (length - 1)/4

	ld	[%fp+72],%l0
	ld	[%l0+0],%l0
	add	%l0,-1,%l0
	mov	4,%l1
	mov	%l0,%o0
	mov	%l1,%o1
	call	.div
	nop
	mov	%o0,%l1
	sethi	%hi(GPB.unbyte.alen),%l0
	or	%l0,%lo(GPB.unbyte.alen),%l0
	st	%l1,[%l0+0]

!   21	      newlen = 4*(1 + alen)

	sethi	%hi(GPB.unbyte.alen),%l0
	or	%l0,%lo(GPB.unbyte.alen),%l0
	ld	[%l0+0],%l0
	add	%l0,1,%l0
	sll	%l0,2,%l1
	sethi	%hi(GPB.unbyte.newlen),%l0
	or	%l0,%lo(GPB.unbyte.newlen),%l0
	st	%l1,[%l0+0]

!   22	c
!   23	      if (length .gt. 1024) go to 200

	ld	[%fp+72],%l0
	ld	[%l0+0],%l0
	cmp	%l0,1024
	ble	.L17
	nop

	! block 3
.L18:
	ba	.L19
	nop

	! block 4
.L17:

!   24	c
!   25	      do 150 i=1,newlen

	sethi	%hi(GPB.unbyte.newlen),%l0
	or	%l0,%lo(GPB.unbyte.newlen),%l0
	ld	[%l0+0],%l0
	st	%l0,[%fp-12]
	mov	1,%l1
	sethi	%hi(GPB.unbyte.i),%l0
	or	%l0,%lo(GPB.unbyte.i),%l0
	st	%l1,[%l0+0]
	sethi	%hi(GPB.unbyte.i),%l0
	or	%l0,%lo(GPB.unbyte.i),%l0
	ld	[%l0+0],%l1
	ld	[%fp-12],%l0
	cmp	%l1,%l0
	bg	.L21
	nop

	! block 5
.L25:
.L22:

!   26	c        'i' is a not-too-clever index that counts operations.
!   27	c        'is' is 1 for the first input word, 2 for the second etc.
!   28	c        'iout' is 1 for the first output word which corresponds to
!   29	c        the first byte of input word 1 (confusing isn't it!)
!   30	        is = (i - 1)/4  + 1

	sethi	%hi(GPB.unbyte.i),%l0
	or	%l0,%lo(GPB.unbyte.i),%l0
	ld	[%l0+0],%l0
	add	%l0,-1,%l0
	mov	4,%l1
	mov	%l0,%o0
	mov	%l1,%o1
	call	.div
	nop
	mov	%o0,%l0
	add	%l0,1,%l1
	sethi	%hi(GPB.unbyte.is),%l0
	or	%l0,%lo(GPB.unbyte.is),%l0
	st	%l1,[%l0+0]

!   31		iout=is*8 -3 -i

	sethi	%hi(GPB.unbyte.is),%l0
	or	%l0,%lo(GPB.unbyte.is),%l0
	ld	[%l0+0],%l0
	sll	%l0,3,%l2
	sethi	%hi(GPB.unbyte.i),%l0
	or	%l0,%lo(GPB.unbyte.i),%l0
	ld	[%l0+0],%l1
	sub	%l2,%l1,%l0
	add	%l0,-3,%l1
	sethi	%hi(GPB.unbyte.iout),%l0
	or	%l0,%lo(GPB.unbyte.iout),%l0
	st	%l1,[%l0+0]

!   32	        output(iout) =  and(lsbyte, input(is))

	sethi	%hi(GPB.unbyte.lsbyte),%l0
	or	%l0,%lo(GPB.unbyte.lsbyte),%l0
	ld	[%l0+0],%l3
	ld	[%fp-4],%l2
	sethi	%hi(GPB.unbyte.is),%l0
	or	%l0,%lo(GPB.unbyte.is),%l0
	ld	[%l0+0],%l0
	sll	%l0,2,%l1
	add	%l2,%l1,%l0
	ld	[%l0+0],%l1
	and	%l3,%l1,%l3
	ld	[%fp-8],%l2
	sethi	%hi(GPB.unbyte.iout),%l0
	or	%l0,%lo(GPB.unbyte.iout),%l0
	ld	[%l0+0],%l0
	sll	%l0,2,%l1
	add	%l2,%l1,%l0
	st	%l3,[%l0+0]

!   33	        input(is) = rshift(input(is), 8)

	ld	[%fp-4],%l2
	sethi	%hi(GPB.unbyte.is),%l0
	or	%l0,%lo(GPB.unbyte.is),%l0
	ld	[%l0+0],%l0
	sll	%l0,2,%l1
	add	%l2,%l1,%l0
	ld	[%l0+0],%l0
	sra	%l0,8,%l3
	ld	[%fp-4],%l2
	sethi	%hi(GPB.unbyte.is),%l0
	or	%l0,%lo(GPB.unbyte.is),%l0
	ld	[%l0+0],%l0
	sll	%l0,2,%l1
	add	%l2,%l1,%l0
	st	%l3,[%l0+0]

	! block 6
.L20:

!   34	  150 continue

	sethi	%hi(GPB.unbyte.i),%l0
	or	%l0,%lo(GPB.unbyte.i),%l0
	ld	[%l0+0],%l0
	add	%l0,1,%l1
	sethi	%hi(GPB.unbyte.i),%l0
	or	%l0,%lo(GPB.unbyte.i),%l0
	st	%l1,[%l0+0]
	sethi	%hi(GPB.unbyte.i),%l0
	or	%l0,%lo(GPB.unbyte.i),%l0
	ld	[%l0+0],%l1
	ld	[%fp-12],%l0
	cmp	%l1,%l0
	ble	.L22
	nop

	! block 7
.L28:
.L21:

!   35	      return

	ba	.L13
	nop

	! block 8
.L19:

!   36	  200 write(6,900) length

	sethi	%hi(GPB.unbyte.IO.30+24),%l0
	or	%l0,%lo(GPB.unbyte.IO.30+24),%l0
	st	%fp,[%l0+0]
	sethi	%hi(GPB.unbyte.IO.30),%l0
	or	%l0,%lo(GPB.unbyte.IO.30),%l0
	mov	%l0,%o0
	call	__s_wsFe_nv
	nop
	sethi	%hi(.L_cseg0),%l0
	or	%l0,%lo(.L_cseg0),%l0
	sethi	%hi(.L_cseg1),%l1
	or	%l1,%lo(.L_cseg1),%l1
	ld	[%fp+72],%l2
	mov	4,%l3
	mov	%l0,%o0
	mov	%l1,%o1
	mov	%l2,%o2
	mov	%l3,%o3
	call	__do_f_out_nv
	nop
	call	__e_wsfe
	nop

!   37	  900 format (' value of length too long in unbyte :',i10)
!   38	      stop 2

	sethi	%hi(.L_cseg2),%l0
	or	%l0,%lo(.L_cseg2),%l0
	mov	1,%l1
	mov	%l0,%o0
	mov	%l1,%o1
	call	__s_stop
	nop

!   39	      end


	! block 9
.L13:
.L11:
.L12:
	jmp	%i7+8
	restore
	.size	unbyte_,(.-unbyte_)
	.align	8

	.section	".data",#alloc,#write
	.align	8
GPB.unbyte.IO.30:
	.word	0x1000000
	.skip	4
	.word	0x6
	.skip	4
	.word	GPB.unbyte.FORMAT.29
	.skip	8
	.type	GPB.unbyte.IO.30,#object
	.size	GPB.unbyte.IO.30,28

	.section	".bss",#alloc,#write
	.align	8
GPB.unbyte.is:
	.skip	4
	.type	GPB.unbyte.is,#object
	.size	GPB.unbyte.is,4

	.section	".data",#alloc,#write
	.align	4
GPB.unbyte.lsbyte:
	.word	0xff
	.type	GPB.unbyte.lsbyte,#object
	.size	GPB.unbyte.lsbyte,4

	.section	".bss",#alloc,#write
	.align	8
GPB.unbyte.alen:
	.skip	4
	.type	GPB.unbyte.alen,#object
	.size	GPB.unbyte.alen,4
	.align	8
GPB.unbyte.newlen:
	.skip	4
	.type	GPB.unbyte.newlen,#object
	.size	GPB.unbyte.newlen,4
	.align	8
GPB.unbyte.i:
	.skip	4
	.type	GPB.unbyte.i,#object
	.size	GPB.unbyte.i,4
	.align	8
GPB.unbyte.iout:
	.skip	4
	.type	GPB.unbyte.iout,#object
	.size	GPB.unbyte.iout,4

	.section	".rodata",#alloc
	.align	4
.L_cseg0:
	.word	0x3
	.type	.L_cseg0,#object
	.size	.L_cseg0,4
	.align	4
.L_cseg1:
	.word	0x1
	.type	.L_cseg1,#object
	.size	.L_cseg1,4
	.align	4
.L_cseg2:
	.ascii	"2\000\000"
	.type	.L_cseg2,#object
	.size	.L_cseg2,3

	.section	".data",#alloc,#write
	.align	4
GPB.unbyte.CONSTANT.31:
	.ascii	" value of length too long in unbyte :"
	.skip	3
	.type	GPB.unbyte.CONSTANT.31,#object
	.size	GPB.unbyte.CONSTANT.31,40
	.align	4
GPB.unbyte.FORMAT.29:
	.word	0x1
	.skip	12
	.word	0xc,0x25
	.word	GPB.unbyte.CONSTANT.31
	.skip	4
	.word	0x6,0x1
	.skip	8
	.word	0x7,0xa,0x1
	.skip	4
	.word	0x2
	.skip	12
	.type	GPB.unbyte.FORMAT.29,#object
	.size	GPB.unbyte.FORMAT.29,80

	.file	"unbyte.f"
	.xstabs	".stab.index","V=3.1;R=3.0",60,0,0,842629737
	.xstabs	".stab.index","/amd/plas5/h1/vgr/src/imp;/opt/SUNWspro/bin/../SC4.0/bin/f77 -sbfast   unbyte.f",52,0,0,0
	.xstabs	".stab.sbfocus","unbyte.f.0yPRTV.bd",72,0,0,0
