         Edinburgh IMP77 Compiler - Version 8.4
    1 %begin
				.section	".text"
		.Ltext0:
				.section	".rodata"
		.LC2:
				.byte	4
				.asciz	"p2: "
				.skip	250
				.section	".text"
				.align 4
				.proc	020
		P2.6066:
		.LFB187:
		.LVL24:
				save	%sp, -1472, %sp
		.LVL25:
				ldx	[%g7+40], %g1
				stx	%g1, [%fp+2039]
				mov	0, %g1
    2   %string(255) s
				mov	%i1, %o1
				call	_imp_initialise, 0
				 mov	%i0, %o0
		.LVL26:
		.LBB46:
    3   %integer n
    4
    5   %routine p1 (%string(*)%name k)
		.LVL12:
				save	%sp, -1472, %sp
		.LVL13:
				ldx	[%g7+40], %g1
				stx	%g1, [%fp+2039]
				mov	0, %g1
		.LBB30:
    6     print string("p1: ")
				mov	256, %o2
				sethi	%hi(.LC3), %o1
				or	%o1, %lo(.LC3), %o1
				call	memcpy, 0
				 add	%fp, 1783, %o0
		.LVL14:
				mov	256, %o2
				add	%fp, 1783, %o1
				call	memcpy, 0
				 add	%fp, 1015, %o0
		.LVL15:
				mov	256, %o2
				add	%fp, 1015, %o1
				call	memcpy, 0
				 add	%fp, 1783, %o0
		.LVL16:
		.LBE30:
		.LBB31:
		.LBB32:
				mov	256, %o2
				add	%fp, 1783, %o1
				call	memcpy, 0
				 add	%fp, 751, %o0
		.LVL17:
				call	_imp_printstring, 0
				 add	%fp, 751, %o0
		.LVL18:
				mov	256, %o2
				add	%fp, 1271, %o1
				call	memcpy, 0
				 add	%fp, 1527, %o0
		.LVL19:
		.LBE32:
		.LBE31:
		.LBB33:
		.LBB34:
				mov	256, %o2
				add	%fp, 1527, %o1
				call	memcpy, 0
				 add	%fp, 751, %o0
		.LVL20:
				call	_imp_printstring, 0
				 add	%fp, 751, %o0
		.LVL21:
		.LBE34:
		.LBE33:
		.LBB35:
		.LBB36:
				call	_imp_newline, 0
				 nop
		.LVL22:
		.LBE36:
		.LBE35:
    7     print string(k)
    8     newline
    9   %end
   10
				ldx	[%fp+2039], %g1
				ldx	[%g7+40], %g2
				xor	%g1, %g2, %g1
				mov	0, %g2
				brnz,pn	%g1, .L6
				 nop
				return	%i7+8
				 nop
		.L6:
				call	__stack_chk_fail, 0
				 nop
		.LVL23:
				nop
		.LFE186:
				.section	".rodata"
		.LC1:
				.byte	9
				.asciz	"test done"
				.skip	245
				.section	".text"
				.align 4
				.global main
				.proc	04
		main:
		.LFB185:
   11   %routine p2 (%string(*)%name k)
				.register	%g2, #scratch
				.register	%g7, #ignore
		.LVL0:
				save	%sp, -1472, %sp
		.LVL1:
				ldx	[%g7+40], %g1
				stx	%g1, [%fp+2039]
				mov	0, %g1
		.LBB23:
   12     print string("p2: ")
				mov	256, %o2
				sethi	%hi(.LC2), %o1
				or	%o1, %lo(.LC2), %o1
				call	memcpy, 0
				 add	%fp, 1783, %o0
		.LVL2:
				mov	256, %o2
				add	%fp, 1783, %o1
				call	memcpy, 0
				 add	%fp, 1015, %o0
		.LVL3:
				mov	256, %o2
				add	%fp, 1015, %o1
				call	memcpy, 0
				 add	%fp, 1783, %o0
		.LVL4:
		.LBE23:
		.LBB24:
		.LBB25:
				mov	256, %o2
				add	%fp, 1783, %o1
				call	memcpy, 0
				 add	%fp, 751, %o0
		.LVL5:
				call	_imp_printstring, 0
				 add	%fp, 751, %o0
		.LVL6:
				mov	256, %o2
				add	%fp, 1271, %o1
				call	memcpy, 0
				 add	%fp, 1527, %o0
		.LVL7:
		.LBE25:
		.LBE24:
		.LBB26:
		.LBB27:
				mov	256, %o2
				add	%fp, 1527, %o1
				call	memcpy, 0
				 add	%fp, 751, %o0
		.LVL8:
				call	_imp_printstring, 0
				 add	%fp, 751, %o0
		.LVL9:
		.LBE27:
		.LBE26:
		.LBB28:
		.LBB29:
				call	_imp_newline, 0
				 nop
		.LVL10:
		.LBE29:
		.LBE28:
   13     print string(k)
   14     newline
   15   %end
   16
				ldx	[%fp+2039], %g1
				ldx	[%g7+40], %g2
				xor	%g1, %g2, %g1
				mov	0, %g2
				brnz,pn	%g1, .L3
				 nop
				return	%i7+8
				 nop
		.L3:
				call	__stack_chk_fail, 0
				 nop
		.LVL11:
				nop
		.LFE187:
				.section	".rodata"
		.LC3:
				.byte	4
				.asciz	"p1: "
				.skip	250
				.section	".text"
				.align 4
				.proc	020
		P1.6059:
		.LFB186:
   17   %routine pass (%routine p (%string(*)%name k), %string(*)%name k)
   18     p(k)
				call	P1.6059, 0
				 add	%fp, 1015, %o0
		.LVL28:
		.L10:
		.LBE48:
		.LBE47:
		.LBB49:
				mov	256, %o2
		.L13:
				mov	%i5, %o1
				call	memcpy, 0
				 add	%fp, 1271, %o0
		.LVL29:
				mov	256, %o2
				add	%fp, 1271, %o1
				call	memcpy, 0
				 add	%fp, 1527, %o0
		.LVL30:
				mov	256, %o2
				add	%fp, 1527, %o1
				call	memcpy, 0
				 add	%fp, 1783, %o0
		.LVL31:
		.LBE49:
		.LBB50:
		.LBB51:
				mov	256, %o2
				add	%fp, 1783, %o1
				call	memcpy, 0
				 add	%fp, 751, %o0
		.LVL32:
				call	_imp_printstring, 0
				 add	%fp, 751, %o0
		.LVL33:
		.LBE51:
		.LBE50:
		.LBB52:
		.LBB53:
				call	_imp_newline, 0
				 nop
		.LVL34:
		.L8:
		.LBE53:
		.LBE52:
				call	P2.6066, 0
				 add	%fp, 1015, %o0
		.LVL38:
		.LBE55:
		.LBE54:
				ba,pt	%xcc, .L13
				 mov	256, %o2
		.LFE185:
		.Letext0:
   19   %end
   20
   21   %cycle
   22     read(n)
				call	_imp_readint, 0
				 add	%fp, 1011, %o0
		.LVL35:
   23     read(s)
				call	_imp_readitem, 0
				 add	%fp, 1015, %o0
		.LVL36:
   24     %if n = 1 %start
				lduw	[%fp+1011], %g1
				cmp	%g1, 1
				be,pn	%icc, .L12
				 nop
		.L9:
		.LVL37:
		.LBB54:
		.LBB55:
   25       pass(p1,s)
   26     %else
   27       pass(p2,s)
   28     %finish
   29     print string("test done")
				sethi	%hi(.LC1), %i5
		.LBE46:
				ba,pt	%xcc, .L8
				 or	%i5, %lo(.LC1), %i5
		.L12:
		.LVL27:
		.LBB47:
		.LBB48:
   30     newline
   31   %repeat
   32
   33 %end
   34 %end %of %file
   29 Statements compiled
