	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function analogix_dp_fast_link_train
_analogix_dp_fast_link_train:           ## @analogix_dp_fast_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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	callq	_analogix_dp_reset_macro
	movl	24(%r15), %esi
	movq	%r15, %rdi
	callq	_analogix_dp_set_link_bandwidth
	movl	8(%r15), %esi
	movq	%r15, %rdi
	callq	_analogix_dp_set_lane_count
	cmpl	$0, 8(%r15)
	jle	LBB0_3
## %bb.1:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	movl	(%rax,%rbx,4), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_analogix_dp_set_lane_link_training
	incq	%rbx
	movslq	8(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_2
LBB0_3:
	movq	_analogix_dp_get_pll_lock_status@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DP_TIMEOUT_LOOP_COUNT@GOTPCREL(%rip), %rax
	imull	$120, (%rax), %r9d
	xorl	%r14d, %r14d
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	movl	$120, %r8d
	callq	_readx_poll_timeout
	testl	%eax, %eax
	je	LBB0_6
## %bb.4:
	movl	%eax, %ebx
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
LBB0_5:
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	movl	%ebx, %r14d
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_18
## %bb.17:
	movl	%r14d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_TRAINING_PTN1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_analogix_dp_set_training_pattern
	movl	$500, %edi                      ## imm = 0x1F4
	movl	$600, %esi                      ## imm = 0x258
	callq	_usleep_range
	movq	_TRAINING_PTN2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_analogix_dp_set_training_pattern
	movl	$500, %edi                      ## imm = 0x1F4
	movl	$600, %esi                      ## imm = 0x258
	callq	_usleep_range
	movq	_DP_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_analogix_dp_set_training_pattern
	movq	_verify_fast_training@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_16
## %bb.7:
	leaq	32(%r15), %r12
	movq	_DP_LANE_ALIGN_STATUS_UPDATED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-52(%rbp), %rdx
	movq	%r12, %rdi
	callq	_drm_dp_dpcd_readb
	testl	%eax, %eax
	js	LBB0_8
## %bb.9:
	movq	_DP_LANE0_1_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%r12, %rdi
	movl	$2, %ecx
	callq	_drm_dp_dpcd_read
	testl	%eax, %eax
	js	LBB0_10
## %bb.11:
	movl	8(%r15), %esi
	leaq	-48(%rbp), %rdi
	callq	_analogix_dp_clock_recovery_ok
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	movl	(%r15), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_15
LBB0_8:
	movl	%eax, %ebx
	movl	(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_5
LBB0_10:
	movl	%eax, %ebx
	movl	(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_5
LBB0_13:
	movl	-52(%rbp), %esi
	movl	8(%r15), %edx
	leaq	-48(%rbp), %rdi
	callq	_analogix_dp_channel_eq_ok
	testq	%rax, %rax
	je	LBB0_16
## %bb.14:
	movl	(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
LBB0_15:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_DRM_DEV_ERROR
	movq	%r15, %rdi
	callq	_analogix_dp_reduce_link_rate
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r14d
	jmp	LBB0_16
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_analogix_dp_get_pll_lock_status,4,2 ## @analogix_dp_get_pll_lock_status
	.comm	_PLL_UNLOCKED,4,2               ## @PLL_UNLOCKED
	.comm	_DP_TIMEOUT_LOOP_COUNT,4,2      ## @DP_TIMEOUT_LOOP_COUNT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Wait for pll lock failed %d\n"

	.comm	_TRAINING_PTN1,4,2              ## @TRAINING_PTN1
	.comm	_TRAINING_PTN2,4,2              ## @TRAINING_PTN2
	.comm	_DP_NONE,4,2                    ## @DP_NONE
	.comm	_verify_fast_training,8,3       ## @verify_fast_training
	.comm	_DP_LANE_ALIGN_STATUS_UPDATED,4,2 ## @DP_LANE_ALIGN_STATUS_UPDATED
L_.str.1:                               ## @.str.1
	.asciz	"Read align status failed %d\n"

	.comm	_DP_LANE0_1_STATUS,4,2          ## @DP_LANE0_1_STATUS
L_.str.2:                               ## @.str.2
	.asciz	"Read link status failed %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Clock recovery failed\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.4:                               ## @.str.4
	.asciz	"Channel EQ failed\n"

	.no_dead_strip	_analogix_dp_fast_link_train
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function analogix_dp_fast_link_train
_analogix_dp_fast_link_train:           ; @analogix_dp_fast_link_train
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	bl	_analogix_dp_reset_macro
	ldr	w1, [x19, #24]
	mov	x0, x19
	bl	_analogix_dp_set_link_bandwidth
	ldr	w1, [x19, #8]
	mov	x0, x19
	bl	_analogix_dp_set_lane_count
	ldr	w8, [x19, #8]
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x20, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w1, [x8, x20, lsl #2]
	mov	x0, x19
	mov	x2, x20
	bl	_analogix_dp_set_lane_link_training
	add	x20, x20, #1
	ldrsw	x8, [x19, #8]
	cmp	x20, x8
	b.lt	LBB0_2
LBB0_3:
Lloh3:
	adrp	x8, _analogix_dp_get_pll_lock_status@GOTPAGE
Lloh4:
	ldr	x8, [x8, _analogix_dp_get_pll_lock_status@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _DP_TIMEOUT_LOOP_COUNT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DP_TIMEOUT_LOOP_COUNT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	mov	w9, #120
	mul	w5, w8, w9
	mov	x1, x19
	mov	w3, #0
	mov	w4, #120
	bl	_readx_poll_timeout
	cbz	w0, LBB0_7
; %bb.4:
	mov	x20, x0
	ldr	w0, [x19]
	str	x20, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	bl	_DRM_DEV_ERROR
LBB0_5:
	ldr	x8, [sp, #24]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.6:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
LBB0_7:
Lloh14:
	adrp	x8, _TRAINING_PTN1@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TRAINING_PTN1@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_analogix_dp_set_training_pattern
	mov	w0, #500
	mov	w1, #600
	bl	_usleep_range
Lloh17:
	adrp	x8, _TRAINING_PTN2@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TRAINING_PTN2@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_analogix_dp_set_training_pattern
	mov	w0, #500
	mov	w1, #600
	bl	_usleep_range
Lloh20:
	adrp	x8, _DP_NONE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _DP_NONE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_analogix_dp_set_training_pattern
Lloh23:
	adrp	x8, _verify_fast_training@GOTPAGE
Lloh24:
	ldr	x8, [x8, _verify_fast_training@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	cbz	x8, LBB0_17
; %bb.8:
	add	x20, x19, #32
Lloh26:
	adrp	x8, _DP_LANE_ALIGN_STATUS_UPDATED@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DP_LANE_ALIGN_STATUS_UPDATED@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x20
	bl	_drm_dp_dpcd_readb
	tbnz	w0, #31, LBB0_12
; %bb.9:
Lloh29:
	adrp	x8, _DP_LANE0_1_STATUS@GOTPAGE
Lloh30:
	ldr	x8, [x8, _DP_LANE0_1_STATUS@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	x0, x20
	mov	w3, #2
	bl	_drm_dp_dpcd_read
	tbnz	w0, #31, LBB0_13
; %bb.10:
	ldr	w1, [x19, #8]
	add	x0, sp, #16
	bl	_analogix_dp_clock_recovery_ok
	cbz	x0, LBB0_14
; %bb.11:
	ldr	w0, [x19]
Lloh32:
	adrp	x1, l_.str.3@PAGE
Lloh33:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_16
LBB0_12:
	mov	x21, x0
	ldr	w0, [x19]
	str	x21, [sp]
Lloh34:
	adrp	x1, l_.str.1@PAGE
Lloh35:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_DRM_DEV_ERROR
	mov	x20, x21
	b	LBB0_5
LBB0_13:
	mov	x20, x0
	ldr	w0, [x19]
	str	x20, [sp]
Lloh36:
	adrp	x1, l_.str.2@PAGE
Lloh37:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_DRM_DEV_ERROR
                                        ; kill: def $w20 killed $w20 killed $x20 def $x20
	b	LBB0_5
LBB0_14:
	ldr	w1, [sp, #12]
	ldr	w2, [x19, #8]
	add	x0, sp, #16
	bl	_analogix_dp_channel_eq_ok
	cbz	x0, LBB0_17
; %bb.15:
	ldr	w0, [x19]
Lloh38:
	adrp	x1, l_.str.4@PAGE
Lloh39:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_16:
	bl	_DRM_DEV_ERROR
	mov	x0, x19
	bl	_analogix_dp_reduce_link_rate
Lloh40:
	adrp	x8, _EIO@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_5
LBB0_17:
	mov	w20, #0
	b	LBB0_5
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.cfi_endproc
                                        ; -- End function
	.comm	_analogix_dp_get_pll_lock_status,4,2 ; @analogix_dp_get_pll_lock_status
	.comm	_PLL_UNLOCKED,4,2               ; @PLL_UNLOCKED
	.comm	_DP_TIMEOUT_LOOP_COUNT,4,2      ; @DP_TIMEOUT_LOOP_COUNT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Wait for pll lock failed %d\n"

	.comm	_TRAINING_PTN1,4,2              ; @TRAINING_PTN1
	.comm	_TRAINING_PTN2,4,2              ; @TRAINING_PTN2
	.comm	_DP_NONE,4,2                    ; @DP_NONE
	.comm	_verify_fast_training,8,3       ; @verify_fast_training
	.comm	_DP_LANE_ALIGN_STATUS_UPDATED,4,2 ; @DP_LANE_ALIGN_STATUS_UPDATED
l_.str.1:                               ; @.str.1
	.asciz	"Read align status failed %d\n"

	.comm	_DP_LANE0_1_STATUS,4,2          ; @DP_LANE0_1_STATUS
l_.str.2:                               ; @.str.2
	.asciz	"Read link status failed %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Clock recovery failed\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.4:                               ; @.str.4
	.asciz	"Channel EQ failed\n"

	.no_dead_strip	_analogix_dp_fast_link_train
.subsections_via_symbols
