	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_dp_complete_link_train   ## -- Begin function intel_dp_complete_link_train
	.p2align	4, 0x90
_intel_dp_complete_link_train:          ## @intel_dp_complete_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	%rsp, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	8(%rdi), %eax
	movl	%eax, -52(%rbp)
	movq	_DP_LINK_STATUS_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	xorl	%r13d, %r13d
	xorl	%r14d, %r14d
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	callq	_intel_dp_start_link_train
	incl	%r14d
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	%r12, %rsp
	movq	%rsp, %r12
	movq	_DP_LINK_STATUS_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	cmpl	$5, %r14d
	jg	LBB0_11
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	leaq	-52(%rbp), %rsi
	callq	_intel_dp_set_signal_levels
	movl	-52(%rbp), %esi
	movq	_DP_LINK_SCRAMBLING_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_DP_TRAINING_PATTERN_2@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	movq	%r15, %rdi
	callq	_intel_dp_set_link_train
	testl	%eax, %eax
	je	LBB0_12
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	4(%r15), %edi
	callq	_drm_dp_link_train_channel_eq_delay
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_intel_dp_get_link_status
	testl	%eax, %eax
	je	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_drm_dp_clock_recovery_ok
	testl	%eax, %eax
	je	LBB0_4
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_drm_dp_channel_eq_ok
	testq	%rax, %rax
	jne	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r15, %rdi
	cmpl	$6, %r13d
	jge	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rsi
	callq	_intel_get_adjust_train
	incl	%r13d
	jmp	LBB0_10
LBB0_8:                                 ##   in Loop: Header=BB0_1 Depth=1
	callq	_intel_dp_link_down
	movq	%r15, %rdi
	callq	_intel_dp_start_link_train
	incl	%r14d
	xorl	%r13d, %r13d
	jmp	LBB0_10
LBB0_11:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	%r15, %rdi
	callq	_intel_dp_link_down
LBB0_12:
	movq	%r12, %rsp
LBB0_13:
	movl	-52(%rbp), %esi
	movq	_DP_TRAINING_PATTERN_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_intel_dp_set_link_train
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_15
## %bb.14:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	%r12, %rsp
	leaq	L_.str.1(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_13
LBB0_15:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DP_LINK_STATUS_SIZE,4,2        ## @DP_LINK_STATUS_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to train DP, aborting\n"

	.comm	_DP_TRAINING_PATTERN_2,4,2      ## @DP_TRAINING_PATTERN_2
	.comm	_DP_LINK_SCRAMBLING_DISABLE,4,2 ## @DP_LINK_SCRAMBLING_DISABLE
L_.str.1:                               ## @.str.1
	.asciz	"Channel EQ done. DP Training successfull\n"

	.comm	_DP_TRAINING_PATTERN_DISABLE,4,2 ## @DP_TRAINING_PATTERN_DISABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_intel_dp_complete_link_train   ; -- Begin function intel_dp_complete_link_train
	.p2align	2
_intel_dp_complete_link_train:          ; @intel_dp_complete_link_train
	.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
	sub	sp, sp, #16
	mov	x19, x0
	mov	x21, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	w8, [x0, #8]
	stur	w8, [x29, #-76]
Lloh3:
	adrp	x22, _DP_LINK_STATUS_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _DP_LINK_STATUS_SIZE@GOTPAGEOFF]
	ldr	w8, [x22]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	mov	w26, #0
	mov	w23, #0
Lloh7:
	adrp	x24, _DP_TRAINING_PATTERN_2@GOTPAGE
Lloh8:
	ldr	x24, [x24, _DP_TRAINING_PATTERN_2@GOTPAGEOFF]
Lloh9:
	adrp	x25, _DP_LINK_SCRAMBLING_DISABLE@GOTPAGE
Lloh10:
	ldr	x25, [x25, _DP_LINK_SCRAMBLING_DISABLE@GOTPAGEOFF]
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x20
	bl	_intel_get_adjust_train
	add	w26, w26, #1
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	sp, x21
	mov	x21, sp
	ldr	w8, [x22]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh11:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh12:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x20, x9, x8
	mov	sp, x20
	cmp	w23, #5
	b.gt	LBB0_11
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	x1, x29, #76
	mov	x0, x19
	bl	_intel_dp_set_signal_levels
	ldur	w1, [x29, #-76]
	ldr	w8, [x24]
	ldr	w9, [x25]
	orr	w2, w9, w8
	mov	x0, x19
	bl	_intel_dp_set_link_train
	cbz	w0, LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x19, #4]
	bl	_drm_dp_link_train_channel_eq_delay
	mov	x0, x19
	mov	x1, x20
	bl	_intel_dp_get_link_status
	cbz	w0, LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x19]
	mov	x0, x20
	bl	_drm_dp_clock_recovery_ok
	cbz	w0, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w1, [x19]
	mov	x0, x20
	bl	_drm_dp_channel_eq_ok
	cbnz	x0, LBB0_15
; %bb.7:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	cmp	w26, #6
	b.lt	LBB0_1
; %bb.8:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_intel_dp_link_down
	mov	x0, x19
	bl	_intel_dp_start_link_train
	mov	w26, #0
	b	LBB0_10
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x19
	bl	_intel_dp_start_link_train
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w23, w23, #1
	b	LBB0_2
LBB0_11:
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x19
	bl	_intel_dp_link_down
LBB0_12:
	mov	sp, x21
LBB0_13:
	ldur	w1, [x29, #-76]
Lloh15:
	adrp	x8, _DP_TRAINING_PATTERN_DISABLE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DP_TRAINING_PATTERN_DISABLE@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_intel_dp_set_link_train
	ldur	x8, [x29, #-72]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.14:
	sub	sp, x29, #64
	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
	ret
LBB0_15:
	mov	sp, x21
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_DEBUG_KMS
	b	LBB0_13
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_DP_LINK_STATUS_SIZE,4,2        ; @DP_LINK_STATUS_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to train DP, aborting\n"

	.comm	_DP_TRAINING_PATTERN_2,4,2      ; @DP_TRAINING_PATTERN_2
	.comm	_DP_LINK_SCRAMBLING_DISABLE,4,2 ; @DP_LINK_SCRAMBLING_DISABLE
l_.str.1:                               ; @.str.1
	.asciz	"Channel EQ done. DP Training successfull\n"

	.comm	_DP_TRAINING_PATTERN_DISABLE,4,2 ; @DP_TRAINING_PATTERN_DISABLE
.subsections_via_symbols
