	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_scan_kb                 ## -- Begin function matrix_scan_kb
	.p2align	4, 0x90
_matrix_scan_kb:                        ## @matrix_scan_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_layer_state@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	cmpl	%ecx, _matrix_scan_kb.layer_indicator(%rip)
	je	LBB0_5
## %bb.1:
	movq	_layer_info@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	4(%rax), %rsi
	movq	$-1, %rdx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	-4(%rsi), %edi
	incq	%rdx
	cmpl	$-1, %edi
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%rsi), %ebx
	andl	%ecx, %ebx
	addq	$20, %rsi
	cmpl	%ebx, %edi
	jne	LBB0_2
LBB0_4:
	movl	%edx, %ecx
	leaq	(%rcx,%rcx,4), %rdx
	movl	16(%rax,%rdx,4), %esi
	movl	8(%rax,%rdx,4), %ecx
	movl	12(%rax,%rdx,4), %edx
	movl	$32, %edi
	callq	_set_rgb
	movl	(%r14), %eax
	movl	%eax, _matrix_scan_kb.layer_indicator(%rip)
LBB0_5:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_matrix_scan_user               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__DATA,__data
	.p2align	2                               ## @matrix_scan_kb.layer_indicator
_matrix_scan_kb.layer_indicator:
	.long	4294967295                      ## 0xffffffff

	.comm	_layer_state,4,2                ## @layer_state
	.comm	_layer_info,8,3                 ## @layer_info
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_matrix_scan_kb                 ; -- Begin function matrix_scan_kb
	.p2align	2
_matrix_scan_kb:                        ; @matrix_scan_kb
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	adrp	x19, _matrix_scan_kb.layer_indicator@PAGE
	ldr	w9, [x19, _matrix_scan_kb.layer_indicator@PAGEOFF]
Lloh0:
	adrp	x20, _layer_state@GOTPAGE
Lloh1:
	ldr	x20, [x20, _layer_state@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w9, w8
	b.eq	LBB0_4
; %bb.1:
Lloh2:
	adrp	x9, _layer_info@GOTPAGE
Lloh3:
	ldr	x9, [x9, _layer_info@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	add	x11, x9, #4
	mov	x10, #-1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w12, w13, [x11, #-4]
	and	w13, w13, w8
	add	x10, x10, #1
	add	x11, x11, #20
	cmn	w12, #1
	ccmp	w12, w13, #4, ne
	b.ne	LBB0_2
; %bb.3:
	and	x8, x10, #0xffffffff
	mov	w10, #20
	madd	x8, x8, x10, x9
	ldp	w2, w1, [x8, #12]
	ldr	w3, [x8, #8]
	mov	w0, #32
	bl	_set_rgb
	ldr	w8, [x20]
	str	w8, [x19, _matrix_scan_kb.layer_indicator@PAGEOFF]
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_matrix_scan_user
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__DATA,__data
	.p2align	2                               ; @matrix_scan_kb.layer_indicator
_matrix_scan_kb.layer_indicator:
	.long	4294967295                      ; 0xffffffff

	.comm	_layer_state,4,2                ; @layer_state
	.comm	_layer_info,8,3                 ; @layer_info
.subsections_via_symbols
