	mov	SP,-1
	jump	@IO_ASM_END
puts:
	push	r1
	load	r1,sf,3
	mov	r0,1
	int	205
	pop	r1
	return
fputs:
	push	r1
	load	r1,sf,4
	load	r0,sf,3
	int	205
	pop	r1
	return
putline:
	push	r1
	load	r1,sf,3
	mov	r0,1
	int	205
	out	1,1,'\n'
	pop	r1
	return
fputline:
	push	r28
	push	r1
	load	r1,sf,4
	load	r28,sf,3
	move	r0,r28
	int	205
	out	1,r28,'\n'
	pop	r1
	pop	r28
	return
putc:
	load	r0,sf,3
	out	0,1,r0
	return
fputc:
	push	r1
	load	r0,sf,3
	load	r1,sf,4
	out	0,r0,r1
	pop	r1
	return
put_int:
	push	r1
	push	r2
	move	r0,1
	load	r1,sf,3
	load	r2,sf,4
	int	201
	pop	r2
	pop	r1
	return
fput_int:
	push	r1
	push	r2
	load	r0,sf,3
	load	r1,sf,4
	load	r2,sf,5
	int	201
	pop	r2
	pop	r1
	return
put_dec:
	push	r1
	move	r0,1
	load	r1,sf,3
	int	202
	pop	r1
	return
fput_dec:
	push	r1
	load	r0,sf,3
	load	r1,sf,4
	int	202
	pop	r1
	return
put_hex:
	push	r1
	push	r2
	move	r0,1
	load	r1,sf,3
	move	r2,-1
	int	203
	pop	r2
	pop	r1
	return
put_hex_size:
	push	r1
	push	r2
	move	r0,1
	load	r1,sf,3
	load	r2,sf,4
	int	203
	pop	r2
	pop	r1
	return
fput_hex:
	push	r1
	load	r0,sf,3
	load	r1,sf,4
	int	203
	pop	r1
	return
fput_hex_size:
	push	r1
	push	r2
	load	r0,sf,3
	load	r1,sf,4
	load	r2,sf,5
	int	203
	pop	r2
	pop	r1
	return
put_fp:
	mov	r0,1
	ld	f0,sf,3
	int	204
	return
fput_fp:
	ld	r0,sf,3
	ld	f0,sf,4
	int	204
	return
put_nl:
	out	0,1,'\n'
	return
fput_nl:
	push	r28
	ld	r28,sf,3
	out	0,r28,'\n'
	pop	r28
	return
fprintf:
	int	211
	return
cond_fprintf:
	int	212
	return
debug:
	return
cond_debug:
	return
fatal:
	load	r0,sf,3
	push	"\nFATAL: "
	push	r0
	call	fputs
	add	SP,2
	int	211
	move	r0,0
	int	30
	return
cond_fatal:
	load	r0,sf,3
	jump	z,@_b6aae5a7_COND298_ELSE
	load	r0,sf,4
	push	"\nFATAL: "
	push	r0
	call	fputs
	add	SP,2
	int	212
	move	r0,0
	int	30
_b6aae5a7_COND298_ELSE:
_b6aae5a7_COND298_END:
	return
__FGETLINE_BUFFER:
	dci	0
fgetline:
	push	r24
	push	r25
	push	r26
	push	r27
	push	r28
	push	r1
	load	r24,sf,3
	load	r28,__FGETLINE_BUFFER
	cmp	r28,0
	jump	nz,@_5f488524_COND318_ELSE
	move	r0,128
	int	20
	move	r28,r0
_5f488524_COND318_ELSE:
_5f488524_COND318_END:
	cmp	r28,0
	jump	z,@_5f488524_COND323_ELSE
	load	r27,r28,-1
	sub	r27,1
	clear	r25
	in	r26,0,r24
	jump	@_5f488524_LOOP328_COND
_5f488524_LOOP328:
	cmp	r26,'\n'
	jump	nz,@_5f488524_COND329_ELSE
	jump	@_5f488524_LOOP328_END
_5f488524_COND329_ELSE:
_5f488524_COND329_END:
	cmp	r25,r27
	jump	n,@_5f488524_COND332_ELSE
	move	r1,r27
	add	r1,128
	move	r0,r28
	int	21
	move	r28,r0
	cmp	r28,0
	jump	nz,@_5f488524_COND338_ELSE
	jump	@_5f488524_LOOP328_END
_5f488524_COND338_ELSE:
_5f488524_COND338_END:
	load	r27,r28,-1
	sub	r27,1
_5f488524_COND332_ELSE:
_5f488524_COND332_END:
	store	r26,r28,r25
	add	r25,1
	in	r26,0,r24
_5f488524_LOOP328_COND:
	cmp	r26,-1
	jump	ne,@_5f488524_LOOP328
_5f488524_LOOP328_END:
	cmp	r28,0
	jump	z,@_5f488524_COND348_ELSE
	store	0,r28,r25
_5f488524_COND348_ELSE:
_5f488524_COND348_END:
_5f488524_COND323_ELSE:
_5f488524_COND323_END:
	store	r28,__FGETLINE_BUFFER
	cmp	r26,-1
	move	eq,r0,-1,0
	move	r1,r0
	cmp	r25,0
	move	eq,r0,-1,0
	and	r0,r1
	move	nz,r0,0,r28
	pop	r1
	pop	r28
	pop	r27
	pop	r26
	pop	r25
	pop	r24
	return
_PORT_MAP:
	dca	256
openTextFile:
	push	r24
	push	r25
	push	r26
	push	r27
	push	r28
	push	r1
	load	r28,sf,3
	load	r27,sf,4
	move	r26,3
	load	r25,_PORT_MAP,-1
	jump	@_5877f0b3_FIND_PORT_END
_5877f0b3_FIND_PORT:
	load	r0,_PORT_MAP,r26
	jump	z,@_5877f0b3_FOUND_PORT
	add	r26,1
_5877f0b3_FIND_PORT_END:
	cmp	r26,r25
	jump	lt,@_5877f0b3_FIND_PORT
	move	r0,-1
	jump	@_5877f0b3_FINIS
_5877f0b3_FOUND_PORT:
	move	r24,r26
	cmp	r27,0
	jump	nz,@_5877f0b3_NOT_READ_MODE
	move	r0,r24
	move	r1,r28
	int	220
	move	r0,r24
	store	-1,_PORT_MAP,r24
	jump	@_5877f0b3_FINIS
_5877f0b3_NOT_READ_MODE:
	cmp	r27,1
	jump	nz,@_5877f0b3_NOT_WRITE_MODE
	move	r0,r24
	move	r1,r28
	int	221
	move	r0,r24
	store	-1,_PORT_MAP,r24
	jump	@_5877f0b3_FINIS
_5877f0b3_NOT_WRITE_MODE:
	cmp	r27,2
	jump	nz,@_5877f0b3_NOT_APPEND_MODE
	move	r0,r24
	move	r1,r28
	int	222
	move	r0,r24
	store	-1,_PORT_MAP,r24
	jump	@_5877f0b3_FINIS
_5877f0b3_NOT_APPEND_MODE:
	move	r0,-1
_5877f0b3_FINIS:
	pop	r1
	pop	r28
	pop	r27
	pop	r26
	pop	r25
	pop	r24
	return
openRawFile:
	push	r24
	push	r25
	push	r26
	push	r27
	push	r28
	push	r1
	load	r28,sf,3
	load	r27,sf,4
	move	r26,3
	load	r25,_PORT_MAP,-1
	jump	@_2eff781a_FIND_PORT_END
_2eff781a_FIND_PORT:
	load	r0,_PORT_MAP,r26
	jump	z,@_2eff781a_FOUND_PORT
	add	r26,1
_2eff781a_FIND_PORT_END:
	cmp	r26,r25
	jump	lt,@_2eff781a_FIND_PORT
	move	r0,-1
	jump	@_2eff781a_FINIS
_2eff781a_FOUND_PORT:
	move	r24,r26
	cmp	r27,0
	jump	nz,@_2eff781a_NOT_READ_MODE
	move	r0,r24
	move	r1,r28
	int	223
	move	r0,r24
	store	-1,_PORT_MAP,r24
	jump	@_2eff781a_FINIS
_2eff781a_NOT_READ_MODE:
	cmp	r27,1
	jump	nz,@_2eff781a_NOT_WRITE_MODE
	move	r0,r24
	move	r1,r28
	int	224
	move	r0,r24
	store	-1,_PORT_MAP,r24
	jump	@_2eff781a_FINIS
_2eff781a_NOT_WRITE_MODE:
	cmp	r27,2
	jump	nz,@_2eff781a_NOT_APPEND_MODE
	move	r0,r24
	move	r1,r28
	int	225
	move	r0,r24
	store	-1,_PORT_MAP,r24
	jump	@_2eff781a_FINIS
_2eff781a_NOT_APPEND_MODE:
	move	r0,-1
_2eff781a_FINIS:
	pop	r1
	pop	r28
	pop	r27
	pop	r26
	pop	r25
	pop	r24
	return
closeFile:
	load	r0,sf,3
	store	0,_PORT_MAP,r0
	int	226
	return
flush:
	load	r0,sf,3
	int	227
	return
deleteFile:
	load	r0,sf,3
	int	228
	return
makeDirectory:
	load	r0,sf,3
	int	229
	return
deleteDirectory:
	load	r0,sf,3
	int	230
	return
isDirectory:
	load	r0,sf,3
	int	231
	return
isFile:
	load	r0,sf,3
	int	232
	return
fileExists:
	load	r0,sf,3
	int	233
	return
listFiles:
	load	r0,sf,3
	int	234
	return
tempDirectory:
	load	r0,sf,3
	int	235
	return
tempFile:
	load	r0,sf,3
	load	r1,sf,4
	int	236
	return
copy_text_file:
	push	r26
	push	r27
	push	r28
	load	r27,sf,3
	load	r26,sf,4
	push	r27
	call	fgetline
	add	SP,1
	move	r28,r0
	jump	@_eac83904_LOOP538_COND
_eac83904_LOOP538:
	push	r28
	push	r26
	call	fputs
	add	SP,2
	push	r26
	call	fput_nl
	add	SP,1
	push	r27
	call	fgetline
	add	SP,1
	move	r28,r0
_eac83904_LOOP538_COND:
	cmp	r28,0
	jump	ne,@_eac83904_LOOP538
_eac83904_LOOP538_END:
	pop	r28
	pop	r27
	pop	r26
	return
copy_raw_file:
	push	r26
	push	r27
	push	r28
	load	r27,sf,3
	load	r26,sf,4
	in	r28,1,r27
	jump	@_50d9e4bd_LOOP551_COND
_50d9e4bd_LOOP551:
	out	1,r26,r28
	in	r28,1,r27
_50d9e4bd_LOOP551_COND:
	cmp	r28,-1
	jump	ne,@_50d9e4bd_LOOP551
_50d9e4bd_LOOP551_END:
	pop	r28
	pop	r27
	pop	r26
	return
IO_ASM_END:
	nop
	jump	@MATH_ASM_END
pi:
	int	100
	return
ln_base:
	int	101
	return
fdiv:
	push	r27
	push	r28
	push	f30
	push	f31
	load	r28,sf,4
	load	r27,sf,3
	move	f31,r27
	move	f30,r28
	div	f31,f30
	pop	f31
	pop	f30
	pop	r28
	pop	r27
	return
fabs:
	load	f0,sf,3
	int	102
	return
abs:
	load	r0,sf,3
	int	103
	return
ceil:
	load	f0,sf,3
	int	104
	return
floor:
	load	f0,sf,3
	int	105
	return
round:
	load	f0,sf,3
	int	106
	return
sqrt:
	load	f0,sf,3
	int	107
	return
exp:
	load	f0,sf,3
	int	108
	return
log:
	load	f0,sf,3
	int	109
	return
exp10:
	push	f1
	move	f0,10.
	load	f1,sf,3
	int	110
	pop	f1
	return
log10:
	load	f0,sf,3
	int	109
	push	f1
	move	f1,2.3025850929940456840179914546844
	div	f0,f1
	pop	f1
	return
exp2:
	push	f1
	move	f0,2.
	load	f1,sf,3
	int	110
	pop	f1
	return
log2:
	load	f0,sf,3
	int	109
	push	f1
	move	f1,0.693147180559945309417232121458
	div	f0,f1
	pop	f1
	return
pow:
	push	f1
	load	f0,sf,3
	load	f1,sf,4
	int	110
	pop	f1
	return
ifastpow:
	push	r25
	push	r26
	push	r27
	push	r28
	load	r26,sf,3
	load	r25,sf,4
	move	r27,r26
	move	r28,1
	jump	@_5b2813f3_LOOP_END
_5b2813f3_LOOP_START:
	and	r0,r25,0x1
	jump	z,@_5b2813f3_LOOP_NEXT
	mult	r28,r27
_5b2813f3_LOOP_NEXT:
	mult	r27,r27
	rshift	r25,1
_5b2813f3_LOOP_END:
	test	r25
	jump	nz,@_5b2813f3_LOOP_START
	move	r0,r28
	pop	r28
	pop	r27
	pop	r26
	pop	r25
	return
fastpow:
	push	r27
	push	r28
	push	f29
	push	f30
	push	f31
	load	f29,sf,3
	load	r28,sf,4
	move	r27,0
	test	r28
	jump	nn,@_bfccac7c_SKIP_NEG
	neg	r28
	move	r27,-1
_bfccac7c_SKIP_NEG:
	move	f30,f29
	move	f31,1
	jump	@_bfccac7c_LOOP_END
_bfccac7c_LOOP_START:
	and	r0,r28,0x1
	jump	z,@_bfccac7c_LOOP_NEXT
	mult	f31,f30
_bfccac7c_LOOP_NEXT:
	mult	f30,f30
	rshift	r28,1
_bfccac7c_LOOP_END:
	test	r28
	jump	nz,@_bfccac7c_LOOP_START
	move	f0,f31
	test	r27
	jump	z,@_bfccac7c_SKIP_NEG2
	recip	f0
_bfccac7c_SKIP_NEG2:
	pop	f31
	pop	f30
	pop	f29
	pop	r28
	pop	r27
	return
random:
	int	116
	return
rand:
	push	r1
	load	r0,sf,3
	load	r1,sf,4
	int	117
	pop	r1
	return
min:
	push	r27
	push	r28
	load	r28,sf,3
	load	r27,sf,4
	cmp	r28,r27
	mov	lt,r0,r28,r27
	pop	r28
	pop	r27
	return
max:
	push	r27
	push	r28
	load	r28,sf,3
	load	r27,sf,4
	cmp	r28,r27
	mov	gt,r0,r28,r27
	pop	r28
	pop	r27
	return
fmin:
	push	f30
	push	f31
	load	f31,sf,3
	load	f30,sf,4
	cmp	f31,f30
	mov	lt,f0,f31,f30
	pop	f31
	pop	f30
	return
fmax:
	push	f30
	push	f31
	load	f31,sf,3
	load	f30,sf,4
	cmp	f31,f30
	mov	gt,f0,f31,f30
	pop	f31
	pop	f30
	return
sum:
	push	r25
	push	r26
	push	r27
	push	r28
	load	r27,sf,3
	load	r26,sf,4
	clear	r25
	clear	r28
	jump	@_1be4b_END_LOOP1
_1be4b_LOOP1:
	load	r0,r26,r28
	add	r25,r0
	add	r28,1
_1be4b_END_LOOP1:
	cmp	r28,r27
	jump	lt,@_1be4b_LOOP1
	move	r0,r25
	pop	r28
	pop	r27
	pop	r26
	pop	r25
	return
fsum:
	push	r26
	push	r27
	push	r28
	push	f31
	load	r27,sf,3
	load	r26,sf,4
	clear	f31
	clear	r28
	jump	@_301c25_END_LOOP1
_301c25_LOOP1:
	load	f0,r26,r28
	add	f31,f0
	add	r28,1
_301c25_END_LOOP1:
	cmp	r28,r27
	jump	lt,@_301c25_LOOP1
	move	f0,f31
	pop	f31
	pop	r28
	pop	r27
	pop	r26
	return
MATH_ASM_END:
	nop
	call	main
	int	30
main:
	push	r27
	push	r28
	int	24
	move	r27,r0
	cmp	r27,2
	jump	ne,@_3305b9_GET_ARGS_FAILED
_3305b9_GET_ARGS:
	move	r0,1
	int	23
	jump	z,@_3305b9_GET_ARGS_END
	int	304
	move	r28,r0
	push	r28
	call	compute_pi
	add	SP,1
	push	f0
	call	put_fp
	add	SP,1
	call	put_nl
_3305b9_GET_ARGS_END:
	move	r0,0
	jump	@_3305b9_MAIN_END
_3305b9_GET_ARGS_FAILED:
	push	"You must supply the number of terms 1-11"
	call	puts
	add	SP,1
	move	r0,1
_3305b9_MAIN_END:
	pop	r28
	pop	r27
	return
compute_pi:
	push	r27
	push	r28
	push	f27
	push	f28
	push	f29
	push	f30
	push	f31
	move	f31,0.0
	load	r27,sf,3
	move	r28,0
	move	f30,16
	jump	@_efe5eb01_LOOP_END
_efe5eb01_LOOP_START:
	move	f0,4
	move	f27,8
	mult	f27,r28
	add	f27,1
	div	f28,f0,f27
	move	f0,2
	move	f27,8
	mult	f27,r28
	add	f27,4
	div	f0,f27
	sub	f28,f0
	move	f0,1
	move	f27,8
	mult	f27,r28
	add	f27,5
	div	f0,f27
	sub	f28,f0
	move	f0,1
	move	f27,8
	mult	f27,r28
	add	f27,6
	div	f0,f27
	sub	f28,f0
	move	f0,f30
	move	r0,r28
	neg	r0
	push	r0
	push	f0
	call	fastpow
	add	SP,2
	mult	f0,f28
	add	f31,f0
	add	r28,1
_efe5eb01_LOOP_END:
	cmp	r28,r27
	jump	ne,@_efe5eb01_LOOP_START
	move	f0,f31
	pop	f31
	pop	f30
	pop	f29
	pop	f28
	pop	f27
	pop	r28
	pop	r27
	return
	stop
	stop
