	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hsw_activate_psr2
_hsw_activate_psr2:                     ## @hsw_activate_psr2
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_dp_to_i915
	movq	%rax, %r14
	movl	(%rax), %esi
	movl	$6, %edi
	callq	_max
	movl	8(%r14), %esi
	incl	%esi
	movl	%eax, %edi
	callq	_max
	movl	%eax, %ebx
	movq	_EDP_PSR2_IDLE_FRAME_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	movq	_EDP_PSR2_ENABLE@GOTPCREL(%rip), %rax
	movq	_EDP_SU_TRACK_ENABLE@GOTPCREL(%rip), %rcx
	orl	(%rax), %ebx
	orl	(%rcx), %ebx
	movq	%r14, %rdi
	callq	_INTEL_GEN
	cmpl	$9, %eax
	jg	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	callq	_IS_GEMINILAKE
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	movq	_EDP_Y_COORDINATE_ENABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
LBB0_3:
	movl	8(%r14), %edi
	incl	%edi
	callq	_EDP_PSR2_FRAME_BEFORE_SU
	movl	%eax, %r15d
	movl	4(%r14), %eax
	cmpl	$51, %eax
	jae	LBB0_5
## %bb.4:
	movq	_EDP_PSR2_TP2_TIME_50us@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_5:
	cmpl	$101, %eax
	jge	LBB0_7
## %bb.6:
	movq	_EDP_PSR2_TP2_TIME_100us@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_7:
	cmpl	$501, %eax                      ## imm = 0x1F5
	jae	LBB0_8
## %bb.9:
	movq	_EDP_PSR2_TP2_TIME_500us@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_8:
	movq	_EDP_PSR2_TP2_TIME_2500us@GOTPCREL(%rip), %rax
LBB0_10:
	orl	%ebx, %r15d
	orl	(%rax), %r15d
	movq	_EDP_PSR_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	xorl	%esi, %esi
	callq	_I915_WRITE
	movq	_EDP_PSR2_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_I915_WRITE                     ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_EDP_PSR2_IDLE_FRAME_SHIFT,4,2  ## @EDP_PSR2_IDLE_FRAME_SHIFT
	.comm	_EDP_PSR2_ENABLE,4,2            ## @EDP_PSR2_ENABLE
	.comm	_EDP_SU_TRACK_ENABLE,4,2        ## @EDP_SU_TRACK_ENABLE
	.comm	_EDP_Y_COORDINATE_ENABLE,4,2    ## @EDP_Y_COORDINATE_ENABLE
	.comm	_EDP_PSR2_TP2_TIME_50us,4,2     ## @EDP_PSR2_TP2_TIME_50us
	.comm	_EDP_PSR2_TP2_TIME_100us,4,2    ## @EDP_PSR2_TP2_TIME_100us
	.comm	_EDP_PSR2_TP2_TIME_500us,4,2    ## @EDP_PSR2_TP2_TIME_500us
	.comm	_EDP_PSR2_TP2_TIME_2500us,4,2   ## @EDP_PSR2_TP2_TIME_2500us
	.comm	_EDP_PSR_CTL,4,2                ## @EDP_PSR_CTL
	.comm	_EDP_PSR2_CTL,4,2               ## @EDP_PSR2_CTL
	.no_dead_strip	_hsw_activate_psr2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hsw_activate_psr2
_hsw_activate_psr2:                     ; @hsw_activate_psr2
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_dp_to_i915
	mov	x19, x0
	ldr	w1, [x0]
	mov	w0, #6
	bl	_max
	ldr	w8, [x19, #8]
	add	w1, w8, #1
	bl	_max
Lloh0:
	adrp	x8, _EDP_PSR2_IDLE_FRAME_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EDP_PSR2_IDLE_FRAME_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	lsl	w8, w0, w8
Lloh3:
	adrp	x9, _EDP_PSR2_ENABLE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _EDP_PSR2_ENABLE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _EDP_SU_TRACK_ENABLE@GOTPAGE
Lloh7:
	ldr	x10, [x10, _EDP_SU_TRACK_ENABLE@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	orr	w8, w8, w9
	orr	w20, w8, w10
	mov	x0, x19
	bl	_INTEL_GEN
	cmp	w0, #9
	b.gt	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_IS_GEMINILAKE
	cbz	x0, LBB0_3
LBB0_2:
Lloh9:
	adrp	x8, _EDP_Y_COORDINATE_ENABLE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EDP_Y_COORDINATE_ENABLE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	orr	w20, w8, w20
LBB0_3:
	ldr	w8, [x19, #8]
	add	w0, w8, #1
	bl	_EDP_PSR2_FRAME_BEFORE_SU
	ldr	w8, [x19, #4]
Lloh12:
	adrp	x9, _EDP_PSR2_TP2_TIME_50us@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EDP_PSR2_TP2_TIME_50us@GOTPAGEOFF]
Lloh14:
	adrp	x10, _EDP_PSR2_TP2_TIME_100us@GOTPAGE
Lloh15:
	ldr	x10, [x10, _EDP_PSR2_TP2_TIME_100us@GOTPAGEOFF]
Lloh16:
	adrp	x11, _EDP_PSR2_TP2_TIME_2500us@GOTPAGE
Lloh17:
	ldr	x11, [x11, _EDP_PSR2_TP2_TIME_2500us@GOTPAGEOFF]
Lloh18:
	adrp	x12, _EDP_PSR2_TP2_TIME_500us@GOTPAGE
Lloh19:
	ldr	x12, [x12, _EDP_PSR2_TP2_TIME_500us@GOTPAGEOFF]
	cmp	w8, #501
	csel	x11, x12, x11, lo
	cmp	w8, #101
	csel	x10, x10, x11, lt
	cmp	w8, #51
	csel	x8, x9, x10, lo
	orr	w9, w0, w20
	ldr	w8, [x8]
	orr	w19, w9, w8
Lloh20:
	adrp	x8, _EDP_PSR_CTL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EDP_PSR_CTL@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	mov	w1, #0
	bl	_I915_WRITE
Lloh23:
	adrp	x8, _EDP_PSR2_CTL@GOTPAGE
Lloh24:
	ldr	x8, [x8, _EDP_PSR2_CTL@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_I915_WRITE
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EDP_PSR2_IDLE_FRAME_SHIFT,4,2  ; @EDP_PSR2_IDLE_FRAME_SHIFT
	.comm	_EDP_PSR2_ENABLE,4,2            ; @EDP_PSR2_ENABLE
	.comm	_EDP_SU_TRACK_ENABLE,4,2        ; @EDP_SU_TRACK_ENABLE
	.comm	_EDP_Y_COORDINATE_ENABLE,4,2    ; @EDP_Y_COORDINATE_ENABLE
	.comm	_EDP_PSR2_TP2_TIME_50us,4,2     ; @EDP_PSR2_TP2_TIME_50us
	.comm	_EDP_PSR2_TP2_TIME_100us,4,2    ; @EDP_PSR2_TP2_TIME_100us
	.comm	_EDP_PSR2_TP2_TIME_500us,4,2    ; @EDP_PSR2_TP2_TIME_500us
	.comm	_EDP_PSR2_TP2_TIME_2500us,4,2   ; @EDP_PSR2_TP2_TIME_2500us
	.comm	_EDP_PSR_CTL,4,2                ; @EDP_PSR_CTL
	.comm	_EDP_PSR2_CTL,4,2               ; @EDP_PSR2_CTL
	.no_dead_strip	_hsw_activate_psr2
.subsections_via_symbols
