	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function Screen_DrawAtariSpeed
LCPI0_0:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__literal16,16byte_literals
	.p2align	3
LCPI0_1:
	.quad	0x404e000000000000              ## double 60
	.quad	0x4049000000000000              ## double 50
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_Screen_DrawAtariSpeed
	.p2align	4, 0x90
_Screen_DrawAtariSpeed:                 ## @Screen_DrawAtariSpeed
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_Screen_show_atari_speed@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_4
## %bb.1:
	movapd	%xmm0, %xmm1
	subsd	_Screen_DrawAtariSpeed.last_time(%rip), %xmm1
	ucomisd	LCPI0_0(%rip), %xmm1
	jb	LBB0_3
## %bb.2:
	movq	_Atari800_nframes@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	subl	_Screen_DrawAtariSpeed.last_updated(%rip), %ecx
	imull	$100, %ecx, %ecx
	cvtsi2sd	%ecx, %xmm2
	divsd	%xmm1, %xmm2
	movq	_Atari800_tv_mode@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_Atari800_TV_PAL@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	cmpq	(%rdx), %rcx
	sete	%sil
	leaq	LCPI0_1(%rip), %rcx
	divsd	(%rcx,%rsi,8), %xmm2
	cvttsd2si	%xmm2, %ecx
	movl	%ecx, _Screen_DrawAtariSpeed.percent_display(%rip)
	movl	%eax, _Screen_DrawAtariSpeed.last_updated(%rip)
	movsd	%xmm0, _Screen_DrawAtariSpeed.last_time(%rip)
LBB0_3:
	movq	_Screen_atari@GOTPCREL(%rip), %rax
	movq	_Screen_visible_x1@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	shlq	$2, %rcx
	addq	(%rax), %rcx
	movq	_SMALLFONT_WIDTH@GOTPCREL(%rip), %r14
	movslq	(%r14), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	(%rcx,%rax,4), %rax
	movq	_Screen_visible_y2@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movq	_SMALLFONT_HEIGHT@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	subq	%rdx, %rcx
	movq	_Screen_WIDTH@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	imulq	%rcx, %rdx
	leaq	(%rax,%rdx,4), %rbx
	movq	_SMALLFONT_PERCENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$12, %edx
	xorl	%ecx, %ecx
	callq	_SmallFont_DrawChar
	movslq	(%r14), %rax
	shlq	$2, %rax
	subq	%rax, %rbx
	movl	_Screen_DrawAtariSpeed.percent_display(%rip), %esi
	movq	%rbx, %rdi
	movl	$12, %edx
	xorl	%ecx, %ecx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_SmallFont_DrawInt              ## TAILCALL
LBB0_4:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Screen_show_atari_speed,8,3    ## @Screen_show_atari_speed
	.section	__DATA,__data
	.p2align	2                               ## @Screen_DrawAtariSpeed.percent_display
_Screen_DrawAtariSpeed.percent_display:
	.long	100                             ## 0x64

.zerofill __DATA,__bss,_Screen_DrawAtariSpeed.last_updated,4,2 ## @Screen_DrawAtariSpeed.last_updated
.zerofill __DATA,__bss,_Screen_DrawAtariSpeed.last_time,8,3 ## @Screen_DrawAtariSpeed.last_time
	.comm	_Atari800_nframes,4,2           ## @Atari800_nframes
	.comm	_Atari800_tv_mode,8,3           ## @Atari800_tv_mode
	.comm	_Atari800_TV_PAL,8,3            ## @Atari800_TV_PAL
	.comm	_Screen_atari,8,3               ## @Screen_atari
	.comm	_Screen_visible_x1,4,2          ## @Screen_visible_x1
	.comm	_SMALLFONT_WIDTH,4,2            ## @SMALLFONT_WIDTH
	.comm	_Screen_visible_y2,4,2          ## @Screen_visible_y2
	.comm	_SMALLFONT_HEIGHT,4,2           ## @SMALLFONT_HEIGHT
	.comm	_Screen_WIDTH,4,2               ## @Screen_WIDTH
	.comm	_SMALLFONT_PERCENT,4,2          ## @SMALLFONT_PERCENT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Screen_DrawAtariSpeed          ; -- Begin function Screen_DrawAtariSpeed
	.p2align	2
_Screen_DrawAtariSpeed:                 ; @Screen_DrawAtariSpeed
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
Lloh0:
	adrp	x8, _Screen_show_atari_speed@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Screen_show_atari_speed@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_4
; %bb.1:
	adrp	x8, _Screen_DrawAtariSpeed.last_time@PAGE
	ldr	d1, [x8, _Screen_DrawAtariSpeed.last_time@PAGEOFF]
	fsub	d1, d0, d1
	fmov	d2, #0.50000000
	fcmp	d1, d2
	adrp	x20, _Screen_DrawAtariSpeed.percent_display@PAGE
	b.lt	LBB0_3
; %bb.2:
Lloh3:
	adrp	x9, _Atari800_nframes@GOTPAGE
Lloh4:
	ldr	x9, [x9, _Atari800_nframes@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	adrp	x10, _Screen_DrawAtariSpeed.last_updated@PAGE
	ldr	w11, [x10, _Screen_DrawAtariSpeed.last_updated@PAGEOFF]
	sub	w11, w9, w11
	mov	w12, #100
	mul	w11, w11, w12
	scvtf	d2, w11
	fdiv	d1, d2, d1
Lloh6:
	adrp	x11, _Atari800_tv_mode@GOTPAGE
Lloh7:
	ldr	x11, [x11, _Atari800_tv_mode@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
Lloh9:
	adrp	x12, _Atari800_TV_PAL@GOTPAGE
Lloh10:
	ldr	x12, [x12, _Atari800_TV_PAL@GOTPAGEOFF]
Lloh11:
	ldr	x12, [x12]
	cmp	x11, x12
	mov	x11, #4633641066610819072
	fmov	d2, x11
	mov	x11, #4632233691727265792
	fmov	d3, x11
	fcsel	d2, d3, d2, eq
	fdiv	d1, d1, d2
	fcvtzs	w11, d1
	str	w11, [x20, _Screen_DrawAtariSpeed.percent_display@PAGEOFF]
	str	w9, [x10, _Screen_DrawAtariSpeed.last_updated@PAGEOFF]
	str	d0, [x8, _Screen_DrawAtariSpeed.last_time@PAGEOFF]
LBB0_3:
Lloh12:
	adrp	x8, _Screen_atari@GOTPAGE
Lloh13:
	ldr	x8, [x8, _Screen_atari@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _Screen_visible_x1@GOTPAGE
Lloh16:
	ldr	x9, [x9, _Screen_visible_x1@GOTPAGEOFF]
Lloh17:
	ldrsw	x9, [x9]
	add	x8, x8, x9, lsl #2
Lloh18:
	adrp	x21, _SMALLFONT_WIDTH@GOTPAGE
Lloh19:
	ldr	x21, [x21, _SMALLFONT_WIDTH@GOTPAGEOFF]
	ldrsw	x9, [x21]
	mov	w10, #20
	madd	x8, x9, x10, x8
Lloh20:
	adrp	x9, _Screen_visible_y2@GOTPAGE
Lloh21:
	ldr	x9, [x9, _Screen_visible_y2@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
Lloh23:
	adrp	x10, _SMALLFONT_HEIGHT@GOTPAGE
Lloh24:
	ldr	x10, [x10, _SMALLFONT_HEIGHT@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	sub	w9, w9, w10
Lloh26:
	adrp	x10, _Screen_WIDTH@GOTPAGE
Lloh27:
	ldr	x10, [x10, _Screen_WIDTH@GOTPAGEOFF]
Lloh28:
	ldr	w10, [x10]
	mul	w9, w9, w10
	add	x19, x8, w9, sxtw #2
Lloh29:
	adrp	x8, _SMALLFONT_PERCENT@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SMALLFONT_PERCENT@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #12
	mov	w3, #0
	bl	_SmallFont_DrawChar
	ldrsw	x8, [x21]
	sub	x0, x19, x8, lsl #2
	ldr	w1, [x20, _Screen_DrawAtariSpeed.percent_display@PAGEOFF]
	mov	w2, #12
	mov	w3, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_SmallFont_DrawInt
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_Screen_show_atari_speed,8,3    ; @Screen_show_atari_speed
	.section	__DATA,__data
	.p2align	2                               ; @Screen_DrawAtariSpeed.percent_display
_Screen_DrawAtariSpeed.percent_display:
	.long	100                             ; 0x64

.zerofill __DATA,__bss,_Screen_DrawAtariSpeed.last_updated,4,2 ; @Screen_DrawAtariSpeed.last_updated
.zerofill __DATA,__bss,_Screen_DrawAtariSpeed.last_time,8,3 ; @Screen_DrawAtariSpeed.last_time
	.comm	_Atari800_nframes,4,2           ; @Atari800_nframes
	.comm	_Atari800_tv_mode,8,3           ; @Atari800_tv_mode
	.comm	_Atari800_TV_PAL,8,3            ; @Atari800_TV_PAL
	.comm	_Screen_atari,8,3               ; @Screen_atari
	.comm	_Screen_visible_x1,4,2          ; @Screen_visible_x1
	.comm	_SMALLFONT_WIDTH,4,2            ; @SMALLFONT_WIDTH
	.comm	_Screen_visible_y2,4,2          ; @Screen_visible_y2
	.comm	_SMALLFONT_HEIGHT,4,2           ; @SMALLFONT_HEIGHT
	.comm	_Screen_WIDTH,4,2               ; @Screen_WIDTH
	.comm	_SMALLFONT_PERCENT,4,2          ; @SMALLFONT_PERCENT
.subsections_via_symbols
