	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psmouse_cleanup
_psmouse_cleanup:                       ## @psmouse_cleanup
	.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	%rdi, %rbx
	callq	_serio_get_drvdata
	movq	%rax, %r15
	movq	_psmouse_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movq	8(%rbx), %rax
	movq	_SERIO_PS_PSTHRU@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.2:
	callq	_serio_get_drvdata
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_psmouse_deactivate
	jmp	LBB0_5
LBB0_4:
	xorl	%r14d, %r14d
LBB0_5:
	movq	%r15, %rdi
	callq	_psmouse_deactivate
	movq	16(%r15), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	*%rax
LBB0_7:
	movq	%r15, %rdi
	callq	_psmouse_reset
	addq	$8, %r15
	movq	_PSMOUSE_CMD_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	testq	%r14, %r14
	je	LBB0_11
## %bb.8:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	*%rax
LBB0_10:
	movq	%r14, %rdi
	callq	_psmouse_activate
LBB0_11:
	movq	_psmouse_mutex@GOTPCREL(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_psmouse_mutex,4,2              ## @psmouse_mutex
	.comm	_SERIO_PS_PSTHRU,8,3            ## @SERIO_PS_PSTHRU
	.comm	_PSMOUSE_CMD_ENABLE,4,2         ## @PSMOUSE_CMD_ENABLE
	.no_dead_strip	_psmouse_cleanup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psmouse_cleanup
_psmouse_cleanup:                       ; @psmouse_cleanup
	.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	x20, x0
	bl	_serio_get_drvdata
	mov	x19, x0
Lloh0:
	adrp	x0, _psmouse_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _psmouse_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	x0, [x20]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x20, #8]
Lloh2:
	adrp	x9, _SERIO_PS_PSTHRU@GOTPAGE
Lloh3:
	ldr	x9, [x9, _SERIO_PS_PSTHRU@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	bl	_serio_get_drvdata
	mov	x20, x0
	bl	_psmouse_deactivate
	b	LBB0_4
LBB0_3:
	mov	x20, #0
LBB0_4:
	mov	x0, x19
	bl	_psmouse_deactivate
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x19
	blr	x8
LBB0_6:
	mov	x0, x19
	bl	_psmouse_reset
	add	x0, x19, #8
Lloh5:
	adrp	x8, _PSMOUSE_CMD_ENABLE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PSMOUSE_CMD_ENABLE@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x1, #0
	bl	_ps2_command
	cbz	x20, LBB0_10
; %bb.7:
	ldr	x8, [x20]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x20
	blr	x8
LBB0_9:
	mov	x0, x20
	bl	_psmouse_activate
LBB0_10:
Lloh8:
	adrp	x0, _psmouse_mutex@GOTPAGE
Lloh9:
	ldr	x0, [x0, _psmouse_mutex@GOTPAGEOFF]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_mutex_unlock
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_psmouse_mutex,4,2              ; @psmouse_mutex
	.comm	_SERIO_PS_PSTHRU,8,3            ; @SERIO_PS_PSTHRU
	.comm	_PSMOUSE_CMD_ENABLE,4,2         ; @PSMOUSE_CMD_ENABLE
	.no_dead_strip	_psmouse_cleanup
.subsections_via_symbols
