	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_backlight_set                  ## -- Begin function backlight_set
	.p2align	4, 0x90
_backlight_set:                         ## @backlight_set
	.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
	movl	%edi, %ebx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_printf
	movl	%ebx, %eax
	shll	$16, %eax
	subl	%ebx, %eax
	movq	_BACKLIGHT_LEVELS@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, %edi
	callq	_cie_lightness
	movq	%rax, %r14
	leaq	L_.str.1(%rip), %rdi
	movl	%r14d, %esi
	callq	_printf
	testl	%ebx, %ebx
	je	LBB0_3
## %bb.1:
	xorl	%eax, %eax
	callq	_is_breathing
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_3:
	movq	_PWMD3@GOTPCREL(%rip), %rdi
	xorl	%esi, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_pwmDisableChannel              ## TAILCALL
LBB0_4:
	movq	_PWMD3@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	movl	$65535, %esi                    ## imm = 0xFFFF
	movl	%r14d, %edx
	callq	_PWM_FRACTION_TO_WIDTH
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%eax, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_pwmEnableChannel               ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"backlight_set(%d)\n"

	.comm	_BACKLIGHT_LEVELS,4,2           ## @BACKLIGHT_LEVELS
L_.str.1:                               ## @.str.1
	.asciz	"duty: (%d)\n"

	.comm	_PWMD3,4,2                      ## @PWMD3
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_backlight_set                  ; -- Begin function backlight_set
	.p2align	2
_backlight_set:                         ; @backlight_set
	.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
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_printf
	lsl	w8, w20, #16
	sub	w8, w8, w20
Lloh2:
	adrp	x9, _BACKLIGHT_LEVELS@GOTPAGE
Lloh3:
	ldr	x9, [x9, _BACKLIGHT_LEVELS@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	sdiv	w0, w8, w9
	bl	_cie_lightness
	mov	x19, x0
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x19
	bl	_printf
	cbz	w20, LBB0_3
; %bb.1:
	bl	_is_breathing
	cbz	w0, LBB0_4
; %bb.2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
Lloh7:
	adrp	x0, _PWMD3@GOTPAGE
Lloh8:
	ldr	x0, [x0, _PWMD3@GOTPAGEOFF]
	mov	w1, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_pwmDisableChannel
LBB0_4:
Lloh9:
	adrp	x20, _PWMD3@GOTPAGE
Lloh10:
	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
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_pwmEnableChannel
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"backlight_set(%d)\n"

	.comm	_BACKLIGHT_LEVELS,4,2           ; @BACKLIGHT_LEVELS
l_.str.1:                               ; @.str.1
	.asciz	"duty: (%d)\n"

	.comm	_PWMD3,4,2                      ; @PWMD3
.subsections_via_symbols
