	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function analogix_dp_disable_psr
_analogix_dp_disable_psr:               ## @analogix_dp_disable_psr
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_POWER_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edx, %edx
	callq	_analogix_dp_set_analog_power_down
	leaq	4(%r14), %rbx
	movq	_DP_SET_POWER@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DP_SET_POWER_D0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	callq	_drm_dp_dpcd_writeb
	cmpl	$1, %eax
	jne	LBB0_1
## %bb.3:
	movq	_DP_PSR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_drm_dp_dpcd_readb
	cmpl	$1, %eax
	jne	LBB0_4
## %bb.5:
	movq	-32(%rbp), %rax
	movq	_DP_PSR_SINK_INACTIVE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	jmp	LBB0_10
LBB0_1:
	movl	%eax, %r15d
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_4:
	movl	%eax, %r15d
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_7:
	movq	%r14, %rdi
	callq	_analogix_dp_train_link
	testl	%eax, %eax
	je	LBB0_9
## %bb.8:
	movl	%eax, %r15d
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
LBB0_2:
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
LBB0_10:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	$0, -40(%rbp)
	movabsq	$8589934599, %rax               ## imm = 0x200000007
	movq	%rax, -56(%rbp)
	movl	$8, -48(%rbp)
	movq	-64(%rbp), %rax
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%rax)
	movq	%r14, %rdi
	movq	%rbx, %rsi
	movl	$1, %edx
	callq	_analogix_dp_send_psr_spd
	movl	%eax, %r15d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_POWER_ALL,4,2                  ## @POWER_ALL
	.comm	_DP_SET_POWER,4,2               ## @DP_SET_POWER
	.comm	_DP_SET_POWER_D0,4,2            ## @DP_SET_POWER_D0
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to set DP Power0 %d\n"

	.comm	_DP_PSR_STATUS,4,2              ## @DP_PSR_STATUS
L_.str.1:                               ## @.str.1
	.asciz	"Failed to read psr status %d\n"

	.comm	_DP_PSR_SINK_INACTIVE,8,3       ## @DP_PSR_SINK_INACTIVE
L_.str.2:                               ## @.str.2
	.asciz	"sink inactive, skip disable psr"

L_.str.3:                               ## @.str.3
	.asciz	"Failed to train the link %d\n"

	.no_dead_strip	_analogix_dp_disable_psr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function analogix_dp_disable_psr
lCPI0_0:
	.long	7                               ; 0x7
	.long	2                               ; 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_analogix_dp_disable_psr:               ; @analogix_dp_disable_psr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
Lloh0:
	adrp	x8, _POWER_ALL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _POWER_ALL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w2, #0
	bl	_analogix_dp_set_analog_power_down
	add	x21, x19, #4
Lloh3:
	adrp	x8, _DP_SET_POWER@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DP_SET_POWER@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _DP_SET_POWER_D0@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DP_SET_POWER_D0@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x21
	bl	_drm_dp_dpcd_writeb
	cmp	w0, #1
	b.ne	LBB0_4
; %bb.1:
Lloh9:
	adrp	x8, _DP_PSR_STATUS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DP_PSR_STATUS@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x21
	bl	_drm_dp_dpcd_readb
	cmp	w0, #1
	b.ne	LBB0_5
; %bb.2:
	ldr	x8, [sp, #8]
Lloh12:
	adrp	x9, _DP_PSR_SINK_INACTIVE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DP_PSR_SINK_INACTIVE@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_DRM_DEV_ERROR
	mov	w20, #0
	b	LBB0_9
LBB0_4:
	mov	x20, x0
	ldr	w0, [x19]
	str	x20, [sp]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
	b	LBB0_9
LBB0_5:
	mov	x20, x0
	ldr	w0, [x19]
	str	x20, [sp]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_6:
	mov	x0, x19
	bl	_analogix_dp_train_link
	cbz	w0, LBB0_10
; %bb.7:
	mov	x20, x0
	ldr	w0, [x19]
	str	x20, [sp]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_8:
	bl	_DRM_DEV_ERROR
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
LBB0_9:
	mov	x0, x20
	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
	add	sp, sp, #96
	ret
LBB0_10:
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	str	xzr, [sp, #40]
Lloh23:
	adrp	x8, lCPI0_0@PAGE
Lloh24:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #24]
	mov	w8, #8
	str	w8, [sp, #32]
	ldr	x8, [sp, #16]
	stp	xzr, xzr, [x8]
	add	x1, sp, #16
	mov	x0, x19
	mov	w2, #1
	bl	_analogix_dp_send_psr_spd
	mov	x20, x0
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdr	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_POWER_ALL,4,2                  ; @POWER_ALL
	.comm	_DP_SET_POWER,4,2               ; @DP_SET_POWER
	.comm	_DP_SET_POWER_D0,4,2            ; @DP_SET_POWER_D0
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to set DP Power0 %d\n"

	.comm	_DP_PSR_STATUS,4,2              ; @DP_PSR_STATUS
l_.str.1:                               ; @.str.1
	.asciz	"Failed to read psr status %d\n"

	.comm	_DP_PSR_SINK_INACTIVE,8,3       ; @DP_PSR_SINK_INACTIVE
l_.str.2:                               ; @.str.2
	.asciz	"sink inactive, skip disable psr"

l_.str.3:                               ; @.str.3
	.asciz	"Failed to train the link %d\n"

	.no_dead_strip	_analogix_dp_disable_psr
.subsections_via_symbols
