	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vdp_z80_data_r_m5
_vdp_z80_data_r_m5:                     ## @vdp_z80_data_r_m5
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	movq	_pending@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_code@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	andl	$15, %ecx
	cmpl	$8, %ecx
	je	LBB0_6
## %bb.1:
	cmpl	$4, %ecx
	je	LBB0_5
## %bb.2:
	xorl	%eax, %eax
	testl	%ecx, %ecx
	jne	LBB0_7
## %bb.3:
	movq	_vram@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_addr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	jmp	LBB0_4
LBB0_6:
	movq	_cram@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_addr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %edx
	andl	$126, %edx
	movl	(%rax,%rdx,4), %eax
	movl	%eax, %edx
	andl	$56, %edx
	leal	(%rax,%rax), %esi
	andl	$14, %esi
	leal	(%rsi,%rdx,4), %edx
	shrl	$5, %eax
	andl	$14, %eax
	testb	$1, %cl
	cmovel	%edx, %eax
	jmp	LBB0_7
LBB0_5:
	movq	_vsram@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_addr@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	$127, %esi
LBB0_4:
	xorl	$1, %esi
	callq	_READ_BYTE
                                        ## kill: def $eax killed $eax def $rax
LBB0_7:
	movq	_reg@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	120(%rcx), %ecx
	movq	_addr@GOTPCREL(%rip), %rdx
	addl	%ecx, (%rdx)
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_pending,8,3                    ## @pending
	.comm	_code,4,2                       ## @code
	.comm	_vram,4,2                       ## @vram
	.comm	_addr,4,2                       ## @addr
	.comm	_vsram,4,2                      ## @vsram
	.comm	_cram,8,3                       ## @cram
	.comm	_reg,8,3                        ## @reg
	.no_dead_strip	_vdp_z80_data_r_m5
.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_r_m5
_vdp_z80_data_r_m5:                     ; @vdp_z80_data_r_m5
	.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]
Lloh2:
	adrp	x9, _code@GOTPAGE
Lloh3:
	ldr	x9, [x9, _code@GOTPAGEOFF]
Lloh4:
	str	xzr, [x8]
Lloh5:
	ldr	w8, [x9]
	and	w8, w8, #0xf
Lloh6:
	adrp	x19, _addr@GOTPAGE
Lloh7:
	ldr	x19, [x19, _addr@GOTPAGEOFF]
	cmp	w8, #8
	b.eq	LBB0_4
; %bb.1:
	cmp	w8, #4
	b.eq	LBB0_5
; %bb.2:
	cbnz	w8, LBB0_7
; %bb.3:
Lloh8:
	adrp	x8, _vram@GOTPAGE
Lloh9:
	ldr	x8, [x8, _vram@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	ldr	w8, [x19]
	b	LBB0_6
LBB0_4:
Lloh11:
	adrp	x8, _cram@GOTPAGE
Lloh12:
	ldr	x8, [x8, _cram@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldr	w9, [x19]
	and	x10, x9, #0x7e
	ldr	w8, [x8, x10, lsl #2]
	lsl	w10, w8, #2
	and	w10, w10, #0xe0
	bfi	w10, w8, #1, #3
	lsr	w8, w8, #5
	and	w8, w8, #0xe
	tst	w9, #0x1
	csel	w0, w10, w8, eq
	b	LBB0_8
LBB0_5:
Lloh14:
	adrp	x8, _vsram@GOTPAGE
Lloh15:
	ldr	x8, [x8, _vsram@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	ldr	w8, [x19]
	and	w8, w8, #0x7f
LBB0_6:
	eor	w1, w8, #0x1
	bl	_READ_BYTE
	b	LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
Lloh17:
	adrp	x8, _reg@GOTPAGE
Lloh18:
	ldr	x8, [x8, _reg@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	ldr	w8, [x8, #120]
	ldr	w9, [x19]
	add	w8, w9, w8
	str	w8, [x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_pending,8,3                    ; @pending
	.comm	_code,4,2                       ; @code
	.comm	_vram,4,2                       ; @vram
	.comm	_addr,4,2                       ; @addr
	.comm	_vsram,4,2                      ; @vsram
	.comm	_cram,8,3                       ; @cram
	.comm	_reg,8,3                        ; @reg
	.no_dead_strip	_vdp_z80_data_r_m5
.subsections_via_symbols
