	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_dp_aux_enable_backlight
_intel_dp_aux_enable_backlight:         ## @intel_dp_aux_enable_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	%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
	movq	%rsi, %r14
	movl	(%rsi), %edi
	callq	_to_intel_connector
	movq	%rax, %r15
	movq	8(%rax), %rdi
	callq	_enc_to_intel_dp
	movq	%rax, %r13
	leaq	8(%rax), %r12
	movq	_DP_EDP_BACKLIGHT_MODE_SET_REGISTER@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	callq	_drm_dp_dpcd_readb
	cmpl	$1, %eax
	jne	LBB0_1
## %bb.2:
	movl	-44(%rbp), %eax
	movq	_DP_EDP_BACKLIGHT_CONTROL_MODE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movl	%ebx, %ecx
	andl	%eax, %ecx
	addl	$-128, %ecx
	notl	%ebx
	andl	%eax, %ebx
	orl	$131, %ebx
	cmpl	$3, %ecx
	cmovael	%eax, %ebx
	movq	(%r13), %rax
	movq	_DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 8(%rax)
	je	LBB0_5
## %bb.3:
	movq	%r15, %rdi
	callq	_intel_dp_aux_set_pwm_freq
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	_DP_EDP_BACKLIGHT_FREQ_AUX_SET_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
LBB0_5:
	cmpl	-44(%rbp), %ebx
	je	LBB0_8
## %bb.6:
	movq	_DP_EDP_BACKLIGHT_MODE_SET_REGISTER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	%ebx, %edx
	callq	_drm_dp_dpcd_writeb
	testq	%rax, %rax
	jns	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
LBB0_8:
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_set_aux_backlight_enable
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_intel_dp_aux_set_backlight
	jmp	LBB0_9
LBB0_1:
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DP_EDP_BACKLIGHT_MODE_SET_REGISTER,4,2 ## @DP_EDP_BACKLIGHT_MODE_SET_REGISTER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read DPCD register 0x%x\n"

	.comm	_DP_EDP_BACKLIGHT_CONTROL_MODE_MASK,4,2 ## @DP_EDP_BACKLIGHT_CONTROL_MODE_MASK
	.comm	_DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP,4,2 ## @DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP
	.comm	_DP_EDP_BACKLIGHT_FREQ_AUX_SET_ENABLE,4,2 ## @DP_EDP_BACKLIGHT_FREQ_AUX_SET_ENABLE
L_.str.1:                               ## @.str.1
	.asciz	"Failed to write aux backlight mode\n"

	.no_dead_strip	_intel_dp_aux_enable_backlight
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_dp_aux_enable_backlight
_intel_dp_aux_enable_backlight:         ; @intel_dp_aux_enable_backlight
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	ldr	w0, [x1]
	bl	_to_intel_connector
	mov	x20, x0
	ldr	x0, [x0, #8]
	bl	_enc_to_intel_dp
	mov	x21, x0
	add	x22, x0, #8
Lloh0:
	adrp	x24, _DP_EDP_BACKLIGHT_MODE_SET_REGISTER@GOTPAGE
Lloh1:
	ldr	x24, [x24, _DP_EDP_BACKLIGHT_MODE_SET_REGISTER@GOTPAGEOFF]
	ldr	w1, [x24]
	add	x2, sp, #12
	mov	x0, x22
	bl	_drm_dp_dpcd_readb
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.1:
	ldr	w8, [sp, #12]
Lloh2:
	adrp	x9, _DP_EDP_BACKLIGHT_CONTROL_MODE_MASK@GOTPAGE
Lloh3:
	ldr	x9, [x9, _DP_EDP_BACKLIGHT_CONTROL_MODE_MASK@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	and	w10, w9, w8
	sub	w10, w10, #128
	bic	w9, w8, w9
	mov	w11, #131
	orr	w9, w9, w11
	cmp	w10, #3
	csel	w23, w9, w8, lo
	ldr	x8, [x21]
	ldr	w8, [x8, #8]
Lloh5:
	adrp	x9, _DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_intel_dp_aux_set_pwm_freq
	cbz	x0, LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _DP_EDP_BACKLIGHT_FREQ_AUX_SET_ENABLE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DP_EDP_BACKLIGHT_FREQ_AUX_SET_ENABLE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w23, w8, w23
LBB0_4:
	ldr	w8, [sp, #12]
	cmp	w23, w8
	b.eq	LBB0_7
; %bb.5:
	ldr	w1, [x24]
	mov	x0, x22
	mov	x2, x23
	bl	_drm_dp_dpcd_writeb
	tbz	x0, #63, LBB0_7
; %bb.6:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_KMS
LBB0_7:
	mov	x0, x21
	mov	w1, #1
	bl	_set_aux_backlight_enable
	ldr	w1, [x20]
	mov	x0, x19
	bl	_intel_dp_aux_set_backlight
	b	LBB0_9
LBB0_8:
	ldr	w8, [x24]
	str	x8, [sp]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
LBB0_9:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_DP_EDP_BACKLIGHT_MODE_SET_REGISTER,4,2 ; @DP_EDP_BACKLIGHT_MODE_SET_REGISTER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read DPCD register 0x%x\n"

	.comm	_DP_EDP_BACKLIGHT_CONTROL_MODE_MASK,4,2 ; @DP_EDP_BACKLIGHT_CONTROL_MODE_MASK
	.comm	_DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP,4,2 ; @DP_EDP_BACKLIGHT_FREQ_AUX_SET_CAP
	.comm	_DP_EDP_BACKLIGHT_FREQ_AUX_SET_ENABLE,4,2 ; @DP_EDP_BACKLIGHT_FREQ_AUX_SET_ENABLE
l_.str.1:                               ; @.str.1
	.asciz	"Failed to write aux backlight mode\n"

	.no_dead_strip	_intel_dp_aux_enable_backlight
.subsections_via_symbols
