	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_update_underglow_level         ## -- Begin function update_underglow_level
	.p2align	4, 0x90
_update_underglow_level:                ## @update_underglow_level
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorl	%eax, %eax
	callq	_get_mods
	movq	_last_mods@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %eax
	je	LBB0_19
## %bb.1:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_get_mods
	movl	%eax, (%rbx)
	xorl	%eax, %eax
	callq	_get_mods
	testl	%eax, %eax
	je	LBB0_2
## %bb.4:
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	xorl	%edi, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_rgblight_setrgb
	xorl	%eax, %eax
	callq	_get_mods
	movl	%eax, %ebx
	movq	_KC_LSFT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MOD_BIT
	testl	%ebx, %eax
	je	LBB0_6
## %bb.5:
	movl	$16711680, -64(%rbp)            ## imm = 0xFF0000
	movl	$1, %r14d
LBB0_6:
	xorl	%eax, %eax
	callq	_get_mods
	movl	%eax, %ebx
	movq	_KC_LCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MOD_BIT
	testl	%ebx, %eax
	je	LBB0_8
## %bb.7:
	movl	%r14d, %eax
	incl	%r14d
	movl	$65280, -64(%rbp,%rax,4)        ## imm = 0xFF00
LBB0_8:
	xorl	%eax, %eax
	callq	_get_mods
	movl	%eax, %ebx
	movq	_KC_LALT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MOD_BIT
	testl	%ebx, %eax
	je	LBB0_10
## %bb.9:
	movl	%r14d, %eax
	incl	%r14d
	movl	$255, -64(%rbp,%rax,4)
LBB0_10:
	xorl	%eax, %eax
	callq	_get_mods
	movl	%eax, %ebx
	movq	_KC_LGUI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_MOD_BIT
	testl	%ebx, %eax
	je	LBB0_12
## %bb.11:
	movl	%r14d, %eax
	incl	%r14d
	movl	$16776960, -64(%rbp,%rax,4)     ## imm = 0xFFFF00
	jmp	LBB0_13
LBB0_2:
	movq	_rgb_dimming@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$16, %edi
	shrl	%cl, %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.3:
	movl	%edi, %esi
	movl	%edi, %edx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_rgblight_setrgb                ## TAILCALL
LBB0_12:
	testl	%r14d, %r14d
	je	LBB0_18
LBB0_13:
	movl	%r14d, %r15d
	movq	_RGBLED_NUM@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_15 Depth=1
	cmpq	%r15, %r13
	je	LBB0_18
LBB0_15:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_17 Depth 2
	movq	%r13, %rsi
	incq	%r13
	movl	%ecx, %eax
	imull	%r13d, %eax
	cltd
	idivl	%r15d
	cmpl	%eax, %ebx
	jge	LBB0_14
## %bb.16:                              ##   in Loop: Header=BB0_15 Depth=1
	movl	-64(%rbp,%rsi,4), %r14d
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_15 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r14d, %edi
	movl	%ebx, %esi
	callq	_SET_LED_RGB
	incl	%ebx
	movl	(%r12), %ecx
	movl	%ecx, %eax
	imull	%r13d, %eax
	cltd
	idivl	%r15d
	cmpl	%eax, %ebx
	jl	LBB0_17
	jmp	LBB0_14
LBB0_18:
	xorl	%eax, %eax
	callq	_rgblight_set
LBB0_19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.20:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_last_mods,4,2                  ## @last_mods
	.comm	_rgb_dimming,4,2                ## @rgb_dimming
	.comm	_KC_LSFT,4,2                    ## @KC_LSFT
	.comm	_KC_LCTL,4,2                    ## @KC_LCTL
	.comm	_KC_LALT,4,2                    ## @KC_LALT
	.comm	_KC_LGUI,4,2                    ## @KC_LGUI
	.comm	_RGBLED_NUM,4,2                 ## @RGBLED_NUM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_update_underglow_level         ; -- Begin function update_underglow_level
	.p2align	2
_update_underglow_level:                ; @update_underglow_level
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_get_mods
Lloh3:
	adrp	x19, _last_mods@GOTPAGE
Lloh4:
	ldr	x19, [x19, _last_mods@GOTPAGEOFF]
	ldr	w8, [x19]
	cmp	w0, w8
	b.eq	LBB0_20
; %bb.1:
	bl	_get_mods
	str	w0, [x19]
	bl	_get_mods
	cbz	w0, LBB0_4
; %bb.2:
	stp	xzr, xzr, [sp, #8]
	mov	w0, #0
	mov	w1, #0
	mov	w2, #0
	bl	_rgblight_setrgb
	bl	_get_mods
	mov	x19, x0
Lloh5:
	adrp	x8, _KC_LSFT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _KC_LSFT@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_MOD_BIT
	tst	w0, w19
	b.eq	LBB0_6
; %bb.3:
	mov	w8, #16711680
	str	w8, [sp, #8]
	mov	w20, #1
	b	LBB0_7
LBB0_4:
Lloh8:
	adrp	x8, _rgb_dimming@GOTPAGE
Lloh9:
	ldr	x8, [x8, _rgb_dimming@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	x9, [sp, #24]
Lloh11:
	adrp	x10, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x10, [x10, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
	cmp	x10, x9
	b.ne	LBB0_22
; %bb.5:
	mov	w9, #16
	lsr	w0, w9, w8
	mov	x1, x0
	mov	x2, x0
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	b	_rgblight_setrgb
LBB0_6:
	mov	w20, #0
LBB0_7:
	bl	_get_mods
	mov	x19, x0
Lloh14:
	adrp	x8, _KC_LCTL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _KC_LCTL@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_MOD_BIT
	tst	w0, w19
	b.eq	LBB0_9
; %bb.8:
	mov	w8, w20
	add	w20, w20, #1
	add	x9, sp, #8
	bfi	x9, x8, #2, #1
	mov	w8, #65280
	str	w8, [x9]
LBB0_9:
	bl	_get_mods
	mov	x19, x0
Lloh17:
	adrp	x8, _KC_LALT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _KC_LALT@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_MOD_BIT
	tst	w0, w19
	b.eq	LBB0_11
; %bb.10:
	add	x8, sp, #8
	mov	w9, #255
	str	w9, [x8, w20, uxtw #2]
	add	w20, w20, #1
LBB0_11:
	bl	_get_mods
	mov	x19, x0
Lloh20:
	adrp	x8, _KC_LGUI@GOTPAGE
Lloh21:
	ldr	x8, [x8, _KC_LGUI@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_MOD_BIT
	tst	w0, w19
	b.eq	LBB0_13
; %bb.12:
	add	x8, sp, #8
	mov	w9, #16776960
	str	w9, [x8, w20, uxtw #2]
	add	w20, w20, #1
	b	LBB0_14
LBB0_13:
	cbz	w20, LBB0_19
LBB0_14:
	mov	x9, #0
	mov	w19, #0
	mov	w21, w20
Lloh23:
	adrp	x22, _RGBLED_NUM@GOTPAGE
Lloh24:
	ldr	x22, [x22, _RGBLED_NUM@GOTPAGEOFF]
	ldr	w8, [x22]
	add	x23, sp, #8
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x9, x24
	cmp	x24, x21
	b.eq	LBB0_19
LBB0_16:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	add	x24, x9, #1
	mul	w10, w8, w24
	sdiv	w10, w10, w21
	cmp	w19, w10
	b.ge	LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	ldr	w20, [x23, x9, lsl #2]
LBB0_18:                                ;   Parent Loop BB0_16 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x0, x20
	mov	x1, x19
	bl	_SET_LED_RGB
	add	w19, w19, #1
	ldr	w8, [x22]
	mul	w9, w8, w24
	sdiv	w9, w9, w21
	cmp	w19, w9
	b.lt	LBB0_18
	b	LBB0_15
LBB0_19:
	bl	_rgblight_set
LBB0_20:
	ldr	x8, [sp, #24]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_last_mods,4,2                  ; @last_mods
	.comm	_rgb_dimming,4,2                ; @rgb_dimming
	.comm	_KC_LSFT,4,2                    ; @KC_LSFT
	.comm	_KC_LCTL,4,2                    ; @KC_LCTL
	.comm	_KC_LALT,4,2                    ; @KC_LALT
	.comm	_KC_LGUI,4,2                    ; @KC_LGUI
	.comm	_RGBLED_NUM,4,2                 ; @RGBLED_NUM
.subsections_via_symbols
