         Edinburgh IMP77 Compiler - Version 8.4
    1 %begin
		.Ltext0:
				.align	2
				.global	main
		main:
		.LFB185:
		.LVL0:
				sub	sp, sp, #1888
				stp	x29, x30, [sp]
				add	x29, sp, 0
				stp	x19, x20, [sp, 16]
				stp	x21, x22, [sp, 32]
				stp	x23, x24, [sp, 48]
				str	x25, [sp, 64]
				adrp	x2, :got:__stack_chk_guard
				ldr	x2, [x2, #:got_lo12:__stack_chk_guard]
				ldr	x3, [x2]
				str	x3, [x29, 1880]
				mov	x3,0
    2   %reals %long
				bl	_imp_initialise
		.LVL1:
		.LBB18:
    3
    4   %integer rounds
    5   %real pi = 1.0
    6
				fmov	d0, 1.0e+0
		.LBB27:
				fmov	d0, 1.0e+0
				b	.L6
		.LFE185:
				.section	.rodata
				.align	3
				.set	.LANCHOR0,. + 0
		.LC0:
				.byte	10
				.string	"rounds.txt"
				.zero	244
		__PRETTY_FUNCTION__.7289:
				.string	"_imp_SELECTINPUT"
				.zero	7
		.LC1:
				.byte	21
				.string	"test-new/leibnitz.imp"
				.zero	233
				.section	.rodata.str1.8,"aMS",@progbits,1
				.align	3
		.LC2:
				.string	"Illegal cycle I = 2, 1, ROUNDS"
		.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
				adrp	x20, .LANCHOR0
				add	x20, x20, :lo12:.LANCHOR0
				add	x19, x29, 1624
				mov	x21, 256
				mov	x2, x21
				mov	x1, x20
				mov	x0, x19
				bl	memcpy
		.LVL2:
				add	x22, x29, 600
				mov	x2, x21
				mov	x1, x19
				mov	x0, x22
				bl	memcpy
		.LVL3:
				mov	x2, x21
				mov	x1, x22
				mov	x0, x19
				bl	memcpy
		.LVL4:
		.LBE18:
		.LBB19:
		.LBB20:
				add	x0, x29, 336
				mov	x2, x21
				mov	x1, x19
				mov	x19, x0
				bl	memcpy
		.LVL5:
				mov	x1, x19
				mov	w0, 1
				bl	_imp_openinput
		.LVL6:
		.LBE20:
		.LBE19:
		.LBB21:
		.LBB22:
				adrp	x0, :got:_imp_InStream
				ldr	x0, [x0, #:got_lo12:_imp_InStream]
				mov	w1, 1
				str	w1, [x0]
				adrp	x0, :got:_imp_infile
				ldr	x0, [x0, #:got_lo12:_imp_infile]
				ldr	x1, [x0, 296]
				adrp	x0, :got:_imp_InFile
				ldr	x0, [x0, #:got_lo12:_imp_InFile]
				str	x1, [x0]
				add	x0, x20, x21
				bl	check_instream
		.LVL7:
		.LBE22:
		.LBE21:
   15   select input(1)
   16
   17   read(rounds)
				add	x0, x29, 596
				bl	_imp_readint
		.LVL8:
		.LBB23:
		.LBB24:
				bl	_imp_closeinput
		.LVL9:
		.LBE24:
		.LBE23:
   18
   19   close input;                   ! close file
   20
   21   rounds = rounds + 2;           ! do this outside the loop
				ldr	w19, [x29, 596]
				add	w20, w19, 2
				str	w20, [x29, 596]
		.LVL10:
		.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
				tbnz	w19, #31, .L13
		.L2:
		.LVL11:
				fmov	d3, d0
		.LVL12:
		.L7:
				and	w0, w1, 1
				scvtf	d1, w0
				fadd	d1, d1, d1
				fsub	d1, d1, d3
				scvtf	d2, w2
				fdiv	d1, d1, d2
				fadd	d0, d0, d1
		.LVL14:
		.LDL1:
				add	w2, w2, 2
				adrp	x0, :got:_imp_current_file
				ldr	x0, [x0, #:got_lo12:_imp_current_file]
				ldr	x0, [x0]
				cbz	x0, .L3
				add	x8, x29, 1112
				bl	_imp_c2istr
		.LVL20:
		.L4:
				adrp	x0, :got:_imp_current_line
				ldr	x0, [x0, #:got_lo12:_imp_current_line]
				ldr	w22, [x0]
				cmp	w22, 0
				mov	w0, 25
				csel	w22, w22, w0, ne
				add	x24, x29, 1368
				mov	x8, x24
				adrp	x0, .LC2
				add	x0, x0, :lo12:.LC2
				bl	_imp_c2istr
		.LVL21:
				add	x21, x29, 336
				mov	x25, 256
				mov	x2, x25
				add	x1, x29, 1112
				mov	x0, x21
				bl	memcpy
		.LVL22:
				add	x23, x29, 80
				mov	x2, x25
				mov	x1, x24
				mov	x0, x23
				bl	memcpy
		.LVL23:
				mov	w5, 0
				mov	w4, 1
				mov	w3, 5
				mov	x2, x23
				mov	w1, w22
				mov	x0, x21
				bl	_signal_event
		.LVL24:
				b	.L2
		.L3:
		.LBB26:
				add	x22, x29, 1368
				mov	x23, 256
				mov	x2, x23
				adrp	x1, .LANCHOR0
				add	x1, x1, :lo12:.LANCHOR0
				add	x1, x1, 280
				mov	x0, x22
				bl	memcpy
		.LVL25:
				add	x21, x29, 856
				mov	x2, x23
				mov	x1, x22
				mov	x0, x21
				bl	memcpy
		.LVL26:
		.LBE26:
				mov	x2, x23
				mov	x1, x21
				add	x0, x29, 1112
				bl	memcpy
		.LVL27:
				b	.L4
		.LVL28:
		.L10:
		.LBE34:
   26   %repeat
				mov	w1, 1
		.LBE25:
   27
   28   pi = pi * 4
				cmp	w20, 1
				beq	.L10
				add	w3, w19, 2
				mov	w2, 3
				cmp	w1, w3
				bne	.L7
		.LVL15:
		.L6:
		.LBE27:
		.LBB28:
		.LBB29:
				mov	w0, 16
				fmov	d1, 4.0e+0
				fmul	d0, d0, d1
		.LVL16:
				bl	_imp_printfl
		.LVL17:
		.LBE29:
		.LBE28:
		.LBB30:
		.LBB31:
				bl	_imp_newline
		.LVL18:
		.LBE31:
		.LBE30:
		.LBB32:
		.LBB33:
				mov	w0, 0
				bl	exit
		.LVL19:
		.L13:
		.LBE33:
		.LBE32:
		.LBB34:
   29   print fl(pi, 16);              ! print 16 decimal digits of pi
				add	w1, w1, 1
		.LVL13:
   30   newline
   31
   32 %endofprogram
   18 Statements compiled
