	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_edp_current_link_settings_on_detect
_read_edp_current_link_settings_on_detect: ## @read_edp_current_link_settings_on_detect
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	$0, -32(%rbp)
	movq	$0, -40(%rbp)
	movq	_DP_LANE_COUNT_SET@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	-32(%rbp), %rdx
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	movq	_DC_OK@GOTPCREL(%rip), %r15
	cmpl	(%r15), %eax
	je	LBB0_1
## %bb.2:
	movl	$8, %edi
	callq	_msleep
	movl	(%r14), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	cmpl	(%r15), %eax
	je	LBB0_1
## %bb.3:
	movl	$8, %edi
	callq	_msleep
	movl	(%r14), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	cmpl	(%r15), %eax
	je	LBB0_1
## %bb.4:
	movl	$8, %edi
	callq	_msleep
	movl	(%r14), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	cmpl	(%r15), %eax
	je	LBB0_1
## %bb.5:
	movl	$8, %edi
	callq	_msleep
	movl	(%r14), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	cmpl	(%r15), %eax
	je	LBB0_1
## %bb.6:
	movl	$8, %edi
	callq	_msleep
	movl	(%r14), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	cmpl	(%r15), %eax
	je	LBB0_1
## %bb.7:
	movl	$8, %edi
	callq	_msleep
	movl	(%r14), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	cmpl	(%r15), %eax
	je	LBB0_1
## %bb.8:
	movl	$8, %edi
	callq	_msleep
	movl	(%r14), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	cmpl	(%r15), %eax
	je	LBB0_1
## %bb.9:
	movl	$8, %edi
	callq	_msleep
	movl	(%r14), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	cmpl	(%r15), %eax
	je	LBB0_1
## %bb.10:
	movl	$8, %edi
	callq	_msleep
	movl	(%r14), %esi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	cmpl	(%r15), %eax
	jne	LBB0_11
LBB0_1:
	movl	-32(%rbp), %eax
	movl	%eax, 24(%rbx)
LBB0_12:
	movq	_DP_LINK_BW_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	movq	-56(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_13
## %bb.15:
	movq	%rax, 8(%rbx)
	xorl	%eax, %eax
	jmp	LBB0_16
LBB0_13:
	movq	_DP_LINK_RATE_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	movq	-48(%rbp), %rax
	cmpq	32(%rbx), %rax
	jge	LBB0_17
## %bb.14:
	movq	40(%rbx), %rcx
	movq	(%rcx,%rax,8), %rcx
	movq	%rcx, 8(%rbx)
	movq	%rax, 16(%rbx)
	movl	$1, %eax
LBB0_16:
	movl	%eax, (%rbx)
LBB0_17:
	movq	_DP_MAX_DOWNSPREAD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-40(%rbp), %rdx
	movq	%rbx, %rdi
	movl	$8, %ecx
	callq	_core_link_read_dpcd
	cmpq	$0, -40(%rbp)
	jne	LBB0_18
## %bb.19:
	movq	_LINK_SPREAD_DISABLED@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_18:
	movq	_LINK_SPREAD_05_DOWNSPREAD_30KHZ@GOTPCREL(%rip), %rax
LBB0_20:
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	$8, %edi
	callq	_msleep
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_DC_ERROR_UNEXPECTED,4,2        ## @DC_ERROR_UNEXPECTED
	.comm	_DP_LANE_COUNT_SET,4,2          ## @DP_LANE_COUNT_SET
	.comm	_DC_OK,4,2                      ## @DC_OK
	.comm	_DP_LINK_BW_SET,4,2             ## @DP_LINK_BW_SET
	.comm	_DP_LINK_RATE_SET,4,2           ## @DP_LINK_RATE_SET
	.comm	_DP_MAX_DOWNSPREAD,4,2          ## @DP_MAX_DOWNSPREAD
	.comm	_LINK_SPREAD_05_DOWNSPREAD_30KHZ,4,2 ## @LINK_SPREAD_05_DOWNSPREAD_30KHZ
	.comm	_LINK_SPREAD_DISABLED,4,2       ## @LINK_SPREAD_DISABLED
	.no_dead_strip	_read_edp_current_link_settings_on_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_edp_current_link_settings_on_detect
_read_edp_current_link_settings_on_detect: ; @read_edp_current_link_settings_on_detect
	.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
	str	xzr, [sp, #24]
	str	xzr, [sp]
Lloh0:
	adrp	x20, _DP_LANE_COUNT_SET@GOTPAGE
Lloh1:
	ldr	x20, [x20, _DP_LANE_COUNT_SET@GOTPAGEOFF]
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	w3, #8
	bl	_core_link_read_dpcd
Lloh2:
	adrp	x21, _DC_OK@GOTPAGE
Lloh3:
	ldr	x21, [x21, _DC_OK@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.1:
	mov	w0, #8
	bl	_msleep
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.2:
	mov	w0, #8
	bl	_msleep
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.3:
	mov	w0, #8
	bl	_msleep
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.4:
	mov	w0, #8
	bl	_msleep
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.5:
	mov	w0, #8
	bl	_msleep
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.6:
	mov	w0, #8
	bl	_msleep
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.7:
	mov	w0, #8
	bl	_msleep
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.8:
	mov	w0, #8
	bl	_msleep
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	w8, [x21]
	cmp	w0, w8
	b.eq	LBB0_10
; %bb.9:
	mov	w0, #8
	bl	_msleep
	ldr	w1, [x20]
	add	x2, sp, #24
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	w8, [x21]
	cmp	w0, w8
	b.ne	LBB0_17
LBB0_10:
	ldr	w8, [sp, #24]
	str	w8, [x19, #24]
LBB0_11:
Lloh4:
	adrp	x8, _DP_LINK_BW_SET@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DP_LINK_BW_SET@GOTPAGEOFF]
Lloh6:
	ldr	w1, [x8]
	add	x2, sp, #16
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	x9, [sp, #16]
	cbz	x9, LBB0_13
; %bb.12:
	mov	w8, #0
	str	x9, [x19, #8]
	b	LBB0_15
LBB0_13:
Lloh7:
	adrp	x8, _DP_LINK_RATE_SET@GOTPAGE
Lloh8:
	ldr	x8, [x8, _DP_LINK_RATE_SET@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	x8, [sp, #8]
	ldr	x9, [x19, #32]
	cmp	x8, x9
	b.ge	LBB0_16
; %bb.14:
	ldr	x9, [x19, #40]
	ldr	x9, [x9, x8, lsl #3]
	stp	x9, x8, [x19, #8]
	mov	w8, #1
LBB0_15:
	str	w8, [x19]
LBB0_16:
Lloh10:
	adrp	x8, _DP_MAX_DOWNSPREAD@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DP_MAX_DOWNSPREAD@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x2, sp
	mov	x0, x19
	mov	w3, #8
	bl	_core_link_read_dpcd
	ldr	x8, [sp]
Lloh13:
	adrp	x9, _LINK_SPREAD_05_DOWNSPREAD_30KHZ@GOTPAGE
Lloh14:
	ldr	x9, [x9, _LINK_SPREAD_05_DOWNSPREAD_30KHZ@GOTPAGEOFF]
Lloh15:
	adrp	x10, _LINK_SPREAD_DISABLED@GOTPAGE
Lloh16:
	ldr	x10, [x10, _LINK_SPREAD_DISABLED@GOTPAGEOFF]
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w8, [x8]
	str	w8, [x19, #4]
	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_17:
	mov	w0, #8
	bl	_msleep
	b	LBB0_11
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_DC_ERROR_UNEXPECTED,4,2        ; @DC_ERROR_UNEXPECTED
	.comm	_DP_LANE_COUNT_SET,4,2          ; @DP_LANE_COUNT_SET
	.comm	_DC_OK,4,2                      ; @DC_OK
	.comm	_DP_LINK_BW_SET,4,2             ; @DP_LINK_BW_SET
	.comm	_DP_LINK_RATE_SET,4,2           ; @DP_LINK_RATE_SET
	.comm	_DP_MAX_DOWNSPREAD,4,2          ; @DP_MAX_DOWNSPREAD
	.comm	_LINK_SPREAD_05_DOWNSPREAD_30KHZ,4,2 ; @LINK_SPREAD_05_DOWNSPREAD_30KHZ
	.comm	_LINK_SPREAD_DISABLED,4,2       ; @LINK_SPREAD_DISABLED
	.no_dead_strip	_read_edp_current_link_settings_on_detect
.subsections_via_symbols
