	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rotary_encoder_get_state
_rotary_encoder_get_state:              ## @rotary_encoder_get_state
	.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	8(%rdi), %rcx
	cmpl	$0, (%rcx)
	jle	LBB0_1
## %bb.2:
	movq	%rdi, %r14
	xorl	%r15d, %r15d
	movq	_ROTENC_GRAY@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rcx), %rax
	movl	(%rax,%r15,4), %edi
	callq	_gpiod_get_value_cansleep
	xorl	%edx, %edx
	testl	%eax, %eax
	sete	%dl
	testb	$1, %bl
	cmovel	%eax, %edx
	movq	(%r14), %rcx
	cmpq	(%r12), %rcx
	movq	8(%r14), %rcx
	cmovnel	%eax, %edx
	addl	%ebx, %ebx
	orl	%edx, %ebx
	incq	%r15
	movslq	(%rcx), %rax
	cmpq	%rax, %r15
	jl	LBB0_3
## %bb.4:
	andl	$3, %ebx
	jmp	LBB0_5
LBB0_1:
	xorl	%ebx, %ebx
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ROTENC_GRAY,8,3                ## @ROTENC_GRAY
	.no_dead_strip	_rotary_encoder_get_state
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rotary_encoder_get_state
_rotary_encoder_get_state:              ; @rotary_encoder_get_state
	.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	x8, [x0, #8]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x19, x0
	mov	x21, #0
	mov	w20, #0
Lloh0:
	adrp	x22, _ROTENC_GRAY@GOTPAGE
Lloh1:
	ldr	x22, [x22, _ROTENC_GRAY@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8, #8]
	ldr	w0, [x8, x21, lsl #2]
	bl	_gpiod_get_value_cansleep
	ldr	x9, [x22]
	cmp	w0, #0
	cset	w10, eq
	tst	w20, #0x1
	ldp	x11, x8, [x19]
	ccmp	x11, x9, #0, ne
	csel	w9, w0, w10, ne
	orr	w20, w9, w20, lsl #1
	add	x21, x21, #1
	ldrsw	x9, [x8]
	cmp	x21, x9
	b.lt	LBB0_2
; %bb.3:
	and	w0, w20, #0x3
	b	LBB0_5
LBB0_4:
	mov	w0, #0
LBB0_5:
	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 AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_ROTENC_GRAY,8,3                ; @ROTENC_GRAY
	.no_dead_strip	_rotary_encoder_get_state
.subsections_via_symbols
