proc base64encode
	filen	base64.icn
	local	0,001000,s
	local	1,000020,pad
	local	2,000020,t
	local	3,000020,i
	local	4,000020,j
	local	5,000020,k
	local	6,000040,b64
	local	7,000000,repl
	local	8,000000,ord
	local	9,000000,move
	local	10,000000,ishift
	local	11,000000,ior
	local	12,000000,iand
	con	0,010000,2,053,057
	con	1,002000,1,3
	con	2,010000,1,000
	con	3,010000,1,075
	con	4,010000,0
	con	5,002000,1,1
	con	6,002000,1,2
	con	7,002000,1,4
	con	8,002000,2,15
	con	9,002000,1,6
	con	10,002000,2,63
	con	11,002000,1,0
	declend
	line	32
	colm	11
	init	L1
	mark	L1
	pnull
	var	6
	pnull
	pnull
	pnull
	line	35
	colm	19
	keywd	ucase
	line	35
	colm	29
	keywd	lcase
	line	35
	colm	26
	cat
	line	35
	colm	39
	keywd	digits
	line	35
	colm	36
	cat
	str	0
	line	35
	colm	47
	cat
	line	35
	colm	16
	asgn
	unmark
lab L1
	mark	L2
	pnull
	var	3
	pnull
	pnull
	int	1
	pnull
	pnull
	var	0
	line	37
	colm	15
	size
	int	1
	line	37
	colm	18
	mod
	line	37
	colm	12
	minus
	int	1
	line	37
	colm	24
	mod
	line	37
	colm	6
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	0
	dup
	var	7
	str	2
	var	3
	line	38
	colm	15
	invoke	2
	line	38
	colm	6
	cat
	asgn
	unmark
lab L3
	mark	L4
	pnull
	var	1
	var	7
	str	3
	var	3
	line	39
	colm	15
	invoke	2
	line	39
	colm	8
	asgn
	unmark
lab L4
	mark	L5
	pnull
	var	2
	str	4
	line	41
	colm	6
	asgn
	unmark
lab L5
	mark	L6
	var	0
	line	42
	colm	6
	bscan
lab L7
	mark0
	pushn1
	pnull
	var	3
	var	8
	var	9
	int	5
	line	42
	colm	29
	invoke	1
	line	42
	colm	24
	invoke	1
	line	42
	colm	18
	asgn
	pnull
	var	4
	var	8
	var	9
	int	5
	line	42
	colm	48
	invoke	1
	line	42
	colm	43
	invoke	1
	line	42
	colm	37
	asgn
	pnull
	var	5
	var	8
	var	9
	int	5
	line	42
	colm	67
	invoke	1
	line	42
	colm	62
	invoke	1
	line	42
	colm	56
	asgn
	line	42
	colm	14
	invoke	3
	unmark
	mark	L7
	mark	L10
	pnull
	var	2
	dup
	pnull
	var	6
	pnull
	int	5
	var	10
	var	3
	pnull
	int	6
	line	43
	colm	32
	neg
	line	43
	colm	29
	invoke	2
	line	43
	colm	21
	plus
	line	43
	colm	17
	subsc
	line	43
	colm	9
	cat
	asgn
	unmark
lab L10
	mark	L11
	pnull
	var	2
	dup
	pnull
	var	6
	pnull
	int	5
	var	11
	var	10
	var	12
	var	3
	int	1
	line	44
	colm	39
	invoke	2
	int	7
	line	44
	colm	34
	invoke	2
	var	10
	var	4
	pnull
	int	7
	line	44
	colm	58
	neg
	line	44
	colm	55
	invoke	2
	line	44
	colm	26
	invoke	2
	line	44
	colm	21
	plus
	line	44
	colm	17
	subsc
	line	44
	colm	9
	cat
	asgn
	unmark
lab L11
	mark	L12
	pnull
	var	2
	dup
	pnull
	var	6
	pnull
	int	5
	var	11
	var	10
	var	12
	var	4
	int	8
	line	45
	colm	39
	invoke	2
	int	6
	line	45
	colm	34
	invoke	2
	var	10
	var	5
	pnull
	int	9
	line	45
	colm	59
	neg
	line	45
	colm	56
	invoke	2
	line	45
	colm	26
	invoke	2
	line	45
	colm	21
	plus
	line	45
	colm	17
	subsc
	line	45
	colm	9
	cat
	asgn
	unmark
lab L12
	pnull
	var	2
	dup
	pnull
	var	6
	pnull
	int	5
	var	12
	var	5
	int	10
	line	46
	colm	27
	invoke	2
	line	46
	colm	21
	plus
	line	46
	colm	17
	subsc
	line	46
	colm	9
	cat
	asgn
lab L8
	unmark
	goto	L7
lab L9
	line	42
	colm	6
	escan
	unmark
lab L6
	mark	L13
	pnull
	pnull
	var	2
	int	11
	dup
	pnull
	var	1
	line	48
	colm	12
	size
	line	48
	colm	9
	minus
	sect
	var	1
	line	48
	colm	19
	asgn
	unmark
lab L13
	mark	L14
	mark	L15
	var	2
	line	50
	colm	4
	pret
lab L15
	pfail
	unmark
lab L14
	pnull
	line	51
	colm	1
	pfail
	end
proc base64decode
	local	0,001000,s
	local	1,000020,t
	local	2,000020,w
	local	3,000020,x
	local	4,000020,y
	local	5,000020,z
	local	6,000040,b64
	local	7,000040,c64
	local	8,000040,n64
	local	9,000000,cset
	local	10,000000,string
	local	11,000000,tab
	local	12,000000,many
	local	13,000000,pos
	local	14,000000,map
	local	15,000000,ord
	local	16,000000,move
	local	17,000000,char
	local	18,000000,ior
	local	19,000000,ishift
	local	20,000000,iand
	local	21,000000,trim
	con	0,010000,2,053,057
	con	1,002000,1,1
	con	2,002000,2,64
	con	3,010000,3,075,075,075
	con	4,010000,2,075,075
	con	5,010000,1,075
	con	6,010000,0
	con	7,002000,1,0
	con	8,002000,1,4
	con	9,010000,1,000
	con	10,002000,1,2
	con	11,002000,3,255
	con	12,002000,1,6
	con	13,020000,1,000
	declend
	line	53
	colm	11
	init	L1
	mark	L1
	mark	L2
	pnull
	var	6
	pnull
	pnull
	pnull
	line	57
	colm	14
	keywd	ucase
	line	57
	colm	24
	keywd	lcase
	line	57
	colm	21
	cat
	line	57
	colm	34
	keywd	digits
	line	57
	colm	31
	cat
	str	0
	line	57
	colm	42
	cat
	line	57
	colm	11
	asgn
	unmark
lab L2
	mark	L3
	pnull
	var	7
	var	9
	var	6
	line	58
	colm	18
	invoke	1
	line	58
	colm	11
	asgn
	unmark
lab L3
	pnull
	var	8
	pnull
	var	10
	line	59
	colm	21
	keywd	cset
	line	59
	colm	20
	invoke	1
	int	1
	dup
	int	2
	line	59
	colm	29
	plus
	sect
	line	59
	colm	11
	asgn
	unmark
lab L1
	mark	L4
	mark0
	mark	L5
	var	0
	unmark
	efail
lab L5
	pnull
	line	62
	colm	13
	bscan
	pushn1
	var	11
	var	12
	var	7
	line	62
	colm	25
	invoke	1
	line	62
	colm	20
	invoke	1
	pnull
	mark	L6
	str	3
	esusp
	goto	L7
lab L6
	mark	L8
	str	4
	esusp
	goto	L9
lab L8
	mark	L10
	str	5
	esusp
	goto	L11
lab L10
	str	6
lab L11
lab L9
lab L7
	line	62
	colm	33
	tabmat
	var	13
	int	7
	line	62
	colm	64
	invoke	1
	line	62
	colm	15
	invoke	3
	line	62
	colm	13
	escan
	unmark
	line	62
	colm	74
	pfail
	unmark
lab L4
	mark	L12
	mark0
	pnull
	pnull
	pnull
	var	0
	line	63
	colm	9
	size
	int	8
	line	63
	colm	12
	mod
	int	7
	line	63
	colm	18
	numne
	unmark
	line	63
	colm	28
	pfail
	unmark
lab L12
	mark	L13
	pnull
	var	0
	var	14
	var	0
	str	5
	str	9
	line	65
	colm	12
	invoke	3
	line	65
	colm	6
	asgn
	unmark
lab L13
	mark	L14
	pnull
	var	0
	var	14
	var	0
	var	6
	var	8
	line	66
	colm	12
	invoke	3
	line	66
	colm	6
	asgn
	unmark
lab L14
	mark	L15
	pnull
	var	1
	str	6
	line	68
	colm	6
	asgn
	unmark
lab L15
	mark	L16
	var	0
	line	69
	colm	6
	bscan
lab L17
	mark0
	pushn1
	pnull
	var	2
	var	15
	var	16
	int	1
	line	69
	colm	29
	invoke	1
	line	69
	colm	24
	invoke	1
	line	69
	colm	18
	asgn
	pnull
	var	3
	var	15
	var	16
	int	1
	line	69
	colm	48
	invoke	1
	line	69
	colm	43
	invoke	1
	line	69
	colm	37
	asgn
	pnull
	var	4
	var	15
	var	16
	int	1
	line	70
	colm	29
	invoke	1
	line	70
	colm	24
	invoke	1
	line	70
	colm	18
	asgn
	pnull
	var	5
	var	15
	var	16
	int	1
	line	70
	colm	48
	invoke	1
	line	70
	colm	43
	invoke	1
	line	70
	colm	37
	asgn
	line	69
	colm	14
	invoke	4
	unmark
	mark	L17
	mark	L20
	pnull
	var	1
	dup
	var	17
	var	18
	var	19
	var	2
	int	10
	line	71
	colm	31
	invoke	2
	var	19
	var	3
	pnull
	int	8
	line	71
	colm	47
	neg
	line	71
	colm	44
	invoke	2
	line	71
	colm	23
	invoke	2
	line	71
	colm	18
	invoke	1
	line	71
	colm	9
	cat
	asgn
	unmark
lab L20
	mark	L21
	pnull
	var	1
	dup
	var	17
	var	18
	var	20
	var	19
	var	3
	int	8
	line	72
	colm	36
	invoke	2
	int	11
	line	72
	colm	29
	invoke	2
	var	19
	var	4
	pnull
	int	10
	line	72
	colm	57
	neg
	line	72
	colm	54
	invoke	2
	line	72
	colm	23
	invoke	2
	line	72
	colm	18
	invoke	1
	line	72
	colm	9
	cat
	asgn
	unmark
lab L21
	pnull
	var	1
	dup
	var	17
	var	18
	var	20
	var	19
	var	4
	int	12
	line	73
	colm	36
	invoke	2
	int	11
	line	73
	colm	29
	invoke	2
	var	5
	line	73
	colm	23
	invoke	2
	line	73
	colm	18
	invoke	1
	line	73
	colm	9
	cat
	asgn
lab L18
	unmark
	goto	L17
lab L19
	line	69
	colm	6
	escan
	unmark
lab L16
	mark	L22
	mark	L23
	var	21
	var	1
	cset	13
	line	76
	colm	15
	invoke	2
	line	76
	colm	4
	pret
lab L23
	pfail
	unmark
lab L22
	pnull
	line	77
	colm	1
	pfail
	end
