	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psmouse_connect
_psmouse_connect:                       ## @psmouse_connect
	.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, %r12
	movq	%rdi, %r15
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	_psmouse_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	movq	24(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movq	16(%r15), %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	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$72, %edi
	callq	_kzalloc
	movq	%rax, %r13
	xorl	%eax, %eax
	callq	_input_allocate_device
	testq	%r13, %r13
	je	LBB0_33
## %bb.6:
	testq	%rax, %rax
	je	LBB0_33
## %bb.7:
	movq	%rax, %rbx
	leaq	68(%r13), %rdi
	movq	%r15, %rsi
	callq	_ps2_init
	movq	%r13, %rdi
	addq	$64, %rdi
	movq	_psmouse_resync@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_DELAYED_WORK
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, 32(%r13)
	movl	60(%r13), %edi
	movq	(%r15), %rcx
	leaq	L_.str(%rip), %rdx
	movl	$4, %esi
	callq	_snprintf
	movq	_PSMOUSE_INITIALIZING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_psmouse_set_state
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_serio_set_drvdata
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_serio_open
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %ebx
	jmp	LBB0_32
LBB0_9:
	movq	16(%r15), %rax
	movq	_SERIO_PS_PSTHRU@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:
	movl	$10000, %edi                    ## imm = 0x2710
	movl	$15000, %esi                    ## imm = 0x3A98
	callq	_usleep_range
LBB0_11:
	movq	%r13, %rdi
	callq	_psmouse_probe
	testq	%rax, %rax
	js	LBB0_22
## %bb.12:
	movq	_psmouse_rate@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 56(%r13)
	movq	_psmouse_resolution@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 52(%r13)
	movq	_psmouse_resetafter@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 48(%r13)
	xorl	%eax, %eax
	testq	%r14, %r14
	jne	LBB0_14
## %bb.13:
	movq	_psmouse_resync_time@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_14:
	movl	%eax, 44(%r13)
	movq	_psmouse_smartscroll@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%r13)
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_psmouse_switch_protocol
	movq	16(%r13), %rax
	cmpl	$0, (%rax)
	je	LBB0_23
## %bb.15:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_input_free_device
	movq	$0, 32(%r13)
	xorl	%r12d, %r12d
LBB0_16:
	testq	%r14, %r14
	je	LBB0_24
## %bb.17:
	movq	24(%r14), %rax
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	movq	%r14, %rdi
	callq	*%rax
LBB0_19:
	leaq	8(%r15), %rdi
	movq	_psmouse_attribute_group@GOTPCREL(%rip), %rsi
	callq	_sysfs_create_group
	testl	%eax, %eax
	je	LBB0_37
## %bb.20:
	movl	%eax, %ebx
	movq	8(%r14), %rcx
	testq	%rcx, %rcx
	je	LBB0_25
## %bb.21:
	movq	%r14, %rdi
	callq	*%rcx
	jmp	LBB0_25
LBB0_22:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_31
LBB0_23:
	movq	_PSMOUSE_CMD_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_psmouse_set_state
	movq	%r13, %rdi
	callq	_psmouse_initialize
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_input_register_device
	movq	%rbx, %r12
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_28
	jmp	LBB0_16
LBB0_24:
	leaq	8(%r15), %rdi
	movq	_psmouse_attribute_group@GOTPCREL(%rip), %rsi
	callq	_sysfs_create_group
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_37
LBB0_25:
	testq	%r12, %r12
	je	LBB0_27
## %bb.26:
	movq	%r12, %rdi
	callq	_input_unregister_device
LBB0_27:
	xorl	%r12d, %r12d
LBB0_28:
	movq	%r12, -48(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rax
	testq	%rax, %rax
	je	LBB0_30
## %bb.29:
	movq	%r13, %rdi
	callq	*%rax
LBB0_30:
	movq	_PSMOUSE_IGNORE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_psmouse_set_state
LBB0_31:
	movq	%r15, %rdi
	callq	_serio_close
LBB0_32:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_serio_set_drvdata
	movq	-48(%rbp), %rax                 ## 8-byte Reload
LBB0_33:
	movq	%rax, %rdi
	callq	_input_free_device
	movq	%r13, %rdi
	callq	_kfree
LBB0_34:
	testq	%r14, %r14
	je	LBB0_36
## %bb.35:
	movq	%r14, %rdi
	callq	_psmouse_activate
LBB0_36:
	movq	_psmouse_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_37:
	movq	16(%r13), %rax
	xorl	%ebx, %ebx
	cmpl	$0, (%rax)
	jne	LBB0_34
## %bb.38:
	movq	%r13, %rdi
	callq	_psmouse_activate
	jmp	LBB0_34
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_psmouse_mutex,4,2              ## @psmouse_mutex
	.comm	_SERIO_PS_PSTHRU,8,3            ## @SERIO_PS_PSTHRU
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_psmouse_resync,4,2             ## @psmouse_resync
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/input0"

	.comm	_PSMOUSE_INITIALIZING,4,2       ## @PSMOUSE_INITIALIZING
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_psmouse_rate,4,2               ## @psmouse_rate
	.comm	_psmouse_resolution,4,2         ## @psmouse_resolution
	.comm	_psmouse_resetafter,4,2         ## @psmouse_resetafter
	.comm	_psmouse_resync_time,4,2        ## @psmouse_resync_time
	.comm	_psmouse_smartscroll,4,2        ## @psmouse_smartscroll
	.comm	_PSMOUSE_CMD_MODE,4,2           ## @PSMOUSE_CMD_MODE
	.comm	_psmouse_attribute_group,4,2    ## @psmouse_attribute_group
	.comm	_PSMOUSE_IGNORE,4,2             ## @PSMOUSE_IGNORE
	.no_dead_strip	_psmouse_connect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psmouse_connect
_psmouse_connect:                       ; @psmouse_connect
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x24, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w23, w8
Lloh3:
	adrp	x0, _psmouse_mutex@GOTPAGE
Lloh4:
	ldr	x0, [x0, _psmouse_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	ldr	x0, [x20, #24]
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [x20, #16]
Lloh5:
	adrp	x9, _SERIO_PS_PSTHRU@GOTPAGE
Lloh6:
	ldr	x9, [x9, _SERIO_PS_PSTHRU@GOTPAGEOFF]
Lloh7:
	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:
Lloh8:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #72
	bl	_kzalloc
	mov	x21, x0
	bl	_input_allocate_device
	mov	x22, x0
	cmp	x21, #0
	ccmp	x0, #0, #4, ne
	b.eq	LBB0_28
; %bb.5:
	add	x0, x21, #68
	mov	x1, x20
	bl	_ps2_init
	add	x0, x21, #64
Lloh11:
	adrp	x8, _psmouse_resync@GOTPAGE
Lloh12:
	ldr	x8, [x8, _psmouse_resync@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_INIT_DELAYED_WORK
	str	x22, [x21, #32]
	ldr	w0, [x21, #60]
	ldr	x3, [x20]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	mov	w1, #4
	bl	_snprintf
Lloh16:
	adrp	x8, _PSMOUSE_INITIALIZING@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PSMOUSE_INITIALIZING@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_psmouse_set_state
	mov	x0, x20
	mov	x1, x21
	bl	_serio_set_drvdata
	mov	x0, x20
	mov	x1, x24
	bl	_serio_open
	cbz	w0, LBB0_7
; %bb.6:
	mov	x23, x0
	b	LBB0_27
LBB0_7:
	ldr	x8, [x20, #16]
Lloh19:
	adrp	x9, _SERIO_PS_PSTHRU@GOTPAGE
Lloh20:
	ldr	x9, [x9, _SERIO_PS_PSTHRU@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.8:
	mov	w0, #10000
	mov	w1, #15000
	bl	_usleep_range
LBB0_9:
	mov	x0, x21
	bl	_psmouse_probe
	tbnz	x0, #63, LBB0_18
; %bb.10:
Lloh22:
	adrp	x8, _psmouse_rate@GOTPAGE
Lloh23:
	ldr	x8, [x8, _psmouse_rate@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
	str	w8, [x21, #56]
Lloh25:
	adrp	x8, _psmouse_resolution@GOTPAGE
Lloh26:
	ldr	x8, [x8, _psmouse_resolution@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _psmouse_resetafter@GOTPAGE
Lloh29:
	ldr	x9, [x9, _psmouse_resetafter@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #48]
Lloh31:
	adrp	x8, _psmouse_resync_time@GOTPAGE
Lloh32:
	ldr	x8, [x8, _psmouse_resync_time@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	cmp	x19, #0
	csel	w8, w8, wzr, eq
Lloh34:
	adrp	x9, _psmouse_smartscroll@GOTPAGE
Lloh35:
	ldr	x9, [x9, _psmouse_smartscroll@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	stp	w9, w8, [x21, #40]
	mov	x0, x21
	mov	x1, #0
	bl	_psmouse_switch_protocol
	ldr	x8, [x21, #16]
	ldr	w8, [x8]
	cbz	w8, LBB0_19
; %bb.11:
	mov	x0, x22
	bl	_input_free_device
	mov	x22, #0
	str	xzr, [x21, #32]
LBB0_12:
	cbz	x19, LBB0_20
; %bb.13:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_15
; %bb.14:
	mov	x0, x19
	blr	x8
LBB0_15:
	add	x0, x20, #8
Lloh37:
	adrp	x1, _psmouse_attribute_group@GOTPAGE
Lloh38:
	ldr	x1, [x1, _psmouse_attribute_group@GOTPAGEOFF]
	bl	_sysfs_create_group
	cbz	w0, LBB0_31
; %bb.16:
	mov	x23, x0
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_21
; %bb.17:
	mov	x0, x19
	blr	x8
	b	LBB0_21
LBB0_18:
Lloh39:
	adrp	x8, _ENODEV@GOTPAGE
Lloh40:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh41:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_26
LBB0_19:
Lloh42:
	adrp	x8, _PSMOUSE_CMD_MODE@GOTPAGE
Lloh43:
	ldr	x8, [x8, _PSMOUSE_CMD_MODE@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_psmouse_set_state
	mov	x0, x21
	bl	_psmouse_initialize
	mov	x0, x22
	bl	_input_register_device
	mov	x23, x0
	cbnz	w0, LBB0_23
	b	LBB0_12
LBB0_20:
	add	x0, x20, #8
Lloh45:
	adrp	x1, _psmouse_attribute_group@GOTPAGE
Lloh46:
	ldr	x1, [x1, _psmouse_attribute_group@GOTPAGEOFF]
	bl	_sysfs_create_group
	mov	x23, x0
	cbz	w0, LBB0_31
LBB0_21:
	cbz	x22, LBB0_23
; %bb.22:
	mov	x0, x22
	bl	_input_unregister_device
	mov	x22, #0
LBB0_23:
	ldr	x8, [x21]
	cbz	x8, LBB0_25
; %bb.24:
	mov	x0, x21
	blr	x8
LBB0_25:
Lloh47:
	adrp	x8, _PSMOUSE_IGNORE@GOTPAGE
Lloh48:
	ldr	x8, [x8, _PSMOUSE_IGNORE@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_psmouse_set_state
LBB0_26:
	mov	x0, x20
	bl	_serio_close
LBB0_27:
	mov	x0, x20
	mov	x1, #0
	bl	_serio_set_drvdata
LBB0_28:
	mov	x0, x22
	bl	_input_free_device
	mov	x0, x21
	bl	_kfree
	cbz	x19, LBB0_30
LBB0_29:
	mov	x0, x19
	bl	_psmouse_activate
LBB0_30:
Lloh50:
	adrp	x0, _psmouse_mutex@GOTPAGE
Lloh51:
	ldr	x0, [x0, _psmouse_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	mov	x0, x23
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_31:
	ldr	x8, [x21, #16]
	ldr	w8, [x8]
	cbnz	w8, LBB0_33
; %bb.32:
	mov	x0, x21
	bl	_psmouse_activate
LBB0_33:
	mov	w23, #0
	cbnz	x19, LBB0_29
	b	LBB0_30
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGot	Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_psmouse_mutex,4,2              ; @psmouse_mutex
	.comm	_SERIO_PS_PSTHRU,8,3            ; @SERIO_PS_PSTHRU
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_psmouse_resync,4,2             ; @psmouse_resync
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/input0"

	.comm	_PSMOUSE_INITIALIZING,4,2       ; @PSMOUSE_INITIALIZING
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_psmouse_rate,4,2               ; @psmouse_rate
	.comm	_psmouse_resolution,4,2         ; @psmouse_resolution
	.comm	_psmouse_resetafter,4,2         ; @psmouse_resetafter
	.comm	_psmouse_resync_time,4,2        ; @psmouse_resync_time
	.comm	_psmouse_smartscroll,4,2        ; @psmouse_smartscroll
	.comm	_PSMOUSE_CMD_MODE,4,2           ; @PSMOUSE_CMD_MODE
	.comm	_psmouse_attribute_group,4,2    ; @psmouse_attribute_group
	.comm	_PSMOUSE_IGNORE,4,2             ; @PSMOUSE_IGNORE
	.no_dead_strip	_psmouse_connect
.subsections_via_symbols
