	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vlv_setup_backlight
_vlv_setup_backlight:                   ## @vlv_setup_backlight
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	20(%rdi), %edi
	callq	_to_i915
	movq	_PIPE_A@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	setne	%cl
	movq	_PIPE_B@GOTPCREL(%rip), %rdx
	cmpl	%ebx, (%rdx)
	movq	%rax, %r12
	setne	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_WARN_ON
	testq	%rax, %rax
	je	LBB0_2
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_2:
	movl	%ebx, %edi
	callq	_VLV_BLC_PWM_CTL2
	movl	%eax, %edi
	callq	_I915_READ
	movl	%eax, %r15d
	movq	_BLM_POLARITY_I965@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r15d, %eax
	movl	%eax, (%r14)
	movl	%ebx, %edi
	callq	_VLV_BLC_PWM_CTL
	movl	%eax, %edi
	callq	_I915_READ
	movl	%eax, %ecx
	sarl	$16, %eax
	movl	%eax, 4(%r14)
	cmpl	$65535, %ecx                    ## imm = 0xFFFF
	ja	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_get_backlight_max_vbt
	movl	%eax, 4(%r14)
LBB0_4:
	testl	%eax, %eax
	je	LBB0_1
## %bb.5:
	movq	%r14, %rdi
	callq	_get_backlight_min_vbt
	movl	%eax, 12(%r14)
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	__vlv_get_backlight
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_intel_panel_compute_brightness
	movl	4(%r14), %edx
	movl	12(%r14), %esi
	movl	%eax, %edi
	callq	_clamp
	movl	%eax, 16(%r14)
	movq	_BLM_PWM_ENABLE@GOTPCREL(%rip), %rax
	andl	(%rax), %r15d
	movl	%r15d, 8(%r14)
	xorl	%eax, %eax
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PIPE_A,4,2                     ## @PIPE_A
	.comm	_PIPE_B,4,2                     ## @PIPE_B
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_BLM_POLARITY_I965,4,2          ## @BLM_POLARITY_I965
	.comm	_BLM_PWM_ENABLE,4,2             ## @BLM_PWM_ENABLE
	.no_dead_strip	_vlv_setup_backlight
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vlv_setup_backlight
_vlv_setup_backlight:                   ; @vlv_setup_backlight
	.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	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #20]
	bl	_to_i915
	mov	x21, x0
Lloh0:
	adrp	x8, _PIPE_A@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PIPE_A@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
Lloh3:
	adrp	x8, _PIPE_B@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PIPE_B@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ccmp	w8, w20, #4, ne
	cset	w0, ne
	bl	_WARN_ON
	cbz	x0, LBB0_2
LBB0_1:
Lloh6:
	adrp	x8, _ENODEV@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_2:
	mov	x0, x20
	bl	_VLV_BLC_PWM_CTL2
	bl	_I915_READ
	mov	x22, x0
Lloh9:
	adrp	x8, _BLM_POLARITY_I965@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BLM_POLARITY_I965@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	and	w8, w8, w0
	str	w8, [x19]
	mov	x0, x20
	bl	_VLV_BLC_PWM_CTL
	bl	_I915_READ
	mov	x8, x0
	asr	w0, w0, #16
	str	w0, [x19, #4]
	lsr	w8, w8, #16
	cbnz	w8, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_get_backlight_max_vbt
	str	w0, [x19, #4]
LBB0_4:
	cbz	w0, LBB0_1
; %bb.5:
	mov	x0, x19
	bl	_get_backlight_min_vbt
	str	w0, [x19, #12]
	mov	x0, x21
	mov	x1, x20
	bl	__vlv_get_backlight
	mov	x1, x0
	mov	x0, x19
	bl	_intel_panel_compute_brightness
	ldr	w1, [x19, #12]
	ldr	w2, [x19, #4]
	bl	_clamp
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #16]
Lloh12:
	adrp	x8, _BLM_PWM_ENABLE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _BLM_PWM_ENABLE@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	and	w8, w8, w22
	str	w8, [x19, #8]
LBB0_6:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_PIPE_A,4,2                     ; @PIPE_A
	.comm	_PIPE_B,4,2                     ; @PIPE_B
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_BLM_POLARITY_I965,4,2          ; @BLM_POLARITY_I965
	.comm	_BLM_PWM_ENABLE,4,2             ; @BLM_PWM_ENABLE
	.no_dead_strip	_vlv_setup_backlight
.subsections_via_symbols
