	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_dp_aux_set_pwm_freq
_intel_dp_aux_set_pwm_freq:             ## @intel_dp_aux_set_pwm_freq
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_to_i915
	movq	%rax, %r14
	movq	(%rbx), %rdi
	callq	_enc_to_intel_dp
	movq	%rax, %r13
	movl	(%r14), %ebx
	leaq	L_.str(%rip), %rdi
	xorl	%r14d, %r14d
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.1:
	movq	_DP_EDP_BACKLIGHT_FREQ_BASE_KHZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_KHz
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, %r14d
	movq	_DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	movq	%r13, %rdi
	callq	_drm_dp_dpcd_readb
	cmpl	$1, %eax
	jne	LBB0_7
## %bb.2:
	movq	_DP_EDP_PWMGEN_BIT_COUNT_CAP_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r13, %rdi
	callq	_drm_dp_dpcd_readb
	cmpl	$1, %eax
	jne	LBB0_8
## %bb.3:
	movq	_DP_EDP_PWMGEN_BIT_COUNT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%eax, -44(%rbp)
	andl	%eax, -48(%rbp)
	leal	(%r14,%r14,2), %edi
	movl	$4, %esi
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, %r15d
	leal	(%r14,%r14,4), %edi
	movl	$4, %esi
	callq	_DIV_ROUND_CLOSEST
	movl	-44(%rbp), %esi
	movl	$1, %edx
	movl	%esi, %ecx
	shll	%cl, %edx
	cmpl	%edx, %r15d
	jl	LBB0_5
## %bb.4:
	movl	-48(%rbp), %ebx
	movl	$255, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	cmpl	%eax, %edx
	jge	LBB0_12
LBB0_5:
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_10
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_9
LBB0_8:
	leaq	L_.str.3(%rip), %rdi
LBB0_9:
	xorl	%r14d, %r14d
LBB0_10:
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movl	$1, %r12d
	cmpl	%esi, %ebx
	jl	LBB0_18
## %bb.14:
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_16 Depth=1
	leal	-1(%rbx), %edx
	cmpl	-44(%rbp), %ebx
	movl	%edx, %ebx
	jle	LBB0_19
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movl	$1, %esi
	movl	%ebx, %ecx
	shll	%cl, %esi
	movl	%r14d, %edi
	callq	_DIV_ROUND_CLOSEST
	movl	%eax, %edi
	movl	$1, %esi
	movl	$255, %edx
	callq	_clamp
	movl	%eax, %r12d
	movl	%ebx, %ecx
	shll	%cl, %eax
	cmpl	%eax, %r15d
	jg	LBB0_15
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	cmpl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	jg	LBB0_15
LBB0_18:
	movl	%ebx, %edx
LBB0_19:
	movq	_DP_EDP_PWMGEN_BIT_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_drm_dp_dpcd_writeb
	testq	%rax, %rax
	js	LBB0_22
## %bb.20:
	movq	_DP_EDP_BACKLIGHT_FREQ_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	movl	%r12d, %edx
	callq	_drm_dp_dpcd_writeb
	movl	$1, %r14d
	testq	%rax, %rax
	jns	LBB0_11
## %bb.21:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_9
LBB0_22:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"VBT defined backlight frequency %u Hz\n"

L_.str.1:                               ## @.str.1
	.asciz	"Use panel default backlight frequency\n"

	.comm	_DP_EDP_BACKLIGHT_FREQ_BASE_KHZ,4,2 ## @DP_EDP_BACKLIGHT_FREQ_BASE_KHZ
	.comm	_DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN,4,2 ## @DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN
L_.str.2:                               ## @.str.2
	.asciz	"Failed to read pwmgen bit count cap min\n"

	.comm	_DP_EDP_PWMGEN_BIT_COUNT_CAP_MAX,4,2 ## @DP_EDP_PWMGEN_BIT_COUNT_CAP_MAX
L_.str.3:                               ## @.str.3
	.asciz	"Failed to read pwmgen bit count cap max\n"

	.comm	_DP_EDP_PWMGEN_BIT_COUNT_MASK,4,2 ## @DP_EDP_PWMGEN_BIT_COUNT_MASK
L_.str.4:                               ## @.str.4
	.asciz	"VBT defined backlight frequency out of range\n"

	.comm	_DP_EDP_PWMGEN_BIT_COUNT,4,2    ## @DP_EDP_PWMGEN_BIT_COUNT
L_.str.5:                               ## @.str.5
	.asciz	"Failed to write aux pwmgen bit count\n"

	.comm	_DP_EDP_BACKLIGHT_FREQ_SET,4,2  ## @DP_EDP_BACKLIGHT_FREQ_SET
L_.str.6:                               ## @.str.6
	.asciz	"Failed to write aux backlight freq\n"

	.no_dead_strip	_intel_dp_aux_set_pwm_freq
.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_set_pwm_freq
_intel_dp_aux_set_pwm_freq:             ; @intel_dp_aux_set_pwm_freq
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	w0, [x0, #8]
	bl	_to_i915
	mov	x20, x0
	ldr	x0, [x19]
	bl	_enc_to_intel_dp
	mov	x19, x0
	ldr	w20, [x20]
	str	x20, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	cbz	w20, LBB0_6
; %bb.1:
Lloh2:
	adrp	x8, _DP_EDP_BACKLIGHT_FREQ_BASE_KHZ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DP_EDP_BACKLIGHT_FREQ_BASE_KHZ@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_KHz
	mov	x1, x20
	bl	_DIV_ROUND_CLOSEST
	mov	x20, x0
Lloh5:
	adrp	x8, _DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_drm_dp_dpcd_readb
	cmp	w0, #1
	b.ne	LBB0_7
; %bb.2:
Lloh8:
	adrp	x8, _DP_EDP_PWMGEN_BIT_COUNT_CAP_MAX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DP_EDP_PWMGEN_BIT_COUNT_CAP_MAX@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	bl	_drm_dp_dpcd_readb
	cmp	w0, #1
	b.ne	LBB0_8
; %bb.3:
Lloh11:
	adrp	x8, _DP_EDP_PWMGEN_BIT_COUNT_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DP_EDP_PWMGEN_BIT_COUNT_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	and	w9, w9, w8
	str	w9, [sp, #12]
	ldr	w9, [sp, #8]
	and	w8, w9, w8
	str	w8, [sp, #8]
	add	w0, w20, w20, lsl #1
	mov	w1, #4
	bl	_DIV_ROUND_CLOSEST
	mov	x21, x0
	add	w0, w20, w20, lsl #2
	mov	w1, #4
	bl	_DIV_ROUND_CLOSEST
	ldr	w8, [sp, #12]
	mov	w9, #1
	lsl	w9, w9, w8
	cmp	w21, w9
	b.lt	LBB0_5
; %bb.4:
	mov	x22, x0
	ldr	w24, [sp, #8]
	mov	w9, #255
	lsl	w9, w9, w24
	cmp	w9, w0
	b.ge	LBB0_11
LBB0_5:
Lloh14:
	adrp	x0, l_.str.4@PAGE
Lloh15:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_9
LBB0_6:
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_7:
Lloh18:
	adrp	x0, l_.str.2@PAGE
Lloh19:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh20:
	adrp	x0, l_.str.3@PAGE
Lloh21:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_9:
	bl	_DRM_DEBUG_KMS
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_11:
	mov	w25, #1
	cmp	w24, w8
	b.ge	LBB0_13
; %bb.12:
	mov	x2, x24
	mov	w23, #1
	b	LBB0_16
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	lsl	w1, w25, w24
	mov	x0, x20
	bl	_DIV_ROUND_CLOSEST
	mov	w1, #1
	mov	w2, #255
	bl	_clamp
	mov	x23, x0
	lsl	w8, w0, w24
	cmp	w21, w8
	ccmp	w8, w22, #0, le
	b.le	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	sub	w2, w24, #1
	ldr	w8, [sp, #12]
	cmp	w24, w8
	mov	x24, x2
	b.gt	LBB0_13
	b	LBB0_16
LBB0_15:
	mov	x2, x24
LBB0_16:
Lloh22:
	adrp	x8, _DP_EDP_PWMGEN_BIT_COUNT@GOTPAGE
Lloh23:
	ldr	x8, [x8, _DP_EDP_PWMGEN_BIT_COUNT@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_drm_dp_dpcd_writeb
	tbnz	x0, #63, LBB0_19
; %bb.17:
Lloh25:
	adrp	x8, _DP_EDP_BACKLIGHT_FREQ_SET@GOTPAGE
Lloh26:
	ldr	x8, [x8, _DP_EDP_BACKLIGHT_FREQ_SET@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x23
	bl	_drm_dp_dpcd_writeb
	tbnz	x0, #63, LBB0_20
; %bb.18:
	mov	w0, #1
	b	LBB0_10
LBB0_19:
Lloh28:
	adrp	x0, l_.str.5@PAGE
Lloh29:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_9
LBB0_20:
Lloh30:
	adrp	x0, l_.str.6@PAGE
Lloh31:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_9
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"VBT defined backlight frequency %u Hz\n"

l_.str.1:                               ; @.str.1
	.asciz	"Use panel default backlight frequency\n"

	.comm	_DP_EDP_BACKLIGHT_FREQ_BASE_KHZ,4,2 ; @DP_EDP_BACKLIGHT_FREQ_BASE_KHZ
	.comm	_DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN,4,2 ; @DP_EDP_PWMGEN_BIT_COUNT_CAP_MIN
l_.str.2:                               ; @.str.2
	.asciz	"Failed to read pwmgen bit count cap min\n"

	.comm	_DP_EDP_PWMGEN_BIT_COUNT_CAP_MAX,4,2 ; @DP_EDP_PWMGEN_BIT_COUNT_CAP_MAX
l_.str.3:                               ; @.str.3
	.asciz	"Failed to read pwmgen bit count cap max\n"

	.comm	_DP_EDP_PWMGEN_BIT_COUNT_MASK,4,2 ; @DP_EDP_PWMGEN_BIT_COUNT_MASK
l_.str.4:                               ; @.str.4
	.asciz	"VBT defined backlight frequency out of range\n"

	.comm	_DP_EDP_PWMGEN_BIT_COUNT,4,2    ; @DP_EDP_PWMGEN_BIT_COUNT
l_.str.5:                               ; @.str.5
	.asciz	"Failed to write aux pwmgen bit count\n"

	.comm	_DP_EDP_BACKLIGHT_FREQ_SET,4,2  ; @DP_EDP_BACKLIGHT_FREQ_SET
l_.str.6:                               ; @.str.6
	.asciz	"Failed to write aux backlight freq\n"

	.no_dead_strip	_intel_dp_aux_set_pwm_freq
.subsections_via_symbols
