	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_check_state                    ## -- Begin function check_state
	.p2align	4, 0x90
_check_state:                           ## @check_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	cmpq	$0, _check_state.active_timer(%rip)
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_timer_read
	movq	%rax, _check_state.active_timer(%rip)
LBB0_2:
	movq	_state@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	cmpl	$128, %eax
	je	LBB0_15
## %bb.3:
	cmpl	$129, %eax
	je	LBB0_11
## %bb.4:
	cmpl	$131, %eax
	jne	LBB0_17
## %bb.5:
	cmpb	$0, _check_state.activated(%rip)
	jne	LBB0_9
## %bb.6:
	cmpb	$1, _check_state.slept(%rip)
	jne	LBB0_8
## %bb.7:
	movl	$1, %edi
	callq	_rgblight_mode_noeeprom
LBB0_8:
	movb	$1, _check_state.activated(%rip)
	movb	$0, _check_state.deactivated(%rip)
	movb	$0, _check_state.slept(%rip)
LBB0_9:
	movl	$1, %edi
	movl	$25, %esi
	callq	_velocikey_match_speed
	movq	_fade_interval@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_check_state.active_timer(%rip), %rdi
	callq	_timer_elapsed
	movq	_INACTIVE_DELAY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jl	LBB0_17
## %bb.10:
	xorl	%eax, %eax
	callq	_timer_read
	movq	%rax, _check_state.active_timer(%rip)
	movl	$129, (%rbx)
	jmp	LBB0_17
LBB0_15:
	cmpb	$0, _check_state.slept(%rip)
	jne	LBB0_17
## %bb.16:
	movl	$5, %edi
	callq	_rgblight_mode_noeeprom
	movb	$1, _check_state.slept(%rip)
	movb	$0, _check_state.activated(%rip)
	movb	$0, _check_state.deactivated(%rip)
	jmp	LBB0_17
LBB0_11:
	cmpb	$0, _check_state.deactivated(%rip)
	jne	LBB0_13
## %bb.12:
	movb	$1, _check_state.deactivated(%rip)
	movb	$0, _check_state.activated(%rip)
	movb	$0, _check_state.slept(%rip)
LBB0_13:
	xorl	%eax, %eax
	callq	_velocikey_decelerate
	movl	$1, %edi
	movl	$25, %esi
	callq	_velocikey_match_speed
	movq	_fade_interval@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_check_state.active_timer(%rip), %rdi
	callq	_timer_elapsed
	movq	_SLEEP_DELAY@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jl	LBB0_17
## %bb.14:
	movl	$128, (%rbx)
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_check_state.active_timer,8,3 ## @check_state.active_timer
.zerofill __DATA,__bss,_check_state.activated,1,2 ## @check_state.activated
.zerofill __DATA,__bss,_check_state.deactivated,1,2 ## @check_state.deactivated
.zerofill __DATA,__bss,_check_state.slept,1,2 ## @check_state.slept
	.comm	_state,4,2                      ## @state
	.comm	_fade_interval,4,2              ## @fade_interval
	.comm	_INACTIVE_DELAY,4,2             ## @INACTIVE_DELAY
	.comm	_SLEEP_DELAY,4,2                ## @SLEEP_DELAY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_check_state                    ; -- Begin function check_state
	.p2align	2
_check_state:                           ; @check_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
	adrp	x20, _check_state.active_timer@PAGE
	ldr	x8, [x20, _check_state.active_timer@PAGEOFF]
	cbnz	x8, LBB0_2
; %bb.1:
	bl	_timer_read
	str	x0, [x20, _check_state.active_timer@PAGEOFF]
LBB0_2:
Lloh0:
	adrp	x19, _state@GOTPAGE
Lloh1:
	ldr	x19, [x19, _state@GOTPAGEOFF]
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_11
; %bb.3:
	cmp	w8, #129
	b.eq	LBB0_13
; %bb.4:
	cmp	w8, #131
	b.ne	LBB0_18
; %bb.5:
	adrp	x21, _check_state.activated@PAGE
	ldrb	w8, [x21, _check_state.activated@PAGEOFF]
	tbnz	w8, #0, LBB0_9
; %bb.6:
	adrp	x22, _check_state.slept@PAGE
	ldrb	w8, [x22, _check_state.slept@PAGEOFF]
	cmp	w8, #1
	b.ne	LBB0_8
; %bb.7:
	mov	w0, #1
	bl	_rgblight_mode_noeeprom
LBB0_8:
	mov	w8, #1
	strb	w8, [x21, _check_state.activated@PAGEOFF]
	adrp	x8, _check_state.deactivated@PAGE
	strb	wzr, [x8, _check_state.deactivated@PAGEOFF]
	strb	wzr, [x22, _check_state.slept@PAGEOFF]
LBB0_9:
	mov	w0, #1
	mov	w1, #25
	bl	_velocikey_match_speed
Lloh2:
	adrp	x8, _fade_interval@GOTPAGE
Lloh3:
	ldr	x8, [x8, _fade_interval@GOTPAGEOFF]
Lloh4:
	str	w0, [x8]
	ldr	x0, [x20, _check_state.active_timer@PAGEOFF]
	bl	_timer_elapsed
Lloh5:
	adrp	x8, _INACTIVE_DELAY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _INACTIVE_DELAY@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cmp	w0, w8
	b.lt	LBB0_18
; %bb.10:
	bl	_timer_read
	str	x0, [x20, _check_state.active_timer@PAGEOFF]
	mov	w8, #129
	b	LBB0_17
LBB0_11:
	adrp	x19, _check_state.slept@PAGE
	ldrb	w8, [x19, _check_state.slept@PAGEOFF]
	tbnz	w8, #0, LBB0_18
; %bb.12:
	mov	w0, #5
	bl	_rgblight_mode_noeeprom
	mov	w8, #1
	strb	w8, [x19, _check_state.slept@PAGEOFF]
Lloh8:
	adrp	x8, _check_state.activated@PAGE
	strb	wzr, [x8, _check_state.activated@PAGEOFF]
Lloh9:
	adrp	x8, _check_state.deactivated@PAGE
	strb	wzr, [x8, _check_state.deactivated@PAGEOFF]
	b	LBB0_18
LBB0_13:
	adrp	x8, _check_state.deactivated@PAGE
	ldrb	w9, [x8, _check_state.deactivated@PAGEOFF]
	tbnz	w9, #0, LBB0_15
; %bb.14:
	mov	w9, #1
	strb	w9, [x8, _check_state.deactivated@PAGEOFF]
Lloh10:
	adrp	x8, _check_state.activated@PAGE
	strb	wzr, [x8, _check_state.activated@PAGEOFF]
Lloh11:
	adrp	x8, _check_state.slept@PAGE
	strb	wzr, [x8, _check_state.slept@PAGEOFF]
LBB0_15:
	bl	_velocikey_decelerate
	mov	w0, #1
	mov	w1, #25
	bl	_velocikey_match_speed
Lloh12:
	adrp	x8, _fade_interval@GOTPAGE
Lloh13:
	ldr	x8, [x8, _fade_interval@GOTPAGEOFF]
Lloh14:
	str	w0, [x8]
	ldr	x0, [x20, _check_state.active_timer@PAGEOFF]
	bl	_timer_elapsed
Lloh15:
	adrp	x8, _SLEEP_DELAY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _SLEEP_DELAY@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w0, w8
	b.lt	LBB0_18
; %bb.16:
	mov	w8, #128
LBB0_17:
	str	w8, [x19]
LBB0_18:
	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
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdrp	Lloh8, Lloh9
	.loh AdrpAdrp	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_check_state.active_timer,8,3 ; @check_state.active_timer
.zerofill __DATA,__bss,_check_state.activated,1,2 ; @check_state.activated
.zerofill __DATA,__bss,_check_state.deactivated,1,2 ; @check_state.deactivated
.zerofill __DATA,__bss,_check_state.slept,1,2 ; @check_state.slept
	.comm	_state,4,2                      ; @state
	.comm	_fade_interval,4,2              ; @fade_interval
	.comm	_INACTIVE_DELAY,4,2             ; @INACTIVE_DELAY
	.comm	_SLEEP_DELAY,4,2                ; @SLEEP_DELAY
.subsections_via_symbols
