	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_process_record_kb              ## -- Begin function process_record_kb
	.p2align	4, 0x90
_process_record_kb:                     ## @process_record_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	_queue_for_send@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	cmpl	$130, %edi
	je	LBB0_6
## %bb.1:
	cmpl	$129, %edi
	je	LBB0_11
## %bb.2:
	cmpl	$128, %edi
	jne	LBB0_17
## %bb.3:
	movq	_clock_set_mode@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_16
## %bb.4:
	cmpq	$0, (%rsi)
	je	LBB0_16
## %bb.5:
	movq	_oled_mode@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	incl	%eax
	movq	__NUM_OLED_MODES@GOTPCREL(%rip), %rsi
	cltd
	idivl	(%rsi)
	movl	%edx, (%rcx)
	xorl	%eax, %eax
	callq	_draw_ui
	jmp	LBB0_16
LBB0_6:
	cmpq	$0, (%rsi)
	je	LBB0_16
## %bb.7:
	movq	_clock_set_mode@GOTPCREL(%rip), %rbx
	cmpl	$0, (%rbx)
	je	LBB0_10
## %bb.8:
	xorl	%eax, %eax
	callq	_pre_encoder_mode_change
	movl	$0, (%rbx)
	movq	_previous_encoder_mode@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_encoder_mode@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	jmp	LBB0_9
LBB0_11:
	cmpq	$0, (%rsi)
	je	LBB0_16
## %bb.12:
	xorl	%eax, %eax
	callq	_handle_encoder_press
	movl	%eax, %r14d
	xorl	%eax, %eax
	callq	_timer_read
	testl	%r14d, %r14d
	je	LBB0_16
## %bb.13:
	movl	%eax, %ebx
	movl	%r14d, %edi
	callq	_register_code16
	movq	_MEDIA_KEY_DELAY@GOTPCREL(%rip), %r15
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_timer_elapsed
	cmpl	(%r15), %eax
	jl	LBB0_14
## %bb.15:
	movl	%r14d, %edi
	callq	_unregister_code16
	jmp	LBB0_16
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_process_record_user            ## TAILCALL
LBB0_10:
	movq	_encoder_mode@GOTPCREL(%rip), %r14
	movl	(%r14), %eax
	movq	_previous_encoder_mode@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_pre_encoder_mode_change
	movl	$1, (%rbx)
	movq	_ENC_MODE_CLOCK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_9:
	xorl	%eax, %eax
	callq	_post_encoder_mode_change
LBB0_16:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_queue_for_send,4,2             ## @queue_for_send
	.comm	_clock_set_mode,4,2             ## @clock_set_mode
	.comm	_oled_mode,4,2                  ## @oled_mode
	.comm	__NUM_OLED_MODES,4,2            ## @_NUM_OLED_MODES
	.comm	_previous_encoder_mode,4,2      ## @previous_encoder_mode
	.comm	_encoder_mode,4,2               ## @encoder_mode
	.comm	_ENC_MODE_CLOCK_SET,4,2         ## @ENC_MODE_CLOCK_SET
	.comm	_MEDIA_KEY_DELAY,4,2            ## @MEDIA_KEY_DELAY
	.comm	_MACRO00,4,2                    ## @MACRO00
	.comm	_MACRO15,4,2                    ## @MACRO15
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_process_record_kb              ; -- Begin function process_record_kb
	.p2align	2
_process_record_kb:                     ; @process_record_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, _queue_for_send@GOTPAGE
Lloh1:
	ldr	x8, [x8, _queue_for_send@GOTPAGEOFF]
	mov	w9, #1
Lloh2:
	str	w9, [x8]
	cmp	w0, #130
	b.eq	LBB0_6
; %bb.1:
	cmp	w0, #129
	b.eq	LBB0_9
; %bb.2:
	cmp	w0, #128
	b.ne	LBB0_14
; %bb.3:
Lloh3:
	adrp	x8, _clock_set_mode@GOTPAGE
Lloh4:
	ldr	x8, [x8, _clock_set_mode@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cbnz	w8, LBB0_17
; %bb.4:
	ldr	x8, [x1]
	cbz	x8, LBB0_17
; %bb.5:
Lloh6:
	adrp	x8, _oled_mode@GOTPAGE
Lloh7:
	ldr	x8, [x8, _oled_mode@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
Lloh8:
	adrp	x10, __NUM_OLED_MODES@GOTPAGE
Lloh9:
	ldr	x10, [x10, __NUM_OLED_MODES@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	sdiv	w11, w9, w10
	msub	w9, w11, w10, w9
	str	w9, [x8]
	bl	_draw_ui
	b	LBB0_17
LBB0_6:
	ldr	x8, [x1]
	cbz	x8, LBB0_17
; %bb.7:
Lloh11:
	adrp	x19, _clock_set_mode@GOTPAGE
Lloh12:
	ldr	x19, [x19, _clock_set_mode@GOTPAGEOFF]
	ldr	w8, [x19]
	cbz	w8, LBB0_15
; %bb.8:
	bl	_pre_encoder_mode_change
	str	wzr, [x19]
Lloh13:
	adrp	x8, _previous_encoder_mode@GOTPAGE
Lloh14:
	ldr	x8, [x8, _previous_encoder_mode@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	adrp	x9, _encoder_mode@GOTPAGE
Lloh17:
	ldr	x9, [x9, _encoder_mode@GOTPAGEOFF]
Lloh18:
	str	w8, [x9]
	b	LBB0_16
LBB0_9:
	ldr	x8, [x1]
	cbz	x8, LBB0_17
; %bb.10:
	bl	_handle_encoder_press
	mov	x19, x0
	bl	_timer_read
	cbz	w19, LBB0_17
; %bb.11:
	mov	x20, x0
	mov	x0, x19
	bl	_register_code16
Lloh19:
	adrp	x21, _MEDIA_KEY_DELAY@GOTPAGE
Lloh20:
	ldr	x21, [x21, _MEDIA_KEY_DELAY@GOTPAGEOFF]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_timer_elapsed
	ldr	w8, [x21]
	cmp	w0, w8
	b.lt	LBB0_12
; %bb.13:
	mov	x0, x19
	bl	_unregister_code16
	b	LBB0_17
LBB0_14:
	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	_process_record_user
LBB0_15:
Lloh21:
	adrp	x20, _encoder_mode@GOTPAGE
Lloh22:
	ldr	x20, [x20, _encoder_mode@GOTPAGEOFF]
	ldr	w8, [x20]
Lloh23:
	adrp	x9, _previous_encoder_mode@GOTPAGE
Lloh24:
	ldr	x9, [x9, _previous_encoder_mode@GOTPAGEOFF]
Lloh25:
	str	w8, [x9]
	bl	_pre_encoder_mode_change
	mov	w8, #1
	str	w8, [x19]
Lloh26:
	adrp	x8, _ENC_MODE_CLOCK_SET@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENC_MODE_CLOCK_SET@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x20]
LBB0_16:
	bl	_post_encoder_mode_change
LBB0_17:
	mov	w0, #0
	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 AdrpLdrGotStr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotStr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_queue_for_send,4,2             ; @queue_for_send
	.comm	_clock_set_mode,4,2             ; @clock_set_mode
	.comm	_oled_mode,4,2                  ; @oled_mode
	.comm	__NUM_OLED_MODES,4,2            ; @_NUM_OLED_MODES
	.comm	_previous_encoder_mode,4,2      ; @previous_encoder_mode
	.comm	_encoder_mode,4,2               ; @encoder_mode
	.comm	_ENC_MODE_CLOCK_SET,4,2         ; @ENC_MODE_CLOCK_SET
	.comm	_MEDIA_KEY_DELAY,4,2            ; @MEDIA_KEY_DELAY
	.comm	_MACRO00,4,2                    ; @MACRO00
	.comm	_MACRO15,4,2                    ; @MACRO15
.subsections_via_symbols
