	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps2_write
_ps2_write:                             ## @ps2_write
	.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	%esi, %r14d
	movq	(%rdi), %rbx
	leaq	16(%rbx), %r15
	movq	%r15, %rdi
	callq	_spin_lock_irqsave
	movq	_PS2STAT@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	24(%rbx), %rdi
	callq	_readl_relaxed
	movq	_PS2STAT_TXE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.1:
	movq	_PS2DATA@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	24(%rbx), %rsi
	movzbl	%r14b, %edi
	callq	_writel_relaxed
	jmp	LBB0_6
LBB0_2:
	movl	(%rbx), %eax
	movl	4(%rbx), %ecx
	cmpl	%ecx, %eax
	jne	LBB0_4
## %bb.3:
	movl	20(%rbx), %edi
	callq	_enable_irq
	movl	(%rbx), %eax
	movl	4(%rbx), %ecx
LBB0_4:
	leal	1(%rax), %edx
	andl	$7, %edx
	cmpl	%ecx, %edx
	je	LBB0_6
## %bb.5:
	movq	8(%rbx), %rcx
	cltq
	movb	%r14b, (%rcx,%rax)
	movl	%edx, (%rbx)
LBB0_6:
	movq	%r15, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PS2STAT,8,3                    ## @PS2STAT
	.comm	_PS2STAT_TXE,4,2                ## @PS2STAT_TXE
	.comm	_PS2DATA,8,3                    ## @PS2DATA
	.no_dead_strip	_ps2_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps2_write
_ps2_write:                             ; @ps2_write
	.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, x1
	ldr	x21, [x0]
	add	x19, x21, #16
	mov	x0, x19
	bl	_spin_lock_irqsave
	ldr	x8, [x21, #24]
Lloh0:
	adrp	x9, _PS2STAT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PS2STAT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_readl_relaxed
Lloh3:
	adrp	x8, _PS2STAT_TXE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PS2STAT_TXE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_2
; %bb.1:
	ldr	x8, [x21, #24]
Lloh6:
	adrp	x9, _PS2DATA@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PS2DATA@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x20
	bl	_writel_relaxed
	b	LBB0_6
LBB0_2:
	ldp	w8, w9, [x21]
	cmp	w8, w9
	b.ne	LBB0_4
; %bb.3:
	ldr	w0, [x21, #20]
	bl	_enable_irq
	ldp	w8, w9, [x21]
LBB0_4:
	add	w10, w8, #1
	and	w10, w10, #0x7
	cmp	w10, w9
	b.eq	LBB0_6
; %bb.5:
	ldr	x9, [x21, #8]
	strb	w20, [x9, w8, sxtw]
	str	w10, [x21]
LBB0_6:
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_PS2STAT,8,3                    ; @PS2STAT
	.comm	_PS2STAT_TXE,4,2                ; @PS2STAT_TXE
	.comm	_PS2DATA,8,3                    ; @PS2DATA
	.no_dead_strip	_ps2_write
.subsections_via_symbols
