	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function autoframeskip
LCPI0_0:
	.quad	0x3fe0000000000000              ## double 0.5
LCPI0_1:
	.quad	0x4059000000000000              ## double 100
LCPI0_2:
	.quad	0x4056800000000000              ## double 90
LCPI0_3:
	.quad	0x4034000000000000              ## double 20
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_autoframeskip:                         ## @autoframeskip
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subsd	%xmm0, %xmm1
	xorpd	%xmm2, %xmm2
	ucomisd	%xmm2, %xmm1
	jbe	LBB0_2
## %bb.1:
	addsd	_autoframeskip.afs_sleeptime(%rip), %xmm1
	movsd	%xmm1, _autoframeskip.afs_sleeptime(%rip)
LBB0_2:
	subsd	_autoframeskip.afs_lasttime(%rip), %xmm0
	ucomisd	LCPI0_0(%rip), %xmm0
	jbe	LBB0_17
## %bb.3:
	movq	_Atari800_nframes@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	subl	_autoframeskip.afs_lastframe(%rip), %ecx
	xorps	%xmm1, %xmm1
	cvtsi2sd	%ecx, %xmm1
	movq	_Atari800_tv_mode@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_Atari800_TV_PAL@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_4
## %bb.5:
	movq	_Atari800_FPS_PAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_6
LBB0_4:
	movq	_Atari800_FPS_NTSC@GOTPCREL(%rip), %rcx
LBB0_6:
	xorps	%xmm2, %xmm2
	cvtsi2sdq	(%rcx), %xmm2
	divsd	%xmm2, %xmm1
	movsd	_autoframeskip.afs_sleeptime(%rip), %xmm2 ## xmm2 = mem[0],zero
	movl	_autoframeskip.afs_discard(%rip), %ecx
	cmpl	$2, %ecx
	jg	LBB0_9
## %bb.7:
	movapd	%xmm1, %xmm3
	addsd	%xmm1, %xmm3
	ucomisd	%xmm3, %xmm0
	jbe	LBB0_9
## %bb.8:
	incl	%ecx
	movl	%ecx, _autoframeskip.afs_discard(%rip)
	jmp	LBB0_16
LBB0_9:
	mulsd	LCPI0_1(%rip), %xmm1
	divsd	%xmm0, %xmm1
	movl	$0, _autoframeskip.afs_discard(%rip)
	movsd	LCPI0_2(%rip), %xmm3            ## xmm3 = mem[0],zero
	ucomisd	%xmm1, %xmm3
	jbe	LBB0_12
## %bb.10:
	movq	_Atari800_refresh_rate@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	$3, %edx
	jg	LBB0_16
## %bb.11:
	incl	%edx
	jmp	LBB0_15
LBB0_12:
	mulsd	LCPI0_1(%rip), %xmm2
	divsd	%xmm0, %xmm2
	ucomisd	LCPI0_3(%rip), %xmm2
	jbe	LBB0_16
## %bb.13:
	movq	_Atari800_refresh_rate@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	cmpl	$2, %edx
	jl	LBB0_16
## %bb.14:
	decl	%edx
LBB0_15:
	movl	%edx, (%rcx)
LBB0_16:
	movq	$0, _autoframeskip.afs_sleeptime(%rip)
	movl	%eax, _autoframeskip.afs_lastframe(%rip)
	xorl	%eax, %eax
	callq	_Util_time
	movsd	%xmm0, _autoframeskip.afs_lasttime(%rip)
LBB0_17:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_autoframeskip.afs_lastframe,4,2 ## @autoframeskip.afs_lastframe
.zerofill __DATA,__bss,_autoframeskip.afs_discard,4,2 ## @autoframeskip.afs_discard
.zerofill __DATA,__bss,_autoframeskip.afs_lasttime,8,3 ## @autoframeskip.afs_lasttime
.zerofill __DATA,__bss,_autoframeskip.afs_sleeptime,8,3 ## @autoframeskip.afs_sleeptime
	.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	_Atari800_FPS_PAL,8,3           ## @Atari800_FPS_PAL
	.comm	_Atari800_FPS_NTSC,8,3          ## @Atari800_FPS_NTSC
	.comm	_Atari800_refresh_rate,4,2      ## @Atari800_refresh_rate
	.no_dead_strip	_autoframeskip
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function autoframeskip
_autoframeskip:                         ; @autoframeskip
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	fsub	d1, d1, d0
	fcmp	d1, #0.0
	b.le	LBB0_2
; %bb.1:
	adrp	x8, _autoframeskip.afs_sleeptime@PAGE
	ldr	d2, [x8, _autoframeskip.afs_sleeptime@PAGEOFF]
	fadd	d1, d1, d2
	str	d1, [x8, _autoframeskip.afs_sleeptime@PAGEOFF]
LBB0_2:
	adrp	x19, _autoframeskip.afs_lasttime@PAGE
	ldr	d1, [x19, _autoframeskip.afs_lasttime@PAGEOFF]
	fsub	d0, d0, d1
	fmov	d1, #0.50000000
	fcmp	d0, d1
	b.le	LBB0_13
; %bb.3:
Lloh0:
	adrp	x8, _Atari800_nframes@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Atari800_nframes@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	adrp	x9, _autoframeskip.afs_lastframe@PAGE
	ldr	w10, [x9, _autoframeskip.afs_lastframe@PAGEOFF]
	sub	w10, w8, w10
	scvtf	d1, w10
Lloh3:
	adrp	x10, _Atari800_tv_mode@GOTPAGE
Lloh4:
	ldr	x10, [x10, _Atari800_tv_mode@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
Lloh6:
	adrp	x11, _Atari800_TV_PAL@GOTPAGE
Lloh7:
	ldr	x11, [x11, _Atari800_TV_PAL@GOTPAGEOFF]
Lloh8:
	ldr	x11, [x11]
Lloh9:
	adrp	x12, _Atari800_FPS_PAL@GOTPAGE
Lloh10:
	ldr	x12, [x12, _Atari800_FPS_PAL@GOTPAGEOFF]
Lloh11:
	adrp	x13, _Atari800_FPS_NTSC@GOTPAGE
Lloh12:
	ldr	x13, [x13, _Atari800_FPS_NTSC@GOTPAGEOFF]
	cmp	x10, x11
	csel	x10, x12, x13, eq
	ldr	d2, [x10]
	scvtf	d2, d2
	fdiv	d2, d1, d2
	adrp	x10, _autoframeskip.afs_sleeptime@PAGE
	ldr	d1, [x10, _autoframeskip.afs_sleeptime@PAGEOFF]
	adrp	x11, _autoframeskip.afs_discard@PAGE
	ldr	w12, [x11, _autoframeskip.afs_discard@PAGEOFF]
	cmp	w12, #2
	b.gt	LBB0_6
; %bb.4:
	fadd	d3, d2, d2
	fcmp	d0, d3
	b.le	LBB0_6
; %bb.5:
	add	w12, w12, #1
	str	w12, [x11, _autoframeskip.afs_discard@PAGEOFF]
	b	LBB0_12
LBB0_6:
	mov	x12, #4636737291354636288
	fmov	d3, x12
	fmul	d2, d2, d3
	fdiv	d2, d2, d0
	str	wzr, [x11, _autoframeskip.afs_discard@PAGEOFF]
	mov	x11, #140737488355328
	movk	x11, #16470, lsl #48
	fmov	d3, x11
	fcmp	d2, d3
	b.pl	LBB0_9
; %bb.7:
Lloh13:
	adrp	x11, _Atari800_refresh_rate@GOTPAGE
Lloh14:
	ldr	x11, [x11, _Atari800_refresh_rate@GOTPAGEOFF]
	ldr	w12, [x11]
	cmp	w12, #3
	b.gt	LBB0_12
; %bb.8:
	add	w12, w12, #1
	b	LBB0_11
LBB0_9:
	mov	x11, #4636737291354636288
	fmov	d2, x11
	fmul	d1, d1, d2
	fdiv	d0, d1, d0
Lloh15:
	adrp	x11, _Atari800_refresh_rate@GOTPAGE
Lloh16:
	ldr	x11, [x11, _Atari800_refresh_rate@GOTPAGEOFF]
	ldr	w12, [x11]
	fmov	d1, #20.00000000
	fcmp	d0, d1
	ccmp	w12, #2, #8, gt
	b.lt	LBB0_12
; %bb.10:
	sub	w12, w12, #1
LBB0_11:
	str	w12, [x11]
LBB0_12:
	str	xzr, [x10, _autoframeskip.afs_sleeptime@PAGEOFF]
	str	w8, [x9, _autoframeskip.afs_lastframe@PAGEOFF]
	bl	_Util_time
	str	d0, [x19, _autoframeskip.afs_lasttime@PAGEOFF]
LBB0_13:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_autoframeskip.afs_lastframe,4,2 ; @autoframeskip.afs_lastframe
.zerofill __DATA,__bss,_autoframeskip.afs_discard,4,2 ; @autoframeskip.afs_discard
.zerofill __DATA,__bss,_autoframeskip.afs_lasttime,8,3 ; @autoframeskip.afs_lasttime
.zerofill __DATA,__bss,_autoframeskip.afs_sleeptime,8,3 ; @autoframeskip.afs_sleeptime
	.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	_Atari800_FPS_PAL,8,3           ; @Atari800_FPS_PAL
	.comm	_Atari800_FPS_NTSC,8,3          ; @Atari800_FPS_NTSC
	.comm	_Atari800_refresh_rate,4,2      ; @Atari800_refresh_rate
	.no_dead_strip	_autoframeskip
.subsections_via_symbols
