	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_connector_detect
_nouveau_connector_detect:              ## @nouveau_connector_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r13
	movq	(%rdi), %rdi
	callq	_nouveau_drm
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_nouveau_connector
	movq	%rax, %r14
	movq	$0, -48(%rbp)
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_drm_mode_connector_update_edid_property
	movq	(%r14), %rdi
	callq	_kfree
	movq	$0, (%r14)
LBB0_2:
	leaq	-48(%rbp), %rsi
	movq	%r13, %rdi
	callq	_nouveau_connector_ddc_detect
	movq	%r13, %rdi
	testq	%rax, %rax
	je	LBB0_29
## %bb.3:
	movq	%rax, %rsi
	callq	_drm_get_edid
	movq	%rax, (%r14)
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_drm_mode_connector_update_edid_property
	cmpq	$0, (%r14)
	je	LBB0_4
## %bb.12:
	movq	-48(%rbp), %rdi
	movq	(%rdi), %rax
	movq	(%rax), %rcx
	movq	_DCB_OUTPUT_DP@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_15
## %bb.13:
	callq	_to_drm_encoder
	movq	%rax, %rdi
	callq	_nouveau_dp_detect
	testl	%eax, %eax
	je	LBB0_31
## %bb.14:
	movq	-48(%rbp), %rax
	movq	(%rax), %rax
	movq	(%rax), %rcx
LBB0_15:
	movq	_DCB_OUTPUT_TMDS@GOTPCREL(%rip), %r15
	movslq	(%r15), %rax
	cmpq	%rax, %rcx
	jne	LBB0_16
## %bb.17:
	movq	_DCB_OUTPUT_ANALOG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_find_encoder
	movq	-48(%rbp), %rcx
	movq	(%rcx), %rcx
	movq	(%rcx), %rcx
	jmp	LBB0_18
LBB0_29:
	callq	_nouveau_connector_of_detect
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_5
## %bb.30:
	movq	%r13, %rdi
	movq	%rax, %rsi
	jmp	LBB0_28
LBB0_4:
	movq	%r13, %rdi
	callq	_drm_get_connector_name
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_NV_ERROR
LBB0_5:
	movq	_DCB_OUTPUT_ANALOG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_find_encoder
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:
	movq	_nouveau_tv_disable@GOTPCREL(%rip), %rcx
	cmpl	$0, (%rcx)
	jne	LBB0_8
## %bb.7:
	movq	_DCB_OUTPUT_TV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_find_encoder
	movq	%rax, -48(%rbp)
LBB0_8:
	movq	_connector_status_disconnected@GOTPCREL(%rip), %rbx
	testl	%r15d, %r15d
	je	LBB0_32
## %bb.9:
	testq	%rax, %rax
	je	LBB0_32
## %bb.10:
	movq	%rax, %rdi
	callq	_to_drm_encoder
	movq	(%rax), %rcx
	movq	%rax, %rdi
	movq	%r13, %rsi
	callq	*(%rcx)
	movq	_connector_status_connected@GOTPCREL(%rip), %r14
	cmpl	(%r14), %eax
	jne	LBB0_32
## %bb.11:
	movq	-48(%rbp), %rsi
	movq	%r13, %rdi
	callq	_nouveau_connector_set_encoder
	movq	%r14, %rbx
	jmp	LBB0_32
LBB0_16:
	xorl	%eax, %eax
LBB0_18:
	movq	_DCB_OUTPUT_ANALOG@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_20
## %bb.19:
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_find_encoder
LBB0_20:
	movq	-48(%rbp), %rsi
	testq	%rax, %rax
	je	LBB0_27
## %bb.21:
	movq	(%rsi), %rcx
	movq	(%rcx), %rdi
	movslq	(%rbx), %rcx
	cmpq	%rcx, %rdi
	jne	LBB0_22
## %bb.23:
	movq	(%rax), %r8
	movl	(%r15), %edx
	movslq	%edx, %rbx
	cmpq	%rbx, (%r8)
	jne	LBB0_24
	jmp	LBB0_26
LBB0_22:
	movl	(%r15), %edx
	movslq	%edx, %rbx
LBB0_24:
	cmpq	%rbx, %rdi
	jne	LBB0_27
## %bb.25:
	movq	(%rax), %rax
	cmpq	%rcx, (%rax)
	jne	LBB0_27
LBB0_26:
	movq	(%r14), %rax
	movq	_DRM_EDID_INPUT_DIGITAL@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	andl	(%rax), %esi
	cmovnel	%edx, %ecx
	movq	%r13, %rdi
	movl	%ecx, %esi
	callq	_find_encoder
	movq	%rax, %rsi
	movq	%rax, -48(%rbp)
LBB0_27:
	movq	%r13, %rdi
LBB0_28:
	callq	_nouveau_connector_set_encoder
	movq	_connector_status_connected@GOTPCREL(%rip), %rbx
LBB0_32:
	movl	(%rbx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_31:
	movq	%r13, %rdi
	callq	_drm_get_connector_name
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movl	%eax, %edx
	callq	_NV_ERROR
	movq	_connector_status_disconnected@GOTPCREL(%rip), %rbx
	jmp	LBB0_32
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DDC responded, but no EDID for %s\n"

	.comm	_DCB_OUTPUT_DP,8,3              ## @DCB_OUTPUT_DP
L_.str.1:                               ## @.str.1
	.asciz	"Detected %s, but failed init\n"

	.comm	_connector_status_disconnected,4,2 ## @connector_status_disconnected
	.comm	_DCB_OUTPUT_TMDS,4,2            ## @DCB_OUTPUT_TMDS
	.comm	_DCB_OUTPUT_ANALOG,4,2          ## @DCB_OUTPUT_ANALOG
	.comm	_DRM_EDID_INPUT_DIGITAL,4,2     ## @DRM_EDID_INPUT_DIGITAL
	.comm	_connector_status_connected,4,2 ## @connector_status_connected
	.comm	_nouveau_tv_disable,4,2         ## @nouveau_tv_disable
	.comm	_DCB_OUTPUT_TV,4,2              ## @DCB_OUTPUT_TV
	.no_dead_strip	_nouveau_connector_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_connector_detect
_nouveau_connector_detect:              ; @nouveau_connector_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x21, x1
	mov	x19, x0
	ldr	x0, [x0]
	bl	_nouveau_drm
	mov	x22, x0
	mov	x0, x19
	bl	_nouveau_connector
	mov	x20, x0
	str	xzr, [sp, #8]
	ldr	x8, [x0]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x19
	mov	x1, #0
	bl	_drm_mode_connector_update_edid_property
	ldr	x0, [x20]
	bl	_kfree
	str	xzr, [x20]
LBB0_2:
	add	x1, sp, #8
	mov	x0, x19
	bl	_nouveau_connector_ddc_detect
	cbz	x0, LBB0_9
; %bb.3:
	mov	x1, x0
	mov	x0, x19
	bl	_drm_get_edid
	mov	x1, x0
	str	x0, [x20]
	mov	x0, x19
	bl	_drm_mode_connector_update_edid_property
	ldr	x8, [x20]
	cbz	x8, LBB0_11
; %bb.4:
	ldr	x0, [sp, #8]
	ldr	x8, [x0]
	ldr	x8, [x8]
Lloh0:
	adrp	x9, _DCB_OUTPUT_DP@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DCB_OUTPUT_DP@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.5:
	bl	_to_drm_encoder
	bl	_nouveau_dp_detect
	cbz	w0, LBB0_29
; %bb.6:
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
LBB0_7:
Lloh3:
	adrp	x21, _DCB_OUTPUT_TMDS@GOTPAGE
Lloh4:
	ldr	x21, [x21, _DCB_OUTPUT_TMDS@GOTPAGEOFF]
	ldrsw	x9, [x21]
Lloh5:
	adrp	x22, _DCB_OUTPUT_ANALOG@GOTPAGE
Lloh6:
	ldr	x22, [x22, _DCB_OUTPUT_ANALOG@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_18
; %bb.8:
	ldr	w1, [x22]
	mov	x0, x19
	bl	_find_encoder
	ldr	x8, [sp, #8]
	ldr	x8, [x8]
	ldr	x8, [x8]
	b	LBB0_19
LBB0_9:
	mov	x0, x19
	bl	_nouveau_connector_of_detect
	str	x0, [sp, #8]
	cbz	x0, LBB0_12
; %bb.10:
	mov	x1, x0
	b	LBB0_28
LBB0_11:
	mov	x0, x19
	bl	_drm_get_connector_name
	mov	x2, x0
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_NV_ERROR
LBB0_12:
Lloh9:
	adrp	x8, _DCB_OUTPUT_ANALOG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _DCB_OUTPUT_ANALOG@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_find_encoder
	str	x0, [sp, #8]
Lloh12:
	adrp	x8, _nouveau_tv_disable@GOTPAGE
Lloh13:
	ldr	x8, [x8, _nouveau_tv_disable@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cmp	x0, #0
	ccmp	w8, #0, #0, eq
	b.ne	LBB0_14
; %bb.13:
Lloh15:
	adrp	x8, _DCB_OUTPUT_TV@GOTPAGE
Lloh16:
	ldr	x8, [x8, _DCB_OUTPUT_TV@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_find_encoder
	str	x0, [sp, #8]
LBB0_14:
Lloh18:
	adrp	x8, _connector_status_disconnected@GOTPAGE
Lloh19:
	ldr	x8, [x8, _connector_status_disconnected@GOTPAGEOFF]
	cbz	w21, LBB0_31
; %bb.15:
	cbz	x0, LBB0_31
; %bb.16:
	bl	_to_drm_encoder
	ldr	x8, [x0]
	ldr	x8, [x8]
	mov	x1, x19
	blr	x8
Lloh20:
	adrp	x8, _connector_status_connected@GOTPAGE
Lloh21:
	ldr	x8, [x8, _connector_status_connected@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_30
; %bb.17:
	ldr	x1, [sp, #8]
	b	LBB0_28
LBB0_18:
	mov	x0, #0
LBB0_19:
	ldrsw	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.20:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_find_encoder
LBB0_21:
	ldr	x1, [sp, #8]
	cbz	x0, LBB0_28
; %bb.22:
	ldr	x8, [x1]
	ldr	x10, [x8]
	ldrsw	x8, [x22]
	cmp	x10, x8
	b.ne	LBB0_24
; %bb.23:
	ldr	x9, [x0]
	ldr	x12, [x9]
	ldr	w9, [x21]
	sxtw	x11, w9
	cmp	x12, x11
	b.ne	LBB0_25
	b	LBB0_27
LBB0_24:
	ldr	w9, [x21]
	sxtw	x11, w9
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
LBB0_25:
	cmp	x10, x11
	b.ne	LBB0_28
; %bb.26:
	ldr	x10, [x0]
	ldr	x10, [x10]
	cmp	x10, x8
	b.ne	LBB0_28
LBB0_27:
	ldr	x10, [x20]
	ldr	w10, [x10]
Lloh23:
	adrp	x11, _DRM_EDID_INPUT_DIGITAL@GOTPAGE
Lloh24:
	ldr	x11, [x11, _DRM_EDID_INPUT_DIGITAL@GOTPAGEOFF]
Lloh25:
	ldr	w11, [x11]
	tst	w11, w10
	csel	w1, w8, w9, eq
	mov	x0, x19
	bl	_find_encoder
	mov	x1, x0
	str	x0, [sp, #8]
LBB0_28:
	mov	x0, x19
	bl	_nouveau_connector_set_encoder
Lloh26:
	adrp	x8, _connector_status_connected@GOTPAGE
Lloh27:
	ldr	x8, [x8, _connector_status_connected@GOTPAGEOFF]
	b	LBB0_31
LBB0_29:
	mov	x0, x19
	bl	_drm_get_connector_name
	mov	x2, x0
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x22
	bl	_NV_ERROR
LBB0_30:
Lloh30:
	adrp	x8, _connector_status_disconnected@GOTPAGE
Lloh31:
	ldr	x8, [x8, _connector_status_disconnected@GOTPAGEOFF]
LBB0_31:
	ldr	w0, [x8]
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DDC responded, but no EDID for %s\n"

	.comm	_DCB_OUTPUT_DP,8,3              ; @DCB_OUTPUT_DP
l_.str.1:                               ; @.str.1
	.asciz	"Detected %s, but failed init\n"

	.comm	_connector_status_disconnected,4,2 ; @connector_status_disconnected
	.comm	_DCB_OUTPUT_TMDS,4,2            ; @DCB_OUTPUT_TMDS
	.comm	_DCB_OUTPUT_ANALOG,4,2          ; @DCB_OUTPUT_ANALOG
	.comm	_DRM_EDID_INPUT_DIGITAL,4,2     ; @DRM_EDID_INPUT_DIGITAL
	.comm	_connector_status_connected,4,2 ; @connector_status_connected
	.comm	_nouveau_tv_disable,4,2         ; @nouveau_tv_disable
	.comm	_DCB_OUTPUT_TV,4,2              ; @DCB_OUTPUT_TV
	.no_dead_strip	_nouveau_connector_detect
.subsections_via_symbols
