	.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
	subq	$24, %rsp
	.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, %r14
	movq	8(%rdi), %rbx
	movq	%rbx, %rdi
	callq	_nouveau_drm
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	callq	_nouveau_connector
	movq	%rax, %r12
	movq	_connector_status_disconnected@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	cmpq	$0, 8(%r12)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_drm_connector_update_edid_property
	movq	8(%r12), %rdi
	callq	_kfree
	movq	$0, 8(%r12)
LBB0_2:
	xorl	%eax, %eax
	callq	_drm_kms_helper_is_poll_worker
	movl	(%rbx), %edi
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	callq	_pm_runtime_get_noresume
	jmp	LBB0_6
LBB0_4:
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	jns	LBB0_6
## %bb.5:
	movq	_EACCES@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	jne	LBB0_38
LBB0_6:
	movl	%r15d, -44(%rbp)                ## 4-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	%r13d, %ebx
	movq	%r14, %rdi
	callq	_nouveau_connector_ddc_detect
	testq	%rax, %rax
	je	LBB0_29
## %bb.7:
	movq	%rax, %r13
	movq	8(%rax), %r15
	testq	%r15, %r15
	je	LBB0_29
## %bb.8:
	xorl	%eax, %eax
	callq	_vga_switcheroo_handler_flags
	movq	_VGA_SWITCHEROO_CAN_SWITCH_DDC@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.9:
	movq	(%r12), %rax
	movq	_DCB_CONNECTOR_LVDS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.10:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_drm_get_edid_switcheroo
	jmp	LBB0_12
LBB0_29:
	movq	%r14, %rdi
	callq	_nouveau_connector_of_detect
	testq	%rax, %rax
	je	LBB0_14
## %bb.30:
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_nouveau_connector_set_encoder
	movq	_connector_status_connected@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	jmp	LBB0_37
LBB0_11:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_drm_get_edid
LBB0_12:
	movq	%rax, 8(%r12)
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_drm_connector_update_edid_property
	cmpq	$0, 8(%r12)
	je	LBB0_13
## %bb.16:
	movq	(%r13), %rax
	movl	(%rax), %ecx
	movq	_DCB_OUTPUT_TMDS@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %ecx
	jne	LBB0_17
## %bb.18:
	movq	_DCB_OUTPUT_ANALOG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_find_encoder
	movq	(%r13), %rcx
	movl	(%rcx), %ecx
	jmp	LBB0_19
LBB0_13:
	movl	(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_NV_ERROR
LBB0_14:
	movq	_DCB_OUTPUT_ANALOG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_find_encoder
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_15
## %bb.31:
	movq	_nouveau_tv_disable@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movl	%ebx, %r13d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	jne	LBB0_33
## %bb.32:
	movq	_DCB_OUTPUT_TV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_find_encoder
	movq	%rax, %r12
LBB0_33:
	testl	%ebx, %ebx
	jne	LBB0_34
	jmp	LBB0_37
LBB0_17:
	xorl	%eax, %eax
LBB0_19:
	movq	_DCB_OUTPUT_ANALOG@GOTPCREL(%rip), %r15
	cmpl	(%r15), %ecx
	jne	LBB0_21
## %bb.20:
	movl	(%rbx), %esi
	movq	%r14, %rdi
	callq	_find_encoder
LBB0_21:
	testq	%rax, %rax
	je	LBB0_28
## %bb.22:
	movq	(%r13), %rcx
	movl	(%rcx), %edx
	movl	(%r15), %ecx
	cmpl	%ecx, %edx
	jne	LBB0_23
## %bb.24:
	movq	(%rax), %rsi
	movl	(%rsi), %esi
	movl	(%rbx), %edi
	cmpl	%edi, %esi
	jne	LBB0_25
	jmp	LBB0_27
LBB0_15:
	movl	%ebx, %r13d
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	je	LBB0_37
LBB0_34:
	testq	%r12, %r12
	je	LBB0_37
## %bb.35:
	movq	%r12, %rdi
	callq	_to_drm_encoder
	movq	(%rax), %rcx
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	*(%rcx)
	movq	_connector_status_connected@GOTPCREL(%rip), %r15
	cmpq	(%r15), %rax
	jne	LBB0_37
## %bb.36:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_nouveau_connector_set_encoder
	movl	(%r15), %r13d
	jmp	LBB0_37
LBB0_23:
	movl	(%rbx), %edi
LBB0_25:
	cmpl	%edi, %edx
	jne	LBB0_28
## %bb.26:
	movq	(%rax), %rax
	movl	%edx, %esi
	cmpl	%ecx, (%rax)
	jne	LBB0_28
LBB0_27:
	movq	8(%r12), %rax
	movq	_DRM_EDID_INPUT_DIGITAL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	andl	(%rax), %edx
	cmovel	%ecx, %esi
	movq	%r14, %rdi
	callq	_find_encoder
	movq	%rax, %r13
LBB0_28:
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_nouveau_connector_set_encoder
	movq	_connector_status_connected@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r12, %rdi
	addq	$16, %rdi
	movq	8(%r12), %rsi
	callq	_drm_dp_cec_set_edid
LBB0_37:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	callq	_pm_runtime_mark_last_busy
	movl	(%rbx), %edi
	callq	_pm_runtime_put_autosuspend
LBB0_38:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_connector_status_disconnected,4,2 ## @connector_status_disconnected
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_VGA_SWITCHEROO_CAN_SWITCH_DDC,4,2 ## @VGA_SWITCHEROO_CAN_SWITCH_DDC
	.comm	_DCB_CONNECTOR_LVDS,8,3         ## @DCB_CONNECTOR_LVDS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DDC responded, but no EDID for %s\n"

	.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,8,3 ## @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:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x23, x1
	mov	x20, x0
	ldr	x19, [x0, #8]
	mov	x0, x19
	bl	_nouveau_drm
	mov	x25, x0
	mov	x0, x20
	bl	_nouveau_connector
	mov	x21, x0
Lloh0:
	adrp	x8, _connector_status_disconnected@GOTPAGE
Lloh1:
	ldr	x8, [x8, _connector_status_disconnected@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, #0
	bl	_drm_connector_update_edid_property
	ldr	x0, [x21, #8]
	bl	_kfree
	str	xzr, [x21, #8]
LBB0_2:
	bl	_drm_kms_helper_is_poll_worker
	mov	x8, x0
	ldr	w0, [x19]
	cbz	x8, LBB0_4
; %bb.3:
	bl	_pm_runtime_get_noresume
	b	LBB0_6
LBB0_4:
	bl	_pm_runtime_get_sync
	tbz	w0, #31, LBB0_6
; %bb.5:
Lloh3:
	adrp	x8, _EACCES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_36
LBB0_6:
	mov	x0, x20
	bl	_nouveau_connector_ddc_detect
	cbz	x0, LBB0_11
; %bb.7:
	mov	x24, x0
	ldr	x26, [x0, #8]
	cbz	x26, LBB0_11
; %bb.8:
	bl	_vga_switcheroo_handler_flags
Lloh6:
	adrp	x8, _VGA_SWITCHEROO_CAN_SWITCH_DDC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VGA_SWITCHEROO_CAN_SWITCH_DDC@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_13
; %bb.9:
	ldr	x8, [x21]
Lloh9:
	adrp	x9, _DCB_CONNECTOR_LVDS@GOTPAGE
Lloh10:
	ldr	x9, [x9, _DCB_CONNECTOR_LVDS@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.10:
	mov	x0, x20
	mov	x1, x26
	bl	_drm_get_edid_switcheroo
	b	LBB0_14
LBB0_11:
	mov	x0, x20
	bl	_nouveau_connector_of_detect
	cbz	x0, LBB0_18
; %bb.12:
	mov	x1, x0
	mov	x0, x20
	bl	_nouveau_connector_set_encoder
Lloh12:
	adrp	x8, _connector_status_connected@GOTPAGE
Lloh13:
	ldr	x8, [x8, _connector_status_connected@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	b	LBB0_35
LBB0_13:
	mov	x0, x20
	mov	x1, x26
	bl	_drm_get_edid
LBB0_14:
	mov	x1, x0
	str	x0, [x21, #8]
	mov	x0, x20
	bl	_drm_connector_update_edid_property
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_17
; %bb.15:
	ldr	x8, [x24]
	ldr	w8, [x8]
Lloh15:
	adrp	x22, _DCB_OUTPUT_TMDS@GOTPAGE
Lloh16:
	ldr	x22, [x22, _DCB_OUTPUT_TMDS@GOTPAGEOFF]
	ldr	w9, [x22]
Lloh17:
	adrp	x23, _DCB_OUTPUT_ANALOG@GOTPAGE
Lloh18:
	ldr	x23, [x23, _DCB_OUTPUT_ANALOG@GOTPAGEOFF]
	cmp	w8, w9
	b.ne	LBB0_24
; %bb.16:
	ldr	w1, [x23]
	mov	x0, x20
	bl	_find_encoder
	ldr	x8, [x24]
	ldr	w8, [x8]
	b	LBB0_25
LBB0_17:
	ldr	w2, [x20]
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x25
	bl	_NV_ERROR
LBB0_18:
Lloh21:
	adrp	x8, _DCB_OUTPUT_ANALOG@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DCB_OUTPUT_ANALOG@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_find_encoder
	mov	x21, x0
Lloh24:
	adrp	x8, _nouveau_tv_disable@GOTPAGE
Lloh25:
	ldr	x8, [x8, _nouveau_tv_disable@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmp	x0, #0
	ccmp	w8, #0, #0, eq
	b.ne	LBB0_20
; %bb.19:
Lloh27:
	adrp	x8, _DCB_OUTPUT_TV@GOTPAGE
Lloh28:
	ldr	x8, [x8, _DCB_OUTPUT_TV@GOTPAGEOFF]
Lloh29:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_find_encoder
	mov	x21, x0
LBB0_20:
	cbz	w23, LBB0_35
; %bb.21:
	cbz	x21, LBB0_35
; %bb.22:
	mov	x0, x21
	bl	_to_drm_encoder
	ldr	x8, [x0]
	ldr	x8, [x8]
	mov	x1, x20
	blr	x8
Lloh30:
	adrp	x23, _connector_status_connected@GOTPAGE
Lloh31:
	ldr	x23, [x23, _connector_status_connected@GOTPAGEOFF]
	ldr	x8, [x23]
	cmp	x0, x8
	b.ne	LBB0_35
; %bb.23:
	mov	x0, x20
	mov	x1, x21
	bl	_nouveau_connector_set_encoder
	ldr	w22, [x23]
	b	LBB0_35
LBB0_24:
	mov	x0, #0
LBB0_25:
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_27
; %bb.26:
	ldr	w1, [x22]
	mov	x0, x20
	bl	_find_encoder
LBB0_27:
	cbz	x0, LBB0_34
; %bb.28:
	ldr	x8, [x24]
	ldr	w9, [x8]
	ldr	w8, [x23]
	cmp	w9, w8
	b.ne	LBB0_30
; %bb.29:
	ldr	x10, [x0]
	ldr	w10, [x10]
	ldr	w11, [x22]
	cmp	w10, w11
	b.ne	LBB0_31
	b	LBB0_33
LBB0_30:
	ldr	w11, [x22]
LBB0_31:
	cmp	w9, w11
	b.ne	LBB0_34
; %bb.32:
	ldr	x10, [x0]
	ldr	w11, [x10]
	mov	x10, x9
	cmp	w11, w8
	b.ne	LBB0_34
LBB0_33:
	ldr	x9, [x21, #8]
	ldr	w9, [x9]
Lloh32:
	adrp	x11, _DRM_EDID_INPUT_DIGITAL@GOTPAGE
Lloh33:
	ldr	x11, [x11, _DRM_EDID_INPUT_DIGITAL@GOTPAGEOFF]
Lloh34:
	ldr	w11, [x11]
	tst	w11, w9
	csel	w1, w8, w10, eq
	mov	x0, x20
	bl	_find_encoder
	mov	x24, x0
LBB0_34:
	mov	x0, x20
	mov	x1, x24
	bl	_nouveau_connector_set_encoder
Lloh35:
	adrp	x8, _connector_status_connected@GOTPAGE
Lloh36:
	ldr	x8, [x8, _connector_status_connected@GOTPAGEOFF]
Lloh37:
	ldr	w22, [x8]
	add	x0, x21, #16
	ldr	x1, [x21, #8]
	bl	_drm_dp_cec_set_edid
LBB0_35:
	ldr	w0, [x19]
	bl	_pm_runtime_mark_last_busy
	ldr	w0, [x19]
	bl	_pm_runtime_put_autosuspend
LBB0_36:
	mov	x0, x22
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_connector_status_disconnected,4,2 ; @connector_status_disconnected
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_VGA_SWITCHEROO_CAN_SWITCH_DDC,4,2 ; @VGA_SWITCHEROO_CAN_SWITCH_DDC
	.comm	_DCB_CONNECTOR_LVDS,8,3         ; @DCB_CONNECTOR_LVDS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DDC responded, but no EDID for %s\n"

	.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,8,3 ; @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
