	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vdp_tms_ctrl_w                 ## -- Begin function vdp_tms_ctrl_w
	.p2align	4, 0x90
_vdp_tms_ctrl_w:                        ## @vdp_tms_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
	movl	%edi, %ebx
	movq	_pending@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_1
## %bb.2:
	movl	%ebx, %edx
	shrl	$6, %edx
	movq	_code@GOTPCREL(%rip), %rdi
	movl	%ebx, %ecx
	shll	$8, %ecx
	movq	_addr_latch@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	%esi, %ecx
	andl	$16383, %ecx                    ## imm = 0x3FFF
	movl	$0, (%rax)
	movq	_addr@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	andl	$3, %edx
	movl	%edx, (%rdi)
	je	LBB0_3
## %bb.5:
	testb	$-128, %bl
	je	LBB0_4
## %bb.6:
	andl	$7, %ebx
	movq	_Z80@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	callq	_vdp_reg_w
	cmpl	$1, %ebx
	ja	LBB0_4
## %bb.7:
	movq	_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %ecx
	movl	4(%rax), %eax
	andl	$2, %ecx
	andl	$24, %eax
	orl	%ecx, %eax
	shrl	%eax
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_15:
	movq	_render_bg_inv@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_1:
	movq	_addr_latch@GOTPCREL(%rip), %rcx
	movl	%ebx, (%rcx)
	movl	$1, (%rax)
	jmp	LBB0_4
LBB0_3:
	movq	_vram@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	(%rdx,%rcx,4), %ecx
	movq	_fifo@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	%ecx, (%rdx)
	movl	(%rax), %ecx
	incl	%ecx
	andl	$16383, %ecx                    ## imm = 0x3FFF
	movl	%ecx, (%rax)
	jmp	LBB0_4
LBB0_14:
	movq	_render_bg_m3x@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_13:
	movq	_render_bg_m3@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_render_bg_m0@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_11:
	movq	_render_bg_m2@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_12:
	movq	_render_bg_m1x@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_10:
	movq	_render_bg_m1@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movq	_render_bg@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
LBB0_16:
	ud2
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_14, LBB0_14-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
LJTI0_0:
	.long	L0_0_set_8
	.long	L0_0_set_11
	.long	L0_0_set_16
	.long	L0_0_set_16
	.long	L0_0_set_13
	.long	L0_0_set_14
	.long	L0_0_set_16
	.long	L0_0_set_16
	.long	L0_0_set_10
	.long	L0_0_set_12
	.long	L0_0_set_16
	.long	L0_0_set_16
	.long	L0_0_set_15
	.long	L0_0_set_15
	.end_data_region
                                        ## -- End function
	.comm	_pending,4,2                    ## @pending
	.comm	_addr_latch,4,2                 ## @addr_latch
	.comm	_code,4,2                       ## @code
	.comm	_addr,4,2                       ## @addr
	.comm	_vram,8,3                       ## @vram
	.comm	_fifo,8,3                       ## @fifo
	.comm	_Z80,4,2                        ## @Z80
	.comm	_reg,8,3                        ## @reg
	.comm	_render_bg_m0,4,2               ## @render_bg_m0
	.comm	_render_bg,4,2                  ## @render_bg
	.comm	_render_bg_m1,4,2               ## @render_bg_m1
	.comm	_render_bg_m2,4,2               ## @render_bg_m2
	.comm	_render_bg_m1x,4,2              ## @render_bg_m1x
	.comm	_render_bg_m3,4,2               ## @render_bg_m3
	.comm	_render_bg_inv,4,2              ## @render_bg_inv
	.comm	_render_bg_m3x,4,2              ## @render_bg_m3x
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vdp_tms_ctrl_w                 ; -- Begin function vdp_tms_ctrl_w
	.p2align	2
_vdp_tms_ctrl_w:                        ; @vdp_tms_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	x8, _pending@GOTPAGE
Lloh1:
	ldr	x8, [x8, _pending@GOTPAGEOFF]
	ldr	w9, [x8]
	cbz	w9, LBB0_6
; %bb.1:
	ubfx	w11, w0, #6, #2
Lloh2:
	adrp	x9, _code@GOTPAGE
Lloh3:
	ldr	x9, [x9, _code@GOTPAGEOFF]
Lloh4:
	str	w11, [x9]
Lloh5:
	adrp	x9, _addr_latch@GOTPAGE
Lloh6:
	ldr	x9, [x9, _addr_latch@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x9]
	orr	w9, w1, w0, lsl #8
	and	x10, x9, #0x3fff
Lloh8:
	adrp	x9, _addr@GOTPAGE
Lloh9:
	ldr	x9, [x9, _addr@GOTPAGEOFF]
	str	w10, [x9]
	str	wzr, [x8]
	cbz	w11, LBB0_7
; %bb.2:
	tbz	w0, #7, LBB0_16
; %bb.3:
	and	w19, w0, #0x7
Lloh10:
	adrp	x8, _Z80@GOTPAGE
Lloh11:
	ldr	x8, [x8, _Z80@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_vdp_reg_w
	cmp	w19, #1
	b.hi	LBB0_16
; %bb.4:
Lloh13:
	adrp	x8, _reg@GOTPAGE
Lloh14:
	ldr	x8, [x8, _reg@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	ldp	w9, w8, [x8]
	and	w8, w8, #0x18
	bfxil	w8, w9, #0, #2
	lsr	w8, w8, #1
Lloh16:
	adrp	x9, lJTI0_0@PAGE
Lloh17:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_5
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_5:
Lloh18:
	adrp	x8, _render_bg_inv@GOTPAGE
Lloh19:
	ldr	x8, [x8, _render_bg_inv@GOTPAGEOFF]
	b	LBB0_14
LBB0_6:
Lloh20:
	adrp	x9, _addr_latch@GOTPAGE
Lloh21:
	ldr	x9, [x9, _addr_latch@GOTPAGEOFF]
Lloh22:
	str	w0, [x9]
	mov	w9, #1
	str	w9, [x8]
	b	LBB0_16
LBB0_7:
Lloh23:
	adrp	x8, _vram@GOTPAGE
Lloh24:
	ldr	x8, [x8, _vram@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	ldr	w8, [x8, x10, lsl #2]
Lloh26:
	adrp	x10, _fifo@GOTPAGE
Lloh27:
	ldr	x10, [x10, _fifo@GOTPAGEOFF]
Lloh28:
	ldr	x10, [x10]
	str	w8, [x10]
	ldr	w8, [x9]
	add	w8, w8, #1
	and	w8, w8, #0x3fff
	b	LBB0_15
LBB0_8:
Lloh29:
	adrp	x8, _render_bg_m3x@GOTPAGE
Lloh30:
	ldr	x8, [x8, _render_bg_m3x@GOTPAGEOFF]
	b	LBB0_14
LBB0_9:
Lloh31:
	adrp	x8, _render_bg_m3@GOTPAGE
Lloh32:
	ldr	x8, [x8, _render_bg_m3@GOTPAGEOFF]
	b	LBB0_14
LBB0_10:
Lloh33:
	adrp	x8, _render_bg_m0@GOTPAGE
Lloh34:
	ldr	x8, [x8, _render_bg_m0@GOTPAGEOFF]
	b	LBB0_14
LBB0_11:
Lloh35:
	adrp	x8, _render_bg_m2@GOTPAGE
Lloh36:
	ldr	x8, [x8, _render_bg_m2@GOTPAGEOFF]
	b	LBB0_14
LBB0_12:
Lloh37:
	adrp	x8, _render_bg_m1x@GOTPAGE
Lloh38:
	ldr	x8, [x8, _render_bg_m1x@GOTPAGEOFF]
	b	LBB0_14
LBB0_13:
Lloh39:
	adrp	x8, _render_bg_m1@GOTPAGE
Lloh40:
	ldr	x8, [x8, _render_bg_m1@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
Lloh41:
	adrp	x9, _render_bg@GOTPAGE
Lloh42:
	ldr	x9, [x9, _render_bg@GOTPAGEOFF]
LBB0_15:
	str	w8, [x9]
LBB0_16:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_17:
	brk	#0x1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotStr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh41, Lloh42
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_10-LBB0_5)>>2
	.byte	(LBB0_11-LBB0_5)>>2
	.byte	(LBB0_17-LBB0_5)>>2
	.byte	(LBB0_17-LBB0_5)>>2
	.byte	(LBB0_9-LBB0_5)>>2
	.byte	(LBB0_8-LBB0_5)>>2
	.byte	(LBB0_17-LBB0_5)>>2
	.byte	(LBB0_17-LBB0_5)>>2
	.byte	(LBB0_13-LBB0_5)>>2
	.byte	(LBB0_12-LBB0_5)>>2
	.byte	(LBB0_17-LBB0_5)>>2
	.byte	(LBB0_17-LBB0_5)>>2
	.byte	(LBB0_5-LBB0_5)>>2
	.byte	(LBB0_5-LBB0_5)>>2
                                        ; -- End function
	.comm	_pending,4,2                    ; @pending
	.comm	_addr_latch,4,2                 ; @addr_latch
	.comm	_code,4,2                       ; @code
	.comm	_addr,4,2                       ; @addr
	.comm	_vram,8,3                       ; @vram
	.comm	_fifo,8,3                       ; @fifo
	.comm	_Z80,4,2                        ; @Z80
	.comm	_reg,8,3                        ; @reg
	.comm	_render_bg_m0,4,2               ; @render_bg_m0
	.comm	_render_bg,4,2                  ; @render_bg
	.comm	_render_bg_m1,4,2               ; @render_bg_m1
	.comm	_render_bg_m2,4,2               ; @render_bg_m2
	.comm	_render_bg_m1x,4,2              ; @render_bg_m1x
	.comm	_render_bg_m3,4,2               ; @render_bg_m3
	.comm	_render_bg_inv,4,2              ; @render_bg_inv
	.comm	_render_bg_m3x,4,2              ; @render_bg_m3x
.subsections_via_symbols
