	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_serio_get_drvdata
	movq	%rax, %r12
	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	_PSMOUSE_INITIALIZING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_psmouse_set_state
	addq	$8, %r12
	movq	_PSMOUSE_CMD_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	8(%r15), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_psmouse_warn
LBB0_7:
	movq	16(%r15), %rax
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	%r15, %rdi
	callq	*%rax
LBB0_9:
	movq	_PSMOUSE_CMD_RESET_DIS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	movq	_PSMOUSE_CMD_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_ps2_command
	testq	%r14, %r14
	je	LBB0_13
## %bb.10:
	movq	(%r14), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%r14, %rdi
	callq	*%rax
LBB0_12:
	movq	%r14, %rdi
	callq	_psmouse_activate
LBB0_13:
	movq	_psmouse_mutex@GOTPCREL(%rip), %rdi
	popq	%rbx
	popq	%r12
	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_INITIALIZING,4,2       ## @PSMOUSE_INITIALIZING
	.comm	_PSMOUSE_CMD_DISABLE,4,2        ## @PSMOUSE_CMD_DISABLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to disable mouse on %s\n"

	.comm	_PSMOUSE_CMD_RESET_DIS,4,2      ## @PSMOUSE_CMD_RESET_DIS
	.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	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	x19, x0
	bl	_serio_get_drvdata
	mov	x20, x0
Lloh0:
	adrp	x0, _psmouse_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _psmouse_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	x0, [x19]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #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	x19, x0
	bl	_psmouse_deactivate
	b	LBB0_4
LBB0_3:
	mov	x19, #0
LBB0_4:
Lloh5:
	adrp	x8, _PSMOUSE_INITIALIZING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PSMOUSE_INITIALIZING@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_psmouse_set_state
	add	x21, x20, #8
Lloh8:
	adrp	x8, _PSMOUSE_CMD_DISABLE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PSMOUSE_CMD_DISABLE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, #0
	bl	_ps2_command
	cbz	x0, LBB0_6
; %bb.5:
	ldr	x8, [x20, #8]
	ldr	w2, [x8]
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_psmouse_warn
LBB0_6:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x20
	blr	x8
LBB0_8:
Lloh13:
	adrp	x8, _PSMOUSE_CMD_RESET_DIS@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PSMOUSE_CMD_RESET_DIS@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, #0
	bl	_ps2_command
Lloh16:
	adrp	x8, _PSMOUSE_CMD_ENABLE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PSMOUSE_CMD_ENABLE@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, #0
	bl	_ps2_command
	cbz	x19, LBB0_12
; %bb.9:
	ldr	x8, [x19]
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x19
	blr	x8
LBB0_11:
	mov	x0, x19
	bl	_psmouse_activate
LBB0_12:
Lloh19:
	adrp	x0, _psmouse_mutex@GOTPAGE
Lloh20:
	ldr	x0, [x0, _psmouse_mutex@GOTPAGEOFF]
	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
	b	_mutex_unlock
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_psmouse_mutex,4,2              ; @psmouse_mutex
	.comm	_SERIO_PS_PSTHRU,8,3            ; @SERIO_PS_PSTHRU
	.comm	_PSMOUSE_INITIALIZING,4,2       ; @PSMOUSE_INITIALIZING
	.comm	_PSMOUSE_CMD_DISABLE,4,2        ; @PSMOUSE_CMD_DISABLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to disable mouse on %s\n"

	.comm	_PSMOUSE_CMD_RESET_DIS,4,2      ; @PSMOUSE_CMD_RESET_DIS
	.comm	_PSMOUSE_CMD_ENABLE,4,2         ; @PSMOUSE_CMD_ENABLE
	.no_dead_strip	_psmouse_cleanup
.subsections_via_symbols
