	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function Atari800_Sync
LCPI0_0:
	.quad	0x3ff0000000000000              ## double 1
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_Atari800_Sync
	.p2align	4, 0x90
_Atari800_Sync:                         ## @Atari800_Sync
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	subq	$16, %rsp
	movq	_Atari800_tv_mode@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_Atari800_TV_PAL@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	_Atari800_FPS_PAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_Atari800_FPS_NTSC@GOTPCREL(%rip), %rax
LBB0_3:
	movsd	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero
	divsd	(%rax), %xmm1
	movsd	_Atari800_Sync.lasttime(%rip), %xmm0 ## xmm0 = mem[0],zero
	movsd	%xmm1, -16(%rbp)                ## 8-byte Spill
	addsd	%xmm1, %xmm0
	movsd	%xmm0, _Atari800_Sync.lasttime(%rip)
	xorl	%eax, %eax
	callq	_Util_time
	movapd	%xmm0, %xmm2
	movq	_Atari800_auto_frameskip@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_5
## %bb.4:
	movsd	_Atari800_Sync.lasttime(%rip), %xmm1 ## xmm1 = mem[0],zero
	movapd	%xmm2, %xmm0
	movsd	%xmm2, -8(%rbp)                 ## 8-byte Spill
	callq	_autoframeskip
	movsd	-8(%rbp), %xmm2                 ## 8-byte Reload
                                        ## xmm2 = mem[0],zero
LBB0_5:
	movsd	_Atari800_Sync.lasttime(%rip), %xmm0 ## xmm0 = mem[0],zero
	subsd	%xmm2, %xmm0
	callq	_Util_sleep
	xorl	%eax, %eax
	callq	_Util_time
	movsd	-16(%rbp), %xmm1                ## 8-byte Reload
                                        ## xmm1 = mem[0],zero
	addsd	_Atari800_Sync.lasttime(%rip), %xmm1
	ucomisd	%xmm1, %xmm0
	jbe	LBB0_7
## %bb.6:
	movsd	%xmm0, _Atari800_Sync.lasttime(%rip)
LBB0_7:
	addq	$16, %rsp
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_Atari800_Sync.lasttime,8,3 ## @Atari800_Sync.lasttime
	.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_auto_frameskip,8,3    ## @Atari800_auto_frameskip
	.comm	_Atari800_refresh_rate,8,3      ## @Atari800_refresh_rate
	.comm	_UI_is_active,4,2               ## @UI_is_active
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Atari800_Sync                  ; -- Begin function Atari800_Sync
	.p2align	2
_Atari800_Sync:                         ; @Atari800_Sync
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [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 b8, -40
	.cfi_offset b9, -48
Lloh0:
	adrp	x8, _Atari800_tv_mode@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Atari800_tv_mode@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _Atari800_TV_PAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _Atari800_TV_PAL@GOTPAGEOFF]
Lloh5:
	adrp	x10, _Atari800_FPS_PAL@GOTPAGE
Lloh6:
	ldr	x10, [x10, _Atari800_FPS_PAL@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
Lloh8:
	adrp	x11, _Atari800_FPS_NTSC@GOTPAGE
Lloh9:
	ldr	x11, [x11, _Atari800_FPS_NTSC@GOTPAGEOFF]
	cmp	x8, x9
	csel	x8, x10, x11, eq
	ldr	d0, [x8]
	fmov	d1, #1.00000000
	fdiv	d9, d1, d0
	adrp	x19, _Atari800_Sync.lasttime@PAGE
	ldr	d0, [x19, _Atari800_Sync.lasttime@PAGEOFF]
	fadd	d0, d0, d9
	str	d0, [x19, _Atari800_Sync.lasttime@PAGEOFF]
	bl	_Util_time
	fmov	d8, d0
Lloh10:
	adrp	x8, _Atari800_auto_frameskip@GOTPAGE
Lloh11:
	ldr	x8, [x8, _Atari800_auto_frameskip@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	d1, [x19, _Atari800_Sync.lasttime@PAGEOFF]
	fmov	d0, d8
	bl	_autoframeskip
LBB0_2:
	ldr	d0, [x19, _Atari800_Sync.lasttime@PAGEOFF]
	fsub	d0, d0, d8
	bl	_Util_sleep
	bl	_Util_time
	ldr	d1, [x19, _Atari800_Sync.lasttime@PAGEOFF]
	fadd	d1, d9, d1
	fcmp	d1, d0
	b.pl	LBB0_4
; %bb.3:
	str	d0, [x19, _Atari800_Sync.lasttime@PAGEOFF]
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #48               ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_Atari800_Sync.lasttime,8,3 ; @Atari800_Sync.lasttime
	.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_auto_frameskip,8,3    ; @Atari800_auto_frameskip
	.comm	_Atari800_refresh_rate,8,3      ; @Atari800_refresh_rate
	.comm	_UI_is_active,4,2               ; @UI_is_active
.subsections_via_symbols
