	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arc_ps2_check_rx
_arc_ps2_check_rx:                      ## @arc_ps2_check_rx
	.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	%rsi, %r15
	movq	%rdi, %r14
	leaq	4(%rdi), %r12
	movl	$-1000, %r13d                   ## imm = 0xFC18
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	incl	(%rcx)
	movl	(%rdx), %edx
LBB0_6:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r15), %rdi
	movzbl	%al, %esi
	callq	_serio_interrupt
	incl	%r13d
	je	LBB0_7
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	12(%r15), %edi
	callq	_ioread32
	movl	%eax, %ebx
	movq	_PS2_STAT_RX_VAL@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_8
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	8(%r15), %edi
	callq	_ioread32
	incl	8(%r14)
	movq	%r12, %rcx
	movq	_SERIO_PARITY@GOTPCREL(%rip), %rdx
	movq	_PS2_STAT_RX_FRM_ERR@GOTPCREL(%rip), %rsi
	testl	%ebx, (%rsi)
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rcx
	movq	_SERIO_FRAME@GOTPCREL(%rip), %rdx
	movq	_PS2_STAT_RX_BUF_OVER@GOTPCREL(%rip), %rsi
	testl	%ebx, (%rsi)
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	xorl	%edx, %edx
	jmp	LBB0_6
LBB0_7:
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PS2_STAT_RX_VAL,4,2            ## @PS2_STAT_RX_VAL
	.comm	_PS2_STAT_RX_FRM_ERR,4,2        ## @PS2_STAT_RX_FRM_ERR
	.comm	_SERIO_PARITY,4,2               ## @SERIO_PARITY
	.comm	_PS2_STAT_RX_BUF_OVER,4,2       ## @PS2_STAT_RX_BUF_OVER
	.comm	_SERIO_FRAME,4,2                ## @SERIO_FRAME
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PS/2 hardware stuck\n"

	.no_dead_strip	_arc_ps2_check_rx
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arc_ps2_check_rx
_arc_ps2_check_rx:                      ; @arc_ps2_check_rx
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x1
	mov	x20, x0
	add	x22, x0, #4
	mov	w23, #-1000
Lloh0:
	adrp	x24, _PS2_STAT_RX_VAL@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PS2_STAT_RX_VAL@GOTPAGEOFF]
Lloh2:
	adrp	x25, _PS2_STAT_RX_FRM_ERR@GOTPAGE
Lloh3:
	ldr	x25, [x25, _PS2_STAT_RX_FRM_ERR@GOTPAGEOFF]
Lloh4:
	adrp	x26, _SERIO_PARITY@GOTPAGE
Lloh5:
	ldr	x26, [x26, _SERIO_PARITY@GOTPAGEOFF]
Lloh6:
	adrp	x27, _PS2_STAT_RX_BUF_OVER@GOTPAGE
Lloh7:
	ldr	x27, [x27, _PS2_STAT_RX_BUF_OVER@GOTPAGEOFF]
Lloh8:
	adrp	x28, _SERIO_FRAME@GOTPAGE
Lloh9:
	ldr	x28, [x28, _SERIO_FRAME@GOTPAGEOFF]
	b	LBB0_4
LBB0_1:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x8, x20
	mov	x9, x28
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w10, [x8]
	add	w10, w10, #1
	str	w10, [x8]
	ldr	w2, [x9]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x19]
	and	w1, w0, #0xff
	mov	x0, x8
	bl	_serio_interrupt
	adds	w23, w23, #1
	b.hs	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x19, #12]
	bl	_ioread32
	ldr	w8, [x24]
	tst	w8, w0
	b.eq	LBB0_9
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x21, x0
	ldr	w0, [x19, #8]
	bl	_ioread32
	ldr	w8, [x20, #8]
	add	w8, w8, #1
	str	w8, [x20, #8]
	ldr	w10, [x25]
	mov	x8, x22
	mov	x9, x26
	tst	w10, w21
	b.ne	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x27]
	tst	w8, w21
	b.ne	LBB0_1
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w2, #0
	b	LBB0_3
LBB0_8:
	ldr	x0, [x19]
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_dev_err
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_PS2_STAT_RX_VAL,4,2            ; @PS2_STAT_RX_VAL
	.comm	_PS2_STAT_RX_FRM_ERR,4,2        ; @PS2_STAT_RX_FRM_ERR
	.comm	_SERIO_PARITY,4,2               ; @SERIO_PARITY
	.comm	_PS2_STAT_RX_BUF_OVER,4,2       ; @PS2_STAT_RX_BUF_OVER
	.comm	_SERIO_FRAME,4,2                ; @SERIO_FRAME
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PS/2 hardware stuck\n"

	.no_dead_strip	_arc_ps2_check_rx
.subsections_via_symbols
