proc str2rat
	local	0,001000,s
	local	1,000020,div
	local	2,000020,numer
	local	3,000020,denom
	local	4,000020,sign
	local	5,000000,integer
	local	6,000000,tab
	local	7,000000,upto
	local	8,000000,move
	local	9,000000,pos
	local	10,000000,gcd
	local	11,000000,rational
	local	12,000000,abs
	con	0,010000,1,133
	con	1,020000,1,057
	con	2,002000,1,1
	con	3,020000,1,135
	con	4,002000,1,0
	declend
	filen	rational.icn
	line	47
	colm	11
	mark	L1
	var	0
	line	50
	colm	6
	bscan
	mark	L2
	pnull
	str	0
	line	51
	colm	7
	tabmat
	pop
	pnull
	var	2
	var	5
	var	6
	var	7
	cset	1
	line	52
	colm	32
	invoke	1
	line	52
	colm	27
	invoke	1
	line	52
	colm	23
	invoke	1
	line	52
	colm	13
	asgn
	pop
	var	8
	int	2
	line	53
	colm	11
	invoke	1
	pop
	pnull
	var	3
	var	5
	var	6
	var	7
	cset	3
	line	54
	colm	32
	invoke	1
	line	54
	colm	27
	invoke	1
	line	54
	colm	23
	invoke	1
	line	54
	colm	13
	asgn
	pop
	var	9
	pnull
	int	2
	line	55
	colm	11
	neg
	line	55
	colm	10
	invoke	1
	esusp
	goto	L3
lab L2
	line	56
	colm	11
	pfail
lab L3
	line	50
	colm	6
	escan
	unmark
lab L1
	mark	L4
	pnull
	var	1
	mark	L5
	var	10
	var	2
	var	3
	line	58
	colm	14
	invoke	2
	esusp
	goto	L6
lab L5
	line	58
	colm	30
	pfail
lab L6
	line	58
	colm	8
	asgn
	unmark
lab L4
	mark	L7
	pnull
	var	2
	dup
	var	1
	line	59
	colm	10
	div
	asgn
	unmark
lab L7
	mark	L8
	pnull
	var	3
	dup
	var	1
	line	60
	colm	10
	div
	asgn
	unmark
lab L8
	mark	L9
	mark	L10
	pnull
	pnull
	var	2
	var	3
	line	62
	colm	13
	mult
	int	4
	line	62
	colm	21
	numge
	unmark
	pnull
	var	4
	int	2
	line	62
	colm	36
	asgn
	goto	L11
lab L10
	pnull
	var	4
	pnull
	int	2
	line	63
	colm	20
	neg
	line	63
	colm	17
	asgn
lab L11
	unmark
lab L9
	mark	L12
	mark	L13
	var	11
	var	12
	var	2
	line	65
	colm	23
	invoke	1
	var	12
	var	3
	line	65
	colm	34
	invoke	1
	var	4
	line	65
	colm	19
	invoke	3
	line	65
	colm	4
	pret
lab L13
	pfail
	unmark
lab L12
	pnull
	line	67
	colm	1
	pfail
	end
proc rat2str
	local	0,001000,r
	con	0,010000,1,133
	con	1,010000,1,057
	con	2,010000,1,135
	declend
	line	69
	colm	11
	mark	L1
	mark	L2
	pnull
	pnull
	pnull
	pnull
	str	0
	pnull
	pnull
	var	0
	line	71
	colm	19
	field	numer
	pnull
	var	0
	line	71
	colm	29
	field	sign
	line	71
	colm	26
	mult
	line	71
	colm	15
	cat
	str	1
	line	71
	colm	35
	cat
	pnull
	var	0
	line	71
	colm	46
	field	denom
	line	71
	colm	42
	cat
	str	2
	line	71
	colm	53
	cat
	line	71
	colm	4
	pret
lab L2
	pfail
	unmark
lab L1
	pnull
	line	73
	colm	1
	pfail
	end
proc mpyrat
	local	0,001000,r1
	local	1,001000,r2
	local	2,000020,numer
	local	3,000020,denom
	local	4,000020,div
	local	5,000000,gcd
	local	6,000000,rational
	declend
	line	75
	colm	11
	mark	L1
	pnull
	var	2
	pnull
	pnull
	var	0
	line	78
	colm	15
	field	numer
	pnull
	var	1
	line	78
	colm	26
	field	numer
	line	78
	colm	22
	mult
	line	78
	colm	10
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	3
	pnull
	pnull
	var	0
	line	79
	colm	15
	field	denom
	pnull
	var	1
	line	79
	colm	26
	field	denom
	line	79
	colm	22
	mult
	line	79
	colm	10
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	4
	mark	L4
	var	5
	var	2
	var	3
	line	80
	colm	14
	invoke	2
	esusp
	goto	L5
lab L4
	line	80
	colm	30
	pfail
lab L5
	line	80
	colm	8
	asgn
	unmark
lab L3
	mark	L6
	mark	L7
	var	6
	pnull
	var	2
	var	4
	line	82
	colm	26
	div
	pnull
	var	3
	var	4
	line	82
	colm	38
	div
	pnull
	pnull
	var	0
	line	82
	colm	47
	field	sign
	pnull
	var	1
	line	82
	colm	57
	field	sign
	line	82
	colm	53
	mult
	line	82
	colm	19
	invoke	3
	line	82
	colm	4
	pret
lab L7
	pfail
	unmark
lab L6
	pnull
	line	84
	colm	1
	pfail
	end
proc divrat
	local	0,001000,r1
	local	1,001000,r2
	local	2,000000,mpyrat
	local	3,000000,reciprat
	declend
	line	86
	colm	11
	mark	L1
	mark	L2
	var	2
	var	0
	var	3
	var	1
	line	88
	colm	29
	invoke	1
	line	88
	colm	17
	invoke	2
	line	88
	colm	4
	pret
lab L2
	pfail
	unmark
lab L1
	pnull
	line	90
	colm	1
	pfail
	end
proc reciprat
	local	0,001000,r
	local	1,000000,rational
	con	0,002000,1,0
	declend
	line	92
	colm	11
	mark	L1
	mark	L2
	pnull
	pnull
	var	0
	line	94
	colm	8
	field	numer
	int	0
	line	94
	colm	15
	numeq
	unmark
	line	94
	colm	24
	pfail
	goto	L3
lab L2
	mark	L4
	var	1
	pnull
	var	0
	line	95
	colm	26
	field	denom
	pnull
	var	0
	line	95
	colm	34
	field	numer
	pnull
	var	0
	line	95
	colm	42
	field	sign
	line	95
	colm	24
	invoke	3
	line	95
	colm	9
	pret
lab L4
	pfail
lab L3
	unmark
lab L1
	pnull
	line	97
	colm	1
	pfail
	end
proc negrat
	local	0,001000,r
	local	1,000000,rational
	declend
	line	99
	colm	11
	mark	L1
	mark	L2
	var	1
	pnull
	var	0
	line	101
	colm	21
	field	numer
	pnull
	var	0
	line	101
	colm	29
	field	denom
	pnull
	pnull
	var	0
	line	101
	colm	38
	field	sign
	line	101
	colm	36
	neg
	line	101
	colm	19
	invoke	3
	line	101
	colm	4
	pret
lab L2
	pfail
	unmark
lab L1
	pnull
	line	103
	colm	1
	pfail
	end
proc addrat
	local	0,001000,r1
	local	1,001000,r2
	local	2,000020,denom
	local	3,000020,numer
	local	4,000020,div
	local	5,000020,sign
	local	6,000000,gcd
	local	7,000000,rational
	local	8,000000,abs
	con	0,002000,1,0
	con	1,002000,1,1
	declend
	line	105
	colm	11
	mark	L1
	pnull
	var	2
	pnull
	pnull
	var	0
	line	108
	colm	15
	field	denom
	pnull
	var	1
	line	108
	colm	26
	field	denom
	line	108
	colm	22
	mult
	line	108
	colm	10
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	3
	pnull
	pnull
	pnull
	pnull
	var	0
	line	109
	colm	15
	field	sign
	pnull
	var	0
	line	109
	colm	25
	field	numer
	line	109
	colm	21
	mult
	pnull
	var	1
	line	109
	colm	36
	field	denom
	line	109
	colm	32
	mult
	pnull
	pnull
	pnull
	var	1
	line	110
	colm	9
	field	sign
	pnull
	var	1
	line	110
	colm	19
	field	numer
	line	110
	colm	15
	mult
	pnull
	var	0
	line	110
	colm	30
	field	denom
	line	110
	colm	26
	mult
	line	109
	colm	43
	plus
	line	109
	colm	10
	asgn
	unmark
lab L2
	mark	L3
	mark	L4
	pnull
	var	3
	int	0
	line	112
	colm	13
	numge
	unmark
	pnull
	var	5
	int	1
	line	112
	colm	28
	asgn
	goto	L5
lab L4
	pnull
	var	5
	pnull
	int	1
	line	113
	colm	20
	neg
	line	113
	colm	17
	asgn
lab L5
	unmark
lab L3
	mark	L6
	pnull
	var	4
	mark	L7
	var	6
	var	3
	var	2
	line	115
	colm	14
	invoke	2
	esusp
	goto	L8
lab L7
	line	115
	colm	30
	pfail
lab L8
	line	115
	colm	8
	asgn
	unmark
lab L6
	mark	L9
	mark	L10
	var	7
	var	8
	pnull
	var	3
	var	4
	line	117
	colm	30
	div
	line	117
	colm	23
	invoke	1
	var	8
	pnull
	var	2
	var	4
	line	117
	colm	47
	div
	line	117
	colm	40
	invoke	1
	var	5
	line	117
	colm	19
	invoke	3
	line	117
	colm	4
	pret
lab L10
	pfail
	unmark
lab L9
	pnull
	line	119
	colm	1
	pfail
	end
proc subrat
	local	0,001000,r1
	local	1,001000,r2
	local	2,000000,addrat
	local	3,000000,negrat
	declend
	line	121
	colm	11
	mark	L1
	mark	L2
	var	2
	var	0
	var	3
	var	1
	line	123
	colm	27
	invoke	1
	line	123
	colm	17
	invoke	2
	line	123
	colm	4
	pret
lab L2
	pfail
	unmark
lab L1
	pnull
	line	125
	colm	1
	pfail
	end
