	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdp_fifo_update
_vdp_fifo_update:                       ## @vdp_fifo_update
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_fifo_write_cnt@GOTPCREL(%rip), %r9
	movq	(%r9), %rcx
	testq	%rcx, %rcx
	jle	LBB0_5
## %bb.1:
	movq	_fifo_lastwrite@GOTPCREL(%rip), %r8
	movl	(%r8), %r10d
	subl	%r10d, %edi
	movq	_fifo_latency@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%esi
	testl	%eax, %eax
	jle	LBB0_5
## %bb.2:
	movq	_status@GOTPCREL(%rip), %r11
	movl	$65279, %edi                    ## imm = 0xFEFF
	andl	(%r11), %edi
	movl	%eax, %edx
	movl	%edi, (%r11)
	subq	%rdx, %rcx
	movq	%rcx, (%r9)
	jg	LBB0_4
## %bb.3:
	orl	$512, %edi                      ## imm = 0x200
	movl	%edi, (%r11)
	movq	$0, (%r9)
LBB0_4:
	imull	%esi, %eax
	addl	%r10d, %eax
	movl	%eax, (%r8)
LBB0_5:
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_fifo_write_cnt,8,3             ## @fifo_write_cnt
	.comm	_fifo_lastwrite,4,2             ## @fifo_lastwrite
	.comm	_fifo_latency,4,2               ## @fifo_latency
	.comm	_status,4,2                     ## @status
	.no_dead_strip	_vdp_fifo_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdp_fifo_update
_vdp_fifo_update:                       ; @vdp_fifo_update
	.cfi_startproc
; %bb.0:
Lloh0:
	adrp	x8, _fifo_write_cnt@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fifo_write_cnt@GOTPAGEOFF]
	ldr	x13, [x8]
	cmp	x13, #1
	b.lt	LBB0_5
; %bb.1:
Lloh2:
	adrp	x9, _fifo_lastwrite@GOTPAGE
Lloh3:
	ldr	x9, [x9, _fifo_lastwrite@GOTPAGEOFF]
	ldr	w10, [x9]
	sub	w12, w0, w10
Lloh4:
	adrp	x11, _fifo_latency@GOTPAGE
Lloh5:
	ldr	x11, [x11, _fifo_latency@GOTPAGEOFF]
Lloh6:
	ldr	w11, [x11]
	udiv	w12, w12, w11
	cmp	w12, #1
	b.lt	LBB0_5
; %bb.2:
	sub	x15, x13, w12, uxtw
Lloh7:
	adrp	x13, _status@GOTPAGE
Lloh8:
	ldr	x13, [x13, _status@GOTPAGEOFF]
	str	x15, [x8]
	ldr	w14, [x13]
	mov	w16, #65279
	and	w14, w14, w16
	str	w14, [x13]
	cmp	x15, #0
	b.gt	LBB0_4
; %bb.3:
	orr	w14, w14, #0x200
	str	w14, [x13]
	str	xzr, [x8]
LBB0_4:
	madd	w8, w12, w11, w10
	str	w8, [x9]
LBB0_5:
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_fifo_write_cnt,8,3             ; @fifo_write_cnt
	.comm	_fifo_lastwrite,4,2             ; @fifo_lastwrite
	.comm	_fifo_latency,4,2               ; @fifo_latency
	.comm	_status,4,2                     ; @status
	.no_dead_strip	_vdp_fifo_update
.subsections_via_symbols
