	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function twidjoy_interrupt
_twidjoy_interrupt:                     ## @twidjoy_interrupt
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %r14d
	callq	_serio_get_drvdata
	movq	%rax, %rbx
	testb	%r14b, %r14b
	js	LBB0_2
## %bb.1:
	movq	$0, (%rbx)
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_2:
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_7
LBB0_3:
	movq	_TWIDJOY_MAX_LENGTH@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rcx
	cmpq	%rcx, %rax
	jge	LBB0_5
## %bb.4:
	movq	8(%rbx), %rcx
	leaq	1(%rax), %rsi
	movq	%rsi, (%rbx)
	movb	%r14b, (%rcx,%rax)
	movq	(%rbx), %rax
	movq	(%rdx), %rcx
LBB0_5:
	cmpq	%rcx, %rax
	jne	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	_twidjoy_process_packet
	movq	$0, (%rbx)
LBB0_7:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.comm	_TWIDJOY_MAX_LENGTH,8,3         ## @TWIDJOY_MAX_LENGTH
	.no_dead_strip	_twidjoy_interrupt
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function twidjoy_interrupt
_twidjoy_interrupt:                     ; @twidjoy_interrupt
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	bl	_serio_get_drvdata
	mov	x19, x0
	tbnz	w20, #7, LBB0_2
; %bb.1:
	mov	x8, #0
	str	xzr, [x19]
	b	LBB0_3
LBB0_2:
	ldr	x8, [x19]
	cbz	x8, LBB0_7
LBB0_3:
Lloh0:
	adrp	x10, _TWIDJOY_MAX_LENGTH@GOTPAGE
Lloh1:
	ldr	x10, [x10, _TWIDJOY_MAX_LENGTH@GOTPAGEOFF]
	ldr	x9, [x10]
	cmp	x8, x9
	b.ge	LBB0_5
; %bb.4:
	ldr	x9, [x19, #8]
	add	x11, x8, #1
	str	x11, [x19]
	strb	w20, [x9, x8]
	ldr	x8, [x19]
	ldr	x9, [x10]
LBB0_5:
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_twidjoy_process_packet
	str	xzr, [x19]
LBB0_7:
Lloh2:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.comm	_TWIDJOY_MAX_LENGTH,8,3         ; @TWIDJOY_MAX_LENGTH
	.no_dead_strip	_twidjoy_interrupt
.subsections_via_symbols
