	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_led_matrix_init                ## -- Begin function led_matrix_init
	.p2align	4, 0x90
_led_matrix_init:                       ## @led_matrix_init
	.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
	movq	_led_matrix_driver@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	callq	*(%rcx)
	movl	$500, %edi                      ## imm = 0x1F4
	callq	_wait_ms
	movq	_LED_DRIVER_LED_COUNT@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_3
## %bb.1:
	movq	_g_key_hit@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	$255, (%rcx,%rdx,4)
	incq	%rdx
	movslq	(%rax), %rsi
	cmpq	%rsi, %rdx
	jl	LBB0_2
LBB0_3:
	xorl	%eax, %eax
	callq	_eeconfig_is_enabled
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_dprintf
	xorl	%eax, %eax
	callq	_eeconfig_init
	xorl	%eax, %eax
	callq	_eeconfig_update_led_matrix_default
LBB0_5:
	xorl	%eax, %eax
	callq	_eeconfig_read_led_matrix
	movq	_led_matrix_config@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	cmpl	$0, 8(%rbx)
	jne	LBB0_7
## %bb.6:
	leaq	L_.str.1(%rip), %rdi
	callq	_dprintf
	xorl	%eax, %eax
	callq	_eeconfig_update_led_matrix_default
	xorl	%eax, %eax
	callq	_eeconfig_read_led_matrix
	movq	%rax, (%rbx)
LBB0_7:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_eeconfig_debug_led_matrix      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_led_matrix_driver,8,3          ## @led_matrix_driver
	.comm	_LED_DRIVER_LED_COUNT,4,2       ## @LED_DRIVER_LED_COUNT
	.comm	_g_key_hit,8,3                  ## @g_key_hit
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"led_matrix_init_drivers eeconfig is not enabled.\n"

	.comm	_led_matrix_config,16,3         ## @led_matrix_config
L_.str.1:                               ## @.str.1
	.asciz	"led_matrix_init_drivers led_matrix_config.mode = 0. Write default values to EEPROM.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_led_matrix_init                ; -- Begin function led_matrix_init
	.p2align	2
_led_matrix_init:                       ; @led_matrix_init
	.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
Lloh0:
	adrp	x8, _led_matrix_driver@GOTPAGE
Lloh1:
	ldr	x8, [x8, _led_matrix_driver@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	blr	x8
	mov	w0, #500
	bl	_wait_ms
Lloh3:
	adrp	x8, _LED_DRIVER_LED_COUNT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LED_DRIVER_LED_COUNT@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x9, #0
Lloh5:
	adrp	x10, _g_key_hit@GOTPAGE
Lloh6:
	ldr	x10, [x10, _g_key_hit@GOTPAGEOFF]
Lloh7:
	ldr	x10, [x10]
	mov	w11, #255
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	str	w11, [x10, x9, lsl #2]
	add	x9, x9, #1
	ldrsw	x12, [x8]
	cmp	x9, x12
	b.lt	LBB0_2
LBB0_3:
	bl	_eeconfig_is_enabled
	cbnz	w0, LBB0_5
; %bb.4:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintf
	bl	_eeconfig_init
	bl	_eeconfig_update_led_matrix_default
LBB0_5:
	bl	_eeconfig_read_led_matrix
Lloh10:
	adrp	x19, _led_matrix_config@GOTPAGE
Lloh11:
	ldr	x19, [x19, _led_matrix_config@GOTPAGEOFF]
	str	x0, [x19]
	ldr	w8, [x19, #8]
	cbnz	w8, LBB0_7
; %bb.6:
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dprintf
	bl	_eeconfig_update_led_matrix_default
	bl	_eeconfig_read_led_matrix
	str	x0, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_eeconfig_debug_led_matrix
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_led_matrix_driver,8,3          ; @led_matrix_driver
	.comm	_LED_DRIVER_LED_COUNT,4,2       ; @LED_DRIVER_LED_COUNT
	.comm	_g_key_hit,8,3                  ; @g_key_hit
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"led_matrix_init_drivers eeconfig is not enabled.\n"

	.comm	_led_matrix_config,16,3         ; @led_matrix_config
l_.str.1:                               ; @.str.1
	.asciz	"led_matrix_init_drivers led_matrix_config.mode = 0. Write default values to EEPROM.\n"

.subsections_via_symbols
