	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psmouse_disconnect
_psmouse_disconnect:                    ## @psmouse_disconnect
	.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, %r14
	leaq	16(%rbx), %rdi
	movq	_psmouse_attribute_group@GOTPCREL(%rip), %rsi
	callq	_sysfs_remove_group
	movq	_psmouse_mutex@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	_PSMOUSE_CMD_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_psmouse_set_state
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	_kpsmoused_wq@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_flush_workqueue
	movq	%r15, %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, %r15
	movq	%rax, %rdi
	callq	_psmouse_deactivate
	jmp	LBB0_5
LBB0_4:
	xorl	%r15d, %r15d
LBB0_5:
	movq	16(%r14), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	*%rax
LBB0_7:
	testq	%r15, %r15
	je	LBB0_10
## %bb.8:
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	callq	*%rax
LBB0_10:
	movq	_PSMOUSE_IGNORE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_psmouse_set_state
	movq	%rbx, %rdi
	callq	_serio_close
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_serio_set_drvdata
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_12
## %bb.11:
	callq	_input_unregister_device
LBB0_12:
	movq	%r14, %rdi
	callq	_kfree
	testq	%r15, %r15
	je	LBB0_14
## %bb.13:
	movq	%r15, %rdi
	callq	_psmouse_activate
LBB0_14:
	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_attribute_group,4,2    ## @psmouse_attribute_group
	.comm	_psmouse_mutex,4,2              ## @psmouse_mutex
	.comm	_PSMOUSE_CMD_MODE,4,2           ## @PSMOUSE_CMD_MODE
	.comm	_kpsmoused_wq,4,2               ## @kpsmoused_wq
	.comm	_SERIO_PS_PSTHRU,8,3            ## @SERIO_PS_PSTHRU
	.comm	_PSMOUSE_IGNORE,4,2             ## @PSMOUSE_IGNORE
	.no_dead_strip	_psmouse_disconnect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psmouse_disconnect
_psmouse_disconnect:                    ; @psmouse_disconnect
	.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, x0
	bl	_serio_get_drvdata
	mov	x19, x0
	add	x0, x20, #16
Lloh0:
	adrp	x1, _psmouse_attribute_group@GOTPAGE
Lloh1:
	ldr	x1, [x1, _psmouse_attribute_group@GOTPAGEOFF]
	bl	_sysfs_remove_group
Lloh2:
	adrp	x21, _psmouse_mutex@GOTPAGE
Lloh3:
	ldr	x21, [x21, _psmouse_mutex@GOTPAGEOFF]
	mov	x0, x21
	bl	_mutex_lock
Lloh4:
	adrp	x8, _PSMOUSE_CMD_MODE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _PSMOUSE_CMD_MODE@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_psmouse_set_state
	mov	x0, x21
	bl	_mutex_unlock
Lloh7:
	adrp	x8, _kpsmoused_wq@GOTPAGE
Lloh8:
	ldr	x8, [x8, _kpsmoused_wq@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	_flush_workqueue
	mov	x0, x21
	bl	_mutex_lock
	ldr	x0, [x20]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x20, #8]
Lloh10:
	adrp	x9, _SERIO_PS_PSTHRU@GOTPAGE
Lloh11:
	ldr	x9, [x9, _SERIO_PS_PSTHRU@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.2:
	bl	_serio_get_drvdata
	mov	x21, x0
	bl	_psmouse_deactivate
	ldr	x8, [x19, #16]
	cbnz	x8, LBB0_4
	b	LBB0_5
LBB0_3:
	mov	x21, #0
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_5
LBB0_4:
	mov	x0, x19
	blr	x8
LBB0_5:
	cbz	x21, LBB0_8
; %bb.6:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_8
; %bb.7:
	mov	x0, x21
	blr	x8
LBB0_8:
Lloh13:
	adrp	x8, _PSMOUSE_IGNORE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PSMOUSE_IGNORE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_psmouse_set_state
	mov	x0, x20
	bl	_serio_close
	mov	x0, x20
	mov	x1, #0
	bl	_serio_set_drvdata
	ldr	x0, [x19]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_input_unregister_device
LBB0_10:
	mov	x0, x19
	bl	_kfree
	cbz	x21, LBB0_12
; %bb.11:
	mov	x0, x21
	bl	_psmouse_activate
LBB0_12:
Lloh16:
	adrp	x0, _psmouse_mutex@GOTPAGE
Lloh17:
	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 AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_psmouse_attribute_group,4,2    ; @psmouse_attribute_group
	.comm	_psmouse_mutex,4,2              ; @psmouse_mutex
	.comm	_PSMOUSE_CMD_MODE,4,2           ; @PSMOUSE_CMD_MODE
	.comm	_kpsmoused_wq,4,2               ; @kpsmoused_wq
	.comm	_SERIO_PS_PSTHRU,8,3            ; @SERIO_PS_PSTHRU
	.comm	_PSMOUSE_IGNORE,4,2             ; @PSMOUSE_IGNORE
	.no_dead_strip	_psmouse_disconnect
.subsections_via_symbols
