	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rotary_encoder_irq
_rotary_encoder_irq:                    ## @rotary_encoder_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	16(%rsi), %r15
	movl	28(%r15), %edi
	callq	_gpio_get_value
	xorl	%ebx, %ebx
	testl	%eax, %eax
	setne	%bl
	movl	24(%r15), %edi
	callq	_gpio_get_value
	xorl	%ecx, %ecx
	testl	%eax, %eax
	setne	%cl
	xorl	(%r15), %ebx
	xorl	4(%r15), %ecx
	addl	%ebx, %ebx
	orl	%ecx, %ebx
	leal	-1(%rbx), %eax
	cmpl	$2, %eax
	jb	LBB0_17
## %bb.1:
	cmpl	$3, %ebx
	je	LBB0_19
## %bb.2:
	testl	%ebx, %ebx
	jne	LBB0_20
## %bb.3:
	cmpl	$0, (%r14)
	je	LBB0_20
## %bb.4:
	cmpl	$0, 20(%r15)
	je	LBB0_6
## %bb.5:
	movl	12(%r14), %edi
	xorl	%edx, %edx
	cmpl	4(%r14), %edx
	movl	12(%r15), %esi
	sbbl	%edx, %edx
	orl	$1, %edx
	callq	_input_report_rel
	jmp	LBB0_16
LBB0_17:
	cmpl	$0, (%r14)
	je	LBB0_20
## %bb.18:
	movl	%eax, 4(%r14)
	jmp	LBB0_20
LBB0_19:
	movl	$1, (%r14)
	jmp	LBB0_20
LBB0_6:
	movl	8(%r14), %edx
	cmpl	$0, 4(%r14)
	movl	16(%r15), %eax
	je	LBB0_10
## %bb.7:
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	addl	8(%r15), %edx
LBB0_9:
	xorl	%ecx, %ecx
	subl	$1, %edx
	cmovbl	%ecx, %edx
	jmp	LBB0_13
LBB0_10:
	testl	%eax, %eax
	jne	LBB0_12
## %bb.11:
	cmpl	8(%r15), %edx
	jae	LBB0_15
LBB0_12:
	incl	%edx
LBB0_13:
	testl	%eax, %eax
	je	LBB0_15
## %bb.14:
	movl	%edx, %eax
	xorl	%edx, %edx
	divl	8(%r15)
LBB0_15:
	movl	%edx, 8(%r14)
	movl	12(%r14), %edi
	movl	12(%r15), %esi
	callq	_input_report_abs
LBB0_16:
	movl	12(%r14), %edi
	callq	_input_sync
	movl	$0, (%r14)
LBB0_20:
	movq	_IRQ_HANDLED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IRQ_HANDLED,4,2                ## @IRQ_HANDLED
	.no_dead_strip	_rotary_encoder_irq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rotary_encoder_irq
_rotary_encoder_irq:                    ; @rotary_encoder_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
	ldr	x20, [x1, #16]
	ldr	w0, [x20, #28]
	bl	_gpio_get_value
	cmp	w0, #0
	cset	w21, ne
	ldr	w0, [x20, #24]
	bl	_gpio_get_value
	cmp	w0, #0
	cset	w8, ne
	ldp	w9, w10, [x20]
	eor	w9, w9, w21
	eor	w8, w10, w8
	orr	w8, w8, w9, lsl #1
	sub	w9, w8, #1
	cmp	w9, #2
	b.lo	LBB0_6
; %bb.1:
	cmp	w8, #3
	b.eq	LBB0_8
; %bb.2:
	cbnz	w8, LBB0_20
; %bb.3:
	ldr	w8, [x19]
	cbz	w8, LBB0_20
; %bb.4:
	ldr	w8, [x20, #20]
	cbz	w8, LBB0_9
; %bb.5:
	ldr	w0, [x19, #12]
	ldr	w1, [x20, #12]
	ldr	w8, [x19, #4]
	cmp	w8, #0
	mov	w8, #1
	cneg	w2, w8, ne
	bl	_input_report_rel
	b	LBB0_19
LBB0_6:
	ldr	w8, [x19]
	cbz	w8, LBB0_20
; %bb.7:
	str	w9, [x19, #4]
	b	LBB0_20
LBB0_8:
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_20
LBB0_9:
	ldp	w9, w2, [x19, #4]
	ldr	w8, [x20, #16]
	cbz	w9, LBB0_13
; %bb.10:
	cbz	w8, LBB0_12
; %bb.11:
	ldr	w9, [x20, #8]
	add	w2, w9, w2
LBB0_12:
	sub	w9, w2, #1
	cmp	w2, #0
	csel	w2, wzr, w9, eq
	b	LBB0_16
LBB0_13:
	cbnz	w8, LBB0_15
; %bb.14:
	ldr	w9, [x20, #8]
	cmp	w2, w9
	b.hs	LBB0_18
LBB0_15:
	add	w2, w2, #1
LBB0_16:
	cbz	w8, LBB0_18
; %bb.17:
	ldr	w8, [x20, #8]
	udiv	w9, w2, w8
	msub	w2, w9, w8, w2
LBB0_18:
	str	w2, [x19, #8]
	ldr	w0, [x19, #12]
	ldr	w1, [x20, #12]
	bl	_input_report_abs
LBB0_19:
	ldr	w0, [x19, #12]
	bl	_input_sync
	str	wzr, [x19]
LBB0_20:
Lloh0:
	adrp	x8, _IRQ_HANDLED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IRQ_HANDLED@GOTPAGEOFF]
Lloh2:
	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
	.cfi_endproc
                                        ; -- End function
	.comm	_IRQ_HANDLED,4,2                ; @IRQ_HANDLED
	.no_dead_strip	_rotary_encoder_irq
.subsections_via_symbols
