	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_dp_aux_train               ## -- Begin function drm_dp_aux_train
	.p2align	4, 0x90
_drm_dp_aux_train:                      ## @drm_dp_aux_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
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_DP_TRAINING_PATTERN_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	andl	%edx, %r13d
	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, %r12
	movq	_DP_TRAINING_PATTERN_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	%ebx, %edx
	callq	_drm_dp_dpcd_writeb
	testl	%eax, %eax
	js	LBB0_24
## %bb.1:
	movq	_DP_TRAINING_PATTERN_DISABLE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	cmpl	(%rcx), %r13d
	je	LBB0_24
## %bb.2:
	movl	(%r14), %ecx
	testq	%rcx, %rcx
	je	LBB0_14
## %bb.3:
	movq	_DP_TRAIN_MAX_PRE_EMPHASIS_REACHED@GOTPCREL(%rip), %rdx
	movq	_DP_TRAIN_PRE_EMPH_LEVEL_0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rdx), %eax
	movq	_DP_TRAIN_MAX_SWING_REACHED@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movq	_DP_TRAIN_VOLTAGE_SWING_LEVEL_0@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	cmpl	$8, %ecx
	jae	LBB0_5
## %bb.4:
	xorl	%edx, %edx
	jmp	LBB0_13
LBB0_5:
	movl	%ecx, %edx
	andl	$-8, %edx
	movd	%eax, %xmm0
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	leaq	-8(%rdx), %rbx
	movq	%rbx, %rdi
	shrq	$3, %rdi
	incq	%rdi
	movl	%edi, %esi
	andl	$7, %esi
	cmpq	$56, %rbx
	jae	LBB0_7
## %bb.6:
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_7:
	andq	$-8, %rdi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movdqa	%xmm0, -64(%rbp,%rbx,4)
	movdqa	%xmm0, -48(%rbp,%rbx,4)
	movdqa	%xmm0, -32(%rbp,%rbx,4)
	movdqa	%xmm0, -16(%rbp,%rbx,4)
	movdqa	%xmm0, (%rbp,%rbx,4)
	movdqa	%xmm0, 16(%rbp,%rbx,4)
	movdqa	%xmm0, 32(%rbp,%rbx,4)
	movdqa	%xmm0, 48(%rbp,%rbx,4)
	movdqa	%xmm0, 64(%rbp,%rbx,4)
	movdqa	%xmm0, 80(%rbp,%rbx,4)
	movdqa	%xmm0, 96(%rbp,%rbx,4)
	movdqa	%xmm0, 112(%rbp,%rbx,4)
	movdqa	%xmm0, 128(%rbp,%rbx,4)
	movdqa	%xmm0, 144(%rbp,%rbx,4)
	movdqa	%xmm0, 160(%rbp,%rbx,4)
	movdqa	%xmm0, 176(%rbp,%rbx,4)
	addq	$64, %rbx
	addq	$-8, %rdi
	jne	LBB0_8
LBB0_9:
	testq	%rsi, %rsi
	je	LBB0_12
## %bb.10:
	leaq	-48(,%rbx,4), %rdi
	addq	%rbp, %rdi
	shlq	$5, %rsi
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movdqa	%xmm0, -16(%rdi,%rbx)
	movdqa	%xmm0, (%rdi,%rbx)
	addq	$32, %rbx
	cmpq	%rbx, %rsi
	jne	LBB0_11
LBB0_12:
	cmpq	%rcx, %rdx
	je	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movl	%eax, -64(%rbp,%rdx,4)
	incq	%rdx
	cmpq	%rdx, %rcx
	jne	LBB0_13
LBB0_14:
	movq	_DP_TRAINING_LANE0_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-64(%rbp), %rdx
	movq	%r15, %rdi
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_drm_dp_dpcd_write
	testl	%eax, %eax
	js	LBB0_24
## %bb.15:
	movl	$500, %edi                      ## imm = 0x1F4
	movl	$1000, %esi                     ## imm = 0x3E8
	callq	_usleep_range
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_drm_dp_dpcd_read_link_status
	testl	%eax, %eax
	js	LBB0_24
## %bb.16:
	cmpl	$128, %r13d
	je	LBB0_22
## %bb.17:
	cmpl	$129, %r13d
	jne	LBB0_26
## %bb.18:
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_drm_dp_clock_recovery_ok
	testl	%eax, %eax
	je	LBB0_20
LBB0_23:
	movq	_DP_EDP_CONFIGURATION_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_drm_dp_dpcd_writeb
	movl	%eax, %ecx
	sarl	$31, %eax
	andl	%ecx, %eax
	jmp	LBB0_24
LBB0_22:
	movl	(%r14), %esi
	movq	%r12, %rdi
	callq	_drm_dp_channel_eq_ok
	testl	%eax, %eax
	jne	LBB0_23
LBB0_20:
	movq	_EAGAIN@GOTPCREL(%rip), %rcx
	jmp	LBB0_21
LBB0_26:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r13d, %edx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_21:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_24:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_27
## %bb.25:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_27:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_DP_TRAINING_PATTERN_MASK,4,2   ## @DP_TRAINING_PATTERN_MASK
	.comm	_DP_LINK_STATUS_SIZE,4,2        ## @DP_LINK_STATUS_SIZE
	.comm	_DP_TRAINING_PATTERN_SET,4,2    ## @DP_TRAINING_PATTERN_SET
	.comm	_DP_TRAINING_PATTERN_DISABLE,4,2 ## @DP_TRAINING_PATTERN_DISABLE
	.comm	_DP_TRAIN_MAX_PRE_EMPHASIS_REACHED,4,2 ## @DP_TRAIN_MAX_PRE_EMPHASIS_REACHED
	.comm	_DP_TRAIN_PRE_EMPH_LEVEL_0,4,2  ## @DP_TRAIN_PRE_EMPH_LEVEL_0
	.comm	_DP_TRAIN_MAX_SWING_REACHED,4,2 ## @DP_TRAIN_MAX_SWING_REACHED
	.comm	_DP_TRAIN_VOLTAGE_SWING_LEVEL_0,4,2 ## @DP_TRAIN_VOLTAGE_SWING_LEVEL_0
	.comm	_DP_TRAINING_LANE0_SET,4,2      ## @DP_TRAINING_LANE0_SET
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unsupported training pattern %u\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_DP_EDP_CONFIGURATION_SET,4,2   ## @DP_EDP_CONFIGURATION_SET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_dp_aux_train               ; -- Begin function drm_dp_aux_train
	.p2align	2
_drm_dp_aux_train:                      ; @drm_dp_aux_train
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #32
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _DP_TRAINING_PATTERN_MASK@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DP_TRAINING_PATTERN_MASK@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
Lloh6:
	adrp	x8, _DP_LINK_STATUS_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DP_LINK_STATUS_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh9:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh10:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
Lloh11:
	adrp	x8, _DP_TRAINING_PATTERN_SET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _DP_TRAINING_PATTERN_SET@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_drm_dp_dpcd_writeb
	tbnz	w0, #31, LBB0_21
; %bb.1:
	and	w22, w23, w22
Lloh14:
	adrp	x8, _DP_TRAINING_PATTERN_DISABLE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DP_TRAINING_PATTERN_DISABLE@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_3
; %bb.2:
	mov	w0, #0
	b	LBB0_21
LBB0_3:
	ldr	w3, [x20]
	cbz	w3, LBB0_11
; %bb.4:
Lloh17:
	adrp	x8, _DP_TRAIN_MAX_PRE_EMPHASIS_REACHED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DP_TRAIN_MAX_PRE_EMPHASIS_REACHED@GOTPAGEOFF]
Lloh19:
	adrp	x9, _DP_TRAIN_PRE_EMPH_LEVEL_0@GOTPAGE
Lloh20:
	ldr	x9, [x9, _DP_TRAIN_PRE_EMPH_LEVEL_0@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
Lloh22:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh23:
	adrp	x9, _DP_TRAIN_MAX_SWING_REACHED@GOTPAGE
Lloh24:
	ldr	x9, [x9, _DP_TRAIN_MAX_SWING_REACHED@GOTPAGEOFF]
Lloh25:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh26:
	adrp	x9, _DP_TRAIN_VOLTAGE_SWING_LEVEL_0@GOTPAGE
Lloh27:
	ldr	x9, [x9, _DP_TRAIN_VOLTAGE_SWING_LEVEL_0@GOTPAGEOFF]
Lloh28:
	ldr	w9, [x9]
	orr	w8, w8, w9
	cmp	w3, #16
	b.hs	LBB0_6
; %bb.5:
	mov	x9, #0
	b	LBB0_9
LBB0_6:
	and	x9, x3, #0xfffffff0
	dup.4s	v0, w8
	sub	x10, x29, #72
	add	x10, x10, #32
	mov	x11, x9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	stp	q0, q0, [x10, #-32]
	stp	q0, q0, [x10], #64
	subs	x11, x11, #16
	b.ne	LBB0_7
; %bb.8:
	cmp	x9, x3
	b.eq	LBB0_11
LBB0_9:
	sub	x10, x29, #72
	add	x10, x10, x9, lsl #2
	sub	x9, x3, x9
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	str	w8, [x10], #4
	subs	x9, x9, #1
	b.ne	LBB0_10
LBB0_11:
Lloh29:
	adrp	x8, _DP_TRAINING_LANE0_SET@GOTPAGE
Lloh30:
	ldr	x8, [x8, _DP_TRAINING_LANE0_SET@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	sub	x2, x29, #72
	mov	x0, x19
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_drm_dp_dpcd_write
	tbnz	w0, #31, LBB0_21
; %bb.12:
	mov	w0, #500
	mov	w1, #1000
	bl	_usleep_range
	mov	x0, x19
	mov	x1, x21
	bl	_drm_dp_dpcd_read_link_status
	tbnz	w0, #31, LBB0_21
; %bb.13:
	cmp	w22, #128
	b.eq	LBB0_17
; %bb.14:
	cmp	w22, #129
	b.ne	LBB0_19
; %bb.15:
	ldr	w1, [x20]
	mov	x0, x21
	bl	_drm_dp_clock_recovery_ok
	cbnz	w0, LBB0_18
LBB0_16:
Lloh32:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
	b	LBB0_20
LBB0_17:
	ldr	w1, [x20]
	mov	x0, x21
	bl	_drm_dp_channel_eq_ok
	cbz	w0, LBB0_16
LBB0_18:
Lloh34:
	adrp	x8, _DP_EDP_CONFIGURATION_SET@GOTPAGE
Lloh35:
	ldr	x8, [x8, _DP_EDP_CONFIGURATION_SET@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_drm_dp_dpcd_writeb
	cmp	w0, #0
	csel	w0, w0, wzr, lt
	b	LBB0_21
LBB0_19:
	ldr	w0, [x19]
Lloh37:
	adrp	x1, l_.str@PAGE
Lloh38:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_err
Lloh39:
	adrp	x8, _EINVAL@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_21:
	ldur	x8, [x29, #-56]
Lloh41:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh42:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_23
; %bb.22:
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_23:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_DP_TRAINING_PATTERN_MASK,4,2   ; @DP_TRAINING_PATTERN_MASK
	.comm	_DP_LINK_STATUS_SIZE,4,2        ; @DP_LINK_STATUS_SIZE
	.comm	_DP_TRAINING_PATTERN_SET,4,2    ; @DP_TRAINING_PATTERN_SET
	.comm	_DP_TRAINING_PATTERN_DISABLE,4,2 ; @DP_TRAINING_PATTERN_DISABLE
	.comm	_DP_TRAIN_MAX_PRE_EMPHASIS_REACHED,4,2 ; @DP_TRAIN_MAX_PRE_EMPHASIS_REACHED
	.comm	_DP_TRAIN_PRE_EMPH_LEVEL_0,4,2  ; @DP_TRAIN_PRE_EMPH_LEVEL_0
	.comm	_DP_TRAIN_MAX_SWING_REACHED,4,2 ; @DP_TRAIN_MAX_SWING_REACHED
	.comm	_DP_TRAIN_VOLTAGE_SWING_LEVEL_0,4,2 ; @DP_TRAIN_VOLTAGE_SWING_LEVEL_0
	.comm	_DP_TRAINING_LANE0_SET,4,2      ; @DP_TRAINING_LANE0_SET
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unsupported training pattern %u\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_DP_EDP_CONFIGURATION_SET,4,2   ; @DP_EDP_CONFIGURATION_SET
.subsections_via_symbols
