	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdp_68k_data_w_m5
_vdp_68k_data_w_m5:                     ## @vdp_68k_data_w_m5
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_pending@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_status@GOTPCREL(%rip), %r14
	testb	$8, (%r14)
	jne	LBB0_5
## %bb.1:
	movq	_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testb	$64, 4(%rax)
	je	LBB0_5
## %bb.2:
	movq	_m68k@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_vdp_fifo_update
	movl	$65023, %eax                    ## imm = 0xFDFF
	andl	(%r14), %eax
	movl	%eax, (%r14)
	movq	_fifo_write_cnt@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	cmpl	$3, %ecx
	jg	LBB0_4
## %bb.3:
	incl	%ecx
	movl	%ecx, (%rdx)
	andl	$4, %ecx
	shll	$6, %ecx
	orl	%eax, %ecx
	movl	%ecx, (%r14)
	jmp	LBB0_5
LBB0_4:
	movq	_fifo_latency@GOTPCREL(%rip), %rax
	movq	_fifo_lastwrite@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	addl	(%rax), %edx
	movl	%edx, (%rcx)
	movl	%edx, (%r15)
LBB0_5:
	movl	%ebx, %edi
	callq	_vdp_bus_w
	movq	_dmafill@GOTPCREL(%rip), %rax
	testb	$1, 1(%rax)
	jne	LBB0_7
## %bb.6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	shrl	$8, %ebx
	movl	%ebx, (%rax)
	movq	_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	80(%rax), %ecx
	shll	$8, %ecx
	orl	76(%rax), %ecx
	movl	$65536, %eax                    ## imm = 0x10000
	cmovnel	%ecx, %eax
	movq	_dma_length@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_dma_type@GOTPCREL(%rip), %rax
	movl	$2, (%rax)
	movq	_m68k@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vdp_dma_update                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_pending,8,3                    ## @pending
	.comm	_status,4,2                     ## @status
	.comm	_reg,8,3                        ## @reg
	.comm	_m68k,4,2                       ## @m68k
	.comm	_fifo_write_cnt,4,2             ## @fifo_write_cnt
	.comm	_fifo_latency,8,3               ## @fifo_latency
	.comm	_fifo_lastwrite,4,2             ## @fifo_lastwrite
	.comm	_dmafill,4,2                    ## @dmafill
	.comm	_dma_length,4,2                 ## @dma_length
	.comm	_dma_type,4,2                   ## @dma_type
	.no_dead_strip	_vdp_68k_data_w_m5
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdp_68k_data_w_m5
_vdp_68k_data_w_m5:                     ; @vdp_68k_data_w_m5
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _pending@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pending@GOTPAGEOFF]
Lloh2:
	str	xzr, [x8]
Lloh3:
	adrp	x21, _status@GOTPAGE
Lloh4:
	ldr	x21, [x21, _status@GOTPAGEOFF]
	ldrb	w8, [x21]
Lloh5:
	adrp	x20, _reg@GOTPAGE
Lloh6:
	ldr	x20, [x20, _reg@GOTPAGEOFF]
	tbnz	w8, #3, LBB0_5
; %bb.1:
	ldr	x8, [x20]
	ldrb	w8, [x8, #4]
	tbz	w8, #6, LBB0_5
; %bb.2:
Lloh7:
	adrp	x22, _m68k@GOTPAGE
Lloh8:
	ldr	x22, [x22, _m68k@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_vdp_fifo_update
	ldr	w8, [x21]
	mov	w9, #65023
	and	w8, w8, w9
	str	w8, [x21]
Lloh9:
	adrp	x9, _fifo_write_cnt@GOTPAGE
Lloh10:
	ldr	x9, [x9, _fifo_write_cnt@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w10, #3
	b.gt	LBB0_4
; %bb.3:
	add	w10, w10, #1
	str	w10, [x9]
	lsl	w9, w10, #6
	and	w9, w9, #0x100
	orr	w8, w9, w8
	str	w8, [x21]
	b	LBB0_5
LBB0_4:
Lloh11:
	adrp	x8, _fifo_latency@GOTPAGE
Lloh12:
	ldr	x8, [x8, _fifo_latency@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _fifo_lastwrite@GOTPAGE
Lloh15:
	ldr	x9, [x9, _fifo_lastwrite@GOTPAGEOFF]
	ldr	w10, [x9]
	add	w8, w10, w8
	str	w8, [x9]
	str	w8, [x22]
LBB0_5:
	mov	x0, x19
	bl	_vdp_bus_w
Lloh16:
	adrp	x8, _dmafill@GOTPAGE
Lloh17:
	ldr	x8, [x8, _dmafill@GOTPAGEOFF]
	ldrb	w9, [x8, #1]
	tbnz	w9, #0, LBB0_7
; %bb.6:
	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
LBB0_7:
	lsr	w9, w19, #8
	str	w9, [x8]
	ldr	x8, [x20]
	ldp	w8, w9, [x8, #76]
	orr	w8, w8, w9, lsl #8
	mov	w9, #65536
	cmp	w8, #0
	csel	w8, w9, w8, eq
Lloh18:
	adrp	x9, _dma_length@GOTPAGE
Lloh19:
	ldr	x9, [x9, _dma_length@GOTPAGEOFF]
Lloh20:
	str	w8, [x9]
Lloh21:
	adrp	x8, _dma_type@GOTPAGE
Lloh22:
	ldr	x8, [x8, _dma_type@GOTPAGEOFF]
	mov	w9, #2
Lloh23:
	str	w9, [x8]
Lloh24:
	adrp	x8, _m68k@GOTPAGE
Lloh25:
	ldr	x8, [x8, _m68k@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	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	_vdp_dma_update
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_pending,8,3                    ; @pending
	.comm	_status,4,2                     ; @status
	.comm	_reg,8,3                        ; @reg
	.comm	_m68k,4,2                       ; @m68k
	.comm	_fifo_write_cnt,4,2             ; @fifo_write_cnt
	.comm	_fifo_latency,8,3               ; @fifo_latency
	.comm	_fifo_lastwrite,4,2             ; @fifo_lastwrite
	.comm	_dmafill,4,2                    ; @dmafill
	.comm	_dma_length,4,2                 ; @dma_length
	.comm	_dma_type,4,2                   ; @dma_type
	.no_dead_strip	_vdp_68k_data_w_m5
.subsections_via_symbols
