qute

A software analysis framework built around the QBE intermediate language

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

 1type :.6 = align 4 { 8 }
 2type :.25 = align 8 { 64 }
 3export function w $vsum(w %count.L117.val, ...)
 4{
 5@.L84
 6	%count.L117 =l	alloc4	4
 7	%args.L119 =l	alloc8	24
 8	%copy.L120 =l	alloc8	24
 9	%sum.L121 =l	alloc4	4
10	%i.L126 =l	alloc4	4
11		storew	%count.L117.val,%count.L117
12		vastart %args.L119
13		blit	%args.L119,%copy.L120,24
14		storew	0,%sum.L121
15		storew	0,%i.L126
16		jmp	@.L71
17@.L72
18		%.L75 =w vaarg %copy.L120
19	%.L76 =w	loadsw	%sum.L121
20	%.L77 =w	add	%.L76,%.L75
21		storew	%.L77,%sum.L121
22@.L73
23	%.L78 =w	loadsw	%i.L126
24	%.L79 =w	add	%.L78,1
25		storew	%.L79,%i.L126
26@.L71
27	%.L80 =w	loadsw	%i.L126
28	%.L81 =w	loadsw	%count.L117
29	%.L82 =w	csltw	%.L80,%.L81
30		jnz	%.L82,@.L72,@.L74
31@.L74
32	%.L83 =w	loadsw	%sum.L121
33		ret	%.L83
34}
35export function w $main()
36{
37@.L92
38	%.L86 =w	call	$vsum(w 4, w 10, w 20, w 30, w 40, ...)
39		ret	%.L86
40}