	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_dp_set_idle_link_train   ## -- Begin function intel_dp_set_idle_link_train
	.p2align	4, 0x90
_intel_dp_set_idle_link_train:          ## @intel_dp_set_idle_link_train
	.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
	movq	%rdi, %rbx
	callq	_dp_to_i915
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_dp_to_dig_port
	movl	(%rax), %r15d
	movq	%r14, %rdi
	callq	_HAS_DDI
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movl	%r15d, %edi
	callq	_DP_TP_CTL
	movl	%eax, %edi
	callq	_I915_READ
	movq	_DP_TP_CTL_LINK_TRAIN_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movq	_DP_TP_CTL_LINK_TRAIN_IDLE@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movl	%r15d, %edi
	callq	_DP_TP_CTL
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_I915_WRITE
	movq	_PORT_A@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r15d
	je	LBB0_3
## %bb.2:
	movl	%r15d, %edi
	callq	_DP_TP_STATUS
	movq	_DP_TP_STATUS_IDLE_DONE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	movl	$1, %ecx
	callq	_intel_de_wait_for_set
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	leaq	L_.str(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_DRM_ERROR                      ## TAILCALL
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DP_TP_CTL_LINK_TRAIN_MASK,4,2  ## @DP_TP_CTL_LINK_TRAIN_MASK
	.comm	_DP_TP_CTL_LINK_TRAIN_IDLE,4,2  ## @DP_TP_CTL_LINK_TRAIN_IDLE
	.comm	_PORT_A,4,2                     ## @PORT_A
	.comm	_DP_TP_STATUS_IDLE_DONE,4,2     ## @DP_TP_STATUS_IDLE_DONE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Timed out waiting for DP idle patterns\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_dp_set_idle_link_train   ; -- Begin function intel_dp_set_idle_link_train
	.p2align	2
_intel_dp_set_idle_link_train:          ; @intel_dp_set_idle_link_train
	.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	x20, x0
	bl	_dp_to_i915
	mov	x19, x0
	mov	x0, x20
	bl	_dp_to_dig_port
	ldr	w20, [x0]
	mov	x0, x19
	bl	_HAS_DDI
	cbz	w0, LBB0_4
; %bb.1:
	mov	x0, x20
	bl	_DP_TP_CTL
	bl	_I915_READ
Lloh0:
	adrp	x8, _DP_TP_CTL_LINK_TRAIN_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DP_TP_CTL_LINK_TRAIN_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	bic	w8, w0, w8
Lloh3:
	adrp	x9, _DP_TP_CTL_LINK_TRAIN_IDLE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DP_TP_CTL_LINK_TRAIN_IDLE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w21, w8, w9
	mov	x0, x20
	bl	_DP_TP_CTL
	mov	x1, x21
	bl	_I915_WRITE
Lloh6:
	adrp	x8, _PORT_A@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PORT_A@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w20, w8
	b.eq	LBB0_4
; %bb.2:
	mov	x0, x20
	bl	_DP_TP_STATUS
	mov	x1, x0
Lloh9:
	adrp	x8, _DP_TP_STATUS_IDLE_DONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DP_TP_STATUS_IDLE_DONE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_intel_de_wait_for_set
	cbz	x0, LBB0_4
; %bb.3:
Lloh12:
	adrp	x0, l_.str@PAGE
Lloh13:
	add	x0, x0, l_.str@PAGEOFF
	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	_DRM_ERROR
LBB0_4:
	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
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DP_TP_CTL_LINK_TRAIN_MASK,4,2  ; @DP_TP_CTL_LINK_TRAIN_MASK
	.comm	_DP_TP_CTL_LINK_TRAIN_IDLE,4,2  ; @DP_TP_CTL_LINK_TRAIN_IDLE
	.comm	_PORT_A,4,2                     ; @PORT_A
	.comm	_DP_TP_STATUS_IDLE_DONE,4,2     ; @DP_TP_STATUS_IDLE_DONE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Timed out waiting for DP idle patterns\n"

.subsections_via_symbols
