	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_io_z80_read                    ## -- Begin function io_z80_read
	.p2align	4, 0x90
_io_z80_read:                           ## @io_z80_read
	.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	_port@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	xorl	%eax, %eax
	callq	*(%rcx)
	movl	%eax, %ebx
	movq	(%r15), %rcx
	xorl	%eax, %eax
	callq	*8(%rcx)
                                        ## kill: def $eax killed $eax def $rax
	shll	$8, %eax
	orl	%ebx, %eax
	movq	_io_reg@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	movl	60(%rdx), %ecx
	testl	%r14d, %r14d
	je	LBB0_3
## %bb.1:
	movl	%eax, %esi
	shrl	$10, %esi
	andl	$15, %esi
	andl	$64, %ebx
	orl	%esi, %ebx
	shrl	$7, %eax
	andl	$128, %eax
	orl	%ebx, %eax
	movl	52(%rdx), %esi
	orl	%esi, %eax
	movq	_IO_RESET_HI@GOTPCREL(%rip), %rdi
	orl	(%rdi), %esi
	movl	%eax, %edi
	andl	$-129, %edi
	movl	%ecx, %ebx
	andl	$128, %ebx
	orl	%edi, %ebx
	testb	$8, %cl
	cmovnel	%eax, %ebx
	movl	%esi, 52(%rdx)
	movl	%ebx, %eax
	andl	$-65, %eax
	movl	%ecx, %edx
	andl	$32, %edx
	testb	$2, %cl
	leal	(%rax,%rdx,2), %eax
	cmovnel	%ebx, %eax
	testb	$4, %cl
	jne	LBB0_5
## %bb.2:
	andl	$-9, %eax
	shrl	$3, %ecx
	andl	$8, %ecx
	orl	%ecx, %eax
	jmp	LBB0_5
LBB0_3:
	andl	$63, %ebx
	shrl	$2, %eax
	andl	$192, %eax
	orl	%ebx, %eax
	testb	$1, %cl
	jne	LBB0_5
## %bb.4:
	andl	$-33, %eax
	andl	$16, %ecx
	leal	(%rax,%rcx,2), %eax
LBB0_5:
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_port,8,3                       ## @port
	.comm	_io_reg,8,3                     ## @io_reg
	.comm	_IO_RESET_HI,4,2                ## @IO_RESET_HI
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_io_z80_read                    ; -- Begin function io_z80_read
	.p2align	2
_io_z80_read:                           ; @io_z80_read
	.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	x20, x0
Lloh0:
	adrp	x21, _port@GOTPAGE
Lloh1:
	ldr	x21, [x21, _port@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x8, [x8]
	blr	x8
	mov	x19, x0
	ldr	x8, [x21]
	ldr	x8, [x8, #8]
	blr	x8
	orr	w10, w19, w0, lsl #8
Lloh2:
	adrp	x8, _io_reg@GOTPAGE
Lloh3:
	ldr	x8, [x8, _io_reg@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x8]
	ldr	w8, [x9, #60]
	cbz	w20, LBB0_2
; %bb.1:
	and	w11, w19, #0x40
	bfxil	w11, w10, #10, #4
	lsr	w10, w10, #7
	and	w10, w10, #0x80
	orr	w10, w11, w10
	ldr	w11, [x9, #52]
	orr	w10, w10, w11
Lloh5:
	adrp	x12, _IO_RESET_HI@GOTPAGE
Lloh6:
	ldr	x12, [x12, _IO_RESET_HI@GOTPAGEOFF]
Lloh7:
	ldr	w12, [x12]
	orr	w11, w12, w11
	str	w11, [x9, #52]
	lsr	w9, w8, #5
	lsr	w11, w8, #7
	mov	x12, x10
	bfi	w12, w11, #7, #1
	tst	w8, #0x8
	csel	w10, w12, w10, eq
	mov	x11, x10
	bfi	w11, w9, #6, #1
	tst	w8, #0x2
	csel	w9, w11, w10, eq
	lsr	w10, w8, #6
	mov	x11, x9
	bfi	w11, w10, #3, #1
	tst	w8, #0x4
	csel	w0, w9, w11, ne
	b	LBB0_3
LBB0_2:
	lsr	w9, w10, #2
	and	w9, w9, #0xc0
	bfxil	w9, w19, #0, #6
	and	w10, w9, #0xffffffdf
	lsl	w11, w8, #1
	and	w11, w11, #0x20
	orr	w10, w10, w11
	tst	w8, #0x1
	csel	w0, w9, w10, ne
LBB0_3:
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_port,8,3                       ; @port
	.comm	_io_reg,8,3                     ; @io_reg
	.comm	_IO_RESET_HI,4,2                ; @IO_RESET_HI
.subsections_via_symbols
