	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function tc35876x_brightness_init
_tc35876x_brightness_init:              ## @tc35876x_brightness_init
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_GPIOPWMCTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	leaq	-28(%rbp), %rsi
	callq	_intel_scu_ipc_ioread8
	movl	-28(%rbp), %edx
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	cmpl	$1, %edx
	je	LBB0_7
LBB0_2:
	movq	(%r14), %rdi
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_5
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_warn
LBB0_5:
	movl	(%rbx), %edi
	movl	$1, %esi
	callq	_intel_scu_ipc_iowrite8
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movq	(%r14), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
LBB0_7:
	movq	_SYSTEMCLK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_PWM_FREQUENCY@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_calc_clkdiv
	movl	%eax, %ebx
	movq	_PWM0CLKDIV1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	%bh, %esi
	callq	_intel_scu_ipc_iowrite8
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movq	_PWM0CLKDIV0@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movzbl	%bl, %esi
	callq	_intel_scu_ipc_iowrite8
	testl	%eax, %eax
	je	LBB0_10
LBB0_9:
	movq	(%r14), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	(%r14), %rdi
	movl	(%r15), %ecx
	leaq	L_.str.4(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_dbg
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_GPIOPWMCTRL,4,2                ## @GPIOPWMCTRL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GPIOPWMCTRL read failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"GPIOPWMCTRL was not set to system clock (pwmctrl = 0x%02x)\n"

L_.str.2:                               ## @.str.2
	.asciz	"GPIOPWMCTRL set failed\n"

	.comm	_SYSTEMCLK,4,2                  ## @SYSTEMCLK
	.comm	_PWM_FREQUENCY,4,2              ## @PWM_FREQUENCY
	.comm	_PWM0CLKDIV1,4,2                ## @PWM0CLKDIV1
	.comm	_PWM0CLKDIV0,4,2                ## @PWM0CLKDIV0
L_.str.3:                               ## @.str.3
	.asciz	"PWM0CLKDIV set failed\n"

L_.str.4:                               ## @.str.4
	.asciz	"PWM0CLKDIV set to 0x%04x (%d Hz)\n"

	.no_dead_strip	_tc35876x_brightness_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function tc35876x_brightness_init
_tc35876x_brightness_init:              ; @tc35876x_brightness_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x0
Lloh0:
	adrp	x20, _GPIOPWMCTRL@GOTPAGE
Lloh1:
	ldr	x20, [x20, _GPIOPWMCTRL@GOTPAGEOFF]
	ldr	w0, [x20]
	add	x1, sp, #12
	bl	_intel_scu_ipc_ioread8
	ldr	w2, [sp, #12]
	cmp	w0, #0
	ccmp	w2, #1, #0, eq
	b.eq	LBB0_6
; %bb.1:
	mov	x8, x0
	ldr	x0, [x19]
	cbz	w8, LBB0_3
; %bb.2:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_4
LBB0_3:
Lloh4:
	adrp	x1, l_.str.1@PAGE
Lloh5:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_warn
LBB0_4:
	ldr	w0, [x20]
	mov	w1, #1
	bl	_intel_scu_ipc_iowrite8
	cbz	w0, LBB0_6
; %bb.5:
	ldr	x0, [x19]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
LBB0_6:
Lloh8:
	adrp	x8, _SYSTEMCLK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SYSTEMCLK@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x21, _PWM_FREQUENCY@GOTPAGE
Lloh12:
	ldr	x21, [x21, _PWM_FREQUENCY@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_calc_clkdiv
	mov	x20, x0
Lloh13:
	adrp	x8, _PWM0CLKDIV1@GOTPAGE
Lloh14:
	ldr	x8, [x8, _PWM0CLKDIV1@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	ubfx	w1, w20, #8, #8
	bl	_intel_scu_ipc_iowrite8
	cbnz	w0, LBB0_8
; %bb.7:
Lloh16:
	adrp	x8, _PWM0CLKDIV0@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PWM0CLKDIV0@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	and	w1, w20, #0xff
	bl	_intel_scu_ipc_iowrite8
	cbz	w0, LBB0_10
LBB0_8:
	ldr	x0, [x19]
Lloh19:
	adrp	x1, l_.str.3@PAGE
Lloh20:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
LBB0_9:
	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
	add	sp, sp, #64
	ret
LBB0_10:
	ldr	x0, [x19]
	ldr	w3, [x21]
Lloh21:
	adrp	x1, l_.str.4@PAGE
Lloh22:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x2, x20
	bl	_dev_dbg
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_GPIOPWMCTRL,4,2                ; @GPIOPWMCTRL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GPIOPWMCTRL read failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"GPIOPWMCTRL was not set to system clock (pwmctrl = 0x%02x)\n"

l_.str.2:                               ; @.str.2
	.asciz	"GPIOPWMCTRL set failed\n"

	.comm	_SYSTEMCLK,4,2                  ; @SYSTEMCLK
	.comm	_PWM_FREQUENCY,4,2              ; @PWM_FREQUENCY
	.comm	_PWM0CLKDIV1,4,2                ; @PWM0CLKDIV1
	.comm	_PWM0CLKDIV0,4,2                ; @PWM0CLKDIV0
l_.str.3:                               ; @.str.3
	.asciz	"PWM0CLKDIV set failed\n"

l_.str.4:                               ; @.str.4
	.asciz	"PWM0CLKDIV set to 0x%04x (%d Hz)\n"

	.no_dead_strip	_tc35876x_brightness_init
.subsections_via_symbols
