         Edinburgh IMP77 Compiler - Version 8.4
    1 %begin
				.machinemode zarch
				.machine "zEC12"
		.text
		.Ltext0:
				.align	8
		ONE.6709:
		.LFB187:
		.LVL12:
				stmg	%r11,%r15,88(%r15)
				lay	%r15,-1448(%r15)
				ear	%r1,%a0
				sllg	%r1,%r1,32
				ear	%r1,%a1
				mvc	1440(8,%r15),40(%r1)
    2
				brasl	%r14,_imp_initialise@PLT
		.LVL13:
		.LBB44:
		.LBB45:
				lgrl	%r1,_imp_OutStream@GOTENT
				mvhi	0(%r1),0
				lgrl	%r1,_imp_OutFile@GOTENT
				lgrl	%r2,_imp_outfile@GOTENT
				lg	%r2,8(%r2)
				stg	%r2,0(%r1)
				larl	%r2,__PRETTY_FUNCTION__.6293
				brasl	%r14,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
				larl	%r1,.LC0
				mvc	1184(256,%r15),0(%r1)
				mvc	416(256,%r15),1184(%r15)
				mvc	1184(256,%r15),416(%r15)
		.LBE46:
		.LBB47:
		.LBB48:
				mvc	160(256,%r15),1184(%r15)
				aghik	%r11,%r15,160
				lgr	%r2,%r11
				brasl	%r14,_imp_printstring@PLT
		.LVL15:
		.LBE48:
		.LBE47:
		.LBB49:
		.LBB50:
				brasl	%r14,_imp_newline@PLT
		.LVL16:
		.LBE50:
		.LBE49:
		.LBB51:
		.LBB52:
		.LBB53:
		.LBB54:
   10     css
   11     printstring("end %SPEC test"); newline
				larl	%r1,.LC1
				mvc	928(256,%r15),0(%r1)
				mvc	672(256,%r15),928(%r15)
				mvc	928(256,%r15),672(%r15)
		.LBE57:
		.LBB58:
		.LBB59:
				mvc	160(256,%r15),928(%r15)
				lgr	%r2,%r11
				brasl	%r14,_imp_printstring@PLT
		.LVL19:
		.LBE59:
		.LBE58:
		.LBB60:
		.LBB61:
				brasl	%r14,_imp_newline@PLT
		.LVL20:
		.LBE61:
		.LBE60:
		.LBB62:
		.LBB63:
				lghi	%r2,0
				brasl	%r14,exit@PLT
		.LVL21:
		.LBE63:
		.LBE62:
		.LFE185:
				.comm	CALLCOUNT.6715,4,4
				.section	.rodata
				.align	2
		__PRETTY_FUNCTION__.6293:
				.string	"_imp_SELECTOUTPUT"
		.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:
				stmg	%r9,%r15,72(%r15)
				lay	%r15,-160(%r15)
		.LVL1:
   22             %integer a1,b1,c1,d1
   23             %owninteger callcount
   24
   25             %begin
   26                 a1 = p1
   27                 b1 = 2*p1
				sllk	%r9,%r2,1
		.LVL2:
   28                 c1 = 3*p1
				ark	%r11,%r9,%r2
		.LVL3:
   29                 callcount = callcount + 1
				lrl	%r1,CALLCOUNT.6715
				ahi	%r1,1
				strl	%r1,CALLCOUNT.6715
		.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
				cijh	%r1,9,.L4
		.LVL4:
		.LBB20:
		.LBB21:
   35             %result = d1
   36         %end
				lgfr	%r2,%r2
				lg	%r4,272(%r15)
				lmg	%r9,%r15,232(%r15)
		.LVL9:
				br	%r4
		.LVL10:
		.L4:
   37
   38         b = 3
				lhi	%r2,-1
		.LVL11:
				j	.L3
		.LFE187:
				.section	.rodata
				.align	2
		.LC0:
				.byte	16
				.string	"start %SPEC test"
				.zero	238
				.align	2
		.LC1:
				.byte	14
				.string	"end %SPEC test"
				.zero	240
		.text
				.align	8
		.globl main
		main:
		.LFB185:
   39
   40         %integerfn three(%integer p1,p2,p3)
   41             %integer a3,b3
   42             a3 = one(p1)
				brasl	%r14,ONE.6709
		.LVL5:
				lgr	%r10,%r2
		.LVL6:
		.LBB22:
		.LBB23:
				lghi	%r2,3
				brasl	%r14,ONE.6709
		.LVL17:
		.LBB55:
		.LBB56:
				lghi	%r2,13
				brasl	%r14,ONE.6709
		.LVL18:
		.LBE56:
		.LBE55:
		.LBE54:
		.LBE53:
		.LBE52:
		.LBE51:
		.LBB57:
   43             b3 = two(p2,p3)
   44             %result = a3 + b3
				ar	%r2,%r10
		.LVL8:
		.L2:
		.L3:
		.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)
				ark	%r2,%r9,%r11
				lgfr	%r2,%r2
				brasl	%r14,ONE.6709
		.LVL7:
		.LBE23:
		.LBE22:
   53         %end
?B2 unused
?A2 unused
   54
   55     %end
   56
   57 %endofprogram
   39 Statements compiled
