	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function driver_set_backlight_level
_driver_set_backlight_level:            ## @driver_set_backlight_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%esi, %ebx
	movq	_BL_PWM_PERIOD_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_BL_PWM_PERIOD_BITCNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_BL_PWM_PERIOD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-24(%rbp), %rdx
	leaq	-20(%rbp), %r8
	callq	_REG_GET_2
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	movl	$16, %ecx
	cmovnel	%eax, %ecx
	movl	$-1, %eax
	shll	%cl, %eax
	notl	%eax
	andl	-20(%rbp), %eax
	movl	%eax, -20(%rbp)
	imull	%ebx, %eax
	movl	%eax, %edx
	sarl	%cl, %edx
	movzwl	%dx, %ebx
	decl	%ecx
	btl	%ecx, %eax
	adcl	$0, %ebx
	movq	_BL_PWM_GRP1_REG_LOCK@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	movq	_BL_PWM_GRP1_IGNORE_MASTER_LOCK_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ecx, %edi
	movl	$1, %edx
	movl	$1, %r8d
	callq	_REG_UPDATE_2
	movq	_BL_PWM_CNTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_BL_ACTIVE_INT_FRAC_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edx
	callq	_REG_UPDATE
	movl	(%r14), %edi
	movl	%edi, %esi
	xorl	%edx, %edx
	callq	_REG_UPDATE
	movl	(%r14), %edi
	movq	_BL_PWM_GRP1_REG_UPDATE_PENDING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	movl	$10000, %r8d                    ## imm = 0x2710
	callq	_REG_WAIT
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BL_PWM_PERIOD_CNTL,4,2         ## @BL_PWM_PERIOD_CNTL
	.comm	_BL_PWM_PERIOD_BITCNT,4,2       ## @BL_PWM_PERIOD_BITCNT
	.comm	_BL_PWM_PERIOD,4,2              ## @BL_PWM_PERIOD
	.comm	_BL_PWM_GRP1_REG_LOCK,4,2       ## @BL_PWM_GRP1_REG_LOCK
	.comm	_BL_PWM_GRP1_IGNORE_MASTER_LOCK_EN,4,2 ## @BL_PWM_GRP1_IGNORE_MASTER_LOCK_EN
	.comm	_BL_PWM_CNTL,4,2                ## @BL_PWM_CNTL
	.comm	_BL_ACTIVE_INT_FRAC_CNT,4,2     ## @BL_ACTIVE_INT_FRAC_CNT
	.comm	_BL_PWM_GRP1_REG_UPDATE_PENDING,4,2 ## @BL_PWM_GRP1_REG_UPDATE_PENDING
	.no_dead_strip	_driver_set_backlight_level
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function driver_set_backlight_level
_driver_set_backlight_level:            ; @driver_set_backlight_level
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
Lloh0:
	adrp	x8, _BL_PWM_PERIOD_CNTL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BL_PWM_PERIOD_CNTL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _BL_PWM_PERIOD_BITCNT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _BL_PWM_PERIOD_BITCNT@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _BL_PWM_PERIOD@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BL_PWM_PERIOD@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	add	x2, sp, #8
	add	x4, sp, #12
	bl	_REG_GET_2
	ldr	w8, [sp, #8]
	mov	w9, #16
	cmp	w8, #0
	csel	w8, w9, w8, eq
	ldr	w9, [sp, #12]
	mov	w10, #-1
	lsl	w10, w10, w8
	bic	w9, w9, w10
	str	w9, [sp, #12]
	mul	w9, w9, w19
	asr	w10, w9, w8
	sub	w8, w8, #1
	lsr	w8, w9, w8
	and	w8, w8, #0x1
	add	w19, w8, w10, uxth
Lloh9:
	adrp	x20, _BL_PWM_GRP1_REG_LOCK@GOTPAGE
Lloh10:
	ldr	x20, [x20, _BL_PWM_GRP1_REG_LOCK@GOTPAGEOFF]
	ldr	w0, [x20]
Lloh11:
	adrp	x8, _BL_PWM_GRP1_IGNORE_MASTER_LOCK_EN@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BL_PWM_GRP1_IGNORE_MASTER_LOCK_EN@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w2, #1
	mov	x3, x0
	mov	w4, #1
	bl	_REG_UPDATE_2
Lloh14:
	adrp	x8, _BL_PWM_CNTL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BL_PWM_CNTL@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x8, _BL_ACTIVE_INT_FRAC_CNT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BL_ACTIVE_INT_FRAC_CNT@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_REG_UPDATE
	ldr	w0, [x20]
	mov	x1, x0
	mov	w2, #0
	bl	_REG_UPDATE
	ldr	w0, [x20]
Lloh20:
	adrp	x8, _BL_PWM_GRP1_REG_UPDATE_PENDING@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BL_PWM_GRP1_REG_UPDATE_PENDING@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	w2, #0
	mov	w3, #1
	mov	w4, #10000
	bl	_REG_WAIT
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BL_PWM_PERIOD_CNTL,4,2         ; @BL_PWM_PERIOD_CNTL
	.comm	_BL_PWM_PERIOD_BITCNT,4,2       ; @BL_PWM_PERIOD_BITCNT
	.comm	_BL_PWM_PERIOD,4,2              ; @BL_PWM_PERIOD
	.comm	_BL_PWM_GRP1_REG_LOCK,4,2       ; @BL_PWM_GRP1_REG_LOCK
	.comm	_BL_PWM_GRP1_IGNORE_MASTER_LOCK_EN,4,2 ; @BL_PWM_GRP1_IGNORE_MASTER_LOCK_EN
	.comm	_BL_PWM_CNTL,4,2                ; @BL_PWM_CNTL
	.comm	_BL_ACTIVE_INT_FRAC_CNT,4,2     ; @BL_ACTIVE_INT_FRAC_CNT
	.comm	_BL_PWM_GRP1_REG_UPDATE_PENDING,4,2 ; @BL_PWM_GRP1_REG_UPDATE_PENDING
	.no_dead_strip	_driver_set_backlight_level
.subsections_via_symbols
