	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function magellan_process_packet
_magellan_process_packet:               ## @magellan_process_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
	movl	8(%rdi), %eax
	testl	%eax, %eax
	je	LBB0_10
## %bb.1:
	movq	16(%rdi), %r14
	movq	(%rdi), %rbx
	movb	(%rbx), %cl
	cmpb	$107, %cl
	je	LBB0_6
## %bb.2:
	cmpb	$100, %cl
	jne	LBB0_9
## %bb.3:
	cmpl	$25, %eax
	jne	LBB0_10
## %bb.4:
	movq	%rbx, %rdi
	movl	$24, %esi
	callq	_magellan_crunch_nibbles
	testl	%eax, %eax
	jne	LBB0_10
## %bb.5:
	movq	_magellan_axes@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	(%rax), %esi
	movb	3(%rbx), %al
	shlb	$4, %al
	orb	4(%rbx), %al
	movzbl	%al, %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r15), %rax
	movl	4(%rax), %esi
	movb	7(%rbx), %al
	shlb	$4, %al
	orb	8(%rbx), %al
	movzbl	%al, %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r15), %rax
	movl	8(%rax), %esi
	movb	11(%rbx), %al
	shlb	$4, %al
	orb	12(%rbx), %al
	movzbl	%al, %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r15), %rax
	movl	12(%rax), %esi
	movb	15(%rbx), %al
	shlb	$4, %al
	orb	16(%rbx), %al
	movzbl	%al, %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r15), %rax
	movl	16(%rax), %esi
	movb	19(%rbx), %al
	shlb	$4, %al
	orb	20(%rbx), %al
	movzbl	%al, %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	movq	(%r15), %rax
	movl	20(%rax), %esi
	movb	23(%rbx), %al
	shlb	$4, %al
	orb	24(%rbx), %al
	movzbl	%al, %edx
	movq	%r14, %rdi
	callq	_input_report_abs
	jmp	LBB0_9
LBB0_6:
	cmpl	$4, %eax
	jne	LBB0_10
## %bb.7:
	movq	%rbx, %rdi
	movl	$3, %esi
	callq	_magellan_crunch_nibbles
	testl	%eax, %eax
	je	LBB0_8
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movzbl	1(%rbx), %eax
	addl	%eax, %eax
	movzbl	2(%rbx), %r15d
	shll	$5, %r15d
	orl	%eax, %r15d
	movzbl	3(%rbx), %edx
	movl	%r15d, %ebx
	orl	%edx, %ebx
	movq	_magellan_buttons@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movl	(%rax), %esi
	andl	$1, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	(%r12), %rax
	movl	4(%rax), %esi
	movl	%ebx, %edx
	shrl	%edx
	andl	$1, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	(%r12), %rax
	movl	8(%rax), %esi
	movl	%ebx, %edx
	shrl	$2, %edx
	andl	$1, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	(%r12), %rax
	movl	12(%rax), %esi
	movl	%ebx, %edx
	shrl	$3, %edx
	andl	$1, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	(%r12), %rax
	movl	16(%rax), %esi
	movl	%ebx, %edx
	shrl	$4, %edx
	andl	$1, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	(%r12), %rax
	movl	20(%rax), %esi
	movl	%ebx, %edx
	shrl	$5, %edx
	andl	$1, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	(%r12), %rax
	movl	24(%rax), %esi
	movl	%ebx, %edx
	shrl	$6, %edx
	andl	$1, %edx
	movq	%r14, %rdi
	callq	_input_report_key
	movq	(%r12), %rax
	movl	28(%rax), %esi
	shrl	$7, %ebx
	andl	$1, %ebx
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_input_report_key
	movq	(%r12), %rax
	movl	32(%rax), %esi
	shrl	$8, %r15d
	andl	$1, %r15d
	movq	%r14, %rdi
	movl	%r15d, %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
	.comm	_magellan_axes,8,3              ## @magellan_axes
	.comm	_magellan_buttons,8,3           ## @magellan_buttons
	.no_dead_strip	_magellan_process_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function magellan_process_packet
_magellan_process_packet:               ; @magellan_process_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	w8, [x0, #8]
	cbz	w8, LBB0_8
; %bb.1:
	ldr	x19, [x0, #16]
	ldr	x20, [x0]
	ldrb	w9, [x20]
	cmp	w9, #107
	b.eq	LBB0_6
; %bb.2:
	cmp	w9, #100
	b.ne	LBB0_10
; %bb.3:
	cmp	w8, #25
	b.ne	LBB0_8
; %bb.4:
	mov	x0, x20
	mov	w1, #24
	bl	_magellan_crunch_nibbles
	cbnz	w0, LBB0_8
; %bb.5:
Lloh0:
	adrp	x21, _magellan_axes@GOTPAGE
Lloh1:
	ldr	x21, [x21, _magellan_axes@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	w1, [x8]
	ldrb	w8, [x20, #3]
	ubfiz	w8, w8, #4, #4
	ldrb	w9, [x20, #4]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x21]
	ldr	w1, [x8, #4]
	ldrb	w8, [x20, #7]
	ubfiz	w8, w8, #4, #4
	ldrb	w9, [x20, #8]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x21]
	ldr	w1, [x8, #8]
	ldrb	w8, [x20, #11]
	ubfiz	w8, w8, #4, #4
	ldrb	w9, [x20, #12]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x21]
	ldr	w1, [x8, #12]
	ldrb	w8, [x20, #15]
	ubfiz	w8, w8, #4, #4
	ldrb	w9, [x20, #16]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x21]
	ldr	w1, [x8, #16]
	ldrb	w8, [x20, #19]
	ubfiz	w8, w8, #4, #4
	ldrb	w9, [x20, #20]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_input_report_abs
	ldr	x8, [x21]
	ldr	w1, [x8, #20]
	ldrb	w8, [x20, #23]
	ubfiz	w8, w8, #4, #4
	ldrb	w9, [x20, #24]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_input_report_abs
	b	LBB0_10
LBB0_6:
	cmp	w8, #4
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x20
	mov	w1, #3
	bl	_magellan_crunch_nibbles
	cbz	w0, LBB0_9
LBB0_8:
	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_9:
	ldrb	w8, [x20, #1]
	ldrb	w9, [x20, #2]
	lsl	w9, w9, #5
	orr	w21, w9, w8, lsl #1
	ldrb	w8, [x20, #3]
	orr	w22, w21, w8
Lloh2:
	adrp	x20, _magellan_buttons@GOTPAGE
Lloh3:
	ldr	x20, [x20, _magellan_buttons@GOTPAGEOFF]
	ldr	x9, [x20]
	ldr	w1, [x9]
	and	w2, w8, #0x1
	mov	x0, x19
	bl	_input_report_key
	ldr	x8, [x20]
	ldr	w1, [x8, #4]
	ubfx	w2, w22, #1, #1
	mov	x0, x19
	bl	_input_report_key
	ldr	x8, [x20]
	ldr	w1, [x8, #8]
	ubfx	w2, w22, #2, #1
	mov	x0, x19
	bl	_input_report_key
	ldr	x8, [x20]
	ldr	w1, [x8, #12]
	ubfx	w2, w22, #3, #1
	mov	x0, x19
	bl	_input_report_key
	ldr	x8, [x20]
	ldr	w1, [x8, #16]
	ubfx	w2, w22, #4, #1
	mov	x0, x19
	bl	_input_report_key
	ldr	x8, [x20]
	ldr	w1, [x8, #20]
	ubfx	w2, w22, #5, #1
	mov	x0, x19
	bl	_input_report_key
	ldr	x8, [x20]
	ldr	w1, [x8, #24]
	ubfx	w2, w22, #6, #1
	mov	x0, x19
	bl	_input_report_key
	ldr	x8, [x20]
	ldr	w1, [x8, #28]
	ubfx	w2, w22, #7, #1
	mov	x0, x19
	bl	_input_report_key
	ldr	x8, [x20]
	ldr	w1, [x8, #32]
	ubfx	w2, w21, #8, #1
	mov	x0, x19
	bl	_input_report_key
LBB0_10:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.cfi_endproc
                                        ; -- End function
	.comm	_magellan_axes,8,3              ; @magellan_axes
	.comm	_magellan_buttons,8,3           ; @magellan_buttons
	.no_dead_strip	_magellan_process_packet
.subsections_via_symbols
