1 fn next-random prev: int -> _/edi: int {
2 # https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use
3 var a/ecx: int <- copy 0x4b/75
4 var c/edx: int <- copy 0x4a/74
5 var m/ebx: int <- copy 0x10001
6 var next/eax: int <- copy prev
9 next <- remainder next, m
13 fn remainder a: int, b: int -> _/eax: int {
14 var q/eax: int <- copy 0
15 var r/edx: int <- copy 0
16 q, r <- integer-divide a, b