qsym

A symbolic executor for the QBE intermediate language

git clone https://git.8pit.net/qsym.git

 1export
 2function w $main(w %.1, w %.3) {
 3@start.1
 4	%.2 =l alloc4 4
 5	storew %.1, %.2
 6	%.4 =l alloc4 4
 7	storew %.3, %.4
 8	%.5 =l alloc4 4
 9@body.2
10	%.6 =w loadw %.2
11	%.7 =w loadw %.4
12	%.8 =w csltw %.6, %.7
13	jnz %.8, @if_true.3, @if_false.4
14@if_true.3
15	%.9 =w loadw %.2
16	%.10 =w csltw %.9, 5
17	jnz %.10, @if_true.5, @if_false.6
18@if_true.5
19	ret 3
20@if_false.6
21	ret 2
22@if_join.7
23	jmp @if_join.8
24@if_false.4
25	ret 1
26@if_join.8
27	ret 0
28}