	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_ddi_prepare_link_retrain ## -- Begin function intel_ddi_prepare_link_retrain
	.p2align	4, 0x90
_intel_ddi_prepare_link_retrain:        ## @intel_ddi_prepare_link_retrain
	.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, %rbx
	callq	_enc_to_dig_port
	movq	%rax, %r14
	movq	(%rbx), %rax
	movq	(%rax), %rbx
	movl	(%r14), %r13d
	movl	%r13d, %edi
	callq	_DP_TP_CTL
	movl	%eax, %edi
	callq	_I915_READ
	movq	_DP_TP_CTL_ENABLE@GOTPCREL(%rip), %r15
	testl	%eax, (%r15)
	je	LBB0_5
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	%r13d, %edi
	callq	_DDI_BUF_CTL
	movl	%eax, %edi
	callq	_I915_READ
	movl	%eax, %r12d
	movq	_DDI_BUF_CTL_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	testl	%r12d, %r15d
	je	LBB0_3
## %bb.2:
	movl	%r15d, %ebx
	notl	%ebx
	andl	%r12d, %ebx
	movl	%r13d, %edi
	callq	_DDI_BUF_CTL
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_I915_WRITE
LBB0_3:
	movl	%r13d, %edi
	callq	_DP_TP_CTL
	movl	%eax, %edi
	callq	_I915_READ
	movq	_DP_TP_CTL_LINK_TRAIN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	movq	_DP_TP_CTL_ENABLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	_DP_TP_CTL_LINK_TRAIN_PAT1@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	%r13d, %edi
	callq	_DP_TP_CTL
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_I915_WRITE
	movl	%r13d, %edi
	callq	_DP_TP_CTL
	movl	%eax, %edi
	callq	_POSTING_READ
	testl	%r12d, %r15d
	movq	_DP_TP_CTL_ENABLE@GOTPCREL(%rip), %r15
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_5
## %bb.4:
	movl	%r13d, %esi
	callq	_intel_wait_ddi_buf_idle
LBB0_5:
	movq	_DP_TP_CTL_MODE_SST@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	orl	(%r15), %ebx
	movq	_DP_TP_CTL_LINK_TRAIN_PAT1@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	_DP_TP_CTL_SCRAMBLE_DISABLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	8(%r14), %rcx
	movq	_DP_LANE_COUNT_ENHANCED_FRAME_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	4(%rcx), %eax
	je	LBB0_7
## %bb.6:
	movq	_DP_TP_CTL_ENHANCED_FRAME_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	orl	%eax, %ebx
	movl	%r13d, %edi
	callq	_DP_TP_CTL
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_I915_WRITE
	movl	%r13d, %edi
	callq	_DP_TP_CTL
	movl	%eax, %edi
	callq	_POSTING_READ
	movq	_DDI_BUF_CTL_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 16(%r14)
	movl	%r13d, %edi
	callq	_DDI_BUF_CTL
	movl	16(%r14), %esi
	movl	%eax, %edi
	callq	_I915_WRITE
	movl	%r13d, %edi
	callq	_DDI_BUF_CTL
	movl	%eax, %edi
	callq	_POSTING_READ
	movl	$600, %edi                      ## imm = 0x258
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_udelay                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DP_TP_CTL_ENABLE,4,2           ## @DP_TP_CTL_ENABLE
	.comm	_DDI_BUF_CTL_ENABLE,4,2         ## @DDI_BUF_CTL_ENABLE
	.comm	_DP_TP_CTL_LINK_TRAIN_MASK,4,2  ## @DP_TP_CTL_LINK_TRAIN_MASK
	.comm	_DP_TP_CTL_LINK_TRAIN_PAT1,4,2  ## @DP_TP_CTL_LINK_TRAIN_PAT1
	.comm	_DP_TP_CTL_MODE_SST,4,2         ## @DP_TP_CTL_MODE_SST
	.comm	_DP_TP_CTL_SCRAMBLE_DISABLE,4,2 ## @DP_TP_CTL_SCRAMBLE_DISABLE
	.comm	_DP_LANE_COUNT_ENHANCED_FRAME_EN,4,2 ## @DP_LANE_COUNT_ENHANCED_FRAME_EN
	.comm	_DP_TP_CTL_ENHANCED_FRAME_ENABLE,4,2 ## @DP_TP_CTL_ENHANCED_FRAME_ENABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_ddi_prepare_link_retrain ; -- Begin function intel_ddi_prepare_link_retrain
	.p2align	2
_intel_ddi_prepare_link_retrain:        ; @intel_ddi_prepare_link_retrain
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	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
	.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
	bl	_enc_to_dig_port
	mov	x20, x0
	ldr	x8, [x19]
	ldr	x21, [x8]
	ldr	w19, [x0]
	mov	x0, x19
	bl	_DP_TP_CTL
	bl	_I915_READ
Lloh0:
	adrp	x25, _DP_TP_CTL_ENABLE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _DP_TP_CTL_ENABLE@GOTPAGEOFF]
	ldr	w8, [x25]
Lloh2:
	adrp	x24, _DP_TP_CTL_LINK_TRAIN_PAT1@GOTPAGE
Lloh3:
	ldr	x24, [x24, _DP_TP_CTL_LINK_TRAIN_PAT1@GOTPAGEOFF]
Lloh4:
	adrp	x23, _DDI_BUF_CTL_ENABLE@GOTPAGE
Lloh5:
	ldr	x23, [x23, _DDI_BUF_CTL_ENABLE@GOTPAGEOFF]
	tst	w8, w0
	b.eq	LBB0_5
; %bb.1:
	mov	x0, x19
	bl	_DDI_BUF_CTL
	bl	_I915_READ
	ldr	w8, [x23]
	ands	w26, w8, w0
	b.eq	LBB0_3
; %bb.2:
	bic	w22, w0, w8
	mov	x0, x19
	bl	_DDI_BUF_CTL
	mov	x1, x22
	bl	_I915_WRITE
LBB0_3:
	mov	x0, x19
	bl	_DP_TP_CTL
	bl	_I915_READ
Lloh6:
	adrp	x8, _DP_TP_CTL_LINK_TRAIN_MASK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DP_TP_CTL_LINK_TRAIN_MASK@GOTPAGEOFF]
	ldr	w9, [x25]
Lloh8:
	ldr	w8, [x8]
	orr	w8, w8, w9
	bic	w8, w0, w8
	ldr	w9, [x24]
	orr	w22, w8, w9
	mov	x0, x19
	bl	_DP_TP_CTL
	mov	x1, x22
	bl	_I915_WRITE
	mov	x0, x19
	bl	_DP_TP_CTL
	bl	_POSTING_READ
	cbz	w26, LBB0_5
; %bb.4:
	mov	x0, x21
	mov	x1, x19
	bl	_intel_wait_ddi_buf_idle
LBB0_5:
	ldr	w8, [x25]
Lloh9:
	adrp	x9, _DP_TP_CTL_MODE_SST@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DP_TP_CTL_MODE_SST@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x24]
	orr	w8, w8, w9
Lloh12:
	adrp	x9, _DP_TP_CTL_SCRAMBLE_DISABLE@GOTPAGE
Lloh13:
	ldr	x9, [x9, _DP_TP_CTL_SCRAMBLE_DISABLE@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w8, w8, w9
	ldr	x9, [x20, #8]
	ldr	w9, [x9, #4]
Lloh15:
	adrp	x10, _DP_LANE_COUNT_ENHANCED_FRAME_EN@GOTPAGE
Lloh16:
	ldr	x10, [x10, _DP_LANE_COUNT_ENHANCED_FRAME_EN@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
Lloh18:
	adrp	x11, _DP_TP_CTL_ENHANCED_FRAME_ENABLE@GOTPAGE
Lloh19:
	ldr	x11, [x11, _DP_TP_CTL_ENHANCED_FRAME_ENABLE@GOTPAGEOFF]
Lloh20:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w9, wzr, w11, eq
	orr	w21, w8, w9
	mov	x0, x19
	bl	_DP_TP_CTL
	mov	x1, x21
	bl	_I915_WRITE
	mov	x0, x19
	bl	_DP_TP_CTL
	bl	_POSTING_READ
	ldr	w8, [x23]
	ldr	w9, [x20, #16]
	orr	w8, w9, w8
	str	w8, [x20, #16]
	mov	x0, x19
	bl	_DDI_BUF_CTL
	ldr	w1, [x20, #16]
	bl	_I915_WRITE
	mov	x0, x19
	bl	_DDI_BUF_CTL
	bl	_POSTING_READ
	mov	w0, #600
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_udelay
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_DP_TP_CTL_ENABLE,4,2           ; @DP_TP_CTL_ENABLE
	.comm	_DDI_BUF_CTL_ENABLE,4,2         ; @DDI_BUF_CTL_ENABLE
	.comm	_DP_TP_CTL_LINK_TRAIN_MASK,4,2  ; @DP_TP_CTL_LINK_TRAIN_MASK
	.comm	_DP_TP_CTL_LINK_TRAIN_PAT1,4,2  ; @DP_TP_CTL_LINK_TRAIN_PAT1
	.comm	_DP_TP_CTL_MODE_SST,4,2         ; @DP_TP_CTL_MODE_SST
	.comm	_DP_TP_CTL_SCRAMBLE_DISABLE,4,2 ; @DP_TP_CTL_SCRAMBLE_DISABLE
	.comm	_DP_LANE_COUNT_ENHANCED_FRAME_EN,4,2 ; @DP_LANE_COUNT_ENHANCED_FRAME_EN
	.comm	_DP_TP_CTL_ENHANCED_FRAME_ENABLE,4,2 ; @DP_TP_CTL_ENHANCED_FRAME_ENABLE
.subsections_via_symbols
