	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mp_io
_mp_io:                                 ## @mp_io
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r12
	movl	%edx, %r13d
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	$0, (%rcx)
	callq	_gameport_read
	testb	$1, %al
	jne	LBB0_6
## %bb.1:
	movl	%ebx, -56(%rbp)                 ## 4-byte Spill
	xorl	%r14d, %r14d
	movl	$64, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_gameport_read
	shrb	$4, %al
	andb	$3, %al
	btsl	%eax, %r14d
	decl	%ebx
	jne	LBB0_2
## %bb.3:
	cmpl	$1, %r14d
	jne	LBB0_6
## %bb.4:
	movq	%r15, %rdi
	callq	_gameport_read
	movl	%eax, %r14d
	movl	%eax, -44(%rbp)
	testb	$49, %r14b
	je	LBB0_9
LBB0_5:
	movq	_IO_RESET@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_6:
	movq	_IO_RETRY@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %eax
LBB0_8:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r15, %rdi
	callq	_gameport_trigger
	leaq	-44(%rbp), %r8
	movl	$16, %edi
	xorl	%esi, %esi
	movl	$308, %edx                      ## imm = 0x134
	movq	%r15, %rcx
	callq	_poll_until
	testl	%eax, %eax
	je	LBB0_5
## %bb.10:
	movl	-44(%rbp), %edx
	testb	$32, %dl
	jne	LBB0_12
## %bb.11:
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movl	$1, -60(%rbp)                   ## 4-byte Folded Spill
	movq	_PACKET_IO_SLOW@GOTPCREL(%rip), %rax
	movl	$1, %r14d
	jmp	LBB0_14
LBB0_12:
	andl	$240, %r14d
	movl	%edx, %ecx
	sarl	$4, %ecx
	orl	%r14d, %ecx
	xorl	%eax, %eax
	cmpl	$11, %ecx
	jne	LBB0_8
## %bb.13:
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	%r13d, -48(%rbp)                ## 4-byte Spill
	movl	$3, %r14d
	movl	$7, -60(%rbp)                   ## 4-byte Folded Spill
	movq	_PACKET_IO_FAST@GOTPCREL(%rip), %rax
LBB0_14:
	movq	_PACKET_FULL@GOTPCREL(%rip), %rcx
	movl	(%rax), %r13d
	orl	(%rcx), %r13d
	sarl	$28, %r13d
	leaq	-44(%rbp), %rbx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	xorl	%edi, %edi
	movl	$16, %esi
	movl	$77, %edx
	movq	%r15, %rcx
	movq	%rbx, %r8
	callq	_poll_until
	testl	%eax, %eax
	je	LBB0_5
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	-44(%rbp), %eax
	shrl	$5, %eax
	andl	-60(%rbp), %eax                 ## 4-byte Folded Reload
	movl	%eax, -44(%rbp)
	movq	_PACKET_FULL@GOTPCREL(%rip), %rcx
	testl	%r13d, (%rcx)
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	%r14d, %ecx
	shll	%cl, %r13d
	orl	%eax, %r13d
	movl	$16, %edi
	xorl	%esi, %esi
	movl	$77, %edx
	movq	%r15, %rcx
	movq	%rbx, %r8
	callq	_poll_until
	testl	%eax, %eax
	jne	LBB0_15
	jmp	LBB0_5
LBB0_18:
	testl	%eax, %eax
	jne	LBB0_5
## %bb.19:
	testb	$32, -52(%rbp)                  ## 1-byte Folded Reload
	je	LBB0_21
## %bb.20:
	movl	%r13d, %eax
	andl	$1073676288, %eax               ## imm = 0x3FFF0000
	andl	$32766, %r13d                   ## imm = 0x7FFE
	leal	(%rax,%r13,2), %r13d
	shrl	$2, %r13d
	orl	$-268435456, %r13d              ## imm = 0xF0000000
LBB0_21:
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	movl	%r13d, %edi
	callq	_bit_parity
	cmpl	$1, %eax
	je	LBB0_5
## %bb.22:
	leaq	-44(%rbp), %r8
	movl	$48, %edi
	xorl	%esi, %esi
	movl	$77, %edx
	movq	%r15, %rcx
	callq	_poll_until
	testl	%eax, %eax
	je	LBB0_5
## %bb.23:
	movq	%r15, %rdi
	callq	_gameport_read
	movl	%eax, -44(%rbp)
	testb	$1, %al
	jne	LBB0_5
## %bb.24:
	movq	%r15, %rdi
	callq	_gameport_trigger
	leaq	-44(%rbp), %r8
	xorl	%edi, %edi
	movl	$32, %esi
	movl	$77, %edx
	movq	%r15, %rcx
	callq	_poll_until
	testl	%eax, %eax
	je	LBB0_5
## %bb.25:
	movl	%r13d, (%r12)
	testl	%ebx, %ebx
	je	LBB0_30
## %bb.26:
	movq	_IO_RETRY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%ebx, %eax
	je	LBB0_28
## %bb.27:
	movq	_PACKET_MP_DONE@GOTPCREL(%rip), %rcx
	testl	%r13d, (%rcx)
	je	LBB0_30
LBB0_28:
	movq	_PACKET_MP_MORE@GOTPCREL(%rip), %rcx
	testl	%r13d, (%rcx)
	je	LBB0_31
## %bb.29:
	movq	_IO_GOT_PACKET@GOTPCREL(%rip), %rcx
	jmp	LBB0_42
LBB0_30:
	movq	_IO_GOT_PACKET@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_31:
	leaq	-44(%rbp), %r8
	movl	$32, %edi
	xorl	%esi, %esi
	movl	$77, %edx
	movq	%r15, %rcx
	callq	_poll_until
	testl	%eax, %eax
	je	LBB0_40
## %bb.32:
	movq	%r15, %rdi
	callq	_gameport_read
	movl	%eax, -44(%rbp)
	testb	$1, %al
	jne	LBB0_40
## %bb.33:
	movq	%r15, %rdi
	callq	_gameport_trigger
	leaq	-44(%rbp), %r14
	movl	-48(%rbp), %ebx                 ## 4-byte Reload
	jmp	LBB0_35
LBB0_34:                                ##   in Loop: Header=BB0_35 Depth=1
	movl	%ebx, %eax
	sarl	%eax
	cmpl	$1, %ebx
	movl	%eax, %ebx
	jbe	LBB0_43
LBB0_35:                                ## =>This Inner Loop Header: Depth=1
	movl	$32, %edi
	movl	$16, %esi
	movl	$116, %edx
	movq	%r15, %rcx
	movq	%r14, %r8
	callq	_poll_until
	testl	%eax, %eax
	je	LBB0_40
## %bb.36:                              ##   in Loop: Header=BB0_35 Depth=1
	movl	$48, %edi
	xorl	%esi, %esi
	movl	$193, %edx
	movq	%r15, %rcx
	movq	%r14, %r8
	callq	_poll_until
	testl	%eax, %eax
	je	LBB0_40
## %bb.37:                              ##   in Loop: Header=BB0_35 Depth=1
	testb	$1, -44(%rbp)
	jne	LBB0_40
## %bb.38:                              ##   in Loop: Header=BB0_35 Depth=1
	testb	$1, %bl
	je	LBB0_34
## %bb.39:                              ##   in Loop: Header=BB0_35 Depth=1
	movq	%r15, %rdi
	callq	_gameport_trigger
	jmp	LBB0_34
LBB0_40:
	movq	_IO_GOT_PACKET@GOTPCREL(%rip), %rcx
	movq	_IO_RESET@GOTPCREL(%rip), %rax
LBB0_41:
	movl	(%rax), %eax
LBB0_42:
	orl	(%rcx), %eax
	jmp	LBB0_8
LBB0_43:
	movq	_IO_GOT_PACKET@GOTPCREL(%rip), %rcx
	movq	_IO_MODE_FAST@GOTPCREL(%rip), %rax
	jmp	LBB0_41
	.cfi_endproc
                                        ## -- End function
	.comm	_IO_RETRY,4,2                   ## @IO_RETRY
	.comm	_IO_RESET,4,2                   ## @IO_RESET
	.comm	_PACKET_FULL,4,2                ## @PACKET_FULL
	.comm	_PACKET_IO_FAST,4,2             ## @PACKET_IO_FAST
	.comm	_PACKET_IO_SLOW,4,2             ## @PACKET_IO_SLOW
	.comm	_PACKET_MP_DONE,4,2             ## @PACKET_MP_DONE
	.comm	_IO_GOT_PACKET,4,2              ## @IO_GOT_PACKET
	.comm	_PACKET_MP_MORE,4,2             ## @PACKET_MP_MORE
	.comm	_IO_MODE_FAST,4,2               ## @IO_MODE_FAST
	.no_dead_strip	_mp_io
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mp_io
_mp_io:                                 ; @mp_io
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x3
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
	str	wzr, [x3]
	bl	_gameport_read
	tbnz	w0, #0, LBB0_6
; %bb.1:
	mov	w23, #0
	mov	w24, #64
	mov	w25, #1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_gameport_read
	ubfx	w8, w0, #4, #2
	lsl	w8, w25, w8
	orr	w23, w8, w23
	subs	w24, w24, #1
	b.ne	LBB0_2
; %bb.3:
	cmp	w23, #1
	b.ne	LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_gameport_read
	str	w0, [sp, #12]
	mov	w8, #49
	tst	w0, w8
	b.eq	LBB0_9
LBB0_5:
Lloh0:
	adrp	x8, _IO_RESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IO_RESET@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh2:
	adrp	x8, _IO_RETRY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IO_RETRY@GOTPAGEOFF]
LBB0_7:
	ldr	w0, [x8]
LBB0_8:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_9:
	mov	x23, x0
	mov	x0, x20
	bl	_gameport_trigger
	add	x4, sp, #12
	mov	w0, #16
	mov	w1, #0
	mov	w2, #308
	mov	x3, x20
	bl	_poll_until
	cbz	w0, LBB0_5
; %bb.10:
	ldr	w24, [sp, #12]
	tbnz	w24, #5, LBB0_12
; %bb.11:
	mov	w23, #1
Lloh4:
	adrp	x8, _PACKET_IO_SLOW@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PACKET_IO_SLOW@GOTPAGEOFF]
	mov	w25, #1
	b	LBB0_14
LBB0_12:
	and	w8, w23, #0xf0
	orr	w8, w8, w24, asr #4
	cmp	w8, #11
	b.ne	LBB0_18
; %bb.13:
	mov	w25, #3
	mov	w23, #7
Lloh6:
	adrp	x8, _PACKET_IO_FAST@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PACKET_IO_FAST@GOTPAGEOFF]
LBB0_14:
Lloh8:
	adrp	x27, _PACKET_FULL@GOTPAGE
Lloh9:
	ldr	x27, [x27, _PACKET_FULL@GOTPAGEOFF]
	ldr	w9, [x27]
	ldr	w8, [x8]
	orr	w8, w8, w9
	asr	w26, w8, #28
LBB0_15:                                ; =>This Inner Loop Header: Depth=1
	add	x4, sp, #12
	mov	w0, #0
	mov	w1, #16
	mov	w2, #77
	mov	x3, x20
	bl	_poll_until
	cbz	w0, LBB0_5
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [sp, #12]
	and	w8, w23, w8, lsr #5
	str	w8, [sp, #12]
	ldr	w9, [x27]
	tst	w9, w26
	b.ne	LBB0_19
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	lsl	w9, w26, w25
	orr	w26, w8, w9
	add	x4, sp, #12
	mov	w0, #16
	mov	w1, #0
	mov	w2, #77
	mov	x3, x20
	bl	_poll_until
	cbnz	w0, LBB0_15
	b	LBB0_5
LBB0_18:
	mov	w0, #0
	b	LBB0_8
LBB0_19:
	cbnz	w8, LBB0_5
; %bb.20:
	and	w8, w26, #0x3fff0000
	lsl	w9, w26, #1
	bfxil	w8, w9, #0, #16
	lsr	w8, w8, #2
	orr	w8, w8, #0xf0000000
	tst	w24, #0x20
	csel	w23, w26, w8, eq
	mov	x0, x23
	bl	_bit_parity
	cmp	w0, #1
	b.eq	LBB0_5
; %bb.21:
	add	x4, sp, #12
	mov	w0, #48
	mov	w1, #0
	mov	w2, #77
	mov	x3, x20
	bl	_poll_until
	cbz	w0, LBB0_5
; %bb.22:
	mov	x0, x20
	bl	_gameport_read
	str	w0, [sp, #12]
	tbnz	w0, #0, LBB0_5
; %bb.23:
	mov	x0, x20
	bl	_gameport_trigger
	add	x4, sp, #12
	mov	w0, #0
	mov	w1, #32
	mov	w2, #77
	mov	x3, x20
	bl	_poll_until
	cbz	w0, LBB0_5
; %bb.24:
	str	w23, [x22]
	cbz	w21, LBB0_29
; %bb.25:
Lloh10:
	adrp	x8, _IO_RETRY@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IO_RETRY@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_27
; %bb.26:
Lloh13:
	adrp	x9, _PACKET_MP_DONE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PACKET_MP_DONE@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w23
	b.eq	LBB0_29
LBB0_27:
Lloh16:
	adrp	x9, _PACKET_MP_MORE@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PACKET_MP_MORE@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w23
	b.eq	LBB0_30
; %bb.28:
Lloh19:
	adrp	x9, _IO_GOT_PACKET@GOTPAGE
Lloh20:
	ldr	x9, [x9, _IO_GOT_PACKET@GOTPAGEOFF]
	b	LBB0_40
LBB0_29:
Lloh21:
	adrp	x8, _IO_GOT_PACKET@GOTPAGE
Lloh22:
	ldr	x8, [x8, _IO_GOT_PACKET@GOTPAGEOFF]
	b	LBB0_7
LBB0_30:
	add	x4, sp, #12
	mov	w0, #32
	mov	w1, #0
	mov	w2, #77
	mov	x3, x20
	bl	_poll_until
	cbz	w0, LBB0_39
; %bb.31:
	mov	x0, x20
	bl	_gameport_read
	str	w0, [sp, #12]
	tbnz	w0, #0, LBB0_39
; %bb.32:
	mov	x0, x20
	bl	_gameport_trigger
	b	LBB0_34
LBB0_33:                                ;   in Loop: Header=BB0_34 Depth=1
	asr	w8, w19, #1
	cmp	w19, #1
	mov	x19, x8
	b.ls	LBB0_41
LBB0_34:                                ; =>This Inner Loop Header: Depth=1
	add	x4, sp, #12
	mov	w0, #32
	mov	w1, #16
	mov	w2, #116
	mov	x3, x20
	bl	_poll_until
	cbz	w0, LBB0_39
; %bb.35:                               ;   in Loop: Header=BB0_34 Depth=1
	add	x4, sp, #12
	mov	w0, #48
	mov	w1, #0
	mov	w2, #193
	mov	x3, x20
	bl	_poll_until
	cbz	w0, LBB0_39
; %bb.36:                               ;   in Loop: Header=BB0_34 Depth=1
	ldrb	w8, [sp, #12]
	tbnz	w8, #0, LBB0_39
; %bb.37:                               ;   in Loop: Header=BB0_34 Depth=1
	tbz	w19, #0, LBB0_33
; %bb.38:                               ;   in Loop: Header=BB0_34 Depth=1
	mov	x0, x20
	bl	_gameport_trigger
	b	LBB0_33
LBB0_39:
Lloh23:
	adrp	x8, _IO_GOT_PACKET@GOTPAGE
Lloh24:
	ldr	x8, [x8, _IO_GOT_PACKET@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
Lloh26:
	adrp	x9, _IO_RESET@GOTPAGE
Lloh27:
	ldr	x9, [x9, _IO_RESET@GOTPAGEOFF]
LBB0_40:
	ldr	w9, [x9]
	orr	w0, w9, w8
	b	LBB0_8
LBB0_41:
Lloh28:
	adrp	x8, _IO_GOT_PACKET@GOTPAGE
Lloh29:
	ldr	x8, [x8, _IO_GOT_PACKET@GOTPAGEOFF]
Lloh30:
	ldr	w8, [x8]
Lloh31:
	adrp	x9, _IO_MODE_FAST@GOTPAGE
Lloh32:
	ldr	x9, [x9, _IO_MODE_FAST@GOTPAGEOFF]
	b	LBB0_40
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_IO_RETRY,4,2                   ; @IO_RETRY
	.comm	_IO_RESET,4,2                   ; @IO_RESET
	.comm	_PACKET_FULL,4,2                ; @PACKET_FULL
	.comm	_PACKET_IO_FAST,4,2             ; @PACKET_IO_FAST
	.comm	_PACKET_IO_SLOW,4,2             ; @PACKET_IO_SLOW
	.comm	_PACKET_MP_DONE,4,2             ; @PACKET_MP_DONE
	.comm	_IO_GOT_PACKET,4,2              ; @IO_GOT_PACKET
	.comm	_PACKET_MP_MORE,4,2             ; @PACKET_MP_MORE
	.comm	_IO_MODE_FAST,4,2               ; @IO_MODE_FAST
	.no_dead_strip	_mp_io
.subsections_via_symbols
