	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hsw_activate_psr1
_hsw_activate_psr1:                     ## @hsw_activate_psr1
	.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	%rdi, %r15
	callq	_dp_to_i915
	movq	%rax, %r14
	movq	_EDP_PSR_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	16(%r14), %esi
	movl	$6, %edi
	callq	_max
	movl	(%r14), %esi
	incl	%esi
	movl	%eax, %edi
	callq	_max
	movl	%eax, %ebx
	movq	_EDP_PSR_IDLE_FRAME_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	orl	%r12d, %ebx
	movq	_EDP_PSR_MAX_SLEEP_TIME_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movl	$31, %r13d
	shll	%cl, %r13d
	movq	%r14, %rdi
	callq	_IS_HASWELL
	xorl	%r12d, %r12d
	movl	$0, %ecx
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_2:
	orl	%ecx, %r13d
	orl	%r13d, %ebx
	cmpq	$0, 8(%r14)
	movl	$0, %r13d
	je	LBB0_4
## %bb.3:
	movq	_EDP_PSR_LINK_STANDBY@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_4:
	movq	%r15, %rdi
	callq	_intel_psr1_get_tp_time
	orl	%r13d, %eax
	orl	%eax, %ebx
	movq	%r14, %rdi
	callq	_INTEL_GEN
	cmpl	$8, %eax
	jl	LBB0_6
## %bb.5:
	movq	_EDP_PSR_CRC_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
LBB0_6:
	orl	%r12d, %ebx
	movq	_EDP_PSR_CTL@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	callq	_I915_READ
	movq	_EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	orl	%eax, %ebx
	movl	(%r14), %edi
	movl	%ebx, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_I915_WRITE                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EDP_PSR_ENABLE,4,2             ## @EDP_PSR_ENABLE
	.comm	_EDP_PSR_IDLE_FRAME_SHIFT,4,2   ## @EDP_PSR_IDLE_FRAME_SHIFT
	.comm	_EDP_PSR_MAX_SLEEP_TIME_SHIFT,4,2 ## @EDP_PSR_MAX_SLEEP_TIME_SHIFT
	.comm	_EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES,4,2 ## @EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES
	.comm	_EDP_PSR_LINK_STANDBY,4,2       ## @EDP_PSR_LINK_STANDBY
	.comm	_EDP_PSR_CRC_ENABLE,4,2         ## @EDP_PSR_CRC_ENABLE
	.comm	_EDP_PSR_CTL,4,2                ## @EDP_PSR_CTL
	.comm	_EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK,4,2 ## @EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK
	.no_dead_strip	_hsw_activate_psr1
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hsw_activate_psr1
_hsw_activate_psr1:                     ; @hsw_activate_psr1
	.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	x19, x0
	bl	_dp_to_i915
	mov	x20, x0
Lloh0:
	adrp	x8, _EDP_PSR_ENABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EDP_PSR_ENABLE@GOTPAGEOFF]
Lloh2:
	ldr	w21, [x8]
	ldr	w1, [x0, #16]
	mov	w0, #6
	bl	_max
	ldr	w8, [x20]
	add	w1, w8, #1
	bl	_max
Lloh3:
	adrp	x8, _EDP_PSR_IDLE_FRAME_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EDP_PSR_IDLE_FRAME_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	w8, w0, w8
	orr	w8, w8, w21
Lloh6:
	adrp	x9, _EDP_PSR_MAX_SLEEP_TIME_SHIFT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _EDP_PSR_MAX_SLEEP_TIME_SHIFT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	mov	w10, #31
	lsl	w9, w10, w9
	orr	w21, w8, w9
	mov	x0, x20
	bl	_IS_HASWELL
Lloh9:
	adrp	x8, _EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w8, wzr, w8, eq
	orr	w8, w21, w8
	ldr	x9, [x20, #8]
Lloh12:
	adrp	x10, _EDP_PSR_LINK_STANDBY@GOTPAGE
Lloh13:
	ldr	x10, [x10, _EDP_PSR_LINK_STANDBY@GOTPAGEOFF]
Lloh14:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	orr	w21, w8, w9
	mov	x0, x19
	bl	_intel_psr1_get_tp_time
	orr	w19, w21, w0
	mov	x0, x20
	bl	_INTEL_GEN
Lloh15:
	adrp	x8, _EDP_PSR_CRC_ENABLE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EDP_PSR_CRC_ENABLE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cmp	w0, #7
	csel	w8, w8, wzr, gt
	orr	w19, w19, w8
Lloh18:
	adrp	x20, _EDP_PSR_CTL@GOTPAGE
Lloh19:
	ldr	x20, [x20, _EDP_PSR_CTL@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_I915_READ
Lloh20:
	adrp	x8, _EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	and	w8, w8, w0
	orr	w1, w19, w8
	ldr	w0, [x20]
	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
	b	_I915_WRITE
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_EDP_PSR_ENABLE,4,2             ; @EDP_PSR_ENABLE
	.comm	_EDP_PSR_IDLE_FRAME_SHIFT,4,2   ; @EDP_PSR_IDLE_FRAME_SHIFT
	.comm	_EDP_PSR_MAX_SLEEP_TIME_SHIFT,4,2 ; @EDP_PSR_MAX_SLEEP_TIME_SHIFT
	.comm	_EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES,4,2 ; @EDP_PSR_MIN_LINK_ENTRY_TIME_8_LINES
	.comm	_EDP_PSR_LINK_STANDBY,4,2       ; @EDP_PSR_LINK_STANDBY
	.comm	_EDP_PSR_CRC_ENABLE,4,2         ; @EDP_PSR_CRC_ENABLE
	.comm	_EDP_PSR_CTL,4,2                ; @EDP_PSR_CTL
	.comm	_EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK,4,2 ; @EDP_PSR_RESTORE_PSR_ACTIVE_CTX_MASK
	.no_dead_strip	_hsw_activate_psr1
.subsections_via_symbols
