version	U12.1.00
uid	weighted.u1-1786291390-0
impl	error
global	1
	0,000005,WeightedShuffle,2

proc WeightedShuffle
	local	0,001000,sample
	local	1,001000,percentage
	local	2,000020,lcv
	local	3,000020,pairs
	local	4,000020,weight
	local	5,000020,size
	local	6,000020,newlist
	local	7,000020,legal
	local	8,000020,illegal
	local	9,000000,numeric
	local	10,000000,copy
	local	11,000000,list
	local	12,000000,integer
	local	13,000000,real
	local	14,000000,put
	local	15,000000,set
	local	16,000000,member
	con	0,002000,1,0
	con	1,002000,3,100
	con	2,002000,2,50
	con	3,004000,0.5
	con	4,002000,1,1
	declend
	filen	weighted.icn
	line	31
	colm	11
	synt	any
	mark	L1
	mark	L2
	var	9
	var	1
	line	33
	colm	10
	synt	any
	invoke	1
	line	33
	colm	23
	synt	any
	esusp
	goto	L3
lab L2
	line	33
	colm	25
	synt	any
	pfail
lab L3
	unmark
lab L1
	mark	L4
	mark	L5
	pnull
	pnull
	int	0
	var	1
	line	34
	colm	6
	synt	any
	numle
	int	1
	line	34
	colm	20
	synt	any
	numle
	line	34
	colm	28
	synt	any
	esusp
	goto	L6
lab L5
	line	34
	colm	30
	synt	any
	pfail
lab L6
	unmark
lab L4
	mark	L7
	pnull
	var	6
	var	10
	var	0
	line	35
	colm	18
	synt	any
	invoke	1
	line	35
	colm	11
	synt	any
	asgn
	unmark
lab L7
	mark	L8
	pnull
	var	5
	pnull
	var	6
	line	37
	colm	11
	synt	any
	size
	line	37
	colm	8
	synt	any
	asgn
	unmark
lab L8
	mark	L9
	pnull
	var	7
	var	11
	line	38
	colm	16
	synt	any
	invoke	0
	line	38
	colm	9
	synt	any
	asgn
	unmark
lab L9
	mark	L10
	line	49
	colm	3
	synt	ifelse
	mark	L11
	mark	L13
	pnull
	var	1
	int	2
	line	49
	colm	19
	synt	any
	numle
	line	49
	colm	26
	synt	any
	esusp
	goto	L14
lab L13
	pnull
	var	1
	int	1
	line	49
	colm	40
	synt	any
	numeq
lab L14
	unmark
	mark	L15
	pnull
	var	3
	var	12
	pnull
	pnull
	var	5
	var	1
	line	50
	colm	28
	synt	any
	mult
	int	1
	line	50
	colm	41
	synt	any
	div
	line	50
	colm	22
	synt	any
	invoke	1
	line	50
	colm	11
	synt	any
	asgn
	unmark
lab L15
	line	52
	colm	5
	synt	if
	mark0
	pnull
	var	3
	int	0
	line	52
	colm	14
	synt	any
	numgt
	unmark
	mark	L16
	pnull
	var	4
	var	12
	pnull
	pnull
	var	13
	var	5
	line	55
	colm	31
	synt	any
	invoke	1
	var	3
	line	55
	colm	38
	synt	any
	div
	real	3
	line	55
	colm	47
	synt	any
	plus
	line	55
	colm	25
	synt	any
	invoke	1
	line	55
	colm	14
	synt	any
	asgn
	unmark
lab L16
	mark	L17
	pnull
	var	2
	int	4
	line	58
	colm	11
	synt	any
	asgn
	unmark
lab L17
lab L18
	line	59
	colm	7
	synt	until
	mark	L19
	pnull
	var	2
	var	5
	line	59
	colm	17
	synt	any
	numgt
	unmark
	efail
lab L19
	mark	L18
	mark	L22
	var	14
	var	7
	var	2
	line	60
	colm	13
	synt	any
	invoke	2
	unmark
lab L22
	pnull
	var	2
	dup
	var	4
	line	62
	colm	13
	synt	any
	plus
	asgn
lab L20
	unmark
	goto	L18
lab L21
	line	59
	colm	7
	synt	enduntil
	line	52
	colm	5
	synt	endif
	goto	L12
lab L11
	mark	L23
	pnull
	var	3
	var	12
	pnull
	pnull
	var	5
	pnull
	int	1
	var	1
	line	67
	colm	35
	synt	any
	minus
	line	67
	colm	28
	synt	any
	mult
	int	1
	line	67
	colm	49
	synt	any
	div
	line	67
	colm	22
	synt	any
	invoke	1
	line	67
	colm	11
	synt	any
	asgn
	unmark
lab L23
	line	69
	colm	5
	synt	if
	mark0
	pnull
	var	3
	int	0
	line	69
	colm	14
	synt	any
	numgt
	unmark
	mark	L24
	pnull
	var	4
	var	12
	pnull
	var	5
	var	3
	line	70
	colm	31
	synt	any
	div
	line	70
	colm	25
	synt	any
	invoke	1
	line	70
	colm	14
	synt	any
	asgn
	unmark
lab L24
	mark	L25
	pnull
	var	8
	var	15
	pnull
	line	71
	colm	23
	synt	any
	llist	0
	line	71
	colm	22
	synt	any
	invoke	1
	line	71
	colm	15
	synt	any
	asgn
	unmark
lab L25
	mark	L26
	pnull
	var	2
	int	4
	line	72
	colm	11
	synt	any
	asgn
	unmark
lab L26
	mark	L27
lab L28
	line	73
	colm	7
	synt	until
	mark	L29
	pnull
	var	2
	var	5
	line	73
	colm	17
	synt	any
	numgt
	unmark
	efail
lab L29
	mark	L28
	mark	L32
	pnull
	var	8
	dup
	var	15
	pnull
	var	2
	line	74
	colm	26
	synt	any
	llist	1
	line	74
	colm	25
	synt	any
	invoke	1
	line	74
	colm	17
	synt	any
	unions
	asgn
	unmark
lab L32
	pnull
	var	2
	dup
	var	4
	line	76
	colm	13
	synt	any
	plus
	asgn
lab L30
	unmark
	goto	L28
lab L31
	line	73
	colm	7
	synt	enduntil
	unmark
lab L27
	line	78
	colm	7
	synt	every
	mark0
	pnull
	var	2
	pnull
	int	4
	var	5
	push1
	line	78
	colm	22
	synt	any
	toby
	line	78
	colm	17
	synt	any
	asgn
	pop
	mark0
	line	79
	colm	9
	synt	if
	mark0
	mark	L35
	var	16
	var	8
	var	2
	line	79
	colm	23
	synt	any
	invoke	2
	unmark
	efail
lab L35
	pnull
	unmark
	var	14
	var	7
	var	2
	line	79
	colm	47
	synt	any
	invoke	2
	line	79
	colm	9
	synt	endif
	unmark
lab L33
	efail
lab L34
	line	78
	colm	7
	synt	endevery
	line	69
	colm	5
	synt	endif
lab L12
	line	49
	colm	3
	synt	endifelse
	unmark
lab L10
	mark	L36
	line	82
	colm	3
	synt	every
	mark0
	pnull
	pnull
	var	6
	pnull
	var	7
	line	82
	colm	17
	synt	any
	bang
	line	82
	colm	16
	synt	any
	subsc
	pnull
	var	6
	pnull
	var	7
	line	82
	colm	37
	synt	any
	random
	line	82
	colm	36
	synt	any
	subsc
	line	82
	colm	25
	synt	any
	swap
	pop
lab L37
	efail
lab L38
	line	82
	colm	3
	synt	endevery
	unmark
lab L36
	mark	L39
	mark	L40
	var	6
	line	85
	colm	3
	synt	any
	pret
lab L40
	synt	any
	pfail
	unmark
lab L39
	pnull
	line	86
	colm	1
	synt	any
	pfail
	end
