
;TimeDecruncher - av Mahoney Juni -90
TimeSource:	dc.l	$40000
TimeDest:	dc.l	$50000

Decrunch:
	move.l	TimeSource(pc),a0
	add.l	(a0),a0
	addq.l	#8,a0
	move.l	TimeDest(pc),a1
	move.l	-(a0),a2
	add.l	a1,a2
	tst.l	-(a0)
	move.l	-(a0),d0
	moveq	#$10,d4
	moveq	#2,d5
	moveq	#3,d6
	moveq	#1,d7
	lea	7.w,a4

Z03a:	moveq	#3,d1
	bsr	Z132
	tst.w	d2
	beq.s	Z0a2
	cmp.w	a4,d2	;a4=#7
	bne.s	Z078
	lsr.l	#1,d0
	bne.s	Z05c
	 move.l	-(a0),d0
	 move	d4,ccr
	 roxr.l	#1,d0
Z05c:	bcc.s	Z070
	moveq	#10,d1
	bsr	Z132
	tst.w	d2
	bne.s	Z078
	moveq	#$12,d1
	bsr	Z132
	bra.s	Z078

Z070:	moveq	#4,d1
	bsr	Z132
	addq.w	#7,d2
Z078:	subq.w	#1,d2
Z07a:	moveq	#7,d1
Z07c:	lsr.l	#1,d0
	beq.s	Z08e
	roxl.l	#1,d3
	dbra	d1,Z07c
	move.b	d3,-(a2)
	dbra	d2,Z07a
	bra.s	Z0a2

Z08e:	move.l	-(a0),d0
	move	d4,ccr
	roxr.l	#1,d0
	roxl.l	#1,d3
	dbra	d1,Z07c
	move.b	d3,-(a2)
	dbra	d2,Z07a
Z0a2:	cmp.l	a2,a1
	bge.s	Z122
	moveq	#2,d1
	bsr.s	Z132
	moveq	#2,d3
	moveq	#8,d1
	tst.w	d2
	beq.s	Z110
	moveq	#4,d3
	cmp.w	d5,d2	;d5=#2
	beq.s	Z0fa
	moveq	#3,d3
	cmp.w	d7,d2	;d7=#1
	beq.s	Z0ec
	moveq	#2,d1
	bsr.s	Z132
	cmp.w	d6,d2	;d6=#3
	beq.s	Z0e4
	cmp.w	d5,d2	;d5=#2
	beq.s	Z0da
	addq.w	#5,d2
	move.w	d2,d3
	bra.s	Z0fa

Z0da:	moveq	#2,d1
	bsr.s	Z132
	addq.w	#7,d2
	move.w	d2,d3
	bra.s	Z0fa

Z0e4:	moveq	#8,d1
	bsr.s	Z132
	move.w	d2,d3
	bra.s	Z0fa

Z0ec:	moveq	#8,d1
	lsr.l	#1,d0
	bne.s	Z0f4
	 move.l	-(a0),d0
	 move	d4,ccr
	 roxr.l	#1,d0
Z0f4:	bcs.s	Z110
	moveq	#14,d1
	bra.s	Z110

Z0fa:	moveq	#$10,d1
	lsr.l	#1,d0
	bne.s	Z102
	 move.l	-(a0),d0
	 move	d4,ccr
	 roxr.l	#1,d0
Z102:	bcc.s	Z110
	moveq	#8,d1
	lsr.l	#1,d0
	bne.s	Z10c
	 move.l	-(a0),d0
	 move	d4,ccr
	 roxr.l	#1,d0
Z10c:	bcs.s	Z110
	moveq	#12,d1
Z110:	bsr.s	Z132
	subq.w	#1,d3
Z114:	move.b	-1(a2,d2.l),-(a2)
	dbra	d3,Z114
	cmp.l	a2,a1
	blt	Z03a
Z122:	rts

Z132:	subq.w	#1,d1
	moveq	#0,d2
Z136:	lsr.l	#1,d0
	beq.s	Z142
	roxl.l	#1,d2
	dbra	d1,Z136
	rts
Z142:	move.l	-(a0),d0
	move	d4,ccr
	roxr.l	#1,d0
	roxl.l	#1,d2
	dbra	d1,Z136
	rts

