         Edinburgh IMP77 Compiler - Version 8.4
    1 %begin
				NO_APP
		.Ltext0:
				.section	.rodata.str1.1,"aMS",@progbits,1
		.LC2:
		 		.string	"Illegal cycle I = 2, 1, ROUNDS"
				.section	.rodata
		.LC0:
		 		.byte	10
		 		.string	"rounds.txt"
		 		.zero	244
		.LC1:
		 		.byte	21
		 		.string	"test-new/leibnitz.imp"
		 		.zero	233
				.align	2
				.globl	main
		main:
		.LFB185:
		.LVL0:
		 		link.w %fp,#-1284
		 		fmovem #4,-(%sp)
		 		movem.l #16160,-(%sp)
    2   %reals %long
		 		move.l 12(%fp),-(%sp)
		 		move.l 8(%fp),-(%sp)
		 		jsr _imp_initialise
		.LVL1:
		.LBB18:
    3
    4   %integer rounds
    5   %real pi = 1.0
    6
		 		fmovecr #0x32,%fp1
		.LVL17:
		.L7:
		.LBB27:
		 		fmovecr #0x32,%fp1
		 		jra .L6
		.LFE185:
				.section	.rodata
		__PRETTY_FUNCTION__.5586:
		 		.string	"_imp_SELECTINPUT"
		.Letext0:
    7   !%on %event 9 %start
    8   !  print string("Cannot open file"); newline
    9   !  %stop
   10   !%finish
   11
   12   %integer i
   13
   14   open input(1, "rounds.txt");   ! open file
		 		move.l %fp,%d2
		.LVL2:
		 		add.l #-260,%d2
		.LVL3:
		 		move.l #256,%d3
		 		move.l %d3,-(%sp)
		 		pea .LC0
		 		move.l %d2,-(%sp)
		 		lea memcpy,%a2
		 		jsr (%a2)
		.LVL4:
		 		move.l %fp,%d4
		.LVL5:
		 		add.l #-1284,%d4
		.LVL6:
		 		move.l %d3,-(%sp)
		 		move.l %d2,-(%sp)
		 		move.l %d4,-(%sp)
		 		jsr (%a2)
		.LVL7:
		 		lea (32,%sp),%sp
		 		move.l %d3,-(%sp)
		 		move.l %d4,-(%sp)
		 		move.l %d2,-(%sp)
		 		jsr (%a2)
		.LVL8:
		.LBE18:
		.LBB19:
		.LBB20:
		 		lea (-256,%sp),%sp
		 		move.l %sp,%d0
		 		move.l %d3,-(%sp)
		 		move.l %d2,-(%sp)
		 		move.l %d0,-(%sp)
		 		jsr (%a2)
		.LVL9:
		 		lea (12,%sp),%sp
		 		pea 1.w
		 		jsr _imp_openinput
		.LVL10:
		.LBE20:
		.LBE19:
		.LBB21:
		.LBB22:
		 		moveq #1,%d0
		 		move.l %d0,_imp_InStream
		 		move.l _imp_infile+280,_imp_InFile
		 		lea (272,%sp),%sp
		 		pea __PRETTY_FUNCTION__.5586
		 		jsr check_instream
		.LVL11:
		.LBE22:
		.LBE21:
   15   select input(1)
   16
   17   read(rounds)
		 		pea -4(%fp)
		 		jsr _imp_readint
		.LVL12:
		.LBB23:
		.LBB24:
		 		jsr _imp_closeinput
		.LVL13:
		.LBE24:
		.LBE23:
   18
   19   close input;                   ! close file
   20
   21   rounds = rounds + 2;           ! do this outside the loop
		 		move.l -4(%fp),%d2
		 		move.l %d2,%d3
		 		addq.l #2,%d3
		 		move.l %d3,-4(%fp)
		.LVL14:
		.LBB25:
   22
   23   %for i=2, 1, rounds %cycle
   24     %long %real x = -1.0 + 2.0 * (i & 1); ! allows vectorization
   25     pi = pi + (x / (2 * i - 1)); ! double / unsigned = double
		 		addq.l #8,%sp
		 		tst.l %d2
		 		jlt .L11
		.LVL15:
		.L2:
		 		moveq #1,%d0
		 		and.l %d1,%d0
		 		fmove.l %d0,%fp0
		 		fadd.x %fp0,%fp0
		 		fmovecr #0x32,%fp2
		 		fsub.x %fp2,%fp0
		.LVL19:
		 		fdiv.l %d2,%fp0
		.LVL20:
		 		fadd.x %fp0,%fp1
		.LVL21:
		.LDL1:
		 		addq.l #2,%d2
		 		pea .LC2
		 		lea (-772,%fp),%a1
		 		jsr _imp_c2istr
		.LVL27:
		 		move.l _imp_current_line,%d4
		 		addq.l #4,%sp
		 		jne .L3
		 		moveq #25,%d4
		.L3:
		 		move.l _imp_current_file,%d0
		 		jeq .L4
		 		move.l %d0,-(%sp)
		 		lea (-516,%fp),%a1
		 		jsr _imp_c2istr
		.LVL28:
		 		addq.l #4,%sp
		.L5:
		 		clr.l -(%sp)
		 		pea 1.w
		 		pea 5.w
		 		lea (-256,%sp),%sp
		 		move.l %sp,%d0
		 		move.l #256,%d5
		 		move.l %d5,-(%sp)
		 		pea -772(%fp)
		 		move.l %d0,-(%sp)
		 		lea memcpy,%a2
		 		jsr (%a2)
		.LVL29:
		 		lea (12,%sp),%sp
		 		move.l %d4,-(%sp)
		 		lea (-256,%sp),%sp
		 		move.l %sp,%d0
		 		move.l %d5,-(%sp)
		 		pea -516(%fp)
		 		move.l %d0,-(%sp)
		 		jsr (%a2)
		.LVL30:
		 		lea (12,%sp),%sp
		 		jsr _signal_event
		.LVL31:
		 		lea (528,%sp),%sp
		 		jra .L2
		.L4:
		.LBB26:
		 		move.l %fp,%d5
		.LVL32:
		 		add.l #-516,%d5
		.LVL33:
		 		move.l #256,%d6
		 		move.l %d6,-(%sp)
		 		pea .LC1
		 		move.l %d5,-(%sp)
		 		lea memcpy,%a2
		 		jsr (%a2)
		.LVL34:
		 		move.l %fp,%d7
		.LVL35:
		 		add.l #-1028,%d7
		.LVL36:
		 		move.l %d6,-(%sp)
		 		move.l %d5,-(%sp)
		 		move.l %d7,-(%sp)
		 		jsr (%a2)
		.LVL37:
		.LBE26:
		 		move.l %d6,-(%sp)
		 		move.l %d7,-(%sp)
		 		move.l %d5,-(%sp)
		 		jsr (%a2)
		.LVL38:
		 		lea (36,%sp),%sp
		 		jra .L5
		.LVL39:
		.L9:
		.LBE34:
   26   %repeat
		 		moveq #1,%d1
		.LBE25:
   27
   28   pi = pi * 4
		 		moveq #1,%d0
		 		cmp.l %d3,%d0
		 		jeq .L9
		 		move.l %d2,%a0
		 		addq.l #2,%a0
		 		moveq #3,%d2
		.LVL16:
		 		cmp.l %d1,%a0
		 		jne .L7
		.LVL22:
		.L6:
		.LBE27:
		.LBB28:
		.LBB29:
		 		pea 16.w
		 		fmul.d #0x4010000000000000,%fp1
		.LVL23:
		 		fmove.d %fp1,-(%sp)
		 		jsr _imp_printfl
		.LVL24:
		.LBE29:
		.LBE28:
		.LBB30:
		.LBB31:
		 		jsr _imp_newline
		.LVL25:
		.LBE31:
		.LBE30:
		.LBB32:
		.LBB33:
		 		clr.l -(%sp)
		 		jsr exit
		.LVL26:
		.L11:
		.LBE33:
		.LBE32:
		.LBB34:
   29   print fl(pi, 16);              ! print 16 decimal digits of pi
		 		addq.l #1,%d1
		.LVL18:
   30   newline
   31
   32 %endofprogram
   18 Statements compiled
