	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_dp_link_train           ## -- Begin function radeon_dp_link_train
	.p2align	4, 0x90
_radeon_dp_link_train:                  ## @radeon_dp_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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	callq	_to_radeon_encoder
	movq	(%rax), %r15
	testq	%r15, %r15
	je	LBB0_21
## %bb.1:
	movq	%r14, %rdi
	callq	_to_radeon_connector
	movq	8(%rax), %r13
	testq	%r13, %r13
	je	LBB0_21
## %bb.2:
	movq	%rax, %r12
	movq	(%r13), %rax
	movq	_CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.3:
	movq	_CONNECTOR_OBJECT_ID_eDP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_21
LBB0_4:
	movl	$1, -112(%rbp)
	movq	_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_DPEncoderService@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_GetIndexIntoMasterTable
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edi
	leaq	-116(%rbp), %rdx
	leaq	-52(%rbp), %rcx
	movl	%eax, %esi
	callq	_atom_parse_cmd_header
	testq	%rax, %rax
	je	LBB0_7
## %bb.5:
	cmpl	$2, -52(%rbp)
	jl	LBB0_7
## %bb.6:
	movl	$0, -112(%rbp)
LBB0_7:
	cmpq	$0, 8(%r15)
	jne	LBB0_8
## %bb.9:
	movq	_ATOM_DP_CONFIG_DIG1_ENCODER@GOTPCREL(%rip), %rax
	cmpq	$0, (%r15)
	je	LBB0_12
LBB0_11:
	movq	_ATOM_DP_CONFIG_LINK_B@GOTPCREL(%rip), %rcx
	jmp	LBB0_13
LBB0_8:
	movq	_ATOM_DP_CONFIG_DIG2_ENCODER@GOTPCREL(%rip), %rax
	cmpq	$0, (%r15)
	jne	LBB0_11
LBB0_12:
	movq	_ATOM_DP_CONFIG_LINK_A@GOTPCREL(%rip), %rcx
LBB0_13:
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, -60(%rbp)
	movq	(%r12), %rdi
	movq	_DP_MAX_LANE_COUNT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	callq	_drm_dp_dpcd_readb
	xorl	%ecx, %ecx
	cmpl	$1, %eax
	jne	LBB0_17
## %bb.14:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_ASIC_IS_DCE5
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	_DP_TPS3_SUPPORTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1, %ecx
	testl	%eax, -56(%rbp)
	jne	LBB0_17
LBB0_16:
	xorl	%ecx, %ecx
LBB0_17:
	movl	%ecx, -108(%rbp)
	movl	16(%r13), %esi
	movq	_DP_RECEIVER_CAP_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -72(%rbp)
	movq	%rbx, -80(%rbp)
	movq	%r14, -88(%rbp)
	movl	12(%r13), %eax
	movl	%eax, -92(%rbp)
	movl	8(%r13), %eax
	movl	%eax, -96(%rbp)
	movq	(%r12), %rax
	movq	%rax, -104(%rbp)
	leaq	-112(%rbp), %rdi
	callq	_radeon_dp_link_train_init
	testq	%rax, %rax
	jne	LBB0_20
## %bb.18:
	leaq	-112(%rbp), %rdi
	callq	_radeon_dp_link_train_cr
	testq	%rax, %rax
	jne	LBB0_20
## %bb.19:
	leaq	-112(%rbp), %rdi
	callq	_radeon_dp_link_train_ce
LBB0_20:
	leaq	-112(%rbp), %rdi
	callq	_radeon_dp_link_train_finish
LBB0_21:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CONNECTOR_OBJECT_ID_DISPLAYPORT,8,3 ## @CONNECTOR_OBJECT_ID_DISPLAYPORT
	.comm	_CONNECTOR_OBJECT_ID_eDP,8,3    ## @CONNECTOR_OBJECT_ID_eDP
	.comm	_COMMAND,4,2                    ## @COMMAND
	.comm	_DPEncoderService,4,2           ## @DPEncoderService
	.comm	_ATOM_DP_CONFIG_DIG2_ENCODER,4,2 ## @ATOM_DP_CONFIG_DIG2_ENCODER
	.comm	_ATOM_DP_CONFIG_DIG1_ENCODER,4,2 ## @ATOM_DP_CONFIG_DIG1_ENCODER
	.comm	_ATOM_DP_CONFIG_LINK_B,4,2      ## @ATOM_DP_CONFIG_LINK_B
	.comm	_ATOM_DP_CONFIG_LINK_A,4,2      ## @ATOM_DP_CONFIG_LINK_A
	.comm	_DP_MAX_LANE_COUNT,4,2          ## @DP_MAX_LANE_COUNT
	.comm	_DP_TPS3_SUPPORTED,4,2          ## @DP_TPS3_SUPPORTED
	.comm	_DP_RECEIVER_CAP_SIZE,4,2       ## @DP_RECEIVER_CAP_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_dp_link_train           ; -- Begin function radeon_dp_link_train
	.p2align	2
_radeon_dp_link_train:                  ; @radeon_dp_link_train
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x21, [x8]
	bl	_to_radeon_encoder
	ldr	x24, [x0]
	cbz	x24, LBB0_14
; %bb.1:
	mov	x0, x19
	bl	_to_radeon_connector
	ldr	x23, [x0, #8]
	cbz	x23, LBB0_14
; %bb.2:
	ldr	x8, [x23]
Lloh0:
	adrp	x9, _CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _CONNECTOR_OBJECT_ID_eDP@GOTPAGE
Lloh4:
	ldr	x10, [x10, _CONNECTOR_OBJECT_ID_eDP@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_14
; %bb.3:
	mov	x22, x0
	mov	w8, #1
	str	w8, [sp, #24]
Lloh6:
	adrp	x8, _COMMAND@GOTPAGE
Lloh7:
	ldr	x8, [x8, _COMMAND@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x8, _DPEncoderService@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DPEncoderService@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	bl	_GetIndexIntoMasterTable
	mov	x1, x0
	ldr	w0, [x21]
	add	x2, sp, #16
	add	x3, sp, #12
	bl	_atom_parse_cmd_header
	ldr	w8, [sp, #12]
	cmp	x0, #0
	ccmp	w8, #2, #8, ne
	b.lt	LBB0_5
; %bb.4:
	str	wzr, [sp, #24]
LBB0_5:
Lloh12:
	adrp	x8, _ATOM_DP_CONFIG_DIG1_ENCODER@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ATOM_DP_CONFIG_DIG1_ENCODER@GOTPAGEOFF]
Lloh14:
	adrp	x9, _ATOM_DP_CONFIG_DIG2_ENCODER@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ATOM_DP_CONFIG_DIG2_ENCODER@GOTPAGEOFF]
	ldp	x11, x10, [x24]
	cmp	x10, #0
	csel	x8, x8, x9, eq
Lloh16:
	adrp	x9, _ATOM_DP_CONFIG_LINK_A@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ATOM_DP_CONFIG_LINK_A@GOTPAGEOFF]
	ldr	w8, [x8]
Lloh18:
	adrp	x10, _ATOM_DP_CONFIG_LINK_B@GOTPAGE
Lloh19:
	ldr	x10, [x10, _ATOM_DP_CONFIG_LINK_B@GOTPAGEOFF]
	cmp	x11, #0
	csel	x9, x9, x10, eq
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [sp, #76]
	ldr	x0, [x22]
Lloh20:
	adrp	x8, _DP_MAX_LANE_COUNT@GOTPAGE
Lloh21:
	ldr	x8, [x8, _DP_MAX_LANE_COUNT@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	add	x2, sp, #20
	bl	_drm_dp_dpcd_readb
	cmp	w0, #1
	b.ne	LBB0_9
; %bb.6:
	mov	x0, x21
	bl	_ASIC_IS_DCE5
	cbz	x0, LBB0_9
; %bb.7:
	ldr	w8, [sp, #20]
Lloh23:
	adrp	x9, _DP_TPS3_SUPPORTED@GOTPAGE
Lloh24:
	ldr	x9, [x9, _DP_TPS3_SUPPORTED@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
	mov	w8, #1
	b	LBB0_10
LBB0_9:
	mov	w8, #0
LBB0_10:
	str	w8, [sp, #28]
	ldr	w1, [x23, #16]
Lloh26:
	adrp	x8, _DP_RECEIVER_CAP_SIZE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DP_RECEIVER_CAP_SIZE@GOTPAGEOFF]
Lloh28:
	ldr	w2, [x8]
	bl	_memcpy
	stp	x20, x21, [sp, #56]
	str	x19, [sp, #48]
	ldr	d0, [x23, #8]
	str	d0, [sp, #40]
	ldr	x8, [x22]
	str	x8, [sp, #32]
	add	x0, sp, #24
	bl	_radeon_dp_link_train_init
	cbnz	x0, LBB0_13
; %bb.11:
	add	x0, sp, #24
	bl	_radeon_dp_link_train_cr
	cbnz	x0, LBB0_13
; %bb.12:
	add	x0, sp, #24
	bl	_radeon_dp_link_train_ce
LBB0_13:
	add	x0, sp, #24
	bl	_radeon_dp_link_train_finish
LBB0_14:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_CONNECTOR_OBJECT_ID_DISPLAYPORT,8,3 ; @CONNECTOR_OBJECT_ID_DISPLAYPORT
	.comm	_CONNECTOR_OBJECT_ID_eDP,8,3    ; @CONNECTOR_OBJECT_ID_eDP
	.comm	_COMMAND,4,2                    ; @COMMAND
	.comm	_DPEncoderService,4,2           ; @DPEncoderService
	.comm	_ATOM_DP_CONFIG_DIG2_ENCODER,4,2 ; @ATOM_DP_CONFIG_DIG2_ENCODER
	.comm	_ATOM_DP_CONFIG_DIG1_ENCODER,4,2 ; @ATOM_DP_CONFIG_DIG1_ENCODER
	.comm	_ATOM_DP_CONFIG_LINK_B,4,2      ; @ATOM_DP_CONFIG_LINK_B
	.comm	_ATOM_DP_CONFIG_LINK_A,4,2      ; @ATOM_DP_CONFIG_LINK_A
	.comm	_DP_MAX_LANE_COUNT,4,2          ; @DP_MAX_LANE_COUNT
	.comm	_DP_TPS3_SUPPORTED,4,2          ; @DP_TPS3_SUPPORTED
	.comm	_DP_RECEIVER_CAP_SIZE,4,2       ; @DP_RECEIVER_CAP_SIZE
.subsections_via_symbols
