qute

A software analysis framework built around the QBE intermediate language

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

 1export
 2function w $f(w %.1, ...) {
 3@start.1
 4	%.2 =l alloc4 4
 5	storew %.1, %.2
 6	%.3 =l alloc4 4
 7	%.4 =l alloc4 4
 8	%.5 =l alloc8 24
 9@body.2
10	storew 0, %.4
11	vastart %.5
12	%.6 =w loadw %.2
13	%.7 =w add %.6, 1
14	storew %.7, %.2
15	%.8 =l extsw %.7
16	%.9 =l mul %.8, 4
17	%.10 =l vaarg %.5
18	%.11 =w loadw %.10
19	storew %.11, %.3
20	%.12 =w loadw %.3
21	%.13 =w loadw %.2
22	%.14 =w add %.12, %.13
23	ret %.14
24}
25export
26function w $main() {
27@start.3
28	%.1 =l alloc4 12
29@body.4
30	%.2 =l extsw 0
31	%.3 =l mul %.2, 4
32	%.4 =l add %.1, %.3
33	storew 123, %.4
34	%.5 =w call $f(w 3, ..., l %.1)
35	ret %.5
36}