	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r12
	movzbl	(%r12), %eax
	testb	$64, %al
	jne	LBB0_1
## %bb.11:
	leaq	L_.str(%rip), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dbg                            ## TAILCALL
LBB0_1:
	movq	8(%rdi), %r15
	movq	8(%r15), %r14
	movzbl	1(%r12), %edx
	movb	2(%r12), %cl
	cmpl	$127, %edx
	jne	LBB0_4
## %bb.2:
	cmpb	$127, %cl
	jne	LBB0_4
## %bb.3:
	movb	$127, %cl
	cmpb	$127, 4(%r12)
	jne	LBB0_4
## %bb.10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	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
	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
	movzbl	3(%r12), %ebx
	movl	(%r15), %esi
	movq	_ALPS_QUIRK_TRACKSTICK_BUTTONS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %edx
	andl	%esi, %edx
	jne	LBB0_7
## %bb.5:
	movl	%ebx, %edi
	andl	$7, %edi
	je	LBB0_7
## %bb.6:
	orl	%esi, %ecx
	movl	%ecx, (%r15)
	andl	(%rax), %ecx
	movl	%ecx, %edx
LBB0_7:
	testl	%edx, %edx
	je	LBB0_9
## %bb.8:
	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_9:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_input_sync                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Bad trackstick packet, discarding\n"

	.comm	_REL_X,4,2                      ## @REL_X
	.comm	_REL_Y,4,2                      ## @REL_Y
	.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	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
	ldr	x21, [x0]
	ldrb	w8, [x21]
	tbnz	w8, #6, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	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	_dbg
LBB0_2:
	ldr	x20, [x0, #8]
	ldr	x19, [x20, #8]
	ldrb	w9, [x21, #1]
	ldrb	w10, [x21, #2]
	cmp	w9, #127
	b.ne	LBB0_7
; %bb.3:
	cmp	w10, #127
	b.ne	LBB0_7
; %bb.4:
	ldrb	w10, [x21, #4]
	cmp	w10, #127
	b.ne	LBB0_6
; %bb.5:
	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
	ret
LBB0_6:
	mov	w10, #127
LBB0_7:
	lsr	w11, w8, #4
	lsr	w8, w8, #5
	and	w9, w9, #0x78
	bfi	w9, w8, #7, #1
	and	w22, w10, #0x78
	bfi	w22, w11, #7, #1
	lsr	w2, w9, #3
Lloh2:
	adrp	x8, _REL_X@GOTPAGE
Lloh3:
	ldr	x8, [x8, _REL_X@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_input_report_rel
Lloh5:
	adrp	x8, _REL_Y@GOTPAGE
Lloh6:
	ldr	x8, [x8, _REL_Y@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	neg	w2, w22, lsr #3
	mov	x0, x19
	bl	_input_report_rel
	ldrb	w8, [x21, #3]
Lloh8:
	adrp	x9, _ALPS_QUIRK_TRACKSTICK_BUTTONS@GOTPAGE
Lloh9:
	ldr	x9, [x9, _ALPS_QUIRK_TRACKSTICK_BUTTONS@GOTPAGEOFF]
	ldr	w11, [x20]
	ldr	w12, [x9]
	and	w10, w12, w11
	and	w13, w8, #0x7
	cmp	w10, #0
	ccmp	w13, #0, #4, eq
	b.eq	LBB0_9
; %bb.8:
	orr	w10, w12, w11
	str	w10, [x20]
	ldr	w9, [x9]
	and	w10, w9, w10
LBB0_9:
	cbz	w10, LBB0_11
; %bb.10:
	and	w2, w8, #0x1
	and	w20, w8, #0x2
	and	w21, w8, #0x4
Lloh10:
	adrp	x8, _BTN_LEFT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _BTN_LEFT@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_input_report_key
Lloh13:
	adrp	x8, _BTN_RIGHT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BTN_RIGHT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_input_report_key
Lloh16:
	adrp	x8, _BTN_MIDDLE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BTN_MIDDLE@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_input_report_key
LBB0_11:
	mov	x0, x19
	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	_input_sync
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Bad trackstick packet, discarding\n"

	.comm	_REL_X,4,2                      ; @REL_X
	.comm	_REL_Y,4,2                      ; @REL_Y
	.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
