	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_dp_detect              ## -- Begin function nouveau_dp_detect
	.p2align	4, 0x90
_nouveau_dp_detect:                     ## @nouveau_dp_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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	32(%rdi), %r14
	movq	%r14, %rdi
	callq	_nouveau_drm
	movq	24(%rbx), %r15
	testq	%r15, %r15
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	_DP_DPCD_REV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-80(%rbp), %rdx
	movq	%r15, %rdi
	movl	$32, %ecx
	callq	_nvkm_rdaux
	testl	%eax, %eax
	jne	LBB0_12
## %bb.3:
	imull	$27000, -76(%rbp), %ecx         ## imm = 0x6978
	movl	%ecx, (%rbx)
	movq	_DP_MAX_LANE_COUNT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	andl	-72(%rbp), %edx
	movl	%edx, 4(%rbx)
	movl	-80(%rbp), %r8d
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_NV_DEBUG
	movq	16(%rbx), %rax
	movl	(%rax), %edx
	movl	4(%rax), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_NV_DEBUG
	movq	16(%rbx), %rax
	movl	(%rax), %ecx
	movl	4(%rbx), %edx
	cmpl	%edx, %ecx
	jge	LBB0_5
## %bb.4:
	movl	%ecx, 4(%rbx)
	movl	%ecx, %edx
LBB0_5:
	movl	4(%rax), %eax
	movl	(%rbx), %ecx
	cmpl	%ecx, %eax
	jge	LBB0_7
## %bb.6:
	movl	%eax, (%rbx)
	movl	%eax, %ecx
LBB0_7:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_NV_DEBUG
	leaq	-80(%rbp), %r12
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r12, %rdx
	callq	_nouveau_dp_probe_oui
	movl	8(%rbx), %edi
	movq	_nouveau_mst@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rsi
	callq	_nv50_mstm_detect
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	cmpl	$1, %eax
	jne	LBB0_12
## %bb.9:
	movq	_NOUVEAU_DP_MST@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_12
LBB0_10:
	movq	_NOUVEAU_DP_SST@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %eax
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-40(%rbp), %rcx
	jne	LBB0_14
## %bb.13:
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_DP_DPCD_REV,4,2                ## @DP_DPCD_REV
	.comm	_DP_MAX_LANE_COUNT_MASK,4,2     ## @DP_MAX_LANE_COUNT_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"display: %dx%d dpcd 0x%02x\n"

L_.str.1:                               ## @.str.1
	.asciz	"encoder: %dx%d\n"

L_.str.2:                               ## @.str.2
	.asciz	"maximum: %dx%d\n"

	.comm	_nouveau_mst,4,2                ## @nouveau_mst
	.comm	_NOUVEAU_DP_MST,4,2             ## @NOUVEAU_DP_MST
	.comm	_NOUVEAU_DP_SST,4,2             ## @NOUVEAU_DP_SST
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_dp_detect              ; -- Begin function nouveau_dp_detect
	.p2align	2
_nouveau_dp_detect:                     ; @nouveau_dp_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, #40]
	ldr	x20, [x0, #32]
	mov	x0, x20
	bl	_nouveau_drm
	ldr	x21, [x19, #24]
	cbz	x21, LBB0_9
; %bb.1:
	mov	x22, x0
Lloh3:
	adrp	x8, _DP_DPCD_REV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DP_DPCD_REV@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x21
	mov	w3, #32
	bl	_nvkm_rdaux
	cbnz	w0, LBB0_12
; %bb.2:
	mov	w8, #27000
	ldp	w10, w9, [sp, #8]
	mul	w3, w9, w8
	str	w3, [x19]
	ldr	w8, [sp, #16]
Lloh6:
	adrp	x9, _DP_MAX_LANE_COUNT_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DP_MAX_LANE_COUNT_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	and	w2, w9, w8
	str	w2, [x19, #4]
	str	x10, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_NV_DEBUG
	ldr	x8, [x19, #16]
	ldp	w2, w3, [x8]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_NV_DEBUG
	ldr	x8, [x19, #16]
	ldr	w9, [x8]
	ldr	w2, [x19, #4]
	cmp	w9, w2
	b.ge	LBB0_4
; %bb.3:
	str	w9, [x19, #4]
	mov	x2, x9
LBB0_4:
	ldr	w8, [x8, #4]
	ldr	w3, [x19]
	cmp	w8, w3
	b.ge	LBB0_6
; %bb.5:
	str	w8, [x19]
	mov	x3, x8
LBB0_6:
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	bl	_NV_DEBUG
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x21
	bl	_nouveau_dp_probe_oui
	ldr	w0, [x19, #8]
Lloh15:
	adrp	x8, _nouveau_mst@GOTPAGE
Lloh16:
	ldr	x8, [x8, _nouveau_mst@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	add	x1, sp, #8
	bl	_nv50_mstm_detect
	cbz	w0, LBB0_10
; %bb.7:
	cmp	w0, #1
	b.ne	LBB0_12
; %bb.8:
Lloh18:
	adrp	x8, _NOUVEAU_DP_MST@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NOUVEAU_DP_MST@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh20:
	adrp	x8, _ENODEV@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_10:
Lloh23:
	adrp	x8, _NOUVEAU_DP_SST@GOTPAGE
Lloh24:
	ldr	x8, [x8, _NOUVEAU_DP_SST@GOTPAGEOFF]
LBB0_11:
	ldr	w0, [x8]
LBB0_12:
	ldr	x8, [sp, #40]
Lloh25:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh26:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh27:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_DP_DPCD_REV,4,2                ; @DP_DPCD_REV
	.comm	_DP_MAX_LANE_COUNT_MASK,4,2     ; @DP_MAX_LANE_COUNT_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"display: %dx%d dpcd 0x%02x\n"

l_.str.1:                               ; @.str.1
	.asciz	"encoder: %dx%d\n"

l_.str.2:                               ; @.str.2
	.asciz	"maximum: %dx%d\n"

	.comm	_nouveau_mst,4,2                ; @nouveau_mst
	.comm	_NOUVEAU_DP_MST,4,2             ; @NOUVEAU_DP_MST
	.comm	_NOUVEAU_DP_SST,4,2             ; @NOUVEAU_DP_SST
.subsections_via_symbols
