	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function intel_sdvo_detect
_intel_sdvo_detect:                     ## @intel_sdvo_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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_intel_attached_sdvo
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_to_intel_sdvo_connector
	movq	%rax, %r15
	movq	_SDVO_CMD_GET_ATTACHED_DISPLAYS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movl	$2, %ecx
	callq	_intel_sdvo_get_value
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	-36(%rbp), %edx
	movzbl	%dl, %esi
	sarl	$8, %edx
	movl	(%r15), %ecx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG_KMS
	movl	-36(%rbp), %eax
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movl	%eax, (%r14)
	movq	$0, 4(%r14)
	movl	$0, 12(%r14)
	movl	-36(%rbp), %eax
	testl	%eax, (%r15)
	je	LBB0_5
## %bb.6:
	movq	%r15, %rdi
	callq	_IS_TMDS
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	%rbx, %rdi
	callq	_intel_sdvo_tmds_sink_detect
	movl	%eax, %ebx
	jmp	LBB0_16
LBB0_1:
	movq	_connector_status_unknown@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_21
LBB0_3:
	movq	_connector_status_disconnected@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_21
LBB0_5:
	movq	_connector_status_disconnected@GOTPCREL(%rip), %rax
LBB0_15:
	movl	(%rax), %ebx
	jmp	LBB0_16
LBB0_8:
	movq	%rbx, %rdi
	callq	_intel_sdvo_get_edid
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	movq	%rbx, %rdi
	callq	_intel_sdvo_get_analog_edid
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_14
LBB0_10:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_intel_sdvo_connector_matches_edid
	testq	%rax, %rax
	jne	LBB0_11
## %bb.12:
	movq	_connector_status_disconnected@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_11:
	movq	_connector_status_connected@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %ebx
	movq	%r12, %rdi
	callq	_kfree
LBB0_16:
	movq	_connector_status_connected@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_21
## %bb.17:
	movq	$0, 16(%r14)
	movl	$0, 32(%r14)
	movl	-36(%rbp), %eax
	movq	_SDVO_TV_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_19
## %bb.18:
	movl	$1, 16(%r14)
	movl	$1, 32(%r14)
LBB0_19:
	movq	_SDVO_LVDS_MASK@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_21
## %bb.20:
	xorl	%eax, %eax
	cmpq	$0, 24(%r14)
	setne	%al
	movl	%eax, 20(%r14)
LBB0_21:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	movq	_connector_status_connected@GOTPCREL(%rip), %rax
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_SDVO_CMD_GET_ATTACHED_DISPLAYS,4,2 ## @SDVO_CMD_GET_ATTACHED_DISPLAYS
	.comm	_connector_status_unknown,4,2   ## @connector_status_unknown
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SDVO response %d %d [%x]\n"

	.comm	_connector_status_disconnected,4,2 ## @connector_status_disconnected
	.comm	_connector_status_connected,4,2 ## @connector_status_connected
	.comm	_SDVO_TV_MASK,4,2               ## @SDVO_TV_MASK
	.comm	_SDVO_LVDS_MASK,4,2             ## @SDVO_LVDS_MASK
	.no_dead_strip	_intel_sdvo_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function intel_sdvo_detect
_intel_sdvo_detect:                     ; @intel_sdvo_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x0
	bl	_intel_attached_sdvo
	mov	x19, x0
	mov	x0, x20
	bl	_to_intel_sdvo_connector
	mov	x21, x0
Lloh0:
	adrp	x8, _SDVO_CMD_GET_ATTACHED_DISPLAYS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SDVO_CMD_GET_ATTACHED_DISPLAYS@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	add	x2, sp, #12
	mov	x0, x19
	mov	w3, #2
	bl	_intel_sdvo_get_value
	cbz	w0, LBB0_5
; %bb.1:
	ldr	w8, [sp, #12]
	and	w1, w8, #0xff
	asr	w2, w8, #8
	ldr	w3, [x21]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG_KMS
	ldr	w8, [sp, #12]
	cbz	w8, LBB0_6
; %bb.2:
	stp	w8, wzr, [x19]
	str	xzr, [x19, #8]
	ldr	w8, [x21]
	ldr	w9, [sp, #12]
Lloh5:
	adrp	x23, _connector_status_connected@GOTPAGE
Lloh6:
	ldr	x23, [x23, _connector_status_connected@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.3:
	mov	x0, x21
	bl	_IS_TMDS
	cbz	x0, LBB0_8
; %bb.4:
	mov	x0, x20
	bl	_intel_sdvo_tmds_sink_detect
	mov	x20, x0
	b	LBB0_11
LBB0_5:
Lloh7:
	adrp	x8, _connector_status_unknown@GOTPAGE
Lloh8:
	ldr	x8, [x8, _connector_status_unknown@GOTPAGEOFF]
Lloh9:
	ldr	w20, [x8]
	b	LBB0_16
LBB0_6:
Lloh10:
	adrp	x8, _connector_status_disconnected@GOTPAGE
Lloh11:
	ldr	x8, [x8, _connector_status_disconnected@GOTPAGEOFF]
Lloh12:
	ldr	w20, [x8]
	b	LBB0_16
LBB0_7:
Lloh13:
	adrp	x8, _connector_status_disconnected@GOTPAGE
Lloh14:
	ldr	x8, [x8, _connector_status_disconnected@GOTPAGEOFF]
Lloh15:
	ldr	w20, [x8]
	b	LBB0_11
LBB0_8:
	mov	x0, x20
	bl	_intel_sdvo_get_edid
	mov	x22, x0
	cbnz	x0, LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_intel_sdvo_get_analog_edid
	mov	x22, x0
	cbz	x0, LBB0_17
LBB0_10:
	mov	x0, x21
	mov	x1, x22
	bl	_intel_sdvo_connector_matches_edid
Lloh16:
	adrp	x8, _connector_status_disconnected@GOTPAGE
Lloh17:
	ldr	x8, [x8, _connector_status_disconnected@GOTPAGEOFF]
	cmp	x0, #0
	csel	x8, x8, x23, eq
	ldr	w20, [x8]
	mov	x0, x22
	bl	_kfree
LBB0_11:
	ldr	w8, [x23]
	cmp	w20, w8
	b.ne	LBB0_16
; %bb.12:
	str	xzr, [x19, #16]
	str	wzr, [x19, #32]
	ldr	w8, [sp, #12]
Lloh18:
	adrp	x9, _SDVO_TV_MASK@GOTPAGE
Lloh19:
	ldr	x9, [x9, _SDVO_TV_MASK@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_14
; %bb.13:
	mov	w9, #1
	str	w9, [x19, #16]
	str	w9, [x19, #32]
LBB0_14:
Lloh21:
	adrp	x9, _SDVO_LVDS_MASK@GOTPAGE
Lloh22:
	ldr	x9, [x9, _SDVO_LVDS_MASK@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.15:
	ldr	x8, [x19, #24]
	cmp	x8, #0
	cset	w8, ne
	str	w8, [x19, #20]
LBB0_16:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
LBB0_17:
	ldr	w20, [x23]
	b	LBB0_11
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_SDVO_CMD_GET_ATTACHED_DISPLAYS,4,2 ; @SDVO_CMD_GET_ATTACHED_DISPLAYS
	.comm	_connector_status_unknown,4,2   ; @connector_status_unknown
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SDVO response %d %d [%x]\n"

	.comm	_connector_status_disconnected,4,2 ; @connector_status_disconnected
	.comm	_connector_status_connected,4,2 ; @connector_status_connected
	.comm	_SDVO_TV_MASK,4,2               ; @SDVO_TV_MASK
	.comm	_SDVO_LVDS_MASK,4,2             ; @SDVO_LVDS_MASK
	.no_dead_strip	_intel_sdvo_detect
.subsections_via_symbols
