	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function breathing_callback
_breathing_callback:                    ## @breathing_callback
	.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	_breathing_period@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	shll	$8, %ecx
	movq	_BREATHING_STEPS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ecx, %eax
	cltd
	idivl	%edi
	movl	%eax, %esi
	movq	_breathing_counter@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	incl	%eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	movl	%edx, (%rbx)
	cltd
	idivl	%esi
	cltd
	idivl	%edi
	movl	%edx, %ebx
	movq	_breathing_halt@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_BREATHING_HALT_ON@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movl	%edi, %ecx
	shrl	$31, %ecx
	addl	%edi, %ecx
	sarl	%ecx
	cmpl	%ecx, %ebx
	je	LBB0_4
LBB0_2:
	movq	_BREATHING_HALT_OFF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.3:
	decl	%edi
	cmpl	%edi, %ebx
	jne	LBB0_5
LBB0_4:
	xorl	%eax, %eax
	callq	_breathing_interrupt_disable
LBB0_5:
	movq	_breathing_table@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %rcx
	movl	(%rax,%rcx,4), %edi
	shll	$8, %edi
	callq	_scale_backlight
	movl	%eax, %edi
	callq	_cie_lightness
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_chSysLockFromISR
	movq	_PWMD3@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	movl	$65535, %esi                    ## imm = 0xFFFF
	movl	%ebx, %edx
	callq	_PWM_FRACTION_TO_WIDTH
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	%eax, %edx
	callq	_pwmEnableChannelI
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_chSysUnlockFromISR             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_breathing_period,4,2           ## @breathing_period
	.comm	_BREATHING_STEPS,4,2            ## @BREATHING_STEPS
	.comm	_breathing_counter,4,2          ## @breathing_counter
	.comm	_breathing_halt,8,3             ## @breathing_halt
	.comm	_BREATHING_HALT_ON,8,3          ## @BREATHING_HALT_ON
	.comm	_BREATHING_HALT_OFF,8,3         ## @BREATHING_HALT_OFF
	.comm	_breathing_table,8,3            ## @breathing_table
	.comm	_PWMD3,4,2                      ## @PWMD3
	.no_dead_strip	_breathing_callback
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function breathing_callback
_breathing_callback:                    ; @breathing_callback
	.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, _breathing_period@GOTPAGE
Lloh1:
	ldr	x8, [x8, _breathing_period@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w9, w8, #8
Lloh3:
	adrp	x8, _BREATHING_STEPS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BREATHING_STEPS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x10, _breathing_counter@GOTPAGE
Lloh7:
	ldr	x10, [x10, _breathing_counter@GOTPAGEOFF]
	sdiv	w11, w9, w8
	ldr	w12, [x10]
	add	w12, w12, #1
	sdiv	w13, w12, w9
	msub	w9, w13, w9, w12
	str	w9, [x10]
	sdiv	w9, w9, w11
	sdiv	w10, w9, w8
	msub	w19, w10, w8, w9
Lloh8:
	adrp	x9, _breathing_halt@GOTPAGE
Lloh9:
	ldr	x9, [x9, _breathing_halt@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
Lloh11:
	adrp	x10, _BREATHING_HALT_ON@GOTPAGE
Lloh12:
	ldr	x10, [x10, _BREATHING_HALT_ON@GOTPAGEOFF]
Lloh13:
	ldr	x11, [x10]
	cmp	w8, #0
	cinc	w10, w8, lt
	cmp	x9, x11
	b.ne	LBB0_2
; %bb.1:
	asr	w10, w10, #1
	cmp	w19, w10
	b.eq	LBB0_4
LBB0_2:
Lloh14:
	adrp	x10, _BREATHING_HALT_OFF@GOTPAGE
Lloh15:
	ldr	x10, [x10, _BREATHING_HALT_OFF@GOTPAGEOFF]
Lloh16:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_5
; %bb.3:
	sub	w8, w8, #1
	cmp	w19, w8
	b.ne	LBB0_5
LBB0_4:
	bl	_breathing_interrupt_disable
LBB0_5:
Lloh17:
	adrp	x8, _breathing_table@GOTPAGE
Lloh18:
	ldr	x8, [x8, _breathing_table@GOTPAGEOFF]
Lloh19:
	ldr	x8, [x8]
	ldr	w8, [x8, w19, sxtw #2]
	lsl	w0, w8, #8
	bl	_scale_backlight
	bl	_cie_lightness
	mov	x19, x0
	bl	_chSysLockFromISR
Lloh20:
	adrp	x20, _PWMD3@GOTPAGE
Lloh21:
	ldr	x20, [x20, _PWMD3@GOTPAGEOFF]
	mov	x0, x20
	mov	w1, #65535
	mov	x2, x19
	bl	_PWM_FRACTION_TO_WIDTH
	mov	x2, x0
	mov	x0, x20
	mov	w1, #0
	bl	_pwmEnableChannelI
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_chSysUnlockFromISR
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_breathing_period,4,2           ; @breathing_period
	.comm	_BREATHING_STEPS,4,2            ; @BREATHING_STEPS
	.comm	_breathing_counter,4,2          ; @breathing_counter
	.comm	_breathing_halt,8,3             ; @breathing_halt
	.comm	_BREATHING_HALT_ON,8,3          ; @BREATHING_HALT_ON
	.comm	_BREATHING_HALT_OFF,8,3         ; @BREATHING_HALT_OFF
	.comm	_breathing_table,8,3            ; @breathing_table
	.comm	_PWMD3,4,2                      ; @PWMD3
	.no_dead_strip	_breathing_callback
.subsections_via_symbols
