	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ps2_host_recv                  ## -- Begin function ps2_host_recv
	.p2align	4, 0x90
_ps2_host_recv:                         ## @ps2_host_recv
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_PS2_ERR_NONE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ps2_error@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	xorl	%eax, %eax
	callq	_idle
	movq	_clock_lo@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %r15d
	movl	$100, %esi
	movl	$1, %edx
	callq	_WAIT
	movq	_data_lo@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	movl	$2, %edx
	callq	_WAIT
	movq	_clock_hi@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	movl	$50, %esi
	movl	$3, %edx
	callq	_WAIT
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	%r15d, %r13d
	movq	_clock_lo@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$50, %esi
	movl	$4, %edx
	callq	_WAIT
	xorl	%eax, %eax
	callq	_data_in
	xorl	%r15d, %r15d
	testl	%r13d, %r13d
	sete	%r15b
	movl	$1, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	testl	%eax, %eax
	cmovel	%eax, %edx
	cmovel	%r13d, %r15d
	orl	%edx, %r14d
	movl	(%r12), %edi
	movl	$50, %esi
	movl	$5, %edx
	callq	_WAIT
	incl	%ebx
	cmpl	$8, %ebx
	jne	LBB0_1
## %bb.2:
	movq	_clock_lo@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$50, %esi
	movl	$6, %edx
	callq	_WAIT
	xorl	%eax, %eax
	callq	_data_in
	cmpl	%r15d, %eax
	jne	LBB0_3
## %bb.7:
	movl	(%r12), %edi
	movl	$50, %esi
	movl	$7, %edx
	callq	_WAIT
	movq	_clock_lo@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$50, %esi
	movl	$8, %edx
	callq	_WAIT
	movq	_data_hi@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %esi
	movl	$9, %edx
	callq	_WAIT
	movl	(%r12), %edi
	movl	$50, %esi
	movl	$10, %edx
	callq	_WAIT
	jmp	LBB0_6
LBB0_3:
	movq	_PS2_ERR_PARITY@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_ps2_error@GOTPCREL(%rip), %rax
	movq	%rsi, (%rax)
	movq	_PS2_ERR_STARTBIT3@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jle	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_xprintf
LBB0_5:
	xorl	%r14d, %r14d
LBB0_6:
	xorl	%eax, %eax
	callq	_inhibit
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PS2_ERR_NONE,8,3               ## @PS2_ERR_NONE
	.comm	_ps2_error,8,3                  ## @ps2_error
	.comm	_clock_lo,4,2                   ## @clock_lo
	.comm	_data_lo,4,2                    ## @data_lo
	.comm	_clock_hi,4,2                   ## @clock_hi
	.comm	_PS2_ERR_PARITY,8,3             ## @PS2_ERR_PARITY
	.comm	_data_hi,4,2                    ## @data_hi
	.comm	_PS2_ERR_STARTBIT3,8,3          ## @PS2_ERR_STARTBIT3
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"x%02X\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ps2_host_recv                  ; -- Begin function ps2_host_recv
	.p2align	2
_ps2_host_recv:                         ; @ps2_host_recv
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _PS2_ERR_NONE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PS2_ERR_NONE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x22, _ps2_error@GOTPAGE
Lloh4:
	ldr	x22, [x22, _ps2_error@GOTPAGEOFF]
	str	x8, [x22]
	bl	_idle
Lloh5:
	adrp	x20, _clock_lo@GOTPAGE
Lloh6:
	ldr	x20, [x20, _clock_lo@GOTPAGEOFF]
	ldr	w0, [x20]
	mov	w23, #1
	mov	w1, #100
	mov	w2, #1
	bl	_WAIT
Lloh7:
	adrp	x8, _data_lo@GOTPAGE
Lloh8:
	ldr	x8, [x8, _data_lo@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	mov	w1, #1
	mov	w2, #2
	bl	_WAIT
Lloh10:
	adrp	x21, _clock_hi@GOTPAGE
Lloh11:
	ldr	x21, [x21, _clock_hi@GOTPAGEOFF]
	ldr	w0, [x21]
	mov	w1, #50
	mov	w2, #3
	bl	_WAIT
	mov	w25, #0
	mov	w19, #0
	mov	w24, #1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	mov	w1, #50
	mov	w2, #4
	bl	_WAIT
	bl	_data_in
	cmp	w24, #0
	cset	w8, eq
	lsl	w9, w23, w25
	cmp	w0, #0
	csel	w9, wzr, w9, eq
	orr	w19, w9, w19
	csel	w24, w24, w8, eq
	ldr	w0, [x21]
	mov	w1, #50
	mov	w2, #5
	bl	_WAIT
	add	w25, w25, #1
	cmp	w25, #8
	b.ne	LBB0_1
; %bb.2:
	ldr	w0, [x20]
	mov	w1, #50
	mov	w2, #6
	bl	_WAIT
	bl	_data_in
	cmp	w0, w24
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [x21]
	mov	w1, #50
	mov	w2, #7
	bl	_WAIT
	ldr	w0, [x20]
	mov	w1, #50
	mov	w2, #8
	bl	_WAIT
Lloh12:
	adrp	x8, _data_hi@GOTPAGE
Lloh13:
	ldr	x8, [x8, _data_hi@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	mov	w1, #1
	mov	w2, #9
	bl	_WAIT
	ldr	w0, [x21]
	mov	w1, #50
	mov	w2, #10
	bl	_WAIT
	b	LBB0_7
LBB0_4:
Lloh15:
	adrp	x8, _PS2_ERR_PARITY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _PS2_ERR_PARITY@GOTPAGEOFF]
Lloh17:
	ldr	x1, [x8]
	str	x1, [x22]
Lloh18:
	adrp	x8, _PS2_ERR_STARTBIT3@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PS2_ERR_STARTBIT3@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
	cmp	x1, x8
	b.le	LBB0_6
; %bb.5:
Lloh21:
	adrp	x0, l_.str@PAGE
Lloh22:
	add	x0, x0, l_.str@PAGEOFF
	bl	_xprintf
LBB0_6:
	mov	w19, #0
LBB0_7:
	bl	_inhibit
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_PS2_ERR_NONE,8,3               ; @PS2_ERR_NONE
	.comm	_ps2_error,8,3                  ; @ps2_error
	.comm	_clock_lo,4,2                   ; @clock_lo
	.comm	_data_lo,4,2                    ; @data_lo
	.comm	_clock_hi,4,2                   ; @clock_hi
	.comm	_PS2_ERR_PARITY,8,3             ; @PS2_ERR_PARITY
	.comm	_data_hi,4,2                    ; @data_hi
	.comm	_PS2_ERR_STARTBIT3,8,3          ; @PS2_ERR_STARTBIT3
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"x%02X\n"

.subsections_via_symbols
