	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function z80_sms_in
_z80_sms_in:                            ## @z80_sms_in
	.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
	movq	_EL_IO@GOTPCREL(%rip), %r15
	movl	(%r15), %eax
	movzbl	%dil, %ebx
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	movl	%ebx, %edx
	callq	_elprintf
	andb	$-63, %bl
	jns	LBB0_4
## %bb.1:
	cmpb	$-65, %bl
	jg	LBB0_10
## %bb.2:
	xorl	%eax, %eax
	cmpb	$-128, %bl
	jne	LBB0_8
## %bb.3:
	callq	_vdp_data_read
	movl	%eax, %r14d
	jmp	LBB0_12
LBB0_4:
	movb	$-1, %r14b
	cmpb	$2, %bl
	jb	LBB0_12
## %bb.5:
	movq	_Pico@GOTPCREL(%rip), %rax
	cmpb	$65, %bl
	jne	LBB0_6
## %bb.7:
	movl	4(%rax), %r14d
	leal	1(%r14), %ecx
	movl	%ecx, 4(%rax)
	movq	_EL_HVCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	%r14b, %edx
	leaq	L_.str.2(%rip), %rsi
	callq	_elprintf
	jmp	LBB0_12
LBB0_10:
	cmpb	$-64, %bl
	jne	LBB0_11
## %bb.9:
	movq	_PicoPad@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %ecx
	movl	4(%rax), %r14d
	andl	$63, %ecx
	shll	$6, %r14d
	orl	%ecx, %r14d
	notb	%r14b
	jmp	LBB0_12
LBB0_8:
	callq	_vdp_ctl_read
	movl	%eax, %r14d
	jmp	LBB0_12
LBB0_6:
	movb	8(%rax), %r14b
	movq	_EL_HVCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	%r14b, %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_elprintf
	jmp	LBB0_12
LBB0_11:
	movq	_Pico@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	andl	$128, %ecx
	andl	$32, %eax
	movq	_PicoPad@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	4(%rdx), %edx
	shrl	$2, %edx
	andl	$15, %edx
	leal	(%rcx,%rax,2), %r14d
	orl	%edx, %r14d
	xorb	$63, %r14b
LBB0_12:
	movl	(%r15), %edi
	movzbl	%r14b, %ebx
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edx
	callq	_elprintf
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EL_IO,4,2                      ## @EL_IO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"z80 port %04x read"

	.comm	_Pico,12,2                      ## @Pico
	.comm	_EL_HVCNT,4,2                   ## @EL_HVCNT
L_.str.1:                               ## @.str.1
	.asciz	"V counter read: %02x"

L_.str.2:                               ## @.str.2
	.asciz	"H counter read: %02x"

	.comm	_PicoPad,8,3                    ## @PicoPad
L_.str.3:                               ## @.str.3
	.asciz	"ret = %02x"

	.no_dead_strip	_z80_sms_in
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function z80_sms_in
_z80_sms_in:                            ; @z80_sms_in
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _EL_IO@GOTPAGE
Lloh1:
	ldr	x20, [x20, _EL_IO@GOTPAGEOFF]
	ldr	w0, [x20]
	and	w2, w19, #0xff
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elprintf
	mov	w8, #193
	and	w8, w19, w8
	cmp	w8, #127
	b.gt	LBB0_3
; %bb.1:
	cmp	w8, #2
	b.hs	LBB0_6
; %bb.2:
	mov	w19, #255
	b	LBB0_13
LBB0_3:
	cmp	w8, #191
	b.gt	LBB0_8
; %bb.4:
	cmp	w8, #128
	b.ne	LBB0_10
; %bb.5:
	bl	_vdp_data_read
	mov	x19, x0
	b	LBB0_13
LBB0_6:
	cmp	w8, #64
	b.ne	LBB0_11
; %bb.7:
Lloh4:
	adrp	x8, _Pico@GOTPAGE
Lloh5:
	ldr	x8, [x8, _Pico@GOTPAGEOFF]
	ldrb	w19, [x8, #8]
Lloh6:
	adrp	x8, _EL_HVCNT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EL_HVCNT@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str.1@PAGE
Lloh10:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x19
	bl	_elprintf
	b	LBB0_13
LBB0_8:
	cmp	w8, #192
	b.ne	LBB0_12
; %bb.9:
Lloh11:
	adrp	x8, _PicoPad@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PicoPad@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldp	w9, w8, [x8]
	bfi	w9, w8, #6, #26
	mvn	w19, w9
	b	LBB0_13
LBB0_10:
	bl	_vdp_ctl_read
	mov	x19, x0
	b	LBB0_13
LBB0_11:
Lloh14:
	adrp	x8, _Pico@GOTPAGE
Lloh15:
	ldr	x8, [x8, _Pico@GOTPAGEOFF]
	ldr	w19, [x8, #4]
	add	w9, w19, #1
	str	w9, [x8, #4]
Lloh16:
	adrp	x8, _EL_HVCNT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EL_HVCNT@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	and	w2, w19, #0xff
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_elprintf
	b	LBB0_13
LBB0_12:
Lloh21:
	adrp	x8, _Pico@GOTPAGE
Lloh22:
	ldr	x8, [x8, _Pico@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	lsr	w9, w8, #5
Lloh24:
	adrp	x10, _PicoPad@GOTPAGE
Lloh25:
	ldr	x10, [x10, _PicoPad@GOTPAGEOFF]
	and	w8, w8, #0x80
Lloh26:
	ldr	x10, [x10]
	ldr	w10, [x10, #4]
	bfi	w8, w9, #6, #1
	bfxil	w8, w10, #2, #4
	eor	w19, w8, #0x3f
LBB0_13:
	ldr	w0, [x20]
	and	w19, w19, #0xff
Lloh27:
	adrp	x1, l_.str.3@PAGE
Lloh28:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x2, x19
	bl	_elprintf
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_EL_IO,4,2                      ; @EL_IO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"z80 port %04x read"

	.comm	_Pico,12,2                      ; @Pico
	.comm	_EL_HVCNT,4,2                   ; @EL_HVCNT
l_.str.1:                               ; @.str.1
	.asciz	"V counter read: %02x"

l_.str.2:                               ; @.str.2
	.asciz	"H counter read: %02x"

	.comm	_PicoPad,8,3                    ; @PicoPad
l_.str.3:                               ; @.str.3
	.asciz	"ret = %02x"

	.no_dead_strip	_z80_sms_in
.subsections_via_symbols
