	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function alps_process_trackstick_packet_v3
_alps_process_trackstick_packet_v3:     ## @alps_process_trackstick_packet_v3
	.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	8(%rdi), %r12
	movq	_ALPS_DUALPOINT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_12
## %bb.1:
	movq	(%rdi), %r13
	movzbl	(%r13), %eax
	testb	$64, %al
	jne	LBB0_2
## %bb.13:
	leaq	L_.str.1(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_psmouse_dbg                    ## TAILCALL
LBB0_12:
	leaq	L_.str(%rip), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_psmouse_warn                   ## TAILCALL
LBB0_2:
	movq	8(%r12), %r14
	movzbl	1(%r13), %edx
	movb	2(%r13), %cl
	cmpl	$127, %edx
	jne	LBB0_5
## %bb.3:
	cmpb	$127, %cl
	jne	LBB0_5
## %bb.4:
	movb	$127, %cl
	cmpb	$127, 4(%r13)
	jne	LBB0_5
## %bb.11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movl	%eax, %esi
	andl	$32, %esi
	andl	$120, %edx
	leal	(%rdx,%rsi,4), %edx
	andl	$16, %eax
	andb	$120, %cl
	movzbl	%cl, %ecx
	leal	(%rcx,%rax,8), %ebx
	movzbl	4(%r13), %r15d
	andl	$127, %r15d
	shrl	$3, %edx
	shrl	$3, %ebx
	movq	_REL_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_input_report_rel
	movq	_REL_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	negl	%ebx
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_input_report_rel
	movq	_ABS_PRESSURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_input_report_abs
	movzbl	3(%r13), %ebx
	movl	4(%r12), %eax
	movq	_ALPS_QUIRK_TRACKSTICK_BUTTONS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%edx, %ecx
	andl	%eax, %ecx
	jne	LBB0_8
## %bb.6:
	movl	%ebx, %esi
	andl	$7, %esi
	je	LBB0_8
## %bb.7:
	orl	%edx, %eax
	movl	%eax, 4(%r12)
	movl	%edx, %ecx
LBB0_8:
	testl	%ecx, %ecx
	je	LBB0_10
## %bb.9:
	movl	%ebx, %edx
	andl	$1, %edx
	movl	%ebx, %r15d
	andl	$2, %r15d
	andl	$4, %ebx
	movq	_BTN_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_input_report_key
	movq	_BTN_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%r15d, %edx
	callq	_input_report_key
	movq	_BTN_MIDDLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_input_report_key
LBB0_10:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_input_sync                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ALPS_DUALPOINT,4,2             ## @ALPS_DUALPOINT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Rejected trackstick packet from non DualPoint device"

L_.str.1:                               ## @.str.1
	.asciz	"Bad trackstick packet, discarding\n"

	.comm	_REL_X,4,2                      ## @REL_X
	.comm	_REL_Y,4,2                      ## @REL_Y
	.comm	_ABS_PRESSURE,4,2               ## @ABS_PRESSURE
	.comm	_ALPS_QUIRK_TRACKSTICK_BUTTONS,4,2 ## @ALPS_QUIRK_TRACKSTICK_BUTTONS
	.comm	_BTN_LEFT,4,2                   ## @BTN_LEFT
	.comm	_BTN_RIGHT,4,2                  ## @BTN_RIGHT
	.comm	_BTN_MIDDLE,4,2                 ## @BTN_MIDDLE
	.no_dead_strip	_alps_process_trackstick_packet_v3
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function alps_process_trackstick_packet_v3
_alps_process_trackstick_packet_v3:     ; @alps_process_trackstick_packet_v3
	.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
	ldr	x21, [x0, #8]
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _ALPS_DUALPOINT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ALPS_DUALPOINT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	ldr	x22, [x0]
	ldrb	w8, [x22]
	tbnz	w8, #6, LBB0_4
; %bb.2:
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	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
	b	_psmouse_dbg
LBB0_3:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	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
	b	_psmouse_warn
LBB0_4:
	ldr	x19, [x21, #8]
	ldrb	w9, [x22, #1]
	ldrb	w10, [x22, #2]
	cmp	w9, #127
	b.ne	LBB0_9
; %bb.5:
	cmp	w10, #127
	b.ne	LBB0_9
; %bb.6:
	ldrb	w10, [x22, #4]
	cmp	w10, #127
	b.ne	LBB0_8
; %bb.7:
	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_8:
	mov	w10, #127
LBB0_9:
	lsr	w11, w8, #4
	lsr	w8, w8, #5
	and	w9, w9, #0x78
	bfi	w9, w8, #7, #1
	and	w23, w10, #0x78
	bfi	w23, w11, #7, #1
	ldrb	w8, [x22, #4]
	and	w20, w8, #0x7f
	lsr	w2, w9, #3
Lloh7:
	adrp	x8, _REL_X@GOTPAGE
Lloh8:
	ldr	x8, [x8, _REL_X@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_input_report_rel
Lloh10:
	adrp	x8, _REL_Y@GOTPAGE
Lloh11:
	ldr	x8, [x8, _REL_Y@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	neg	w2, w23, lsr #3
	mov	x0, x19
	bl	_input_report_rel
Lloh13:
	adrp	x8, _ABS_PRESSURE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ABS_PRESSURE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_input_report_abs
	ldrb	w8, [x22, #3]
Lloh16:
	adrp	x9, _ALPS_QUIRK_TRACKSTICK_BUTTONS@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ALPS_QUIRK_TRACKSTICK_BUTTONS@GOTPAGEOFF]
	ldr	w10, [x21, #4]
Lloh18:
	ldr	w9, [x9]
	and	w11, w9, w10
	and	w12, w8, #0x7
	cmp	w11, #0
	ccmp	w12, #0, #4, eq
	b.eq	LBB0_11
; %bb.10:
	orr	w10, w9, w10
	str	w10, [x21, #4]
	mov	x11, x9
LBB0_11:
	cbz	w11, LBB0_13
; %bb.12:
	and	w2, w8, #0x1
	and	w20, w8, #0x2
	and	w21, w8, #0x4
Lloh19:
	adrp	x8, _BTN_LEFT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _BTN_LEFT@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_input_report_key
Lloh22:
	adrp	x8, _BTN_RIGHT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _BTN_RIGHT@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_input_report_key
Lloh25:
	adrp	x8, _BTN_MIDDLE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _BTN_MIDDLE@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_input_report_key
LBB0_13:
	mov	x0, x19
	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
	b	_input_sync
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ALPS_DUALPOINT,4,2             ; @ALPS_DUALPOINT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Rejected trackstick packet from non DualPoint device"

l_.str.1:                               ; @.str.1
	.asciz	"Bad trackstick packet, discarding\n"

	.comm	_REL_X,4,2                      ; @REL_X
	.comm	_REL_Y,4,2                      ; @REL_Y
	.comm	_ABS_PRESSURE,4,2               ; @ABS_PRESSURE
	.comm	_ALPS_QUIRK_TRACKSTICK_BUTTONS,4,2 ; @ALPS_QUIRK_TRACKSTICK_BUTTONS
	.comm	_BTN_LEFT,4,2                   ; @BTN_LEFT
	.comm	_BTN_RIGHT,4,2                  ; @BTN_RIGHT
	.comm	_BTN_MIDDLE,4,2                 ; @BTN_MIDDLE
	.no_dead_strip	_alps_process_trackstick_packet_v3
.subsections_via_symbols
