	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv50_mstm_detect               ## -- Begin function nv50_mstm_detect
	.p2align	4, 0x90
_nv50_mstm_detect:                      ## @nv50_mstm_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	%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
	testq	%rdi, %rdi
	je	LBB0_1
## %bb.2:
	movl	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	leaq	4(%rdi), %r12
	movq	%r12, %rdi
	callq	_mutex_lock
	movl	(%rbx), %r15d
	movq	8(%rbx), %rdi
	testl	%r15d, %r15d
	je	LBB0_6
## %bb.3:
	movq	_DP_MSTM_CTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-44(%rbp), %rdx
	callq	_drm_dp_dpcd_readb
	testl	%eax, %eax
	js	LBB0_5
## %bb.4:
	movq	_DP_MST_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -44(%rbp)
	jne	LBB0_9
LBB0_5:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	jmp	LBB0_12
LBB0_1:
	xorl	%r15d, %r15d
	jmp	LBB0_17
LBB0_6:
	cmpl	$18, (%r14)
	jl	LBB0_12
## %bb.7:
	movq	_DP_MSTM_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	4(%r14), %rdx
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	callq	_drm_dp_dpcd_readb
	testl	%eax, %eax
	js	LBB0_8
## %bb.10:
	movq	_DP_MST_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.13:
	cmpl	%r15d, %r13d
	jne	LBB0_14
	jmp	LBB0_9
LBB0_8:
	movl	%eax, %r15d
	jmp	LBB0_9
LBB0_11:
	movl	$17, (%r14)
LBB0_12:
	xorl	%r13d, %r13d
	cmpl	%r15d, %r13d
	je	LBB0_9
LBB0_14:
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_nv50_mstm_enable
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_15
LBB0_9:
	movq	%r12, %rdi
	callq	_mutex_unlock
LBB0_17:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	%r12, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_drm_dp_mst_topology_mgr_set_mst
	movl	%r13d, %r15d
	testl	%eax, %eax
	je	LBB0_17
## %bb.16:
	movl	(%r14), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_nv50_mstm_enable
	movl	%eax, %r15d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_DP_MSTM_CTRL,4,2               ## @DP_MSTM_CTRL
	.comm	_DP_MST_EN,4,2                  ## @DP_MST_EN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Hub gone, disabling MST topology\n"

	.comm	_DP_MSTM_CAP,4,2                ## @DP_MSTM_CAP
	.comm	_DP_MST_CAP,4,2                 ## @DP_MST_CAP
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nv50_mstm_detect               ; -- Begin function nv50_mstm_detect
	.p2align	2
_nv50_mstm_detect:                      ; @nv50_mstm_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	cbz	x0, LBB0_5
; %bb.1:
	mov	x22, x2
	mov	x20, x1
	mov	x19, x0
	add	x21, x0, #4
	mov	x0, x21
	bl	_mutex_lock
	ldr	w25, [x19]
	ldr	x0, [x19, #8]
	cbz	w25, LBB0_6
; %bb.2:
Lloh0:
	adrp	x8, _DP_MSTM_CTRL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DP_MSTM_CTRL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	bl	_drm_dp_dpcd_readb
	tbnz	w0, #31, LBB0_4
; %bb.3:
	ldr	w8, [sp, #12]
Lloh3:
	adrp	x9, _DP_MST_EN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DP_MST_EN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_10
LBB0_4:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	b	LBB0_11
LBB0_5:
	mov	w22, #0
	b	LBB0_17
LBB0_6:
	ldr	w8, [x20]
	cmp	w8, #18
	b.lt	LBB0_11
; %bb.7:
Lloh8:
	adrp	x8, _DP_MSTM_CAP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DP_MSTM_CAP@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	add	x24, x20, #4
	mov	x2, x24
	bl	_drm_dp_dpcd_readb
	tbnz	w0, #31, LBB0_15
; %bb.8:
	ldr	w8, [x24]
Lloh11:
	adrp	x9, _DP_MST_CAP@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DP_MST_CAP@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.9:
	cmp	w22, w25
	b.ne	LBB0_12
LBB0_10:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x22, x25
	b	LBB0_17
LBB0_11:
	mov	w22, #0
	cmp	w22, w25
	b.eq	LBB0_10
LBB0_12:
	ldr	w1, [x20]
	mov	x0, x19
	mov	x2, x22
	bl	_nv50_mstm_enable
	mov	x23, x0
	cbnz	w0, LBB0_16
; %bb.13:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x19
	mov	x1, x22
	bl	_drm_dp_mst_topology_mgr_set_mst
	cbz	w0, LBB0_17
; %bb.14:
	ldr	w1, [x20]
	mov	x0, x19
	mov	w2, #0
	bl	_nv50_mstm_enable
	mov	x22, x0
	b	LBB0_17
LBB0_15:
	mov	x23, x0
LBB0_16:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x22, x23
LBB0_17:
	mov	x0, x22
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_18:
	mov	w22, #0
	mov	w8, #17
	str	w8, [x20]
	cmp	w22, w25
	b.ne	LBB0_12
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_DP_MSTM_CTRL,4,2               ; @DP_MSTM_CTRL
	.comm	_DP_MST_EN,4,2                  ; @DP_MST_EN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Hub gone, disabling MST topology\n"

	.comm	_DP_MSTM_CAP,4,2                ; @DP_MSTM_CAP
	.comm	_DP_MST_CAP,4,2                 ; @DP_MST_CAP
.subsections_via_symbols
