         Edinburgh IMP77 Compiler - Version 8.4
    1 %begin
		.Ltext0:
		ONE.6407:
		.LFB187:
		.LVL13:
				pushq	%rbx
				subq	$1040, %rsp
				movq	%fs:40, %rax
				movq	%rax, 1032(%rsp)
				xorl	%eax, %eax
    2
				call	_imp_initialise@PLT
		.LVL14:
		.LBB44:
		.LBB45:
				movl	$0, _imp_OutStream(%rip)
				movq	8+_imp_outfile(%rip), %rax
				movq	%rax, _imp_OutFile(%rip)
				leaq	__PRETTY_FUNCTION__.5991(%rip), %rdi
				call	check_outstream@PLT
		.LVL15:
		.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
				movabsq	$5991230563793597555, %rax
				movabsq	$8391162080153257296, %rdx
				movq	%rax, 769(%rsp)
				movq	%rdx, 777(%rsp)
				movq	$0, 785(%rsp)
				movq	$0, 793(%rsp)
				movl	$0, %ebx
				movb	$0, 801(%rsp)
				movw	$0, 802(%rsp)
				movl	$0, 804(%rsp)
				leaq	808(%rsp), %rdi
				movl	$27, %ecx
				movq	%rbx, %rax
				rep stosq
				movb	$16, 768(%rsp)
				movq	768(%rsp), %rax
				movq	776(%rsp), %rdx
				movq	%rax, (%rsp)
				movq	%rdx, 8(%rsp)
		.LVL16:
				movb	$16, (%rsp)
		.LBE46:
		.LBB47:
		.LBB48:
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	1016(%rsp)
				pushq	248(%rsp)
				pushq	248(%rsp)
				call	_imp_printstring@PLT
		.LVL17:
		.LBE48:
		.LBE47:
		.LBB49:
		.LBB50:
				addq	$256, %rsp
				call	_imp_newline@PLT
		.LVL18:
		.LBE50:
		.LBE49:
		.LBB51:
		.LBB52:
		.LBB53:
		.LBB54:
   10     css
   11     printstring("end %SPEC test"); newline
				movabsq	$4994583405676228197, %rax
				movabsq	$128038972170307, %rdx
				movq	%rax, 513(%rsp)
				movq	%rdx, 521(%rsp)
				movb	$0, 529(%rsp)
				movw	$0, 530(%rsp)
				movl	$0, 532(%rsp)
				leaq	536(%rsp), %rdi
				movl	$29, %ecx
				movq	%rbx, %rax
				rep stosq
				movb	$14, 512(%rsp)
				movq	512(%rsp), %rax
				movq	520(%rsp), %rdx
				movq	%rax, 256(%rsp)
				movq	%rdx, 264(%rsp)
		.LVL21:
				movb	$14, 256(%rsp)
		.LBE57:
		.LBB58:
		.LBB59:
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	760(%rsp)
				pushq	504(%rsp)
				pushq	504(%rsp)
				call	_imp_printstring@PLT
		.LVL22:
		.LBE59:
		.LBE58:
		.LBB60:
		.LBB61:
				addq	$256, %rsp
				call	_imp_newline@PLT
		.LVL23:
		.LBE61:
		.LBE60:
		.LBB62:
		.LBB63:
				movl	$0, %edi
				call	exit@PLT
		.LVL24:
		.LBE63:
		.LBE62:
		.LFE185:
				.comm	CALLCOUNT.6413,4,4
				.section	.rodata
				.align 16
		__PRETTY_FUNCTION__.5991:
				.string	"_imp_SELECTOUTPUT"
		.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:
				pushq	%r12
				pushq	%rbp
				pushq	%rbx
		.LVL1:
   22             %integer a1,b1,c1,d1
   23             %owninteger callcount
   24
   25             %begin
   26                 a1 = p1
   27                 b1 = 2*p1
				leal	(%rdi,%rdi), %ebx
		.LVL2:
   28                 c1 = 3*p1
				leal	(%rbx,%rdi), %r12d
		.LVL3:
   29                 callcount = callcount + 1
				movl	CALLCOUNT.6413(%rip), %eax
				addl	$1, %eax
				movl	%eax, CALLCOUNT.6413(%rip)
		.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
				cmpl	$9, %eax
				jg	.L4
		.LVL4:
		.LBB20:
		.LBB21:
   35             %result = d1
				jmp	.L1
		.LFE187:
				.globl	main
		main:
		.LFB185:
   36         %end
				popq	%rbx
		.LVL9:
				popq	%rbp
				popq	%r12
		.LVL10:
				ret
		.LVL11:
		.L4:
   37
   38         b = 3
				movl	$-1, %eax
		.L2:
		.L3:
		.LVL12:
   39
   40         %integerfn three(%integer p1,p2,p3)
   41             %integer a3,b3
   42             a3 = one(p1)
				call	ONE.6407
		.LVL5:
				movl	%eax, %ebp
		.LVL6:
		.LBB22:
		.LBB23:
				movl	$3, %edi
				call	ONE.6407
		.LVL19:
		.LBB55:
		.LBB56:
				movl	$13, %edi
				call	ONE.6407
		.LVL20:
		.LBE56:
		.LBE55:
		.LBE54:
		.LBE53:
		.LBE52:
		.LBE51:
		.LBB57:
   43             b3 = two(p2,p3)
   44             %result = a3 + b3
				addl	%ebp, %eax
		.LVL8:
		.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)
				leal	(%rbx,%r12), %edi
				call	ONE.6407
		.LVL7:
		.LBE23:
		.LBE22:
   53         %end
?B2 unused
?A2 unused
   54
   55     %end
   56
   57 %endofprogram
   39 Statements compiled
