         Edinburgh IMP77 Compiler - Version 8.4
    1 %begin
		.Ltext0:
				.align	1
				.thumb
				.thumb_func
		ONE.10045:
		.LFB187:
				@ Volatile: function does not return.
				@ args = 0, pretend = 0, frame = 1032
				@ frame_needed = 0, uses_anonymous_args = 0
		.LVL12:
				push	{r7, lr}
				sub	sp, sp, #1272
				ldr	r4, .L11
		.LPIC2:
				add	r4, pc
				ldr	r3, .L11+4
				ldr	r3, [r4, r3]
				ldr	r3, [r3]
				str	r3, [sp, #1268]
    2
				bl	_imp_initialise(PLT)
		.LVL13:
		.LBB44:
		.LBB45:
				ldr	r3, .L11+8
				ldr	r3, [r4, r3]
				mov	r8, #0
				str	r8, [r3]
				ldr	r3, .L11+12
				ldr	r3, [r4, r3]
				ldr	r2, .L11+16
				ldr	r2, [r4, r2]
				ldr	r2, [r2, #4]
				str	r2, [r3]
				ldr	r7, .L11+20
		.LPIC3:
				add	r7, pc
				mov	r0, r7
				bl	check_outstream(PLT)
		.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
				mov	r5, #256
				mov	r2, r5
				add	r1, r7, #20
				add	r4, sp, #1012
				mov	r0, r4
				bl	memcpy(PLT)
		.LVL15:
				mov	r2, r5
				mov	r1, r4
				add	r6, sp, #244
				mov	r0, r6
				bl	memcpy(PLT)
		.LVL16:
				mov	r2, r5
				mov	r1, r6
				mov	r0, r4
				bl	memcpy(PLT)
		.LVL17:
		.LBE46:
		.LBB47:
		.LBB48:
				mov	r9, #240
				mov	r2, r9
				addw	r1, sp, #1028
				mov	r0, sp
				bl	memcpy(PLT)
		.LVL18:
				ldm	r4, {r0, r1, r2, r3}
				bl	_imp_printstring(PLT)
		.LVL19:
		.LBE48:
		.LBE47:
		.LBB49:
		.LBB50:
				bl	_imp_newline(PLT)
		.LVL20:
		.LBE50:
		.LBE49:
		.LBB51:
		.LBB52:
		.LBB53:
		.LBB54:
   10     css
   11     printstring("end %SPEC test"); newline
				mov	r2, r5
				add	r1, r7, #276
				add	r4, sp, #756
				mov	r0, r4
				bl	memcpy(PLT)
		.LVL23:
				mov	r2, r5
				mov	r1, r4
				add	r6, sp, #500
				mov	r0, r6
				bl	memcpy(PLT)
		.LVL24:
				mov	r2, r5
				mov	r1, r6
				mov	r0, r4
				bl	memcpy(PLT)
		.LVL25:
		.LBE57:
		.LBB58:
		.LBB59:
				mov	r2, r9
				add	r1, sp, #772
				mov	r0, sp
				bl	memcpy(PLT)
		.LVL26:
				ldm	r4, {r0, r1, r2, r3}
				bl	_imp_printstring(PLT)
		.LVL27:
		.LBE59:
		.LBE58:
		.LBB60:
		.LBB61:
				bl	_imp_newline(PLT)
		.LVL28:
		.LBE61:
		.LBE60:
		.LBB62:
		.LBB63:
				mov	r0, r8
				bl	exit(PLT)
		.LVL29:
		.L12:
				.align	2
		.L11:
				.word	_GLOBAL_OFFSET_TABLE_-(.LPIC2+4)
				.word	__stack_chk_guard(GOT)
				.word	_imp_OutStream(GOT)
				.word	_imp_OutFile(GOT)
				.word	_imp_outfile(GOT)
				.word	.LANCHOR1-(.LPIC3+4)
		.LBE63:
		.LBE62:
		.LFE185:
				.section	.rodata
				.align	2
				.set	.LANCHOR1,. + 0
		__PRETTY_FUNCTION__.9629:
				.ascii	"_imp_SELECTOUTPUT\000"
				.space	2
		.LC0:
				.byte	16
				.ascii	"start %SPEC test\000"
				.space	238
		.LC1:
				.byte	14
				.ascii	"end %SPEC test\000"
				.space	240
				.bss
				.align	2
				.set	.LANCHOR0,. + 0
		CALLCOUNT.10051:
				.space	4
		.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)
				@ args = 0, pretend = 0, frame = 0
				@ frame_needed = 0, uses_anonymous_args = 0
		.LVL0:
				push	{r4, r5, r6, lr}
		.LVL1:
   22             %integer a1,b1,c1,d1
   23             %owninteger callcount
   24
   25             %begin
   26                 a1 = p1
   27                 b1 = 2*p1
				lsls	r5, r0, #1
		.LVL2:
   28                 c1 = 3*p1
				adds	r6, r5, r0
		.LVL3:
   29                 callcount = callcount + 1
				ldr	r2, .L6
		.LPIC0:
				add	r2, pc
				ldr	r3, [r2]
				adds	r3, r3, #1
				str	r3, [r2]
		.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
				cmp	r3, #9
				bgt	.L4
		.LVL4:
		.LBB20:
		.LBB21:
   35             %result = d1
				b	.L1
		.L7:
				.align	2
		.L6:
				.word	.LANCHOR0-(.LPIC0+4)
		.LFE187:
				.align	1
				.global	main
				.thumb
				.thumb_func
		main:
		.LFB185:
   36         %end
				pop	{r4, r5, r6, pc}
		.LVL10:
		.L4:
   37
   38         b = 3
				mov	r0, #-1
		.LVL11:
		.L2:
		.L3:
   39
   40         %integerfn three(%integer p1,p2,p3)
   41             %integer a3,b3
   42             a3 = one(p1)
				bl	ONE.10045(PLT)
		.LVL5:
				mov	r4, r0
		.LVL6:
		.LBB22:
		.LBB23:
				movs	r0, #3
				bl	ONE.10045(PLT)
		.LVL21:
		.LBB55:
		.LBB56:
				movs	r0, #13
				bl	ONE.10045(PLT)
		.LVL22:
		.LBE56:
		.LBE55:
		.LBE54:
		.LBE53:
		.LBE52:
		.LBE51:
		.LBB57:
   43             b3 = two(p2,p3)
   44             %result = a3 + b3
				add	r0, r0, r4
		.LVL9:
		.L1:
		.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)
				adds	r0, r5, r6
		.LVL7:
				bl	ONE.10045(PLT)
		.LVL8:
		.LBE23:
		.LBE22:
   53         %end
?B2 unused
?A2 unused
   54
   55     %end
   56
   57 %endofprogram
   39 Statements compiled
