	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdp_bus_w
_vdp_bus_w:                             ## @vdp_bus_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %ebx
	movq	_code@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	$15, %eax
	cmpl	$5, %eax
	je	LBB0_16
## %bb.1:
	cmpl	$3, %eax
	je	LBB0_7
## %bb.2:
	cmpl	$1, %eax
	jne	LBB0_21
## %bb.3:
	movq	_addr@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edx, %edi
	andl	$65534, %edi                    ## imm = 0xFFFE
	movq	_vram@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %ecx
	bswapl	%ecx
	shrl	$16, %ecx
	testb	$1, %dl
	cmovel	%ebx, %ecx
	movq	_sat_base_mask@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	%edi, %edx
	movq	_satb@GOTPCREL(%rip), %rsi
	cmpl	(%rsi), %edx
	jne	LBB0_5
## %bb.4:
	movq	_sat@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	_sat_addr_mask@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	%edi, %esi
	movl	%ecx, (%rdx,%rsi,4)
LBB0_5:
	cmpl	(%rax,%rdi,4), %ecx
	je	LBB0_21
## %bb.6:
	movl	%ecx, (%rax,%rdi,4)
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_MARK_BG_DIRTY
	jmp	LBB0_21
LBB0_7:
	movq	_cram@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_addr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	andl	$126, %edx
	movl	%ebx, %esi
	shrl	$3, %esi
	andl	$448, %esi                      ## imm = 0x1C0
	movl	%ebx, %edi
	shrl	$2, %edi
	andl	$56, %edi
	orl	%esi, %edi
	shrl	%ebx
	andl	$7, %ebx
	orl	%edi, %ebx
	cmpl	(%rax,%rdx,4), %ebx
	je	LBB0_21
## %bb.8:
	movl	%ecx, %r14d
	shrl	%r14d
	andl	$63, %r14d
	movl	%ebx, (%rax,%rdx,4)
	testb	$30, %cl
	je	LBB0_10
## %bb.9:
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_color_update_m5
LBB0_10:
	movq	_bordrr@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_12
## %bb.11:
	xorl	%edi, %edi
	movl	%ebx, %esi
	callq	_color_update_m5
LBB0_12:
	movq	_v_counter@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_bitmap@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jge	LBB0_21
## %bb.13:
	movq	_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testb	$64, 4(%rax)
	je	LBB0_21
## %bb.14:
	movq	_m68k@GOTPCREL(%rip), %rax
	movq	_mcycles_vdp@GOTPCREL(%rip), %rcx
	movl	$860, %edx                      ## imm = 0x35C
	addl	(%rcx), %edx
	cmpl	%edx, (%rax)
	jg	LBB0_21
## %bb.15:
	callq	_remap_line
	jmp	LBB0_21
LBB0_16:
	movq	_vsram@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_addr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	$126, %ecx
	movl	%ebx, (%rax,%rcx,4)
	movq	_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testb	$4, 44(%rax)
	je	LBB0_21
## %bb.17:
	movq	_v_counter@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_bitmap@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %edi
	jge	LBB0_21
## %bb.18:
	testb	$64, 4(%rax)
	je	LBB0_21
## %bb.19:
	movq	_m68k@GOTPCREL(%rip), %rax
	movq	_mcycles_vdp@GOTPCREL(%rip), %rcx
	movl	$860, %edx                      ## imm = 0x35C
	addl	(%rcx), %edx
	cmpl	%edx, (%rax)
	jg	LBB0_21
## %bb.20:
	callq	_render_line
LBB0_21:
	movq	_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	60(%rax), %eax
	movq	_addr@GOTPCREL(%rip), %rcx
	addl	%eax, (%rcx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_code,4,2                       ## @code
	.comm	_addr,4,2                       ## @addr
	.comm	_vram,8,3                       ## @vram
	.comm	_sat_base_mask,4,2              ## @sat_base_mask
	.comm	_satb,4,2                       ## @satb
	.comm	_sat,8,3                        ## @sat
	.comm	_sat_addr_mask,4,2              ## @sat_addr_mask
	.comm	_cram,8,3                       ## @cram
	.comm	_bordrr,4,2                     ## @bordrr
	.comm	_v_counter,4,2                  ## @v_counter
	.comm	_bitmap,4,2                     ## @bitmap
	.comm	_reg,8,3                        ## @reg
	.comm	_m68k,4,2                       ## @m68k
	.comm	_mcycles_vdp,4,2                ## @mcycles_vdp
	.comm	_vsram,8,3                      ## @vsram
	.comm	_M68K_REG_PC,4,2                ## @M68K_REG_PC
	.comm	_MCYCLES_PER_LINE,4,2           ## @MCYCLES_PER_LINE
	.no_dead_strip	_vdp_bus_w
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vdp_bus_w
_vdp_bus_w:                             ; @vdp_bus_w
	.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
Lloh0:
	adrp	x8, _code@GOTPAGE
Lloh1:
	ldr	x8, [x8, _code@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, #0xf
Lloh3:
	adrp	x22, _reg@GOTPAGE
Lloh4:
	ldr	x22, [x22, _reg@GOTPAGEOFF]
Lloh5:
	adrp	x21, _addr@GOTPAGE
Lloh6:
	ldr	x21, [x21, _addr@GOTPAGEOFF]
	cmp	w8, #5
	b.eq	LBB0_16
; %bb.1:
	cmp	w8, #3
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #1
	b.ne	LBB0_21
; %bb.3:
	ldr	w10, [x21]
	and	x8, x10, #0xfffe
Lloh7:
	adrp	x9, _vram@GOTPAGE
Lloh8:
	ldr	x9, [x9, _vram@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	rev	w11, w0
	lsr	w11, w11, #16
	tst	w10, #0x1
	csel	w10, w0, w11, eq
Lloh10:
	adrp	x11, _sat_base_mask@GOTPAGE
Lloh11:
	ldr	x11, [x11, _sat_base_mask@GOTPAGEOFF]
Lloh12:
	ldr	w11, [x11]
	and	w11, w11, w8
Lloh13:
	adrp	x12, _satb@GOTPAGE
Lloh14:
	ldr	x12, [x12, _satb@GOTPAGEOFF]
Lloh15:
	ldr	w12, [x12]
	cmp	w11, w12
	b.ne	LBB0_5
; %bb.4:
Lloh16:
	adrp	x11, _sat@GOTPAGE
Lloh17:
	ldr	x11, [x11, _sat@GOTPAGEOFF]
Lloh18:
	adrp	x12, _sat_addr_mask@GOTPAGE
Lloh19:
	ldr	x12, [x12, _sat_addr_mask@GOTPAGEOFF]
Lloh20:
	ldr	x11, [x11]
Lloh21:
	ldr	w12, [x12]
	mov	w13, w8
	and	x12, x12, x13
	str	w10, [x11, x12, lsl #2]
LBB0_5:
	ldr	w11, [x9, x8, lsl #2]
	cmp	w10, w11
	b.eq	LBB0_21
; %bb.6:
	str	w10, [x9, x8, lsl #2]
	mov	x0, x8
	bl	_MARK_BG_DIRTY
	b	LBB0_21
LBB0_7:
Lloh22:
	adrp	x8, _cram@GOTPAGE
Lloh23:
	ldr	x8, [x8, _cram@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	ldr	w9, [x21]
	and	x10, x9, #0x7e
	lsr	w11, w0, #3
	and	w19, w11, #0x1c0
	bfxil	w19, w0, #2, #6
	bfxil	w19, w0, #1, #3
	ldr	w11, [x8, x10, lsl #2]
	cmp	w19, w11
	b.eq	LBB0_21
; %bb.8:
	ubfx	w20, w9, #1, #6
	str	w19, [x8, x10, lsl #2]
	tst	w9, #0x1e
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x20
	mov	x1, x19
	bl	_color_update_m5
LBB0_10:
Lloh25:
	adrp	x8, _bordrr@GOTPAGE
Lloh26:
	ldr	x8, [x8, _bordrr@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_12
; %bb.11:
	mov	w0, #0
	mov	x1, x19
	bl	_color_update_m5
LBB0_12:
Lloh28:
	adrp	x8, _v_counter@GOTPAGE
Lloh29:
	ldr	x8, [x8, _v_counter@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
Lloh31:
	adrp	x8, _bitmap@GOTPAGE
Lloh32:
	ldr	x8, [x8, _bitmap@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ge	LBB0_21
; %bb.13:
	ldr	x8, [x22]
	ldrb	w8, [x8, #4]
	tbz	w8, #6, LBB0_21
; %bb.14:
Lloh34:
	adrp	x8, _m68k@GOTPAGE
Lloh35:
	ldr	x8, [x8, _m68k@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
Lloh37:
	adrp	x9, _mcycles_vdp@GOTPAGE
Lloh38:
	ldr	x9, [x9, _mcycles_vdp@GOTPAGEOFF]
Lloh39:
	ldr	w9, [x9]
	add	w9, w9, #860
	cmp	w8, w9
	b.gt	LBB0_21
; %bb.15:
	bl	_remap_line
	b	LBB0_21
LBB0_16:
Lloh40:
	adrp	x8, _vsram@GOTPAGE
Lloh41:
	ldr	x8, [x8, _vsram@GOTPAGEOFF]
Lloh42:
	ldr	x8, [x8]
	ldr	w9, [x21]
	and	x9, x9, #0x7e
	str	w0, [x8, x9, lsl #2]
	ldr	x8, [x22]
	ldrb	w9, [x8, #44]
	tbz	w9, #2, LBB0_21
; %bb.17:
Lloh43:
	adrp	x9, _v_counter@GOTPAGE
Lloh44:
	ldr	x9, [x9, _v_counter@GOTPAGEOFF]
Lloh45:
	ldr	w0, [x9]
Lloh46:
	adrp	x9, _bitmap@GOTPAGE
Lloh47:
	ldr	x9, [x9, _bitmap@GOTPAGEOFF]
Lloh48:
	ldr	w9, [x9]
	cmp	w0, w9
	b.ge	LBB0_21
; %bb.18:
	ldrb	w8, [x8, #4]
	tbz	w8, #6, LBB0_21
; %bb.19:
Lloh49:
	adrp	x8, _m68k@GOTPAGE
Lloh50:
	ldr	x8, [x8, _m68k@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
Lloh52:
	adrp	x9, _mcycles_vdp@GOTPAGE
Lloh53:
	ldr	x9, [x9, _mcycles_vdp@GOTPAGEOFF]
Lloh54:
	ldr	w9, [x9]
	add	w9, w9, #860
	cmp	w8, w9
	b.gt	LBB0_21
; %bb.20:
	bl	_render_line
LBB0_21:
	ldr	x8, [x22]
	ldr	w8, [x8, #60]
	ldr	w9, [x21]
	add	w8, w9, w8
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh20
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.comm	_code,4,2                       ; @code
	.comm	_addr,4,2                       ; @addr
	.comm	_vram,8,3                       ; @vram
	.comm	_sat_base_mask,4,2              ; @sat_base_mask
	.comm	_satb,4,2                       ; @satb
	.comm	_sat,8,3                        ; @sat
	.comm	_sat_addr_mask,4,2              ; @sat_addr_mask
	.comm	_cram,8,3                       ; @cram
	.comm	_bordrr,4,2                     ; @bordrr
	.comm	_v_counter,4,2                  ; @v_counter
	.comm	_bitmap,4,2                     ; @bitmap
	.comm	_reg,8,3                        ; @reg
	.comm	_m68k,4,2                       ; @m68k
	.comm	_mcycles_vdp,4,2                ; @mcycles_vdp
	.comm	_vsram,8,3                      ; @vsram
	.comm	_M68K_REG_PC,4,2                ; @M68K_REG_PC
	.comm	_MCYCLES_PER_LINE,4,2           ; @MCYCLES_PER_LINE
	.no_dead_strip	_vdp_bus_w
.subsections_via_symbols
