% Remember to use the lgrind style

\File{sieve.s},{19:13},{Sep 23 1993}
\L{\LB{\Proc{sieve}\K{program}_\V{sieve}_\K{is}}}
\L{\LB{___\K{const}}}
\L{\LB{______\V{size}_:_\V{int}_=_512;}}
\L{\LB{___\K{var}}}
\L{\LB{______\V{i}_:_\V{int}_:=_1;}}
\L{\LB{___\K{varray}}}
\L{\LB{______\V{flags}_:_\K{array}_[512]_\K{of}_\V{bool}_:=_[3,4,5,12,76];}}
\L{\LB{___\K{proc}}}
\L{\LB{______\V{findPrimes}_()_=}}
\L{\LB{}\Tab{8}{_\K{local}}}
\L{\LB{____________\K{var}}}
\L{\LB{_______________\V{i}_:_\V{int}_:=_2;}}
\L{\LB{}\Tab{8}{____\K{var}}}
\L{\LB{}\Tab{8}{_______\V{j}_:_\V{int}_:=_0}}
\L{\LB{_________\K{in}}}
\L{\LB{____________\K{while}_(\V{i}_\<=_\V{size})}}
\L{\LB{}\Tab{8}{_______\K{do}}}
\L{\LB{__________________\K{if}_\V{flags}[\V{i}]}}
\L{\LB{_____________________\K{then}}}
\L{\LB{________________________\V{j}_:=_\V{i}_+_\V{i};}}
\L{\LB{\-\-______________________\V{Sets}_\V{all}_\V{multiples}_\K{of}_\V{i}_\K{to}_\V{false}\1\V{non}\-\V{prime}}}
\L{\LB{________________________\K{while}_(\V{j}_\<=_\V{size})}}
\L{\LB{___________________________\K{do}}}
\L{\LB{______________________________\V{flags}[\V{j}]_:=_\V{false};}}
\L{\LB{______________________________\V{j}_:=_\V{j}_+_\V{i}}}
\L{\LB{___________________________\K{end}}}
\L{\LB{_____________________\K{end};}}
\L{\LB{__________________\V{i}_:=_\V{i}_+_1}}
\L{\LB{_______________\K{end}}}
\L{\LB{_________\K{end}}}
\L{\LB{\K{in}}}
\L{\LB{___\K{while}_(\V{i}_\<=_\V{size})_\K{do}_\V{flags}[\V{i}]_:=_\V{true}_\K{end};}}
\L{\LB{___\K{call}_\V{findPrimes}_()}}
\L{\LB{\K{end}}}
