	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_z80_ms_port_r                  ## -- Begin function z80_ms_port_r
	.p2align	4, 0x90
_z80_ms_port_r:                         ## @z80_ms_port_r
	.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, %ebx
	movl	%ebx, %eax
	andb	$-63, %al
	js	LBB0_1
## %bb.4:
	cmpb	$2, %al
	jb	LBB0_14
## %bb.5:
	cmpb	$64, %al
	je	LBB0_15
## %bb.6:
	cmpb	$65, %al
	jne	LBB0_9
## %bb.7:
	movq	_Z80@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_vdp_hvc_r
	movl	%eax, %r14d
	jmp	LBB0_16
LBB0_1:
	cmpb	$-128, %al
	je	LBB0_8
## %bb.2:
	cmpb	$-127, %al
	jne	LBB0_9
## %bb.3:
	movq	_Z80@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vdp_z80_ctrl_r                 ## TAILCALL
LBB0_15:
	movq	_Z80@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_vdp_hvc_r
	movl	%eax, %r14d
	shrl	$8, %r14d
LBB0_16:
	movzbl	%r14b, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_vdp_z80_data_r                 ## TAILCALL
LBB0_9:
	testb	$4, %bl
	jne	LBB0_13
## %bb.10:
	movq	_config@GOTPCREL(%rip), %rax
	testb	$1, (%rax)
	jne	LBB0_11
LBB0_13:
	movq	_io_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	testb	$4, 56(%rax)
	jne	LBB0_14
## %bb.17:
	andl	$1, %ebx
	movl	%ebx, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_io_z80_read                    ## TAILCALL
LBB0_14:
	movzbl	%bl, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_z80_unused_port_r              ## TAILCALL
LBB0_11:
	movq	_io_reg@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movb	56(%rax), %r15b
	movl	%ebx, %edi
	andl	$3, %edi
	callq	_YM2413Read
	movl	%eax, %r14d
	testb	$4, %r15b
	jne	LBB0_16
## %bb.12:
	andl	$1, %ebx
	movl	%ebx, %edi
	callq	_io_z80_read
	andb	%r14b, %al
	movl	%eax, %r14d
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_Z80,4,2                        ## @Z80
	.comm	_config,4,2                     ## @config
	.comm	_io_reg,8,3                     ## @io_reg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_z80_ms_port_r                  ; -- Begin function z80_ms_port_r
	.p2align	2
_z80_ms_port_r:                         ; @z80_ms_port_r
	.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
	mov	w8, #193
	and	w8, w0, w8
	cmp	w8, #64
	b.gt	LBB0_3
; %bb.1:
	cmp	w8, #2
	b.hs	LBB0_7
LBB0_2:
	and	w0, w19, #0xff
	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
	b	_z80_unused_port_r
LBB0_3:
	cmp	w8, #65
	b.eq	LBB0_9
; %bb.4:
	cmp	w8, #128
	b.eq	LBB0_11
; %bb.5:
	cmp	w8, #129
	b.ne	LBB0_12
; %bb.6:
Lloh0:
	adrp	x8, _Z80@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Z80@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	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
	b	_vdp_z80_ctrl_r
LBB0_7:
	cmp	w8, #64
	b.ne	LBB0_12
; %bb.8:
Lloh3:
	adrp	x8, _Z80@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Z80@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_vdp_hvc_r
	lsr	w20, w0, #8
	b	LBB0_10
LBB0_9:
Lloh6:
	adrp	x8, _Z80@GOTPAGE
Lloh7:
	ldr	x8, [x8, _Z80@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_vdp_hvc_r
	mov	x20, x0
LBB0_10:
	and	w0, w20, #0xff
	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
LBB0_11:
	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
	b	_vdp_z80_data_r
LBB0_12:
	tbnz	w19, #2, LBB0_14
; %bb.13:
Lloh9:
	adrp	x8, _config@GOTPAGE
Lloh10:
	ldr	x8, [x8, _config@GOTPAGEOFF]
	ldrb	w8, [x8]
	tbnz	w8, #0, LBB0_16
LBB0_14:
Lloh11:
	adrp	x8, _io_reg@GOTPAGE
Lloh12:
	ldr	x8, [x8, _io_reg@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldrb	w8, [x8, #56]
	tbnz	w8, #2, LBB0_2
; %bb.15:
	and	w0, w19, #0x1
	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
	b	_io_z80_read
LBB0_16:
Lloh14:
	adrp	x8, _io_reg@GOTPAGE
Lloh15:
	ldr	x8, [x8, _io_reg@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	ldr	w21, [x8, #56]
	and	w0, w19, #0x3
	bl	_YM2413Read
	mov	x20, x0
	tbnz	w21, #2, LBB0_10
; %bb.17:
	and	w0, w19, #0x1
	bl	_io_z80_read
	and	w20, w0, w20
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_Z80,4,2                        ; @Z80
	.comm	_config,4,2                     ; @config
	.comm	_io_reg,8,3                     ; @io_reg
.subsections_via_symbols
