         Edinburgh IMP77 Compiler - Version 8.4
    1 %begin
		.Ltext0:
		_imp_SELECTINPUT:
		.LFB93:
				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_InStream@GOT(%eax), %edx
				movl	8(%ebp), %ecx
				movl	%ecx, (%edx)
				movl	_imp_infile@GOT(%eax), %ecx
				movl	8(%ebp), %edx
				imull	$276, %edx, %edx
				addl	%ecx, %edx
				addl	$4, %edx
				movl	(%edx), %ecx
				movl	_imp_InFile@GOT(%eax), %edx
				movl	%ecx, (%edx)
				subl	$12, %esp
				leal	__PRETTY_FUNCTION__.5621@GOTOFF(%eax), %edx
				pushl	%edx
				movl	%eax, %ebx
				call	check_instream@PLT
				addl	$16, %esp
				jmp	.L1
		.L4:
				nop
		.L1:
				movl	-4(%ebp), %ebx
				leave
				ret
		.LFE93:
				.section	.rodata
				.align 4
		.LC3:
				.string	"Illegal cycle I = 2, 1, ROUNDS"
				.align 32
		.LC0:
				.byte	10
				.string	"rounds.txt"
				.zero	244
				.align 32
		.LC1:
				.byte	20
				.string	"test-in/leibnitz.imp"
				.zero	234
				.globl	main
		main:
		.LFB189:
				leal	4(%esp), %ecx
				andl	$-16, %esp
				pushl	-4(%ecx)
				pushl	%ebp
				movl	%esp, %ebp
				pushl	%edi
				pushl	%esi
				pushl	%ebx
				pushl	%ecx
				subl	$1368, %esp
				call	__x86.get_pc_thunk.bx
				addl	$_GLOBAL_OFFSET_TABLE_, %ebx
				movl	%ecx, %eax
				movl	4(%eax), %edx
				movl	%edx, -1372(%ebp)
				movl	%gs:20, %esi
				movl	%esi, -28(%ebp)
				xorl	%esi, %esi
				subl	$8, %esp
				pushl	-1372(%ebp)
				pushl	(%eax)
				call	_imp_initialise@PLT
				addl	$16, %esp
    2   %reals %long
    3
    4   %integer rounds
    5   %real pi = 1.0
				fld1
				fstpl	-1336(%ebp)
		.LBB17:
    6
    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
				leal	-284(%ebp), %eax
				leal	.LC0@GOTOFF(%ebx), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				leal	-1308(%ebp), %eax
				leal	-284(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				movl	$1, -1348(%ebp)
				leal	-284(%ebp), %eax
				leal	-1308(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
		.LBE17:
		.LBB18:
		.LBB19:
				subl	$12, %esp
				subl	$256, %esp
				movl	%esp, %eax
				movl	%eax, %edi
				leal	-284(%ebp), %eax
				movl	$64, %edx
				movl	%eax, %esi
				movl	%edx, %ecx
				rep movsl
				pushl	-1348(%ebp)
				call	_imp_openinput@PLT
				addl	$272, %esp
		.LBE19:
		.LBE18:
   15   select input(1)
				subl	$12, %esp
				pushl	$1
				call	_imp_SELECTINPUT
				addl	$16, %esp
   16
   17   read(rounds)
				subl	$12, %esp
				leal	-1364(%ebp), %eax
				pushl	%eax
				call	_imp_readint@PLT
				addl	$16, %esp
		.LBB20:
		.LBB21:
				call	_imp_closeinput@PLT
		.LBE21:
		.LBE20:
   18
   19   close input;                   ! close file
   20
   21   rounds = rounds + 2;           ! do this outside the loop
				movl	-1364(%ebp), %eax
				addl	$2, %eax
				movl	%eax, -1364(%ebp)
		.LBB22:
   22
   23   %for i=2, 1, rounds %cycle
				movl	-1364(%ebp), %eax
				movl	%eax, -1356(%ebp)
		.LBB23:
				movl	-1356(%ebp), %eax
				subl	$2, %eax
				movl	%eax, -1352(%ebp)
				movl	-1352(%ebp), %eax
				xorl	$1, %eax
				shrl	$31, %eax
				movzbl	%al, %eax
		.LBE23:
				testl	%eax, %eax
				je	.L6
				leal	-796(%ebp), %eax
				subl	$8, %esp
				leal	.LC3@GOTOFF(%ebx), %edx
				pushl	%edx
				pushl	%eax
				call	_imp_c2istr@PLT
				addl	$12, %esp
				movl	_imp_current_line@GOT(%ebx), %eax
				movl	(%eax), %eax
				testl	%eax, %eax
				je	.L7
				movl	_imp_current_line@GOT(%ebx), %eax
				movl	(%eax), %eax
				movl	%eax, -1376(%ebp)
				jmp	.L8
		.L7:
				movl	$23, -1376(%ebp)
		.L8:
				movl	_imp_current_file@GOT(%ebx), %eax
				movl	(%eax), %eax
				testl	%eax, %eax
				je	.L9
				movl	_imp_current_file@GOT(%ebx), %eax
				movl	(%eax), %edx
				leal	-540(%ebp), %eax
				subl	$8, %esp
				pushl	%edx
				pushl	%eax
				call	_imp_c2istr@PLT
				addl	$12, %esp
				jmp	.L10
		.L9:
		.LBB24:
				leal	-540(%ebp), %eax
				leal	.LC1@GOTOFF(%ebx), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
				leal	-1052(%ebp), %eax
				leal	-540(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
		.LBE24:
				leal	-540(%ebp), %eax
				leal	-1052(%ebp), %edx
				movl	$64, %ecx
				movl	%eax, %edi
				movl	%edx, %esi
				rep movsl
		.L10:
				pushl	$0
				pushl	$1
				pushl	$5
				subl	$256, %esp
				movl	%esp, %eax
				movl	%eax, %edi
				leal	-796(%ebp), %eax
				movl	$64, %edx
				movl	%eax, %esi
				movl	%edx, %ecx
				rep movsl
				pushl	-1376(%ebp)
				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	_signal_event@PLT
				addl	$528, %esp
		.L6:
				movl	$1, -1360(%ebp)
		.L11:
				movl	-1360(%ebp), %eax
				cmpl	-1356(%ebp), %eax
				je	.L16
				addl	$1, -1360(%ebp)
				nop
		.L13:
		.LBE22:
   24     %long %real x = -1.0 + 2.0 * (i & 1); ! allows vectorization
				movl	-1360(%ebp), %eax
				andl	$1, %eax
				movl	%eax, -1376(%ebp)
				fildl	-1376(%ebp)
				fld	%st(0)
				faddp	%st, %st(1)
				fld1
				fsubrp	%st, %st(1)
				fstpl	-1328(%ebp)
   25     pi = pi + (x / (2 * i - 1)); ! double / unsigned = double
				movl	-1360(%ebp), %eax
				addl	%eax, %eax
				subl	$1, %eax
				movl	%eax, -1376(%ebp)
				fildl	-1376(%ebp)
				fldl	-1328(%ebp)
				fdivp	%st, %st(1)
				fldl	-1336(%ebp)
				faddp	%st, %st(1)
				fstpl	-1336(%ebp)
   26   %repeat
				jmp	.L11
		.L16:
   27
   28   pi = pi * 4
				fldl	-1336(%ebp)
				fldl	.LC4@GOTOFF(%ebx)
				fmulp	%st, %st(1)
				fstpl	-1336(%ebp)
				fldl	-1336(%ebp)
				fstpl	-1320(%ebp)
				movl	$16, -1340(%ebp)
		.LBB25:
		.LBB26:
				subl	$4, %esp
				pushl	-1340(%ebp)
				pushl	-1316(%ebp)
				pushl	-1320(%ebp)
				call	_imp_printfl@PLT
				addl	$16, %esp
		.LBE26:
		.LBE25:
		.LBB27:
		.LBB28:
				call	_imp_newline@PLT
				movl	$0, -1344(%ebp)
		.LBE28:
		.LBE27:
		.LBB29:
		.LBB30:
				subl	$12, %esp
				pushl	-1344(%ebp)
				call	exit@PLT
		.LBE30:
		.LBE29:
		.LFE189:
				.section	.rodata
				.align 4
		__PRETTY_FUNCTION__.5621:
				.string	"_imp_SELECTINPUT"
				.align 8
		.LC4:
				.long	0
				.long	1074790400
				.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:
		.LFB190:
				movl	(%esp), %eax
				ret
		.LFE190:
				.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:
		.LFB191:
				movl	(%esp), %ebx
				ret
		.LFE191:
		.Letext0:
   29   print fl(pi, 16);              ! print 16 decimal digits of pi
   30   newline
   31
   32 %endofprogram
   18 Statements compiled
