	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function analogix_dp_enable_psr
_analogix_dp_enable_psr:                ## @analogix_dp_enable_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	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	addq	$4, %rdi
	movq	_DP_PSR_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-24(%rbp), %rdx
	callq	_drm_dp_dpcd_readb
	cmpl	$1, %eax
	jne	LBB0_1
## %bb.2:
	movq	-24(%rbp), %rcx
	movq	_DP_PSR_SINK_ACTIVE_RFB@GOTPCREL(%rip), %rdx
	xorl	%eax, %eax
	cmpq	(%rdx), %rcx
	jne	LBB0_3
	jmp	LBB0_5
LBB0_1:
	movl	(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_DRM_DEV_ERROR
LBB0_3:
	leaq	-56(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	$0, -32(%rbp)
	movabsq	$8589934599, %rax               ## imm = 0x200000007
	movq	%rax, -48(%rbp)
	movl	$8, -40(%rbp)
	movq	-56(%rbp), %rax
	movl	$0, (%rax)
	movq	_EDP_VSC_PSR_STATE_ACTIVE@GOTPCREL(%rip), %rcx
	movq	_EDP_VSC_PSR_CRC_VALUES_VALID@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	%edx, 4(%rax)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	$1, %edx
	callq	_analogix_dp_send_psr_spd
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movq	_POWER_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_analogix_dp_set_analog_power_down
	xorl	%eax, %eax
LBB0_5:
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DP_PSR_STATUS,4,2              ## @DP_PSR_STATUS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read psr status %d\n"

	.comm	_DP_PSR_SINK_ACTIVE_RFB,8,3     ## @DP_PSR_SINK_ACTIVE_RFB
	.comm	_EDP_VSC_PSR_STATE_ACTIVE,4,2   ## @EDP_VSC_PSR_STATE_ACTIVE
	.comm	_EDP_VSC_PSR_CRC_VALUES_VALID,4,2 ## @EDP_VSC_PSR_CRC_VALUES_VALID
	.comm	_POWER_ALL,4,2                  ## @POWER_ALL
	.no_dead_strip	_analogix_dp_enable_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_enable_psr
lCPI0_0:
	.long	7                               ; 0x7
	.long	2                               ; 0x2
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_analogix_dp_enable_psr:                ; @analogix_dp_enable_psr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
	add	x0, x0, #4
Lloh0:
	adrp	x8, _DP_PSR_STATUS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DP_PSR_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_drm_dp_dpcd_readb
	cmp	w0, #1
	b.ne	LBB0_2
; %bb.1:
	ldr	x8, [sp, #8]
Lloh3:
	adrp	x9, _DP_PSR_SINK_ACTIVE_RFB@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DP_PSR_SINK_ACTIVE_RFB@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
	b	LBB0_5
LBB0_2:
	mov	x2, x0
	ldr	w0, [x19]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
LBB0_3:
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	str	xzr, [sp, #40]
Lloh8:
	adrp	x8, lCPI0_0@PAGE
Lloh9:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [sp, #24]
	mov	w8, #8
	str	w8, [sp, #32]
	ldr	x8, [sp, #16]
	str	wzr, [x8]
Lloh10:
	adrp	x9, _EDP_VSC_PSR_STATE_ACTIVE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _EDP_VSC_PSR_STATE_ACTIVE@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
Lloh13:
	adrp	x10, _EDP_VSC_PSR_CRC_VALUES_VALID@GOTPAGE
Lloh14:
	ldr	x10, [x10, _EDP_VSC_PSR_CRC_VALUES_VALID@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
	orr	w9, w10, w9
	str	w9, [x8, #4]
	add	x1, sp, #16
	mov	x0, x19
	mov	w2, #1
	bl	_analogix_dp_send_psr_spd
	cbnz	w0, LBB0_6
; %bb.4:
Lloh16:
	adrp	x8, _POWER_ALL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _POWER_ALL@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_analogix_dp_set_analog_power_down
LBB0_5:
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdr	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_DP_PSR_STATUS,4,2              ; @DP_PSR_STATUS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read psr status %d\n"

	.comm	_DP_PSR_SINK_ACTIVE_RFB,8,3     ; @DP_PSR_SINK_ACTIVE_RFB
	.comm	_EDP_VSC_PSR_STATE_ACTIVE,4,2   ; @EDP_VSC_PSR_STATE_ACTIVE
	.comm	_EDP_VSC_PSR_CRC_VALUES_VALID,4,2 ; @EDP_VSC_PSR_CRC_VALUES_VALID
	.comm	_POWER_ALL,4,2                  ; @POWER_ALL
	.no_dead_strip	_analogix_dp_enable_psr
.subsections_via_symbols
