         Edinburgh IMP77 Compiler - Version 8.4
    1 %begin
		.Ltext0:
				.globl	next_free_bound_index
				.bss
				.align 4
		next_free_bound_index:
				.zero	4
				.comm	_lb,384,32
				.comm	_ub,384,32
		_imp_SELECTOUTPUT:
		.LFB94:
				pushl	%ebp
				movl	%esp, %ebp
				pushl	%ebx
				subl	$4, %esp
				call	__x86.get_pc_thunk.ax
				addl	$_GLOBAL_OFFSET_TABLE_, %eax
				cmpl	$0, 8(%ebp)
				js	.L4
				movl	_imp_OutStream@GOT(%eax), %edx
				movl	8(%ebp), %ecx
				movl	%ecx, (%edx)
				movl	_imp_outfile@GOT(%eax), %ecx
				movl	8(%ebp), %edx
				imull	$276, %edx, %edx
				addl	%ecx, %edx
				addl	$4, %edx
				movl	(%edx), %ecx
				movl	_imp_OutFile@GOT(%eax), %edx
				movl	%ecx, (%edx)
				subl	$12, %esp
				leal	__PRETTY_FUNCTION__.5628@GOTOFF(%eax), %edx
				pushl	%edx
				movl	%eax, %ebx
				call	check_outstream@PLT
				addl	$16, %esp
				jmp	.L1
		.L4:
				nop
		.L1:
				movl	-4(%ebp), %ebx
				leave
				ret
		.LFE94:
		ONE.6044:
		.LFB191:
				leal	4(%esp), %ecx
				andl	$-16, %esp
				pushl	-4(%ecx)
				pushl	%ebp
				movl	%esp, %ebp
				pushl	%edi
				pushl	%esi
				pushl	%ebx
				pushl	%ecx
				subl	$1064, %esp
				call	__x86.get_pc_thunk.bx
				addl	$_GLOBAL_OFFSET_TABLE_, %ebx
				movl	%ecx, %eax
				movl	4(%eax), %edx
				movl	%edx, -1068(%ebp)
				movl	%gs:20, %esi
				movl	%esi, -28(%ebp)
				xorl	%esi, %esi
				leal	8(%ebp), %edx
				movl	%edx, -1060(%ebp)
				subl	$8, %esp
				pushl	-1068(%ebp)
				pushl	(%eax)
				call	_imp_initialise@PLT
				addl	$16, %esp
    2
    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)
				subl	$12, %esp
				pushl	$0
				call	_imp_SELECTOUTPUT
				addl	$16, %esp
		.LBB14:
    9     printstring("start %SPEC test"); newline
				leal	-284(%ebp), %eax
				leal	.LC0@GOTOFF(%ebx), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				leal	-1052(%ebp), %eax
				leal	-284(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				leal	-284(%ebp), %eax
				leal	-1052(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
		.LBE14:
		.LBB15:
		.LBB16:
				subl	$256, %esp
				movl	%esp, %eax
				movl	%eax, %edi
				leal	-284(%ebp), %eax
				movl	$64, %edx
				movl	%eax, %esi
				movl	%edx, %ecx
				rep movsl
				call	_imp_printstring@PLT
				addl	$256, %esp
		.LBE16:
		.LBE15:
		.LBB17:
		.LBB18:
				call	_imp_newline@PLT
		.LBE18:
		.LBE17:
   10     css
				leal	-1060(%ebp), %eax
				movl	%eax, %ecx
				call	CSS.6025
		.LBB19:
   11     printstring("end %SPEC test"); newline
				leal	-540(%ebp), %eax
				leal	.LC1@GOTOFF(%ebx), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				leal	-796(%ebp), %eax
				leal	-540(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				leal	-540(%ebp), %eax
				leal	-796(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
		.LBE19:
		.LBB20:
		.LBB21:
				subl	$256, %esp
				movl	%esp, %eax
				movl	%eax, %edi
				leal	-540(%ebp), %eax
				movl	$64, %edx
				movl	%eax, %esi
				movl	%edx, %ecx
				rep movsl
				call	_imp_printstring@PLT
				addl	$256, %esp
		.LBE21:
		.LBE20:
		.LBB22:
		.LBB23:
				call	_imp_newline@PLT
				movl	$0, -1056(%ebp)
		.LBE23:
		.LBE22:
		.LBB24:
		.LBB25:
				subl	$12, %esp
				pushl	-1056(%ebp)
				call	exit@PLT
		.LBE25:
		.LBE24:
		.LFE189:
		THREE.6039:
		.LFB192:
   12
   13     %routine css
				pushl	%ebp
				movl	%esp, %ebp
				subl	$56, %esp
				call	__x86.get_pc_thunk.ax
				addl	$_GLOBAL_OFFSET_TABLE_, %eax
				movl	%ecx, -44(%ebp)
				movl	%gs:20, %eax
				movl	%eax, -12(%ebp)
				xorl	%eax, %eax
				leal	8(%ebp), %eax
				movl	%eax, -28(%ebp)
   14         %integer a,b,c
   15
   16         %integerfnspec three(%integer p1,p2,p3)
   17         %integerfnspec two(%integer p1,p2)
   18
   19         c = 5
				movl	$5, -24(%ebp)
   20
   21         %integerfn one(%integer p1)
				pushl	%ebp
				movl	%esp, %ebp
				pushl	%ebx
				subl	$36, %esp
				call	__x86.get_pc_thunk.ax
				addl	$_GLOBAL_OFFSET_TABLE_, %eax
				movl	%ecx, %ebx
				movl	%ecx, -28(%ebp)
   22             %integer a1,b1,c1,d1
   23             %owninteger callcount
   24
   25             %begin
   26                 a1 = p1
				movl	8(%ebp), %edx
				movl	%edx, -20(%ebp)
   27                 b1 = 2*p1
				movl	8(%ebp), %edx
				addl	%edx, %edx
				movl	%edx, -16(%ebp)
   28                 c1 = 3*p1
				movl	8(%ebp), %ecx
				movl	%ecx, %edx
				addl	%edx, %edx
				addl	%ecx, %edx
				movl	%edx, -12(%ebp)
   29                 callcount = callcount + 1
				movl	CALLCOUNT.6050@GOTOFF(%eax), %edx
				addl	$1, %edx
				movl	%edx, CALLCOUNT.6050@GOTOFF(%eax)
   30             %end
				nop
		.L6:
   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
				movl	CALLCOUNT.6050@GOTOFF(%eax), %eax
				cmpl	$9, %eax
				jg	.L12
				subl	$4, %esp
				pushl	-12(%ebp)
				pushl	-16(%ebp)
				pushl	-20(%ebp)
				movl	%ebx, %ecx
				call	THREE.6039
				addl	$16, %esp
				movl	%eax, -24(%ebp)
				jmp	.L9
		.L12:
				nop
		.L8:
				movl	$-1, -24(%ebp)
		.L9:
   35             %result = d1
				movl	-24(%ebp), %eax
   36         %end
				movl	-4(%ebp), %ebx
				leave
				ret
		.LFE191:
		CSS.6025:
		.LFB190:
   37
   38         b = 3
				movl	$3, -20(%ebp)
   39
   40         %integerfn three(%integer p1,p2,p3)
				pushl	%ebp
				movl	%esp, %ebp
				pushl	%ebx
				subl	$36, %esp
				call	__x86.get_pc_thunk.ax
				addl	$_GLOBAL_OFFSET_TABLE_, %eax
				movl	%ecx, %ebx
				movl	%ecx, -28(%ebp)
   41             %integer a3,b3
   42             a3 = one(p1)
				subl	$12, %esp
				pushl	8(%ebp)
				movl	%ebx, %ecx
				call	ONE.6044
				addl	$16, %esp
				movl	%eax, -16(%ebp)
   43             b3 = two(p2,p3)
				subl	$8, %esp
				pushl	16(%ebp)
				pushl	12(%ebp)
				movl	%ebx, %ecx
				call	TWO.6042
				addl	$16, %esp
				movl	%eax, -12(%ebp)
   44             %result = a3 + b3
				movl	-16(%ebp), %edx
				movl	-12(%ebp), %eax
				addl	%edx, %eax
   45         %end
				movl	-4(%ebp), %ebx
				leave
				ret
		.LFE192:
		TWO.6042:
		.LFB193:
   46
   47         a = three(b,c,b+c)
				movl	-20(%ebp), %edx
				movl	-24(%ebp), %eax
				addl	%eax, %edx
				subl	$4, %esp
				leal	-28(%ebp), %eax
				pushl	%edx
				pushl	-24(%ebp)
				pushl	-20(%ebp)
				movl	%eax, %ecx
				call	THREE.6039
				addl	$16, %esp
				movl	%eax, -16(%ebp)
   48
   49         %integerfn two(%integer p1,p2)
				pushl	%ebp
				movl	%esp, %ebp
				pushl	%ebx
				subl	$20, %esp
				call	__x86.get_pc_thunk.ax
				addl	$_GLOBAL_OFFSET_TABLE_, %eax
				movl	%ecx, %ebx
				movl	%ecx, -12(%ebp)
   50             %integer a2,b2
   51
   52             %result = one(p1+p2)
				movl	8(%ebp), %edx
				movl	12(%ebp), %eax
				addl	%edx, %eax
				subl	$12, %esp
				pushl	%eax
				movl	%ebx, %ecx
				call	ONE.6044
				addl	$16, %esp
   53         %end
				movl	-4(%ebp), %ebx
				leave
				ret
		.LFE193:
				.section	.rodata
				.align 4
		__PRETTY_FUNCTION__.5628:
				.string	"_imp_SELECTOUTPUT"
				.comm	CALLCOUNT.6050,4,4
				.section	.text.__x86.get_pc_thunk.ax,"axG",@progbits,__x86.get_pc_thunk.ax,comdat
				.globl	__x86.get_pc_thunk.ax
				.hidden	__x86.get_pc_thunk.ax
		__x86.get_pc_thunk.ax:
		.LFB194:
				movl	(%esp), %eax
				ret
		.LFE194:
				.section	.text.__x86.get_pc_thunk.bx,"axG",@progbits,__x86.get_pc_thunk.bx,comdat
				.globl	__x86.get_pc_thunk.bx
				.hidden	__x86.get_pc_thunk.bx
		__x86.get_pc_thunk.bx:
		.LFB195:
				movl	(%esp), %ebx
				ret
		.LFE195:
		.Letext0:
?B2 unused
?A2 unused
   54
   55     %end
				nop
				movl	-12(%ebp), %eax
				xorl	%gs:20, %eax
				je	.L15
				call	__stack_chk_fail_local
		.L15:
				leave
				ret
		.LFE190:
				.section	.rodata
				.align 32
		.LC0:
				.byte	16
				.string	"start %SPEC test"
				.zero	238
				.align 32
		.LC1:
				.byte	14
				.string	"end %SPEC test"
				.zero	240
				.globl	main
		main:
		.LFB189:
   56
   57 %endofprogram
   39 Statements compiled
