	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_led_matrix_task                ## -- Begin function led_matrix_task
	.p2align	4, 0x90
_led_matrix_task:                       ## @led_matrix_task
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_led_matrix_config@GOTPCREL(%rip), %r15
	cmpl	$0, 4(%r15)
	je	LBB0_20
## %bb.1:
	movq	_g_tick@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	_g_any_key_hit@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	cmpl	$-1, %eax
	je	LBB0_3
## %bb.2:
	incl	%eax
	movl	%eax, (%rcx)
LBB0_3:
	movq	_LED_DRIVER_LED_COUNT@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	testl	%ecx, %ecx
	jle	LBB0_10
## %bb.4:
	movq	_g_key_hit@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	xorl	%ebx, %ebx
	movq	_g_last_led_count@GOTPCREL(%rip), %r14
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	incl	(%rax,%rbx,4)
	movl	(%r13), %ecx
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	movslq	%ecx, %rdx
	cmpq	%rdx, %rbx
	jge	LBB0_10
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$254, (%rax,%rbx,4)
	jg	LBB0_9
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r14), %rdi
	decq	%rdi
	xorl	%esi, %esi
	callq	_MAX
	movq	%rax, (%r14)
	movq	(%r12), %rax
	jmp	LBB0_8
LBB0_10:
	movq	_g_suspend_state@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.11:
	movq	_LED_DISABLE_WHEN_USB_SUSPENDED@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_13
## %bb.12:
	xorl	%eax, %eax
	callq	_led_matrix_custom
	jmp	LBB0_19
LBB0_20:
	xorl	%eax, %eax
	callq	_led_matrix_all_off
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_led_matrix_indicators          ## TAILCALL
LBB0_13:
	movq	_LED_DISABLE_AFTER_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, %eax
	setg	%cl
	imull	$1200, %eax, %eax               ## imm = 0x4B0
	movq	_g_any_key_hit@GOTPCREL(%rip), %rdx
	cmpl	%eax, (%rdx)
	setg	%bl
	andb	%cl, %bl
	cmpb	$1, %bl
	je	LBB0_15
## %bb.14:
	cmpl	$128, (%r15)
	jne	LBB0_15
## %bb.16:
	xorl	%eax, %eax
	callq	_led_matrix_uniform_brightness
	testb	%bl, %bl
	je	LBB0_18
	jmp	LBB0_19
LBB0_15:
	xorl	%eax, %eax
	callq	_led_matrix_custom
	testb	%bl, %bl
	jne	LBB0_19
LBB0_18:
	xorl	%eax, %eax
	callq	_led_matrix_indicators
LBB0_19:
	movq	_led_matrix_driver@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*(%rcx)                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_led_matrix_config,8,2          ## @led_matrix_config
	.comm	_g_tick,4,2                     ## @g_tick
	.comm	_g_any_key_hit,4,2              ## @g_any_key_hit
	.comm	_LED_DRIVER_LED_COUNT,4,2       ## @LED_DRIVER_LED_COUNT
	.comm	_g_key_hit,8,3                  ## @g_key_hit
	.comm	_g_last_led_count,8,3           ## @g_last_led_count
	.comm	_g_suspend_state,8,3            ## @g_suspend_state
	.comm	_LED_DISABLE_WHEN_USB_SUSPENDED,8,3 ## @LED_DISABLE_WHEN_USB_SUSPENDED
	.comm	_LED_DISABLE_AFTER_TIMEOUT,4,2  ## @LED_DISABLE_AFTER_TIMEOUT
	.comm	_led_matrix_driver,8,3          ## @led_matrix_driver
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_led_matrix_task                ; -- Begin function led_matrix_task
	.p2align	2
_led_matrix_task:                       ; @led_matrix_task
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
Lloh0:
	adrp	x19, _led_matrix_config@GOTPAGE
Lloh1:
	ldr	x19, [x19, _led_matrix_config@GOTPAGEOFF]
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_14
; %bb.1:
Lloh2:
	adrp	x8, _g_tick@GOTPAGE
Lloh3:
	ldr	x8, [x8, _g_tick@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh4:
	adrp	x20, _g_any_key_hit@GOTPAGE
Lloh5:
	ldr	x20, [x20, _g_any_key_hit@GOTPAGEOFF]
	ldr	w8, [x20]
	cmn	w8, #1
	b.eq	LBB0_3
; %bb.2:
	add	w8, w8, #1
	str	w8, [x20]
LBB0_3:
Lloh6:
	adrp	x21, _LED_DRIVER_LED_COUNT@GOTPAGE
Lloh7:
	ldr	x21, [x21, _LED_DRIVER_LED_COUNT@GOTPAGEOFF]
	ldr	w9, [x21]
	cmp	w9, #1
	b.lt	LBB0_10
; %bb.4:
	mov	x22, #0
Lloh8:
	adrp	x23, _g_key_hit@GOTPAGE
Lloh9:
	ldr	x23, [x23, _g_key_hit@GOTPAGEOFF]
	ldr	x8, [x23]
Lloh10:
	adrp	x24, _g_last_led_count@GOTPAGE
Lloh11:
	ldr	x24, [x24, _g_last_led_count@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	lsl	x9, x22, #2
	ldr	w10, [x8, x9]
	add	w10, w10, #1
	str	w10, [x8, x9]
	ldr	w9, [x21]
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x22, x22, #1
	cmp	x22, w9, sxtw
	b.ge	LBB0_10
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x8, x22, lsl #2]
	cmp	w10, #254
	b.gt	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	b.ne	LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x8, [x24]
	sub	x0, x8, #1
	mov	w1, #0
	bl	_MAX
	str	x0, [x24]
	ldr	x8, [x23]
	b	LBB0_5
LBB0_10:
Lloh12:
	adrp	x8, _g_suspend_state@GOTPAGE
Lloh13:
	ldr	x8, [x8, _g_suspend_state@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _LED_DISABLE_WHEN_USB_SUSPENDED@GOTPAGE
Lloh16:
	ldr	x9, [x9, _LED_DISABLE_WHEN_USB_SUSPENDED@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x8, #0
	ccmp	x9, #0, #4, ne
	b.ne	LBB0_15
; %bb.11:
Lloh18:
	adrp	x8, _LED_DISABLE_AFTER_TIMEOUT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _LED_DISABLE_AFTER_TIMEOUT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w8, #0
	ldr	w9, [x20]
	mov	w10, #1200
	mul	w8, w8, w10
	ccmp	w9, w8, #4, gt
	cset	w20, gt
	cmp	w20, #1
	b.eq	LBB0_16
; %bb.12:
	ldr	w8, [x19]
	cmp	w8, #128
	b.ne	LBB0_16
; %bb.13:
	bl	_led_matrix_uniform_brightness
	tbz	w20, #0, LBB0_17
	b	LBB0_18
LBB0_14:
	bl	_led_matrix_all_off
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_led_matrix_indicators
LBB0_15:
	bl	_led_matrix_custom
	b	LBB0_18
LBB0_16:
	bl	_led_matrix_custom
	tbnz	w20, #0, LBB0_18
LBB0_17:
	bl	_led_matrix_indicators
LBB0_18:
Lloh21:
	adrp	x8, _led_matrix_driver@GOTPAGE
Lloh22:
	ldr	x8, [x8, _led_matrix_driver@GOTPAGEOFF]
Lloh23:
	ldr	x0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	br	x0
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_led_matrix_config,8,2          ; @led_matrix_config
	.comm	_g_tick,4,2                     ; @g_tick
	.comm	_g_any_key_hit,4,2              ; @g_any_key_hit
	.comm	_LED_DRIVER_LED_COUNT,4,2       ; @LED_DRIVER_LED_COUNT
	.comm	_g_key_hit,8,3                  ; @g_key_hit
	.comm	_g_last_led_count,8,3           ; @g_last_led_count
	.comm	_g_suspend_state,8,3            ; @g_suspend_state
	.comm	_LED_DISABLE_WHEN_USB_SUSPENDED,8,3 ; @LED_DISABLE_WHEN_USB_SUSPENDED
	.comm	_LED_DISABLE_AFTER_TIMEOUT,4,2  ; @LED_DISABLE_AFTER_TIMEOUT
	.comm	_led_matrix_driver,8,3          ; @led_matrix_driver
.subsections_via_symbols
