	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdv_intel_dp_complete_link_train
_cdv_intel_dp_complete_link_train:      ## @cdv_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, %rbx
	movq	(%rdi), %r14
	movl	(%r14), %r12d
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	movq	_DP_LINK_TRAIN_PAT_2@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	orl	%r12d, %r15d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%r12d, %r12d
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_2 Depth 2
	cmpl	$7, %r12d
	movl	$6, %r13d
	cmovgel	%r12d, %r13d
	.p2align	4, 0x90
LBB0_2:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	24(%r14), %rax
	movq	32(%r14), %rcx
	movl	(%rax), %esi
	movl	(%rcx), %edx
	movl	4(%rcx), %ecx
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	movq	_DP_TRAINING_PATTERN_2@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_cdv_intel_dp_set_link_train
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=2
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=2
	cmpl	%r12d, %r13d
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	24(%r14), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cdv_intel_dp_set_vswing_premph
	movq	_DP_TRAINING_PATTERN_2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_cdv_intel_dplink_set_level
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_udelay
	movq	%rbx, %rdi
	callq	_cdv_intel_dp_get_link_status
	testl	%eax, %eax
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_2 Depth=2
	movq	16(%r14), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edx
	movl	8(%rax), %ecx
	movl	12(%rax), %r8d
	movl	16(%rax), %r9d
	movl	20(%rax), %eax
	movl	%eax, (%rsp)
	leaq	L_.str.4(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	movq	16(%r14), %rdi
	movl	8(%r14), %esi
	callq	_cdv_intel_clock_recovery_ok
	movq	%rbx, %rdi
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_2 Depth=2
	callq	_cdv_intel_dp_start_link_train
	incl	%r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_1 Depth=1
	callq	_cdv_intel_channel_eq_ok
	testq	%rax, %rax
	jne	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	movq	%rbx, %rdi
	cmpl	$6, %r13d
	jge	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	callq	_cdv_intel_get_adjust_train
	incl	%r13d
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_1
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	callq	_cdv_intel_dp_link_down
	movq	%rbx, %rdi
	callq	_cdv_intel_dp_start_link_train
	incl	%r12d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_1
LBB0_5:
	leaq	L_.str.3(%rip), %rdi
	callq	_DRM_ERROR
	movq	%rbx, %rdi
	callq	_cdv_intel_dp_link_down
LBB0_11:
	movq	_DP_LINK_TRAIN_OFF@GOTPCREL(%rip), %rax
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	orl	(%rax), %esi
	movl	4(%r14), %edi
	callq	_REG_WRITE
	movl	4(%r14), %edi
	callq	_REG_READ
	movq	_DP_TRAINING_PATTERN_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_DP_TRAINING_PATTERN_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cdv_intel_dp_aux_native_write_1 ## TAILCALL
LBB0_10:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\n"

	.comm	_DP_LINK_TRAIN_PAT_2,4,2        ## @DP_LINK_TRAIN_PAT_2
L_.str.1:                               ## @.str.1
	.asciz	"DP Link Train Set %x, Link_config %x, %x\n"

	.comm	_DP_TRAINING_PATTERN_2,4,2      ## @DP_TRAINING_PATTERN_2
L_.str.2:                               ## @.str.2
	.asciz	"Failure in aux-transfer setting pattern 2\n"

L_.str.3:                               ## @.str.3
	.asciz	"failed to train DP, aborting\n"

L_.str.4:                               ## @.str.4
	.asciz	"DP Link status %x, %x, %x, %x, %x, %x\n"

L_.str.5:                               ## @.str.5
	.asciz	"PT2 train is done\n"

	.comm	_DP_LINK_TRAIN_OFF,4,2          ## @DP_LINK_TRAIN_OFF
	.comm	_DP_TRAINING_PATTERN_SET,4,2    ## @DP_TRAINING_PATTERN_SET
	.comm	_DP_TRAINING_PATTERN_DISABLE,4,2 ## @DP_TRAINING_PATTERN_DISABLE
	.no_dead_strip	_cdv_intel_dp_complete_link_train
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdv_intel_dp_complete_link_train
_cdv_intel_dp_complete_link_train:      ; @cdv_intel_dp_complete_link_train
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
	ldr	x24, [x0]
	ldr	w25, [x24]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	str	wzr, [sp, #60]                  ; 4-byte Folded Spill
	mov	w26, #0
Lloh2:
	adrp	x8, _DP_LINK_TRAIN_PAT_2@GOTPAGE
Lloh3:
	ldr	x8, [x8, _DP_LINK_TRAIN_PAT_2@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	orr	w20, w8, w25
	mov	w8, #6
Lloh5:
	adrp	x21, l_.str.1@PAGE
Lloh6:
	add	x21, x21, l_.str.1@PAGEOFF
Lloh7:
	adrp	x28, _DP_TRAINING_PATTERN_2@GOTPAGE
Lloh8:
	ldr	x28, [x28, _DP_TRAINING_PATTERN_2@GOTPAGEOFF]
Lloh9:
	adrp	x22, l_.str.2@PAGE
Lloh10:
	add	x22, x22, l_.str.2@PAGEOFF
Lloh11:
	adrp	x23, l_.str.4@PAGE
Lloh12:
	add	x23, x23, l_.str.4@PAGEOFF
LBB0_1:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_2 Depth 2
	cmp	w26, #6
	csel	w27, w26, w8, gt
LBB0_2:                                 ;   Parent Loop BB0_1 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldp	x8, x9, [x24, #24]
	ldr	w8, [x8]
	ldp	w10, w9, [x9]
	stp	x10, x9, [sp, #8]
	str	x8, [sp]
	mov	x0, x21
	bl	_DRM_DEBUG_KMS
	ldr	w2, [x28]
	mov	x0, x19
	mov	x1, x20
	bl	_cdv_intel_dp_set_link_train
	cbnz	w0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=2
	mov	x0, x22
	bl	_DRM_DEBUG_KMS
LBB0_4:                                 ;   in Loop: Header=BB0_2 Depth=2
	cmp	w27, w26
	b.eq	LBB0_12
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=2
	ldr	x8, [x24, #24]
	ldr	w1, [x8]
	mov	x0, x19
	bl	_cdv_intel_dp_set_vswing_premph
	ldr	w1, [x28]
	mov	x0, x19
	bl	_cdv_intel_dplink_set_level
	mov	w0, #1000
	bl	_udelay
	mov	x0, x19
	bl	_cdv_intel_dp_get_link_status
	cbz	w0, LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_2 Depth=2
	ldr	x8, [x24, #16]
	ldp	w9, w10, [x8]
	ldp	w11, w12, [x8, #8]
	ldp	w13, w8, [x8, #16]
	stp	x13, x8, [sp, #32]
	stp	x11, x12, [sp, #16]
	stp	x9, x10, [sp]
	mov	x0, x23
	bl	_DRM_DEBUG_KMS
	ldr	x0, [x24, #16]
	ldr	w1, [x24, #8]
	bl	_cdv_intel_clock_recovery_ok
	cbnz	w0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_2 Depth=2
	mov	x0, x19
	bl	_cdv_intel_dp_start_link_train
	add	w26, w26, #1
	b	LBB0_2
LBB0_8:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_cdv_intel_channel_eq_ok
	cbnz	x0, LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w27, [sp, #60]                  ; 4-byte Folded Reload
	mov	x0, x19
	cmp	w27, #6
	b.ge	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_1 Depth=1
	bl	_cdv_intel_get_adjust_train
	add	w27, w27, #1
	str	w27, [sp, #60]                  ; 4-byte Folded Spill
	mov	w8, #6
	b	LBB0_1
LBB0_11:                                ;   in Loop: Header=BB0_1 Depth=1
	bl	_cdv_intel_dp_link_down
	mov	x0, x19
	bl	_cdv_intel_dp_start_link_train
	str	wzr, [sp, #60]                  ; 4-byte Folded Spill
	add	w26, w26, #1
	mov	w8, #6
	b	LBB0_1
LBB0_12:
Lloh13:
	adrp	x0, l_.str.3@PAGE
Lloh14:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x19
	bl	_cdv_intel_dp_link_down
LBB0_13:
Lloh15:
	adrp	x8, _DP_LINK_TRAIN_OFF@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DP_LINK_TRAIN_OFF@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	orr	w1, w8, w25
	ldr	w0, [x24, #4]
	bl	_REG_WRITE
	ldr	w0, [x24, #4]
	bl	_REG_READ
Lloh18:
	adrp	x8, _DP_TRAINING_PATTERN_SET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _DP_TRAINING_PATTERN_SET@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _DP_TRAINING_PATTERN_DISABLE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DP_TRAINING_PATTERN_DISABLE@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	b	_cdv_intel_dp_aux_native_write_1
LBB0_14:
Lloh24:
	adrp	x0, l_.str.5@PAGE
Lloh25:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_DRM_DEBUG_KMS
	b	LBB0_13
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_DP_LINK_TRAIN_PAT_2,4,2        ; @DP_LINK_TRAIN_PAT_2
l_.str.1:                               ; @.str.1
	.asciz	"DP Link Train Set %x, Link_config %x, %x\n"

	.comm	_DP_TRAINING_PATTERN_2,4,2      ; @DP_TRAINING_PATTERN_2
l_.str.2:                               ; @.str.2
	.asciz	"Failure in aux-transfer setting pattern 2\n"

l_.str.3:                               ; @.str.3
	.asciz	"failed to train DP, aborting\n"

l_.str.4:                               ; @.str.4
	.asciz	"DP Link status %x, %x, %x, %x, %x, %x\n"

l_.str.5:                               ; @.str.5
	.asciz	"PT2 train is done\n"

	.comm	_DP_LINK_TRAIN_OFF,4,2          ; @DP_LINK_TRAIN_OFF
	.comm	_DP_TRAINING_PATTERN_SET,4,2    ; @DP_TRAINING_PATTERN_SET
	.comm	_DP_TRAINING_PATTERN_DISABLE,4,2 ; @DP_TRAINING_PATTERN_DISABLE
	.no_dead_strip	_cdv_intel_dp_complete_link_train
.subsections_via_symbols
