	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function twidjoy_process_packet
_twidjoy_process_packet:                ## @twidjoy_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	%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	(%rdi), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rdi), %r15
	movq	_twidjoy_buttons@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movl	(%rbx), %r12d
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.1:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movzbl	1(%rcx), %eax
	andl	$127, %eax
	shlq	$7, %rax
	movzbl	(%rcx), %r13d
	andl	$127, %r13d
	orq	%rax, %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	16(%rbx), %r12d
	addq	$16, %rbx
	testl	%r12d, %r12d
	je	LBB0_6
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	testl	%r12d, %r12d
	jle	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movb	4(%rbx), %cl
	shll	%cl, %r12d
	andl	%r13d, %r12d
	shrq	%cl, %r12
	decq	%r12
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rbx), %rcx
	movl	(%rcx,%rax,4), %esi
	leaq	1(%rax), %r14
	xorl	%edx, %edx
	cmpq	%rax, %r12
	sete	%dl
	movq	%r15, %rdi
	callq	_input_report_key
	movslq	(%rbx), %rcx
	movq	%r14, %rax
	cmpq	%rcx, %r14
	jl	LBB0_4
	jmp	LBB0_5
LBB0_6:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movzbl	4(%rbx), %eax
	movl	%eax, %ecx
	shll	$5, %ecx
	movzbl	%cl, %ecx
	movzbl	3(%rbx), %esi
	movl	%esi, %edx
	shrl	$2, %edx
	andl	$31, %edx
	leal	(%rcx,%rdx), %edi
	testb	$8, %al
	leal	-256(%rcx,%rdx), %edx
	cmovel	%edi, %edx
	movl	%esi, %eax
	shll	$7, %eax
	movzbl	%al, %eax
	movzbl	2(%rbx), %ecx
	andl	$127, %ecx
	leal	(%rax,%rcx), %edi
	testb	$2, %sil
	leal	-256(%rax,%rcx), %r14d
	cmovel	%edi, %r14d
	movq	_ABS_X@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	negl	%edx
	movq	%r15, %rdi
	callq	_input_report_abs
	movq	_ABS_Y@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_input_report_abs
	movq	%r15, %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	_twidjoy_buttons,8,3            ## @twidjoy_buttons
	.comm	_ABS_X,4,2                      ## @ABS_X
	.comm	_ABS_Y,4,2                      ## @ABS_Y
	.no_dead_strip	_twidjoy_process_packet
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function twidjoy_process_packet
_twidjoy_process_packet:                ; @twidjoy_process_packet
	.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
	ldp	x20, x19, [x0]
Lloh0:
	adrp	x8, _twidjoy_buttons@GOTPAGE
Lloh1:
	ldr	x8, [x8, _twidjoy_buttons@GOTPAGEOFF]
Lloh2:
	ldr	x21, [x8]
	ldr	w8, [x21]
	cbz	w8, LBB0_6
; %bb.1:
	ldrb	w9, [x20, #1]
	and	x9, x9, #0x7f
	ldrb	w10, [x20]
	and	x22, x10, #0x7f
	bfi	x22, x9, #7, #7
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x21, #16]!
	cbz	w8, LBB0_6
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x9, #0
	ldr	w10, [x21, #4]
	lsl	w8, w8, w10
	and	x8, x8, x22
	lsr	x8, x8, x10
	sub	x23, x8, #1
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x21, #8]
	ldr	w1, [x8, x9, lsl #2]
	add	x24, x9, #1
	cmp	x23, x9
	cset	w2, eq
	mov	x0, x19
	bl	_input_report_key
	ldrsw	x8, [x21]
	mov	x9, x24
	cmp	x24, x8
	b.lt	LBB0_5
	b	LBB0_2
LBB0_6:
	ldrb	w8, [x20, #4]
	ldrb	w9, [x20, #3]
	ubfx	w10, w9, #2, #5
	bfi	w10, w8, #5, #3
	orr	w11, w10, #0xffffff00
	tst	w8, #0x8
	csel	w8, w10, w11, eq
	ldrb	w10, [x20, #2]
	and	w10, w10, #0x7f
	bfi	w10, w9, #7, #1
	orr	w11, w10, #0xffffff00
	tst	w9, #0x2
	csel	w20, w10, w11, eq
Lloh3:
	adrp	x9, _ABS_X@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ABS_X@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x9]
	neg	w2, w8
	mov	x0, x19
	bl	_input_report_abs
Lloh6:
	adrp	x8, _ABS_Y@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ABS_Y@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_input_report_abs
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_twidjoy_buttons,8,3            ; @twidjoy_buttons
	.comm	_ABS_X,4,2                      ; @ABS_X
	.comm	_ABS_Y,4,2                      ; @ABS_Y
	.no_dead_strip	_twidjoy_process_packet
.subsections_via_symbols
