	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rotary_irq
_rotary_irq:                            ## @rotary_irq
	.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	%rsi, %r15
	movq	16(%rsi), %r12
	movq	_ERCR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	8(%rsi), %rdi
	callq	___raw_readl
	movl	%eax, %ebx
	andl	$15, %ebx
	movq	%r15, %rdi
	callq	_clear_sbcr
	movl	%ebx, %edx
	subl	(%r15), %edx
	je	LBB0_6
## %bb.1:
	movl	%ebx, (%r15)
	movl	(%r12), %eax
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	movl	4(%r12), %r14d
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.3:
	testl	%edx, %edx
	cmovgl	%eax, %r14d
	leaq	4(%r15), %rbx
	movl	4(%r15), %edi
	movl	%r14d, %esi
	movl	$1, %edx
	callq	_input_report_key
	movl	4(%r15), %edi
	callq	_input_sync
	movl	4(%r15), %edi
	movl	%r14d, %esi
	xorl	%edx, %edx
	callq	_input_report_key
	movq	%rbx, %r15
	jmp	LBB0_5
LBB0_4:
	movl	4(%r15), %edi
	addq	$4, %r15
	movl	8(%r12), %esi
	callq	_input_report_rel
LBB0_5:
	movl	(%r15), %edi
	callq	_input_sync
LBB0_6:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERCR,8,3                       ## @ERCR
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_rotary_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rotary_irq
_rotary_irq:                            ; @rotary_irq
	.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
	mov	x19, x1
	ldp	x8, x20, [x1, #8]
Lloh0:
	adrp	x9, _ERCR@GOTPAGE
Lloh1:
	ldr	x9, [x9, _ERCR@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	___raw_readl
	and	w21, w0, #0xf
	mov	x0, x19
	bl	_clear_sbcr
	ldr	w8, [x19]
	subs	w2, w21, w8
	b.eq	LBB0_6
; %bb.1:
	str	w21, [x19]
	ldr	w8, [x20]
	cbz	w8, LBB0_4
; %bb.2:
	ldr	w9, [x20, #4]
	cbz	w9, LBB0_4
; %bb.3:
	cmp	w2, #0
	csel	w20, w8, w9, gt
	ldr	w0, [x19, #4]!
	mov	x1, x20
	mov	w2, #1
	bl	_input_report_key
	ldr	w0, [x19]
	bl	_input_sync
	ldr	w0, [x19]
	mov	x1, x20
	mov	w2, #0
	bl	_input_report_key
	b	LBB0_5
LBB0_4:
	ldr	w0, [x19, #4]!
	ldr	w1, [x20, #8]
	bl	_input_report_rel
LBB0_5:
	ldr	w0, [x19]
	bl	_input_sync
LBB0_6:
Lloh3:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ERCR,8,3                       ; @ERCR
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_rotary_irq
.subsections_via_symbols
