	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vdp_z80_ctrl_w                 ## -- Begin function vdp_z80_ctrl_w
	.p2align	4, 0x90
_vdp_z80_ctrl_w:                        ## @vdp_z80_ctrl_w
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
                                        ## kill: def $edi killed $edi def $rdi
	movq	_pending@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	cmpq	$3, %rax
	ja	LBB0_14
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_13:
	movq	_addr_latch@GOTPCREL(%rip), %rax
	movl	%edi, (%rax)
	movl	$1, (%rbx)
	jmp	LBB0_14
LBB0_2:
	movq	_addr@GOTPCREL(%rip), %r8
	movl	(%r8), %eax
	andl	$49152, %eax                    ## imm = 0xC000
	movl	%edi, %ecx
	andl	$63, %ecx
	shlq	$8, %rcx
	orq	%rax, %rcx
	movq	_addr_latch@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orq	%rsi, %rcx
	movl	%ecx, (%r8)
	movq	_code@GOTPCREL(%rip), %r9
	movl	(%r9), %edx
	andl	$60, %edx
	movl	%edi, %eax
	shrl	$6, %eax
	andl	$3, %eax
	orl	%eax, %edx
	movl	%edx, (%r9)
	cmpl	$2, %eax
	jne	LBB0_4
## %bb.3:
	andl	$31, %edi
	movq	_Z80@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
                                        ## kill: def $edi killed $edi killed $rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_vdp_reg_w
	movl	$0, (%rbx)
	jmp	LBB0_14
LBB0_6:
	movq	_addr_latch@GOTPCREL(%rip), %rax
	movl	%edi, (%rax)
	movl	$3, (%rbx)
	jmp	LBB0_14
LBB0_7:
	movl	$0, (%rbx)
	movq	_addr_latch@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shll	$14, %ecx
	movzwl	%cx, %ecx
	movq	_addr@GOTPCREL(%rip), %rdx
	movl	$16383, %esi                    ## imm = 0x3FFF
	andl	(%rdx), %esi
	orl	%ecx, %esi
	movl	%esi, (%rdx)
	movq	_code@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	$3, %edx
	movl	%eax, %esi
	shrl	$2, %esi
	andl	$60, %esi
	orl	%edx, %esi
	movl	%esi, (%rcx)
	testb	$-128, %al
	je	LBB0_14
## %bb.8:
	movq	_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testb	$16, 4(%rax)
	je	LBB0_14
## %bb.9:
	movl	92(%rax), %ecx
	sarl	$6, %ecx
	cmpl	$3, %ecx
	je	LBB0_12
## %bb.10:
	cmpl	$2, %ecx
	jne	LBB0_14
## %bb.11:
	movq	_dmafill@GOTPCREL(%rip), %rax
	movl	$256, (%rax)                    ## imm = 0x100
	jmp	LBB0_14
LBB0_4:
	movq	_reg@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	4(%rdx), %esi
	shrl	%esi
	andl	$2, %esi
	movl	%esi, (%rbx)
	orl	%eax, %esi
	jne	LBB0_14
## %bb.5:
	movq	_vram@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	andl	$16383, %ecx                    ## imm = 0x3FFF
	movl	(%rax,%rcx,4), %eax
	movq	_fifo@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, (%rcx)
	movl	60(%rdx), %eax
	movl	(%r8), %ecx
	addl	%ecx, %eax
	incl	%eax
	movl	%eax, (%r8)
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_12:
	movl	80(%rax), %ecx
	shll	$8, %ecx
	orl	76(%rax), %ecx
	movl	$65536, %edx                    ## imm = 0x10000
	cmovnel	%ecx, %edx
	movq	_dma_length@GOTPCREL(%rip), %rcx
	movl	%edx, (%rcx)
	movl	88(%rax), %ecx
	shll	$8, %ecx
	orl	84(%rax), %ecx
	movq	_dma_src@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	movq	_dma_type@GOTPCREL(%rip), %rax
	movl	$3, (%rax)
	movq	_Z80@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_vdp_dma_update                 ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
LJTI0_0:
	.long	L0_0_set_13
	.long	L0_0_set_2
	.long	L0_0_set_6
	.long	L0_0_set_7
	.end_data_region
                                        ## -- End function
	.comm	_pending,4,2                    ## @pending
	.comm	_addr_latch,4,2                 ## @addr_latch
	.comm	_addr,4,2                       ## @addr
	.comm	_code,4,2                       ## @code
	.comm	_Z80,4,2                        ## @Z80
	.comm	_reg,8,3                        ## @reg
	.comm	_vram,8,3                       ## @vram
	.comm	_fifo,8,3                       ## @fifo
	.comm	_dmafill,4,2                    ## @dmafill
	.comm	_dma_length,4,2                 ## @dma_length
	.comm	_dma_src,4,2                    ## @dma_src
	.comm	_dma_type,4,2                   ## @dma_type
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vdp_z80_ctrl_w                 ; -- Begin function vdp_z80_ctrl_w
	.p2align	2
_vdp_z80_ctrl_w:                        ; @vdp_z80_ctrl_w
	.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
Lloh0:
	adrp	x19, _pending@GOTPAGE
Lloh1:
	ldr	x19, [x19, _pending@GOTPAGEOFF]
	ldr	w8, [x19]
	cmp	w8, #3
	b.hi	LBB0_7
; %bb.1:
Lloh2:
	adrp	x9, lJTI0_0@PAGE
Lloh3:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
Lloh4:
	adrp	x8, _addr_latch@GOTPAGE
Lloh5:
	ldr	x8, [x8, _addr_latch@GOTPAGEOFF]
Lloh6:
	str	w0, [x8]
	mov	w8, #1
	b	LBB0_6
LBB0_3:
Lloh7:
	adrp	x8, _addr@GOTPAGE
Lloh8:
	ldr	x8, [x8, _addr@GOTPAGEOFF]
	ldr	w9, [x8]
	and	x9, x9, #0xc000
	lsl	w10, w0, #8
	and	x10, x10, #0x3f00
Lloh9:
	adrp	x11, _addr_latch@GOTPAGE
Lloh10:
	ldr	x11, [x11, _addr_latch@GOTPAGEOFF]
	orr	x9, x9, x10
Lloh11:
	ldr	w1, [x11]
	orr	x9, x9, x1
	str	w9, [x8]
Lloh12:
	adrp	x10, _code@GOTPAGE
Lloh13:
	ldr	x10, [x10, _code@GOTPAGEOFF]
	ldr	w11, [x10]
	and	w12, w11, #0x3c
	ubfx	w11, w0, #6, #2
	bfxil	w12, w0, #6, #2
	str	w12, [x10]
	cmp	w11, #2
	b.ne	LBB0_13
; %bb.4:
	and	w0, w0, #0x1f
Lloh14:
	adrp	x8, _Z80@GOTPAGE
Lloh15:
	ldr	x8, [x8, _Z80@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_vdp_reg_w
	str	wzr, [x19]
	b	LBB0_7
LBB0_5:
Lloh17:
	adrp	x8, _addr_latch@GOTPAGE
Lloh18:
	ldr	x8, [x8, _addr_latch@GOTPAGEOFF]
Lloh19:
	str	w0, [x8]
	mov	w8, #3
LBB0_6:
	str	w8, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	str	wzr, [x19]
Lloh20:
	adrp	x8, _addr_latch@GOTPAGE
Lloh21:
	ldr	x8, [x8, _addr_latch@GOTPAGEOFF]
Lloh22:
	adrp	x9, _addr@GOTPAGE
Lloh23:
	ldr	x9, [x9, _addr@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	ldr	w10, [x9]
	and	w10, w10, #0x3fff
	bfi	w10, w8, #14, #2
Lloh25:
	adrp	x11, _code@GOTPAGE
Lloh26:
	ldr	x11, [x11, _code@GOTPAGEOFF]
	str	w10, [x9]
	ldr	w9, [x11]
	lsr	w10, w8, #2
	and	w10, w10, #0x3c
	bfxil	w10, w9, #0, #2
	str	w10, [x11]
	tbz	w8, #7, LBB0_7
; %bb.9:
Lloh27:
	adrp	x8, _reg@GOTPAGE
Lloh28:
	ldr	x8, [x8, _reg@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	ldrb	w9, [x8, #4]
	tbz	w9, #4, LBB0_7
; %bb.10:
	ldr	w9, [x8, #92]
	asr	w9, w9, #6
	cmp	w9, #3
	b.eq	LBB0_15
; %bb.11:
	cmp	w9, #2
	b.ne	LBB0_7
; %bb.12:
Lloh30:
	adrp	x8, _dmafill@GOTPAGE
Lloh31:
	ldr	x8, [x8, _dmafill@GOTPAGEOFF]
	mov	w9, #256
Lloh32:
	str	w9, [x8]
	b	LBB0_7
LBB0_13:
Lloh33:
	adrp	x10, _reg@GOTPAGE
Lloh34:
	ldr	x10, [x10, _reg@GOTPAGEOFF]
Lloh35:
	ldr	x10, [x10]
	ldr	w12, [x10, #4]
	lsr	w12, w12, #1
	and	w12, w12, #0x2
	str	w12, [x19]
	orr	w11, w12, w11
	cbnz	w11, LBB0_7
; %bb.14:
Lloh36:
	adrp	x11, _vram@GOTPAGE
Lloh37:
	ldr	x11, [x11, _vram@GOTPAGEOFF]
Lloh38:
	ldr	x11, [x11]
	and	x9, x9, #0x3fff
	ldr	w9, [x11, x9, lsl #2]
Lloh39:
	adrp	x11, _fifo@GOTPAGE
Lloh40:
	ldr	x11, [x11, _fifo@GOTPAGEOFF]
Lloh41:
	ldr	x11, [x11]
	str	w9, [x11]
	ldr	w9, [x10, #60]
	ldr	w10, [x8]
	add	w9, w9, w10
	add	w9, w9, #1
	str	w9, [x8]
	b	LBB0_7
LBB0_15:
	ldp	w10, w9, [x8, #76]
	orr	w9, w10, w9, lsl #8
	mov	w10, #65536
	cmp	w9, #0
	csel	w9, w10, w9, eq
Lloh42:
	adrp	x10, _dma_length@GOTPAGE
Lloh43:
	ldr	x10, [x10, _dma_length@GOTPAGEOFF]
Lloh44:
	str	w9, [x10]
	ldp	w8, w9, [x8, #84]
	orr	w8, w8, w9, lsl #8
Lloh45:
	adrp	x9, _dma_src@GOTPAGE
Lloh46:
	ldr	x9, [x9, _dma_src@GOTPAGEOFF]
Lloh47:
	str	w8, [x9]
Lloh48:
	adrp	x8, _dma_type@GOTPAGE
Lloh49:
	ldr	x8, [x8, _dma_type@GOTPAGEOFF]
	mov	w9, #3
Lloh50:
	str	w9, [x8]
Lloh51:
	adrp	x8, _Z80@GOTPAGE
Lloh52:
	ldr	x8, [x8, _Z80@GOTPAGEOFF]
Lloh53:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_vdp_dma_update
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotStr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotStr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotStr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotStr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotStr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_3-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
                                        ; -- End function
	.comm	_pending,4,2                    ; @pending
	.comm	_addr_latch,4,2                 ; @addr_latch
	.comm	_addr,4,2                       ; @addr
	.comm	_code,4,2                       ; @code
	.comm	_Z80,4,2                        ; @Z80
	.comm	_reg,8,3                        ; @reg
	.comm	_vram,8,3                       ; @vram
	.comm	_fifo,8,3                       ; @fifo
	.comm	_dmafill,4,2                    ; @dmafill
	.comm	_dma_length,4,2                 ; @dma_length
	.comm	_dma_src,4,2                    ; @dma_src
	.comm	_dma_type,4,2                   ; @dma_type
.subsections_via_symbols
