proc pq
	filen	pqueue.icn
	local	0,001000,L
	local	1,000020,Q
	local	2,000020,i
	local	3,000020,e
	local	4,000000,list
	local	5,000000,put
	local	6,000000,pqelem
	local	7,000000,numeric
	local	8,000000,runerr
	local	9,000000,pq__down
	con	0,002000,3,102
	con	1,002000,1,2
	con	2,002000,1,1
	declend
	line	45
	colm	11
	mark	L1
	pnull
	pnull
	var	0
	line	48
	colm	4
	null
	var	4
	line	48
	colm	14
	invoke	0
	line	48
	colm	7
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	1
	var	4
	line	49
	colm	13
	invoke	0
	line	49
	colm	6
	asgn
	unmark
lab L2
	mark	L3
	mark0
	pnull
	var	3
	pnull
	var	0
	line	50
	colm	15
	bang
	line	50
	colm	12
	asgn
	pop
	mark0
	var	5
	var	1
	var	6
	pnull
	var	3
	line	51
	colm	22
	field	data
	mark	L6
	var	7
	pnull
	var	3
	line	51
	colm	38
	field	priority
	line	51
	colm	36
	invoke	1
	esusp
	goto	L7
lab L6
	var	8
	int	0
	pnull
	var	3
	line	51
	colm	64
	field	priority
	line	51
	colm	57
	invoke	2
lab L7
	line	51
	colm	20
	invoke	2
	line	51
	colm	10
	invoke	2
	unmark
lab L4
	efail
lab L5
	unmark
lab L3
	mark	L8
	mark0
	pnull
	var	2
	pnull
	pnull
	pnull
	var	1
	line	52
	colm	15
	size
	int	1
	line	52
	colm	18
	div
	int	2
	pnull
	int	2
	line	52
	colm	30
	neg
	line	52
	colm	22
	toby
	line	52
	colm	12
	asgn
	pop
	mark0
	var	9
	var	1
	var	2
	line	53
	colm	15
	invoke	2
	unmark
lab L9
	efail
lab L10
	unmark
lab L8
	mark	L11
	mark	L12
	var	1
	line	54
	colm	4
	pret
lab L12
	pfail
	unmark
lab L11
	pnull
	line	55
	colm	1
	pfail
	end
proc pqget
	local	0,001000,Q
	local	1,000020,e
	local	2,000000,get
	local	3,000000,push
	local	4,000000,pull
	local	5,000000,pq__down
	con	0,002000,1,1
	declend
	line	57
	colm	11
	mark	L1
	pnull
	var	1
	mark	L2
	var	2
	var	0
	line	60
	colm	12
	invoke	1
	esusp
	goto	L3
lab L2
	line	60
	colm	18
	pfail
lab L3
	line	60
	colm	6
	asgn
	unmark
lab L1
	mark	L4
	var	3
	var	0
	var	4
	var	0
	line	61
	colm	16
	invoke	1
	line	61
	colm	8
	invoke	2
	unmark
lab L4
	mark	L5
	var	5
	var	0
	int	0
	line	62
	colm	12
	invoke	2
	unmark
lab L5
	mark	L6
	mark	L7
	var	1
	line	63
	colm	4
	pret
lab L7
	pfail
	unmark
lab L6
	pnull
	line	64
	colm	1
	pfail
	end
proc pqgen
	local	0,001000,Q
	local	1,000020,q
	local	2,000020,e
	local	3,000000,copy
	local	4,000000,pqget
	declend
	line	66
	colm	11
	mark	L1
	pnull
	var	1
	var	3
	var	0
	line	69
	colm	13
	invoke	1
	line	69
	colm	6
	asgn
	unmark
lab L1
	mark	L2
lab L3
	mark0
	pnull
	var	2
	var	3
	var	4
	var	1
	line	70
	colm	25
	invoke	1
	line	70
	colm	19
	invoke	1
	line	70
	colm	12
	asgn
	unmark
	mark	L3
	mark0
	var	2
	line	71
	colm	7
	psusp
	pop
lab L6
	efail
lab L7
lab L4
	unmark
	goto	L3
lab L5
	unmark
lab L2
	pnull
	line	72
	colm	1
	pfail
	end
proc pqput
	local	0,001000,Q
	local	1,001000,e
	local	2,000000,put
	local	3,000000,pqelem
	local	4,000000,numeric
	local	5,000000,runerr
	local	6,000000,pq__up
	con	0,002000,3,102
	declend
	line	74
	colm	11
	mark	L1
	var	2
	var	0
	var	3
	pnull
	var	1
	line	75
	colm	19
	field	data
	mark	L2
	var	4
	pnull
	var	1
	line	75
	colm	35
	field	priority
	line	75
	colm	33
	invoke	1
	esusp
	goto	L3
lab L2
	var	5
	int	0
	pnull
	var	1
	line	75
	colm	61
	field	priority
	line	75
	colm	54
	invoke	2
lab L3
	line	75
	colm	17
	invoke	2
	line	75
	colm	7
	invoke	2
	unmark
lab L1
	mark	L4
	var	6
	var	0
	pnull
	var	0
	line	76
	colm	14
	size
	line	76
	colm	10
	invoke	2
	unmark
lab L4
	mark	L5
	mark	L6
	var	0
	line	77
	colm	4
	pret
lab L6
	pfail
	unmark
lab L5
	pnull
	line	78
	colm	1
	pfail
	end
proc pq__down
	local	0,001000,Q
	local	1,001000,i
	local	2,000020,left
	local	3,000020,right
	local	4,000020,largest
	local	5,000000,pq__down
	con	0,002000,1,2
	con	1,002000,1,1
	declend
	line	83
	colm	11
	mark	L1
	pnull
	var	2
	pnull
	var	1
	int	0
	line	86
	colm	14
	mult
	line	86
	colm	9
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	3
	pnull
	var	2
	int	1
	line	87
	colm	18
	plus
	line	87
	colm	10
	asgn
	unmark
lab L2
	mark	L3
	mark	L4
	pnull
	pnull
	pnull
	var	0
	var	2
	line	89
	colm	8
	subsc
	line	89
	colm	14
	field	priority
	pnull
	pnull
	var	0
	var	1
	line	89
	colm	27
	subsc
	line	89
	colm	30
	field	priority
	line	89
	colm	24
	numgt
	unmark
	pnull
	var	4
	var	2
	line	89
	colm	53
	asgn
	goto	L5
lab L4
	pnull
	var	4
	var	1
	line	90
	colm	17
	asgn
lab L5
	unmark
lab L3
	mark	L6
	mark0
	pnull
	pnull
	pnull
	var	0
	var	3
	line	91
	colm	8
	subsc
	line	91
	colm	15
	field	priority
	pnull
	pnull
	var	0
	var	4
	line	91
	colm	28
	subsc
	line	91
	colm	37
	field	priority
	line	91
	colm	25
	numgt
	unmark
	pnull
	var	4
	var	3
	line	91
	colm	60
	asgn
	unmark
lab L6
	mark	L7
	mark0
	pnull
	var	4
	var	1
	line	92
	colm	15
	numne
	unmark
	mark	L8
	pnull
	pnull
	var	0
	var	1
	line	93
	colm	8
	subsc
	pnull
	var	0
	var	4
	line	93
	colm	17
	subsc
	line	93
	colm	12
	swap
	unmark
lab L8
	var	5
	var	0
	var	4
	line	94
	colm	15
	invoke	2
	unmark
lab L7
	mark	L9
	mark	L10
	pnull
	line	96
	colm	4
	pret
lab L10
	pfail
	unmark
lab L9
	pnull
	line	97
	colm	1
	pfail
	end
proc pq__up
	local	0,001000,Q
	local	1,001000,i
	local	2,000020,parent
	local	3,000000,pq__up
	con	0,002000,1,2
	declend
	line	99
	colm	11
	mark	L1
	pnull
	var	2
	pnull
	var	1
	int	0
	line	102
	colm	16
	div
	line	102
	colm	11
	asgn
	unmark
lab L1
	mark	L2
	mark0
	pnull
	pnull
	pnull
	var	0
	var	1
	line	103
	colm	8
	subsc
	line	103
	colm	11
	field	priority
	pnull
	pnull
	var	0
	var	2
	line	103
	colm	24
	subsc
	line	103
	colm	32
	field	priority
	line	103
	colm	21
	numgt
	unmark
	mark	L3
	pnull
	pnull
	var	0
	var	1
	line	104
	colm	8
	subsc
	pnull
	var	0
	var	2
	line	104
	colm	17
	subsc
	line	104
	colm	12
	swap
	unmark
lab L3
	var	3
	var	0
	var	2
	line	105
	colm	13
	invoke	2
	unmark
lab L2
	mark	L4
	mark	L5
	pnull
	line	107
	colm	4
	pret
lab L5
	pfail
	unmark
lab L4
	pnull
	line	108
	colm	1
	pfail
	end
