	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdp_z80_data_w_m4
_vdp_z80_data_w_m4:                     ## @vdp_z80_data_w_m4
	.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, %r14d
	movq	_pending@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_code@GOTPCREL(%rip), %rax
	testb	$2, (%rax)
	movq	_addr@GOTPCREL(%rip), %r15
	movl	(%r15), %ebx
	jne	LBB0_1
## %bb.4:
	andl	$16383, %ebx                    ## imm = 0x3FFF
	movq	_vram@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	%r14d, (%rax,%rbx,4)
	je	LBB0_6
## %bb.5:
	movl	%r14d, (%rax,%rbx,4)
	movl	%ebx, %edi
	callq	_MARK_BG_DIRTY
	jmp	LBB0_6
LBB0_1:
	andl	$31, %ebx
	movq	_cram@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpl	%r14d, (%rax,%rbx,8)
	je	LBB0_6
## %bb.2:
	movq	%rbx, %rcx
	addq	%rbx, %rcx
	movl	%r14d, (%rax,%rcx,4)
	movl	%ebx, %edi
	movl	%r14d, %esi
	callq	_color_update_m4
	movq	_bordrr@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	$15, %eax
	orl	$16, %eax
	cmpl	%eax, %ebx
	jne	LBB0_6
## %bb.3:
	movl	$64, %edi
	movl	%r14d, %esi
	callq	_color_update_m4
LBB0_6:
	movq	_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	120(%rax), %eax
	movl	(%r15), %ecx
	addl	%ecx, %eax
	incl	%eax
	movl	%eax, (%r15)
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pending,8,3                    ## @pending
	.comm	_code,4,2                       ## @code
	.comm	_addr,4,2                       ## @addr
	.comm	_cram,8,3                       ## @cram
	.comm	_bordrr,4,2                     ## @bordrr
	.comm	_vram,8,3                       ## @vram
	.comm	_reg,8,3                        ## @reg
	.no_dead_strip	_vdp_z80_data_w_m4
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdp_z80_data_w_m4
_vdp_z80_data_w_m4:                     ; @vdp_z80_data_w_m4
	.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	x9, _code@GOTPAGE
Lloh4:
	ldr	x9, [x9, _code@GOTPAGEOFF]
Lloh5:
	adrp	x21, _addr@GOTPAGE
Lloh6:
	ldr	x21, [x21, _addr@GOTPAGEOFF]
	ldr	w8, [x21]
	ldrb	w9, [x9]
	tbnz	w9, #1, LBB0_3
; %bb.1:
	and	w0, w8, #0x3fff
Lloh7:
	adrp	x8, _vram@GOTPAGE
Lloh8:
	ldr	x8, [x8, _vram@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	w9, [x8, w0, uxtw #2]
	cmp	w9, w19
	b.eq	LBB0_6
; %bb.2:
	str	w19, [x8, x0, lsl #2]
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_MARK_BG_DIRTY
	b	LBB0_6
LBB0_3:
Lloh10:
	adrp	x9, _cram@GOTPAGE
Lloh11:
	ldr	x9, [x9, _cram@GOTPAGEOFF]
	and	x20, x8, #0x1f
Lloh12:
	ldr	x8, [x9]
	lsl	x9, x20, #3
	ldr	w9, [x8, x9]
	cmp	w9, w19
	b.eq	LBB0_6
; %bb.4:
	lsl	x9, x20, #1
	str	w19, [x8, x9, lsl #2]
	mov	x0, x20
	mov	x1, x19
	bl	_color_update_m4
Lloh13:
	adrp	x8, _bordrr@GOTPAGE
Lloh14:
	ldr	x8, [x8, _bordrr@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	mov	w9, #16
	bfxil	w9, w8, #0, #4
	cmp	w20, w9
	b.ne	LBB0_6
; %bb.5:
	mov	w0, #64
	mov	x1, x19
	bl	_color_update_m4
LBB0_6:
Lloh16:
	adrp	x8, _reg@GOTPAGE
Lloh17:
	ldr	x8, [x8, _reg@GOTPAGEOFF]
Lloh18:
	ldr	x8, [x8]
	ldr	w8, [x8, #120]
	ldr	w9, [x21]
	add	w8, w8, w9
	add	w8, w8, #1
	str	w8, [x21]
	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
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_pending,8,3                    ; @pending
	.comm	_code,4,2                       ; @code
	.comm	_addr,4,2                       ; @addr
	.comm	_cram,8,3                       ; @cram
	.comm	_bordrr,4,2                     ; @bordrr
	.comm	_vram,8,3                       ; @vram
	.comm	_reg,8,3                        ; @reg
	.no_dead_strip	_vdp_z80_data_w_m4
.subsections_via_symbols
