	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_dp_detect
_radeon_dp_detect:                      ## @radeon_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	%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, %r13d
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	callq	_to_radeon_connector
	movq	%rax, %r15
	movq	_connector_status_disconnected@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	24(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_radeon_best_single_encoder
	movq	%rax, %r12
	testl	%r13d, %r13d
	je	LBB0_1
LBB0_3:
	movq	16(%r15), %rdi
	testq	%rdi, %rdi
	je	LBB0_5
## %bb.4:
	callq	_kfree
	movq	$0, 16(%r15)
LBB0_5:
	movq	8(%rbx), %rax
	movq	_DRM_MODE_CONNECTOR_eDP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.6:
	movq	_DRM_MODE_CONNECTOR_LVDS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_7
## %bb.18:
	movq	%rbx, %rdi
	callq	_radeon_connector_encoder_get_dp_bridge_encoder_id
	movq	_ENCODER_OBJECT_ID_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.23:
	movq	%r15, %rdi
	callq	_radeon_dp_getsinktype
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%rax, (%r12)
	movl	(%r15), %esi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_radeon_hpd_sense
	testq	%rax, %rax
	je	LBB0_26
## %bb.24:
	movq	_connector_status_connected@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	(%r12), %rax
	movq	_CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_31
## %bb.25:
	movq	%r15, %rdi
	callq	_radeon_dp_getdpcd
	jmp	LBB0_31
LBB0_7:
	testq	%r12, %r12
	je	LBB0_8
## %bb.9:
	movq	%r12, %rdi
	callq	_to_radeon_encoder
	cmpl	$320, (%rax)                    ## imm = 0x140
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	jl	LBB0_12
## %bb.10:
	cmpl	$240, 4(%rax)
	jl	LBB0_12
## %bb.11:
	movq	_connector_status_connected@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_12
LBB0_1:
	movq	%rbx, %rdi
	callq	_radeon_check_hpd_status_unchanged
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movl	(%rbx), %r14d
	jmp	LBB0_32
LBB0_19:
	movq	_CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	%r15, %rdi
	callq	_radeon_dp_getdpcd
	testq	%r12, %r12
	je	LBB0_31
## %bb.20:
	movq	%r12, %rdi
	callq	_radeon_atom_ext_encoder_setup_ddc
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_radeon_ddc_probe
	testq	%rax, %rax
	jne	LBB0_30
## %bb.21:
	cmpq	$0, 8(%r15)
	je	LBB0_31
## %bb.22:
	movq	(%r12), %rax
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	*(%rax)
	movl	%eax, %r14d
	jmp	LBB0_31
LBB0_8:
	movq	-48(%rbp), %r12                 ## 8-byte Reload
LBB0_12:
	movq	_CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	cmpl	$0, 8(%r12)
	jne	LBB0_14
## %bb.13:
	movq	_ATOM_TRANSMITTER_ACTION_POWER_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_atombios_set_edp_panel_power
LBB0_14:
	movq	%r15, %rdi
	callq	_radeon_dp_getdpcd
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	_connector_status_connected@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_16:
	cmpl	$0, 8(%r12)
	jne	LBB0_31
## %bb.17:
	movq	_ATOM_TRANSMITTER_ACTION_POWER_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_atombios_set_edp_panel_power
	jmp	LBB0_31
LBB0_26:
	movq	(%r12), %rax
	movq	_CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_28
## %bb.27:
	movq	%r15, %rdi
	callq	_radeon_dp_getdpcd
	jmp	LBB0_29
LBB0_28:
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_radeon_ddc_probe
LBB0_29:
	testq	%rax, %rax
	je	LBB0_31
LBB0_30:
	movq	_connector_status_connected@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_31:
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_radeon_connector_update_scratch_regs
LBB0_32:
	movl	%r14d, %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	_DRM_MODE_CONNECTOR_eDP,8,3     ## @DRM_MODE_CONNECTOR_eDP
	.comm	_DRM_MODE_CONNECTOR_LVDS,8,3    ## @DRM_MODE_CONNECTOR_LVDS
	.comm	_connector_status_connected,4,2 ## @connector_status_connected
	.comm	_CONNECTOR_OBJECT_ID_DISPLAYPORT,8,3 ## @CONNECTOR_OBJECT_ID_DISPLAYPORT
	.comm	_ATOM_TRANSMITTER_ACTION_POWER_ON,4,2 ## @ATOM_TRANSMITTER_ACTION_POWER_ON
	.comm	_ATOM_TRANSMITTER_ACTION_POWER_OFF,4,2 ## @ATOM_TRANSMITTER_ACTION_POWER_OFF
	.comm	_ENCODER_OBJECT_ID_NONE,8,3     ## @ENCODER_OBJECT_ID_NONE
	.no_dead_strip	_radeon_dp_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_dp_detect
_radeon_dp_detect:                      ; @radeon_dp_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	x24, x1
	mov	x19, x0
	ldr	x8, [x0, #16]
	ldr	x23, [x8]
	bl	_to_radeon_connector
	mov	x21, x0
Lloh0:
	adrp	x8, _connector_status_disconnected@GOTPAGE
Lloh1:
	ldr	x8, [x8, _connector_status_disconnected@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	ldr	x25, [x0, #24]
	mov	x0, x19
	bl	_radeon_best_single_encoder
	mov	x22, x0
	cbz	w24, LBB0_15
LBB0_1:
	ldr	x0, [x21, #16]
	cbz	x0, LBB0_3
; %bb.2:
	bl	_kfree
	str	xzr, [x21, #16]
LBB0_3:
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _DRM_MODE_CONNECTOR_eDP@GOTPAGE
Lloh4:
	ldr	x9, [x9, _DRM_MODE_CONNECTOR_eDP@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
Lloh6:
	adrp	x10, _DRM_MODE_CONNECTOR_LVDS@GOTPAGE
Lloh7:
	ldr	x10, [x10, _DRM_MODE_CONNECTOR_LVDS@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_11
; %bb.4:
	cbz	x22, LBB0_7
; %bb.5:
	mov	x0, x22
	bl	_to_radeon_encoder
	ldr	w8, [x0]
	cmp	w8, #320
	b.lt	LBB0_7
; %bb.6:
	ldr	w8, [x0, #4]
Lloh9:
	adrp	x9, _connector_status_connected@GOTPAGE
Lloh10:
	ldr	x9, [x9, _connector_status_connected@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w8, #239
	csel	w20, w9, w20, gt
LBB0_7:
Lloh12:
	adrp	x8, _CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	str	x8, [x25]
	ldr	w8, [x25, #8]
	cbnz	w8, LBB0_9
; %bb.8:
Lloh15:
	adrp	x8, _ATOM_TRANSMITTER_ACTION_POWER_ON@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ATOM_TRANSMITTER_ACTION_POWER_ON@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_atombios_set_edp_panel_power
LBB0_9:
	mov	x0, x21
	bl	_radeon_dp_getdpcd
Lloh18:
	adrp	x8, _connector_status_connected@GOTPAGE
Lloh19:
	ldr	x8, [x8, _connector_status_connected@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w20, w20, w8, eq
	ldr	w8, [x25, #8]
	cbnz	w8, LBB0_26
; %bb.10:
Lloh21:
	adrp	x8, _ATOM_TRANSMITTER_ACTION_POWER_OFF@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ATOM_TRANSMITTER_ACTION_POWER_OFF@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_atombios_set_edp_panel_power
	b	LBB0_26
LBB0_11:
	mov	x0, x19
	bl	_radeon_connector_encoder_get_dp_bridge_encoder_id
Lloh24:
	adrp	x8, _ENCODER_OBJECT_ID_NONE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENCODER_OBJECT_ID_NONE@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_17
; %bb.12:
	mov	x0, x21
	bl	_radeon_dp_getsinktype
	str	x0, [x25]
	ldr	w1, [x21]
	mov	x0, x23
	bl	_radeon_hpd_sense
	cbz	x0, LBB0_20
; %bb.13:
Lloh27:
	adrp	x8, _connector_status_connected@GOTPAGE
Lloh28:
	ldr	x8, [x8, _connector_status_connected@GOTPAGEOFF]
Lloh29:
	ldr	w20, [x8]
	ldr	x8, [x25]
Lloh30:
	adrp	x9, _CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPAGE
Lloh31:
	ldr	x9, [x9, _CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_26
; %bb.14:
	mov	x0, x21
	bl	_radeon_dp_getdpcd
	b	LBB0_26
LBB0_15:
	mov	x0, x19
	bl	_radeon_check_hpd_status_unchanged
	cbz	x0, LBB0_1
; %bb.16:
	ldr	w20, [x19]
	b	LBB0_27
LBB0_17:
Lloh33:
	adrp	x8, _CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPAGE
Lloh34:
	ldr	x8, [x8, _CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPAGEOFF]
Lloh35:
	ldr	x8, [x8]
	str	x8, [x25]
	mov	x0, x21
	bl	_radeon_dp_getdpcd
	cbz	x22, LBB0_26
; %bb.18:
	mov	x0, x22
	bl	_radeon_atom_ext_encoder_setup_ddc
	mov	x0, x21
	mov	w1, #1
	bl	_radeon_ddc_probe
	cbz	x0, LBB0_22
; %bb.19:
Lloh36:
	adrp	x8, _connector_status_connected@GOTPAGE
Lloh37:
	ldr	x8, [x8, _connector_status_connected@GOTPAGEOFF]
Lloh38:
	ldr	w20, [x8]
	b	LBB0_26
LBB0_20:
	ldr	x8, [x25]
Lloh39:
	adrp	x9, _CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPAGE
Lloh40:
	ldr	x9, [x9, _CONNECTOR_OBJECT_ID_DISPLAYPORT@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	mov	x0, x21
	cmp	x8, x9
	b.ne	LBB0_24
; %bb.21:
	bl	_radeon_dp_getdpcd
	b	LBB0_25
LBB0_22:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_26
; %bb.23:
	ldr	x8, [x22]
	ldr	x8, [x8]
	mov	x0, x22
	mov	x1, x19
	blr	x8
	mov	x20, x0
	b	LBB0_26
LBB0_24:
	mov	w1, #0
	bl	_radeon_ddc_probe
LBB0_25:
Lloh42:
	adrp	x8, _connector_status_connected@GOTPAGE
Lloh43:
	ldr	x8, [x8, _connector_status_connected@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w20, w20, w8, eq
LBB0_26:
	mov	x0, x19
	mov	x1, x20
	bl	_radeon_connector_update_scratch_regs
LBB0_27:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.comm	_connector_status_disconnected,4,2 ; @connector_status_disconnected
	.comm	_DRM_MODE_CONNECTOR_eDP,8,3     ; @DRM_MODE_CONNECTOR_eDP
	.comm	_DRM_MODE_CONNECTOR_LVDS,8,3    ; @DRM_MODE_CONNECTOR_LVDS
	.comm	_connector_status_connected,4,2 ; @connector_status_connected
	.comm	_CONNECTOR_OBJECT_ID_DISPLAYPORT,8,3 ; @CONNECTOR_OBJECT_ID_DISPLAYPORT
	.comm	_ATOM_TRANSMITTER_ACTION_POWER_ON,4,2 ; @ATOM_TRANSMITTER_ACTION_POWER_ON
	.comm	_ATOM_TRANSMITTER_ACTION_POWER_OFF,4,2 ; @ATOM_TRANSMITTER_ACTION_POWER_OFF
	.comm	_ENCODER_OBJECT_ID_NONE,8,3     ; @ENCODER_OBJECT_ID_NONE
	.no_dead_strip	_radeon_dp_detect
.subsections_via_symbols
