quebex

A software analysis framework built around the QBE intermediate language

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

 1export
 2function w $entry(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	jmp @body.2
10@body.2
11	%.6 =w loadw %.2
12	%.7 =w loadw %.4
13	%.8 =w csltw %.6, %.7
14	jnz %.8, @if_true.3, @if_false.4
15@if_true.3
16	%.9 =w loadw %.2
17	%.10 =w csltw %.9, 5
18	jnz %.10, @if_true.5, @if_false.6
19@if_true.5
20	ret 3
21@if_false.6
22	ret 2
23@if_join.7
24	jmp @if_join.8
25@if_false.4
26	ret 1
27@if_join.8
28	ret
29}