	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trackpoint_detect              ## -- Begin function trackpoint_detect
	.p2align	4, 0x90
_trackpoint_detect:                     ## @trackpoint_detect
	.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
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r12
	leaq	-48(%rbp), %rsi
	leaq	-56(%rbp), %rdx
	callq	_trackpoint_start_protocol
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
LBB0_1:
	movl	%r14d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	xorl	%r14d, %r14d
	testl	%ebx, %ebx
	je	LBB0_1
## %bb.3:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	%rax, %rbx
	leaq	40(%r12), %r15
	movq	%rax, %rdi
	callq	_trackpoint_defaults
	movq	-48(%rbp), %rax
	movq	%rax, (%rbx)
	movq	-56(%rbp), %rax
	movq	%rax, 8(%rbx)
	movq	%rbx, 16(%r12)
	movq	_trackpoint_variants@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rcx
	movl	(%rax,%rcx,4), %eax
	movl	%eax, 8(%r12)
	leaq	L_.str(%rip), %rax
	movq	%rax, (%r12)
	movq	_trackpoint_reconnect@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%r12)
	movq	_trackpoint_disconnect@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r12)
	movq	_TP_VARIANT_IBM@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rcx
	jne	LBB0_9
## %bb.5:
	movq	_TP_EXT_BTN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movq	%r15, %rdi
	callq	_trackpoint_read
	testl	%eax, %eax
	je	LBB0_17
## %bb.6:
	leaq	L_.str.1(%rip), %rsi
LBB0_7:
	movq	%r12, %rdi
	callq	_psmouse_warn
LBB0_9:
	movq	$51, -40(%rbp)
LBB0_10:
	movq	24(%r12), %rdi
	movq	_EV_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BTN_MIDDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_input_set_capability
LBB0_11:
	movq	_INPUT_PROP_POINTER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r12), %rax
	movl	(%rax), %esi
	callq	___set_bit
	movq	_INPUT_PROP_POINTING_STICK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	24(%r12), %rax
	movl	(%rax), %esi
	callq	___set_bit
	movq	-48(%rbp), %rax
	cmpq	(%rbx), %rax
	jne	LBB0_13
## %bb.12:
	movq	%r15, %rdi
	callq	_trackpoint_power_on_reset
	testq	%rax, %rax
	je	LBB0_14
LBB0_13:
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_trackpoint_sync
LBB0_14:
	movq	(%r15), %rdi
	movq	_trackpoint_attr_group@GOTPCREL(%rip), %rsi
	callq	_device_add_group
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_psmouse_err
	movq	16(%r12), %rdi
	callq	_kfree
	movq	$0, 16(%r12)
	movl	$-1, %r14d
	jmp	LBB0_1
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_1
LBB0_16:
	movl	8(%r12), %edx
	movq	-56(%rbp), %rcx
	movq	-40(%rbp), %r9
	movl	%r9d, %r8d
	shrl	$4, %r8d
	andl	$15, %r8d
	andl	$15, %r9d
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	callq	_psmouse_info
	jmp	LBB0_1
LBB0_17:
	movq	-40(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:
	andl	$15, %eax
	cmpl	$3, %eax
	jae	LBB0_10
	jmp	LBB0_11
LBB0_19:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_trackpoint_variants,8,3        ## @trackpoint_variants
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"TrackPoint"

	.comm	_trackpoint_reconnect,4,2       ## @trackpoint_reconnect
	.comm	_trackpoint_disconnect,4,2      ## @trackpoint_disconnect
	.comm	_TP_VARIANT_IBM,8,3             ## @TP_VARIANT_IBM
	.comm	_TP_EXT_BTN,4,2                 ## @TP_EXT_BTN
L_.str.1:                               ## @.str.1
	.asciz	"failed to get extended button data, assuming 3 buttons\n"

L_.str.2:                               ## @.str.2
	.asciz	"got 0 in extended button data, assuming 3 buttons\n"

	.comm	_EV_KEY,4,2                     ## @EV_KEY
	.comm	_BTN_MIDDLE,4,2                 ## @BTN_MIDDLE
	.comm	_INPUT_PROP_POINTER,4,2         ## @INPUT_PROP_POINTER
	.comm	_INPUT_PROP_POINTING_STICK,4,2  ## @INPUT_PROP_POINTING_STICK
	.comm	_trackpoint_attr_group,4,2      ## @trackpoint_attr_group
L_.str.3:                               ## @.str.3
	.asciz	"failed to create sysfs attributes, error: %d\n"

L_.str.4:                               ## @.str.4
	.asciz	"%s TrackPoint firmware: 0x%02x, buttons: %d/%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trackpoint_detect              ; -- Begin function trackpoint_detect
	.p2align	2
_trackpoint_detect:                     ; @trackpoint_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x0
	add	x1, sp, #24
	add	x2, sp, #16
	bl	_trackpoint_start_protocol
	cbnz	w0, LBB0_17
; %bb.1:
	cbz	w20, LBB0_16
; %bb.2:
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_14
; %bb.3:
	mov	x21, x0
	add	x20, x19, #40
	bl	_trackpoint_defaults
	ldr	x8, [sp, #24]
	str	x8, [x21]
	ldp	x8, x9, [sp, #16]
	str	x8, [x21, #8]
	str	x21, [x19, #16]
Lloh3:
	adrp	x8, _trackpoint_variants@GOTPAGE
Lloh4:
	ldr	x8, [x8, _trackpoint_variants@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w8, [x8, x9, lsl #2]
	str	w8, [x19, #8]
Lloh6:
	adrp	x8, l_.str@PAGE
Lloh7:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x19]
Lloh8:
	adrp	x8, _trackpoint_reconnect@GOTPAGE
Lloh9:
	ldr	x8, [x8, _trackpoint_reconnect@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x10, _trackpoint_disconnect@GOTPAGE
Lloh12:
	ldr	x10, [x10, _trackpoint_disconnect@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	stp	w10, w8, [x19, #32]
Lloh14:
	adrp	x21, _TP_VARIANT_IBM@GOTPAGE
Lloh15:
	ldr	x21, [x21, _TP_VARIANT_IBM@GOTPAGEOFF]
	ldr	x8, [x21]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.4:
Lloh16:
	adrp	x8, _TP_EXT_BTN@GOTPAGE
Lloh17:
	ldr	x8, [x8, _TP_EXT_BTN@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x20
	bl	_trackpoint_read
	cbz	w0, LBB0_18
; %bb.5:
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_psmouse_warn
LBB0_7:
	mov	w8, #51
	str	x8, [sp, #8]
LBB0_8:
	ldr	x0, [x19, #24]
Lloh21:
	adrp	x8, _EV_KEY@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EV_KEY@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
Lloh24:
	adrp	x8, _BTN_MIDDLE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _BTN_MIDDLE@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	bl	_input_set_capability
LBB0_9:
Lloh27:
	adrp	x8, _INPUT_PROP_POINTER@GOTPAGE
Lloh28:
	ldr	x8, [x8, _INPUT_PROP_POINTER@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
	ldr	w1, [x8]
	bl	___set_bit
Lloh30:
	adrp	x8, _INPUT_PROP_POINTING_STICK@GOTPAGE
Lloh31:
	ldr	x8, [x8, _INPUT_PROP_POINTING_STICK@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	ldr	x8, [x19, #24]
	ldr	w1, [x8]
	bl	___set_bit
	ldr	x8, [sp, #24]
	ldr	x9, [x21]
	cmp	x8, x9
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x20
	bl	_trackpoint_power_on_reset
	cbz	x0, LBB0_12
LBB0_11:
	mov	x0, x19
	mov	w1, #0
	bl	_trackpoint_sync
LBB0_12:
	ldr	x0, [x20]
Lloh33:
	adrp	x1, _trackpoint_attr_group@GOTPAGE
Lloh34:
	ldr	x1, [x1, _trackpoint_attr_group@GOTPAGEOFF]
	bl	_device_add_group
	cbz	w0, LBB0_15
; %bb.13:
	mov	x2, x0
Lloh35:
	adrp	x1, l_.str.3@PAGE
Lloh36:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_psmouse_err
	ldr	x0, [x19, #16]
	bl	_kfree
	str	xzr, [x19, #16]
	mov	w0, #-1
	b	LBB0_17
LBB0_14:
Lloh37:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_17
LBB0_15:
	ldr	w2, [x19, #8]
	ldp	x8, x3, [sp, #8]
	ubfx	x4, x8, #4, #4
	and	x5, x8, #0xf
Lloh40:
	adrp	x1, l_.str.4@PAGE
Lloh41:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x19
	bl	_psmouse_info
LBB0_16:
	mov	w0, #0
LBB0_17:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_18:
	ldr	x8, [sp, #8]
	cbz	x8, LBB0_20
; %bb.19:
	and	x8, x8, #0xf
	cmp	x8, #3
	b.hs	LBB0_8
	b	LBB0_9
LBB0_20:
Lloh42:
	adrp	x1, l_.str.2@PAGE
Lloh43:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_trackpoint_variants,8,3        ; @trackpoint_variants
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"TrackPoint"

	.comm	_trackpoint_reconnect,4,2       ; @trackpoint_reconnect
	.comm	_trackpoint_disconnect,4,2      ; @trackpoint_disconnect
	.comm	_TP_VARIANT_IBM,8,3             ; @TP_VARIANT_IBM
	.comm	_TP_EXT_BTN,4,2                 ; @TP_EXT_BTN
l_.str.1:                               ; @.str.1
	.asciz	"failed to get extended button data, assuming 3 buttons\n"

l_.str.2:                               ; @.str.2
	.asciz	"got 0 in extended button data, assuming 3 buttons\n"

	.comm	_EV_KEY,4,2                     ; @EV_KEY
	.comm	_BTN_MIDDLE,4,2                 ; @BTN_MIDDLE
	.comm	_INPUT_PROP_POINTER,4,2         ; @INPUT_PROP_POINTER
	.comm	_INPUT_PROP_POINTING_STICK,4,2  ; @INPUT_PROP_POINTING_STICK
	.comm	_trackpoint_attr_group,4,2      ; @trackpoint_attr_group
l_.str.3:                               ; @.str.3
	.asciz	"failed to create sysfs attributes, error: %d\n"

l_.str.4:                               ; @.str.4
	.asciz	"%s TrackPoint firmware: 0x%02x, buttons: %d/%d\n"

.subsections_via_symbols
