	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pegasus_parse_packet
_pegasus_parse_packet:                  ## @pegasus_parse_packet
	.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), %rbx
	movb	(%rbx), %al
	addb	$-128, %al
	cmpb	$3, %al
	ja	LBB0_7
## %bb.1:
	movq	24(%rdi), %r12
	movzbl	%al, %eax
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	jmpq	*%rax
LBB0_2:
	movb	1(%rbx), %al
	movq	_BUTTON_PRESSED@GOTPCREL(%rip), %rcx
	cmpb	(%rcx), %al
	jne	LBB0_8
## %bb.3:
	addq	$16, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_schedule_work                  ## TAILCALL
LBB0_7:
	movq	8(%rdi), %rdi
	leaq	L_.str.1(%rip), %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_warn_once                  ## TAILCALL
LBB0_4:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_warn_once
LBB0_5:
	leaq	2(%rbx), %rdi
	callq	_le16_to_cpup
	movl	%eax, %r15d
	leaq	4(%rbx), %rdi
	callq	_le16_to_cpup
	movl	%eax, %r14d
	movl	%r15d, %eax
	orl	%r14d, %eax
	jne	LBB0_6
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_BTN_TOUCH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PEN_TIP@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	andb	1(%rbx), %al
	movzbl	%al, %edx
	movq	%r12, %rdi
	callq	_input_report_key
	movq	_BTN_RIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PEN_BUTTON_PRESSED@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	andb	1(%rbx), %al
	movzbl	%al, %edx
	movq	%r12, %rdi
	callq	_input_report_key
	movq	_BTN_TOOL_PEN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$1, %edx
	callq	_input_report_key
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_input_report_abs
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_input_report_abs
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_input_sync                     ## TAILCALL
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_5, LBB0_5-LJTI0_0
.set L0_0_set_4, LBB0_4-LJTI0_0
LJTI0_0:
	.long	L0_0_set_2
	.long	L0_0_set_5
	.long	L0_0_set_4
	.long	L0_0_set_5
	.end_data_region
                                        ## -- End function
	.comm	_BUTTON_PRESSED,1,0             ## @BUTTON_PRESSED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Pen battery low\n"

	.comm	_BTN_TOUCH,4,2                  ## @BTN_TOUCH
	.comm	_PEN_TIP,1,0                    ## @PEN_TIP
	.comm	_BTN_RIGHT,4,2                  ## @BTN_RIGHT
	.comm	_PEN_BUTTON_PRESSED,1,0         ## @PEN_BUTTON_PRESSED
	.comm	_BTN_TOOL_PEN,4,2               ## @BTN_TOOL_PEN
	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
L_.str.1:                               ## @.str.1
	.asciz	"unknown answer from device\n"

	.no_dead_strip	_pegasus_parse_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pegasus_parse_packet
_pegasus_parse_packet:                  ; @pegasus_parse_packet
	.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	x22, [x0]
	ldrb	w8, [x22]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_4
; %bb.1:
	ldr	x19, [x0, #24]
Lloh0:
	adrp	x9, lJTI0_0@PAGE
Lloh1:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldrb	w8, [x22, #1]
Lloh2:
	adrp	x9, _BUTTON_PRESSED@GOTPAGE
Lloh3:
	ldr	x9, [x9, _BUTTON_PRESSED@GOTPAGEOFF]
	ldrb	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.3:
	add	x0, x0, #16
	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	_schedule_work
LBB0_4:
	ldr	x0, [x0, #8]
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@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	_dev_warn_once
LBB0_5:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_warn_once
LBB0_6:
	add	x0, x22, #2
	bl	_le16_to_cpup
	mov	x21, x0
	add	x0, x22, #4
	bl	_le16_to_cpup
	orr	w8, w21, w0
	cbnz	w8, LBB0_8
LBB0_7:
	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_8:
	mov	x20, x0
Lloh8:
	adrp	x8, _BTN_TOUCH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BTN_TOUCH@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldrb	w8, [x22, #1]
Lloh11:
	adrp	x9, _PEN_TIP@GOTPAGE
Lloh12:
	ldr	x9, [x9, _PEN_TIP@GOTPAGEOFF]
	ldrb	w9, [x9]
	and	w2, w9, w8
	mov	x0, x19
	bl	_input_report_key
Lloh13:
	adrp	x8, _BTN_RIGHT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _BTN_RIGHT@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldrb	w8, [x22, #1]
Lloh16:
	adrp	x9, _PEN_BUTTON_PRESSED@GOTPAGE
Lloh17:
	ldr	x9, [x9, _PEN_BUTTON_PRESSED@GOTPAGEOFF]
	ldrb	w9, [x9]
	and	w2, w9, w8
	mov	x0, x19
	bl	_input_report_key
Lloh18:
	adrp	x8, _BTN_TOOL_PEN@GOTPAGE
Lloh19:
	ldr	x8, [x8, _BTN_TOOL_PEN@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_input_report_key
Lloh21:
	adrp	x8, _ABS_X@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ABS_X@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x21
	bl	_input_report_abs
Lloh24:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_input_report_abs
	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	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_5-LBB0_2)>>2
	.byte	(LBB0_6-LBB0_2)>>2
                                        ; -- End function
	.comm	_BUTTON_PRESSED,1,0             ; @BUTTON_PRESSED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Pen battery low\n"

	.comm	_BTN_TOUCH,4,2                  ; @BTN_TOUCH
	.comm	_PEN_TIP,1,0                    ; @PEN_TIP
	.comm	_BTN_RIGHT,4,2                  ; @BTN_RIGHT
	.comm	_PEN_BUTTON_PRESSED,1,0         ; @PEN_BUTTON_PRESSED
	.comm	_BTN_TOOL_PEN,4,2               ; @BTN_TOOL_PEN
	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
l_.str.1:                               ; @.str.1
	.asciz	"unknown answer from device\n"

	.no_dead_strip	_pegasus_parse_packet
.subsections_via_symbols
