         Edinburgh IMP77 Compiler - Version 8.4
    1 %begin
				.machine ppc
				.section	".text"
		.Ltext0:
				.align 2
		ONE.7004:
		.LFB187:
		.LVL12:
				stwu 1,-1328(1)
				mflr 0
				stw 0,1332(1)
				stw 31,1324(1)
				lwz 9,-28680(2)
				stw 9,1308(1)
				li 9,0
    2
				bl _imp_initialise
		.LVL13:
		.LBB44:
		.LBB45:
				lis 9,_imp_OutStream@ha
				li 10,0
				stw 10,_imp_OutStream@l(9)
				lis 9,_imp_outfile+4@ha
				lwz 10,_imp_outfile+4@l(9)
				lis 9,_imp_OutFile@ha
				stw 10,_imp_OutFile@l(9)
				lis 31,.LANCHOR1@ha
				la 31,.LANCHOR1@l(31)
				mr 3,31
				bl check_outstream
		.LVL14:
		.LBE45:
		.LBE44:
		.LBB46:
    3     ! An example program which uses a %routinespec and a call
    4     ! to the routine BEFORE actually the routine implementation
    5
    6     %routinespec css
    7
    8     selectoutput(0)
    9     printstring("start %SPEC test"); newline
				li 5,256
				addi 4,31,18
				addi 3,1,1052
				bl memcpy
		.LVL15:
				li 5,256
				addi 4,1,1052
				addi 3,1,284
				bl memcpy
		.LVL16:
				li 5,256
				addi 4,1,284
				addi 3,1,1052
				bl memcpy
		.LVL17:
		.LBE46:
		.LBB47:
		.LBB48:
				li 5,256
				addi 4,1,1052
				addi 3,1,16
				bl memcpy
		.LVL18:
				addi 3,1,16
				bl _imp_printstring
		.LVL19:
		.LBE48:
		.LBE47:
		.LBB49:
		.LBB50:
				bl _imp_newline
		.LVL20:
		.LBE50:
		.LBE49:
		.LBB51:
		.LBB52:
		.LBB53:
		.LBB54:
   10     css
   11     printstring("end %SPEC test"); newline
				li 5,256
				addi 4,31,274
				addi 3,1,796
				bl memcpy
		.LVL23:
				li 5,256
				addi 4,1,796
				addi 3,1,540
				bl memcpy
		.LVL24:
				li 5,256
				addi 4,1,540
				addi 3,1,796
				bl memcpy
		.LVL25:
		.LBE57:
		.LBB58:
		.LBB59:
				li 5,256
				addi 4,1,796
				addi 3,1,16
				bl memcpy
		.LVL26:
				addi 3,1,16
				bl _imp_printstring
		.LVL27:
		.LBE59:
		.LBE58:
		.LBB60:
		.LBB61:
				bl _imp_newline
		.LVL28:
		.LBE61:
		.LBE60:
		.LBB62:
		.LBB63:
				li 3,0
				bl exit
		.LVL29:
		.LBE63:
		.LBE62:
		.LFE185:
				.section	.rodata
				.align 2
				.set	.LANCHOR1,. + 0
		__PRETTY_FUNCTION__.6588:
				.string	"_imp_SELECTOUTPUT"
		.LC0:
				.byte	16
				.string	"start %SPEC test"
				.zero	238
		.LC1:
				.byte	14
				.string	"end %SPEC test"
				.zero	240
				.section	".bss"
				.align 2
				.set	.LANCHOR0,. + 0
		CALLCOUNT.7010:
				.zero	4
				.section	".text"
		.Letext0:
   12
   13     %routine css
   14         %integer a,b,c
   15
   16         %integerfnspec three(%integer p1,p2,p3)
   17         %integerfnspec two(%integer p1,p2)
   18
   19         c = 5
   20
   21         %integerfn one(%integer p1)
		.LVL0:
				stwu 1,-32(1)
				mflr 0
				stw 0,36(1)
				stw 29,20(1)
				stw 30,24(1)
				stw 31,28(1)
				slwi 29,3,1
		.LVL1:
				mulli 30,3,3
		.LVL2:
		.LBB20:
		.LBB21:
   22             %integer a1,b1,c1,d1
   23             %owninteger callcount
   24
   25             %begin
   26                 a1 = p1
   27                 b1 = 2*p1
   28                 c1 = 3*p1
   29                 callcount = callcount + 1
				lis 10,.LANCHOR0@ha
				lwz 9,.LANCHOR0@l(10)
				addi 9,9,1
				stw 9,.LANCHOR0@l(10)
		.LDL1:
   30             %end
   31
   32             ! Use callcount as a defence against repeated calls to routine 'three'
   33             ! which would cause a stack overflow.
   34             %if (callcount < 10) %then d1 = three(a1,b1,c1) %else d1 = -1
				cmpwi 7,9,9
				bgt 7,.L4
   35             %result = d1
   36         %end
				lwz 0,36(1)
				mtlr 0
				lwz 29,20(1)
		.LVL8:
				lwz 30,24(1)
		.LVL9:
				lwz 31,28(1)
				addi 1,1,32
				blr
		.LVL10:
		.L4:
				blr
		.LFE187:
				.align 2
				.globl main
		main:
		.LFB185:
   37
   38         b = 3
				li 3,-1
		.LVL11:
		.L2:
		.L3:
   39
   40         %integerfn three(%integer p1,p2,p3)
   41             %integer a3,b3
   42             a3 = one(p1)
				bl ONE.7004
		.LVL3:
				mr 31,3
		.LVL4:
		.LBB22:
		.LBB23:
				li 3,3
				bl ONE.7004
		.LVL21:
		.LBB55:
		.LBB56:
				li 3,13
				bl ONE.7004
		.LVL22:
		.LBE56:
		.LBE55:
		.LBE54:
		.LBE53:
		.LBE52:
		.LBE51:
		.LBB57:
   43             b3 = two(p2,p3)
   44             %result = a3 + b3
				add 3,31,3
		.LVL7:
		.LBE21:
		.LBE20:
   45         %end
   46
   47         a = three(b,c,b+c)
   48
   49         %integerfn two(%integer p1,p2)
   50             %integer a2,b2
   51
   52             %result = one(p1+p2)
				add 3,29,30
		.LVL5:
				bl ONE.7004
		.LVL6:
		.LBE23:
		.LBE22:
   53         %end
?B2 unused
?A2 unused
   54
   55     %end
   56
   57 %endofprogram
   39 Statements compiled
