	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function psb_lvds_pwm_set_brightness
_psb_lvds_pwm_set_brightness:           ## @psb_lvds_pwm_set_brightness
	.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
	movl	%esi, %r15d
	movq	%rdi, %r14
	movq	8(%rdi), %r12
	callq	_psb_intel_lvds_get_max_backlight
	movl	%eax, %r13d
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_BUG_ON
	imull	%r13d, %r15d
	movq	_BRIGHTNESS_MAX_LEVEL@GOTPCREL(%rip), %rcx
	movl	%r15d, %eax
	cltd
	idivl	(%rcx)
	movq	(%r12), %rcx
	movq	(%rcx), %rcx
	movq	_BLC_POLARITY_INVERSE@GOTPCREL(%rip), %rdx
	movl	%r13d, %ebx
	subl	%eax, %ebx
	cmpq	(%rdx), %rcx
	cmovnel	%eax, %ebx
	movq	_PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	movq	_BLC_PWM_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_PSB_BACKLIGHT_PWM_CTL_SHIFT@GOTPCREL(%rip), %r15
	movb	(%r15), %cl
	movl	%r13d, %esi
	shll	%cl, %esi
	orl	%ebx, %esi
	callq	_REG_WRITE
	movl	(%r14), %edi
	movb	(%r15), %cl
	shll	%cl, %r13d
	orl	%ebx, %r13d
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	callq	_dev_info
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BRIGHTNESS_MAX_LEVEL,4,2       ## @BRIGHTNESS_MAX_LEVEL
	.comm	_BLC_POLARITY_INVERSE,8,3       ## @BLC_POLARITY_INVERSE
	.comm	_PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR,4,2 ## @PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR
	.comm	_BLC_PWM_CTL,4,2                ## @BLC_PWM_CTL
	.comm	_PSB_BACKLIGHT_PWM_CTL_SHIFT,4,2 ## @PSB_BACKLIGHT_PWM_CTL_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Backlight lvds set brightness %08x\n"

	.no_dead_strip	_psb_lvds_pwm_set_brightness
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function psb_lvds_pwm_set_brightness
_psb_lvds_pwm_set_brightness:           ; @psb_lvds_pwm_set_brightness
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x1
	mov	x20, x0
	ldr	x22, [x0, #8]
	bl	_psb_intel_lvds_get_max_backlight
	mov	x21, x0
	cmp	w0, #0
	cset	w0, eq
	bl	_BUG_ON
	mul	w8, w21, w19
Lloh0:
	adrp	x9, _BRIGHTNESS_MAX_LEVEL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BRIGHTNESS_MAX_LEVEL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
	ldr	x9, [x22]
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _BLC_POLARITY_INVERSE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _BLC_POLARITY_INVERSE@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	sub	w11, w21, w8
	cmp	x9, x10
	csel	w8, w11, w8, eq
Lloh6:
	adrp	x9, _PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w19, w8, w9
Lloh9:
	adrp	x8, _BLC_PWM_CTL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BLC_PWM_CTL@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
Lloh12:
	adrp	x22, _PSB_BACKLIGHT_PWM_CTL_SHIFT@GOTPAGE
Lloh13:
	ldr	x22, [x22, _PSB_BACKLIGHT_PWM_CTL_SHIFT@GOTPAGEOFF]
	ldr	w8, [x22]
	lsl	w8, w21, w8
	orr	w1, w8, w19
	bl	_REG_WRITE
	ldr	w0, [x20]
	ldr	w8, [x22]
	lsl	w8, w21, w8
	orr	w2, w8, w19
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_info
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BRIGHTNESS_MAX_LEVEL,4,2       ; @BRIGHTNESS_MAX_LEVEL
	.comm	_BLC_POLARITY_INVERSE,8,3       ; @BLC_POLARITY_INVERSE
	.comm	_PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR,4,2 ; @PSB_BACKLIGHT_PWM_POLARITY_BIT_CLEAR
	.comm	_BLC_PWM_CTL,4,2                ; @BLC_PWM_CTL
	.comm	_PSB_BACKLIGHT_PWM_CTL_SHIFT,4,2 ; @PSB_BACKLIGHT_PWM_CTL_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Backlight lvds set brightness %08x\n"

	.no_dead_strip	_psb_lvds_pwm_set_brightness
.subsections_via_symbols
