	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rainbow_loop                   ## -- Begin function rainbow_loop
	.p2align	4, 0x90
_rainbow_loop:                          ## @rainbow_loop
	.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	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	_rainbow_loop.last_timer(%rip), %edi
	callq	_timer_elapsed
	xorl	%r12d, %r12d
	cmpl	$8, %eax
	jl	LBB0_15
## %bb.1:
	cmpl	$360, _rainbow_loop.i(%rip)     ## imm = 0x168
	jl	LBB0_3
## %bb.2:
	movl	$0, _rainbow_loop.i(%rip)
LBB0_3:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_timer_read
	movl	%eax, _rainbow_loop.last_timer(%rip)
	movq	__LIGHTS@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movslq	_rainbow_loop.i(%rip), %rax
	leal	120(%rax), %edx
	movslq	%edx, %rdx
	imulq	$-1240768329, %rdx, %rdx        ## imm = 0xB60B60B7
	shrq	$32, %rdx
	addl	%eax, %edx
	addl	$120, %edx
	movl	%edx, %esi
	shrl	$31, %esi
	sarl	$8, %edx
	addl	%esi, %edx
	imull	$360, %edx, %edx                ## imm = 0x168
	negl	%edx
	addl	%eax, %edx
	addl	$120, %edx
	movslq	%edx, %rdx
	movq	(%rcx,%rdx,8), %rdx
	movq	%rdx, _rainbow_loop.r(%rip)
	movq	(%rcx,%rax,8), %rdx
	movq	%rdx, _rainbow_loop.g(%rip)
	leal	240(%rax), %edx
	movslq	%edx, %rdx
	imulq	$-1240768329, %rdx, %rdx        ## imm = 0xB60B60B7
	shrq	$32, %rdx
	addl	%eax, %edx
	addl	$240, %edx
	movl	%edx, %esi
	shrl	$31, %esi
	sarl	$8, %edx
	addl	%esi, %edx
	imull	$360, %edx, %edx                ## imm = 0x168
	negl	%edx
	addl	%eax, %edx
	addl	$240, %edx
	movslq	%edx, %rdx
	movq	(%rcx,%rdx,8), %rcx
	movq	%rcx, _rainbow_loop.b(%rip)
	incl	%eax
	movl	%eax, _rainbow_loop.i(%rip)
	movq	_RBW@GOTPCREL(%rip), %r15
	cmpq	$0, (%r15)
	je	LBB0_15
## %bb.4:
	xorl	%ebx, %ebx
	movq	_rbw_led_keys@GOTPCREL(%rip), %r13
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	_rainbow_loop.r(%rip), %rdi
	movq	_rainbow_loop.g(%rip), %rsi
	movq	_rainbow_loop.b(%rip), %rdx
	movq	_led_dim@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_SET_LED_RGB
	movl	$1, %r12d
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%r14
	addq	$16, %rbx
	cmpq	(%r15), %r14
	jae	LBB0_15
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rax
	movq	(%rax,%rbx), %r8
	movl	8(%rax,%rbx), %ecx
	cmpl	$129, %ecx
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$128, %ecx
	jne	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_active_key_pos@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$0, (%rcx,%r8,4)
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, 12(%rax,%rbx)
	jne	LBB0_9
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_active_key_pos@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpl	$0, (%rcx,%r8,4)
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	cmpl	$0, 12(%rax,%rbx)
	je	LBB0_13
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	__LC@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rax,%rcx,8), %rax
	movq	(%rax), %rdi
	movq	8(%rax), %rsi
	movq	16(%rax), %rdx
	movq	_led_dim@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_SET_LED_RGB
	movq	(%r13), %rax
	movl	$1, %r12d
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_DEFAULT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 8(%rax,%rbx)
	jmp	LBB0_14
LBB0_15:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_rainbow_loop.last_timer,4,2 ## @rainbow_loop.last_timer
.zerofill __DATA,__bss,_rainbow_loop.i,4,2 ## @rainbow_loop.i
.zerofill __DATA,__bss,_rainbow_loop.r,8,3 ## @rainbow_loop.r
.zerofill __DATA,__bss,_rainbow_loop.g,8,3 ## @rainbow_loop.g
.zerofill __DATA,__bss,_rainbow_loop.b,8,3 ## @rainbow_loop.b
	.comm	__LIGHTS,8,3                    ## @_LIGHTS
	.comm	_RBW,8,3                        ## @RBW
	.comm	_rbw_led_keys,8,3               ## @rbw_led_keys
	.comm	_active_key_pos,8,3             ## @active_key_pos
	.comm	_led_dim,4,2                    ## @led_dim
	.comm	__LC,8,3                        ## @_LC
	.comm	_DEFAULT,4,2                    ## @DEFAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_rainbow_loop                   ; -- Begin function rainbow_loop
	.p2align	2
_rainbow_loop:                          ; @rainbow_loop
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	adrp	x21, _rainbow_loop.last_timer@PAGE
	ldr	w0, [x21, _rainbow_loop.last_timer@PAGEOFF]
	bl	_timer_elapsed
	cmp	w0, #8
	b.lt	LBB0_15
; %bb.1:
	adrp	x20, _rainbow_loop.i@PAGE
	ldr	w8, [x20, _rainbow_loop.i@PAGEOFF]
	cmp	w8, #360
	b.lt	LBB0_3
; %bb.2:
	str	wzr, [x20, _rainbow_loop.i@PAGEOFF]
LBB0_3:
	bl	_timer_read
Lloh0:
	adrp	x8, __LIGHTS@GOTPAGE
Lloh1:
	ldr	x8, [x8, __LIGHTS@GOTPAGEOFF]
	str	w0, [x21, _rainbow_loop.last_timer@PAGEOFF]
Lloh2:
	ldr	x8, [x8]
	ldrsw	x9, [x20, _rainbow_loop.i@PAGEOFF]
	add	w10, w9, #120
	mov	w11, #24759
	movk	w11, #46603, lsl #16
	smull	x12, w10, w11
	lsr	x12, x12, #32
	add	w12, w12, w10
	asr	w13, w12, #8
	add	w12, w13, w12, lsr #31
	mov	w13, #360
	msub	w10, w12, w13, w10
	ldr	x10, [x8, w10, sxtw #3]
	adrp	x12, _rainbow_loop.r@PAGE
	str	x10, [x12, _rainbow_loop.r@PAGEOFF]
	ldr	x10, [x8, x9, lsl #3]
	adrp	x21, _rainbow_loop.g@PAGE
	str	x10, [x21, _rainbow_loop.g@PAGEOFF]
	add	w10, w9, #240
	smull	x11, w10, w11
	lsr	x11, x11, #32
	add	w11, w11, w10
	asr	w12, w11, #8
	add	w11, w12, w11, lsr #31
	msub	w10, w11, w13, w10
	ldr	x8, [x8, w10, sxtw #3]
	adrp	x22, _rainbow_loop.b@PAGE
	str	x8, [x22, _rainbow_loop.b@PAGEOFF]
	add	w8, w9, #1
	str	w8, [x20, _rainbow_loop.i@PAGEOFF]
Lloh3:
	adrp	x23, _RBW@GOTPAGE
Lloh4:
	ldr	x23, [x23, _RBW@GOTPAGEOFF]
	ldr	x8, [x23]
	cbz	x8, LBB0_15
; %bb.4:
	mov	x24, #0
	mov	x25, #0
	mov	w0, #0
Lloh5:
	adrp	x26, _rbw_led_keys@GOTPAGE
Lloh6:
	ldr	x26, [x26, _rbw_led_keys@GOTPAGEOFF]
Lloh7:
	adrp	x27, _active_key_pos@GOTPAGE
Lloh8:
	ldr	x27, [x27, _active_key_pos@GOTPAGEOFF]
Lloh9:
	adrp	x28, _led_dim@GOTPAGE
Lloh10:
	ldr	x28, [x28, _led_dim@GOTPAGEOFF]
Lloh11:
	adrp	x20, _DEFAULT@GOTPAGE
Lloh12:
	ldr	x20, [x20, _DEFAULT@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
Lloh13:
	adrp	x8, _rainbow_loop.r@PAGE
Lloh14:
	ldr	x0, [x8, _rainbow_loop.r@PAGEOFF]
	ldr	x1, [x21, _rainbow_loop.g@PAGEOFF]
	ldr	x2, [x22, _rainbow_loop.b@PAGEOFF]
	ldr	w3, [x28]
	bl	_SET_LED_RGB
	mov	w0, #1
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x25, x25, #1
	ldr	x8, [x23]
	add	x24, x24, #16
	cmp	x25, x8
	b.hs	LBB0_16
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	add	x9, x8, x24
	ldr	x4, [x9]
	ldr	w9, [x9, #8]
	cmp	w9, #129
	b.eq	LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	cmp	w9, #128
	b.ne	LBB0_6
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x9, [x27]
	ldr	w9, [x9, x4, lsl #2]
	cbz	w9, LBB0_5
; %bb.10:                               ;   in Loop: Header=BB0_7 Depth=1
	add	x8, x8, x24
	ldr	w8, [x8, #12]
	cbnz	w8, LBB0_5
	b	LBB0_6
LBB0_11:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	x9, [x27]
	ldr	w9, [x9, x4, lsl #2]
	cbz	w9, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_7 Depth=1
	add	x9, x8, x24
	ldr	w9, [x9, #12]
	cbz	w9, LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_7 Depth=1
Lloh15:
	adrp	x8, __LC@GOTPAGE
Lloh16:
	ldr	x8, [x8, __LC@GOTPAGEOFF]
Lloh17:
	ldr	x8, [x8]
	ldr	x8, [x8, x19, lsl #3]
	ldp	x0, x1, [x8]
	ldr	x2, [x8, #16]
	ldr	w3, [x28]
	bl	_SET_LED_RGB
	ldr	x8, [x26]
	mov	w0, #1
LBB0_14:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w9, [x20]
	add	x8, x8, x24
	str	w9, [x8, #8]
	b	LBB0_6
LBB0_15:
	mov	w0, #0
LBB0_16:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdr	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_rainbow_loop.last_timer,4,2 ; @rainbow_loop.last_timer
.zerofill __DATA,__bss,_rainbow_loop.i,4,2 ; @rainbow_loop.i
.zerofill __DATA,__bss,_rainbow_loop.r,8,3 ; @rainbow_loop.r
.zerofill __DATA,__bss,_rainbow_loop.g,8,3 ; @rainbow_loop.g
.zerofill __DATA,__bss,_rainbow_loop.b,8,3 ; @rainbow_loop.b
	.comm	__LIGHTS,8,3                    ; @_LIGHTS
	.comm	_RBW,8,3                        ; @RBW
	.comm	_rbw_led_keys,8,3               ; @rbw_led_keys
	.comm	_active_key_pos,8,3             ; @active_key_pos
	.comm	_led_dim,4,2                    ; @led_dim
	.comm	__LC,8,3                        ; @_LC
	.comm	_DEFAULT,4,2                    ; @DEFAULT
.subsections_via_symbols
