	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_encoder_update_kb              ## -- Begin function encoder_update_kb
	.p2align	4, 0x90
_encoder_update_kb:                     ## @encoder_update_kb
	.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	_encoder_value@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	cmpl	$1, %esi
	sbbl	%ecx, %ecx
	movl	(%rax), %edx
	orl	$1, %ecx
	leal	(%rdx,%rcx), %ebx
	addl	$63, %ebx
                                        ## kill: def $edx killed $edx killed $rdx
	addl	%ecx, %edx
	cmovnsl	%edx, %ebx
	andl	$-64, %ebx
	subl	%ebx, %edx
	movl	%edx, (%rax)
	movq	_queue_for_send@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	testq	%rdi, %rdi
	je	LBB0_1
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movq	_layer@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.9:
	testl	%esi, %esi
	je	LBB0_12
## %bb.10:
	xorl	%edi, %edi
	jmp	LBB0_11
LBB0_2:
	xorl	%eax, %eax
	testl	%esi, %esi
	je	LBB0_4
## %bb.3:
	callq	_handle_encoder_clockwise
	jmp	LBB0_5
LBB0_12:
	movl	$1, %edi
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_change_encoder_mode            ## TAILCALL
LBB0_4:
	callq	_handle_encoder_ccw
LBB0_5:
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_timer_read
	testq	%r14, %r14
	je	LBB0_13
## %bb.6:
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_register_code16
	movq	_MEDIA_KEY_DELAY@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_timer_elapsed
	cmpq	(%r15), %rax
	jl	LBB0_7
## %bb.8:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_unregister_code16              ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_encoder_value,4,2              ## @encoder_value
	.comm	_queue_for_send,4,2             ## @queue_for_send
	.comm	_layer,8,3                      ## @layer
	.comm	_MEDIA_KEY_DELAY,8,3            ## @MEDIA_KEY_DELAY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_encoder_update_kb              ; -- Begin function encoder_update_kb
	.p2align	2
_encoder_update_kb:                     ; @encoder_update_kb
	.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
Lloh0:
	adrp	x8, _encoder_value@GOTPAGE
Lloh1:
	ldr	x8, [x8, _encoder_value@GOTPAGEOFF]
	ldr	w9, [x8]
	sub	w10, w9, #1
	cmp	w1, #0
	csinc	w9, w10, w9, eq
	and	w10, w9, #0x3f
	negs	w9, w9
	and	w9, w9, #0x3f
	csneg	w9, w10, w9, mi
	str	w9, [x8]
Lloh2:
	adrp	x8, _queue_for_send@GOTPAGE
Lloh3:
	ldr	x8, [x8, _queue_for_send@GOTPAGEOFF]
	mov	w9, #1
Lloh4:
	str	w9, [x8]
	cbz	x0, LBB0_2
LBB0_1:
	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
LBB0_2:
Lloh5:
	adrp	x8, _layer@GOTPAGE
Lloh6:
	ldr	x8, [x8, _layer@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cbz	x8, LBB0_5
; %bb.3:
	cbz	w1, LBB0_7
; %bb.4:
	mov	w0, #0
	b	LBB0_8
LBB0_5:
	cbz	w1, LBB0_9
; %bb.6:
	bl	_handle_encoder_clockwise
	b	LBB0_10
LBB0_7:
	mov	w0, #1
LBB0_8:
	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
	b	_change_encoder_mode
LBB0_9:
	bl	_handle_encoder_ccw
LBB0_10:
	mov	x19, x0
	bl	_timer_read
	cbz	x19, LBB0_1
; %bb.11:
	mov	x20, x0
	mov	x0, x19
	bl	_register_code16
Lloh8:
	adrp	x21, _MEDIA_KEY_DELAY@GOTPAGE
Lloh9:
	ldr	x21, [x21, _MEDIA_KEY_DELAY@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_timer_elapsed
	ldr	x8, [x21]
	cmp	x0, x8
	b.lt	LBB0_12
; %bb.13:
	mov	x0, x19
	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
	b	_unregister_code16
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_encoder_value,4,2              ; @encoder_value
	.comm	_queue_for_send,4,2             ; @queue_for_send
	.comm	_layer,8,3                      ; @layer
	.comm	_MEDIA_KEY_DELAY,8,3            ; @MEDIA_KEY_DELAY
.subsections_via_symbols
