	.psect	.prog.
bagen:
	jsr	r0,__csav
	sub	$6,sp
	mov	lmp,-2(r5)
	bit	flag,$10
	beq	.2
	tst	board+12
	bne	.3
	tst	board+14
	bne	.3
	cmp	board+16,$4
	bne	.3
	mov	$4,(sp)
	jsr	pc,wattack
	tst	r0
	beq	.4
	mov	$5,(sp)
	jsr	pc,wattack
	tst	r0
	beq	.4
	mov	$6,(sp)
	jsr	pc,wattack
	tst	r0
	beq	.4
	mov	$2,(sp)
	clr	-(sp)
	mov	$4,-(sp)
	jsr	pc,btry
	cmp	(sp)+,(sp)+
.4:
.3:
.2:
	bit	flag,$20
	beq	.5
	cmp	board,$4
	bne	.6
	tst	board+2
	bne	.6
	tst	board+4
	bne	.6
	tst	board+6
	bne	.6
	mov	$2,(sp)
	jsr	pc,wattack
	tst	r0
	beq	.7
	mov	$3,(sp)
	jsr	pc,wattack
	tst	r0
	beq	.7
	mov	$4,(sp)
	jsr	pc,wattack
	tst	r0
	beq	.7
	mov	$177776,(sp)
	clr	-(sp)
	mov	$4,-(sp)
	jsr	pc,btry
	cmp	(sp)+,(sp)+
.7:
.6:
.5:
	jsr	pc,bgen
	mov	-2(r5),-4(r5)
.11:
	cmp	-4(r5),lmp
	beq	.10
	mov	-4(r5),r0
	add	$2,-4(r5)
	mov	(r0),-6(r5)
	mov	*-4(r5),(sp)
	jsr	pc,bmove
	mov	bkpos,(sp)
	jsr	pc,wattack
	tst	r0
	beq	.12
	mov	-2(r5),r0
	add	$2,-2(r5)
	mov	-6(r5),(r0)
	mov	-2(r5),r0
	add	$2,-2(r5)
	mov	*-4(r5),(r0)
.12:
	add	$2,-4(r5)
	jsr	pc,bremove
	br	.11
.10:
	mov	-2(r5),lmp
.1:
	jmp	__cret
btry:
	jsr	r0,__csav
	mov	12(r5),r0
	asl	r0
	add	$dir,r0
	bit	(r0),14(r5)
	bne	.14
	mov	12(r5),(sp)
	add	16(r5),(sp)
	mov	12(r5),-(sp)
	jsr	pc,bcheck
	tst	(sp)+
.14:
.13:
	jmp	__cret
bcheck:
	jsr	r0,__csav
	mov	14(r5),r0
	asl	r0
	add	$board,r0
	mov	(r0),r0
	ble	.16
	mov	$1,r0
	br	.15
.16:
	mov	14(r5),r0
	asl	r0
	add	$board,r0
	mov	(r0),r0
	asl	r0
	add	$pval+14,r0
	mov	(r0),r0
	mov	r0,-(sp)
	sub	value,(sp)
	mov	lmp,r0
	add	$2,lmp
	mov	(sp)+,(r0)
	mov	12(r5),r0
	swab	r0
	clrb	r0
	mov	r0,-(sp)
	bis	14(r5),(sp)
	mov	lmp,r0
	add	$2,lmp
	mov	(sp)+,(r0)
	mov	14(r5),r0
	asl	r0
	add	$board,r0
	mov	(r0),r0
	beq	.77777
	mov	$1,r0
	br	.77776
.77777:
	clr	r0
.77776:
.15:
	jmp	__cret
wagen:
	jsr	r0,__csav
	sub	$6,sp
	mov	lmp,-2(r5)
	bit	flag,$1
	beq	.20
	tst	board+172
	bne	.21
	tst	board+174
	bne	.21
	cmp	board+176,$177774
	bne	.21
	mov	$74,(sp)
	jsr	pc,battack
	tst	r0
	beq	.22
	mov	$75,(sp)
	jsr	pc,battack
	tst	r0
	beq	.22
	mov	$76,(sp)
	jsr	pc,battack
	tst	r0
	beq	.22
	mov	$2,(sp)
	clr	-(sp)
	mov	$74,-(sp)
	jsr	pc,wtry
	cmp	(sp)+,(sp)+
.22:
.21:
.20:
	bit	flag,$2
	beq	.23
	cmp	board+160,$177774
	bne	.24
	tst	board+162
	bne	.24
	tst	board+164
	bne	.24
	tst	board+166
	bne	.24
	mov	$72,(sp)
	jsr	pc,battack
	tst	r0
	beq	.25
	mov	$73,(sp)
	jsr	pc,battack
	tst	r0
	beq	.25
	mov	$74,(sp)
	jsr	pc,battack
	tst	r0
	beq	.25
	mov	$177776,(sp)
	clr	-(sp)
	mov	$74,-(sp)
	jsr	pc,wtry
	cmp	(sp)+,(sp)+
.25:
.24:
.23:
	jsr	pc,wgen
	mov	-2(r5),-4(r5)
.27:
	cmp	-4(r5),lmp
	beq	.26
	mov	-4(r5),r0
	add	$2,-4(r5)
	mov	(r0),-6(r5)
	mov	*-4(r5),(sp)
	jsr	pc,wmove
	mov	wkpos,(sp)
	jsr	pc,battack
	tst	r0
	beq	.30
	mov	-2(r5),r0
	add	$2,-2(r5)
	mov	-6(r5),(r0)
	mov	-2(r5),r0
	add	$2,-2(r5)
	mov	*-4(r5),(r0)
.30:
	add	$2,-4(r5)
	jsr	pc,wremove
	br	.27
.26:
	mov	-2(r5),lmp
.17:
	jmp	__cret
wtry:
	jsr	r0,__csav
	mov	12(r5),r0
	asl	r0
	add	$dir,r0
	bit	(r0),14(r5)
	bne	.32
	mov	12(r5),(sp)
	add	16(r5),(sp)
	mov	12(r5),-(sp)
	jsr	pc,wcheck
	tst	(sp)+
.32:
.31:
	jmp	__cret
wcheck:
	jsr	r0,__csav
	mov	14(r5),r0
	asl	r0
	add	$board,r0
	mov	(r0),r0
	bge	.34
	mov	$1,r0
	br	.33
.34:
	mov	value,-(sp)
	mov	14(r5),r0
	asl	r0
	add	$board,r0
	mov	(r0),r0
	asl	r0
	add	$pval+14,r0
	mov	(r0),r0
	sub	r0,(sp)
	mov	lmp,r0
	add	$2,lmp
	mov	(sp)+,(r0)
	mov	12(r5),r0
	swab	r0
	clrb	r0
	mov	r0,-(sp)
	bis	14(r5),(sp)
	mov	lmp,r0
	add	$2,lmp
	mov	(sp)+,(r0)
	mov	14(r5),r0
	asl	r0
	add	$board,r0
	mov	(r0),r0
	beq	.77775
	mov	$1,r0
	br	.77774
.77775:
	clr	r0
.77774:
.33:
	jmp	__cret
	.globl	wcheck
	.globl	wremove
	.globl	wmove
	.globl	wgen
	.globl	wtry
	.globl	battack
	.globl	wagen
	.globl	bcheck
	.globl	bremove
	.globl	bmove
	.globl	bgen
	.globl	btry
	.globl	wattack
	.globl	bagen
	.globl	sbuf
	.globl	ambuf
	.globl	lmbuf
	.globl	board
	.globl	dir
	.globl	ipval
	.globl	pval
	.globl	edge
	.globl	column
	.globl	wkpos
	.globl	bkpos
	.globl	eppos
	.globl	flag
	.globl	depth
	.globl	mfmt
	.globl	ivalue
	.globl	value
	.globl	ply
	.globl	mantom
	.globl	lastmov
	.globl	sbufp
	.globl	amp
	.globl	lmp
	.globl	abmove
	.globl	game
	.globl	gval
	.globl	moveno
	.globl	intrp
	.globl	matflg
	.globl	manflg
	.globl	bookp
	.globl	bookf
	.globl	mdepth
	.globl	qdepth
	.globl	testf
	.globl	clktim
	.globl	control
	.globl	bheur
	.globl	wheur
	.globl	center
	.globl	attacv
	.globl	__csav
	.globl	__cret
	.psect	.prog.
	.even
	.psect	.data.
	.even
	.psect	.mwcn.
	.even
	.psect	.prof.
	.even
