	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_atom_encoder_prepare
_radeon_atom_encoder_prepare:           ## @radeon_atom_encoder_prepare
	.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
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movq	(%rax), %r14
	callq	_to_radeon_encoder
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_radeon_get_connector_for_encoder
	movq	%rax, %r15
	movq	_ATOM_DEVICE_DFP_SUPPORT@GOTPCREL(%rip), %rcx
	movq	_ATOM_DEVICE_LCD_SUPPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	testl	%eax, (%rbx)
	jne	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_radeon_encoder_get_dp_bridge_encoder_id
	movq	_ENCODER_OBJECT_ID_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_5
LBB0_2:
	movq	8(%rbx), %r13
	testq	%r13, %r13
	je	LBB0_5
## %bb.3:
	movq	(%r13), %rsi
	movq	%r14, %rdi
	callq	_radeon_atom_release_dig_encoder
	movq	%r12, %rdi
	movl	$-1, %esi
	callq	_radeon_atom_pick_dig_encoder
	movq	%rax, (%r13)
	movq	_ATOM_DEVICE_DFP_SUPPORT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rbx)
	je	LBB0_5
## %bb.4:
	movq	_CHIP_R600@GOTPCREL(%rip), %rcx
	movq	(%r14), %rdx
	movq	8(%r14), %rsi
	xorl	%edi, %edi
	cmpq	(%rcx), %rdx
	cmovlq	%rdi, %rax
	movl	(%rsi,%rax,4), %eax
	movl	%eax, 8(%r13)
LBB0_5:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_radeon_atom_output_lock
	testq	%r15, %r15
	je	LBB0_10
## %bb.6:
	movq	%r15, %rdi
	callq	_to_radeon_connector
	cmpq	$0, (%rax)
	je	LBB0_8
## %bb.7:
	movq	%rax, %rdi
	callq	_radeon_router_select_cd_port
LBB0_8:
	movq	(%r15), %rax
	movq	_DRM_MODE_CONNECTOR_eDP@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	movq	_ATOM_TRANSMITTER_ACTION_POWER_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_atombios_set_edp_panel_power
LBB0_10:
	movq	%r12, %rdi
	callq	_atombios_set_encoder_crtc_source
	movq	%r14, %rdi
	callq	_ASIC_IS_DCE8
	testq	%rax, %rax
	je	LBB0_11
## %bb.15:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dce8_program_fmt               ## TAILCALL
LBB0_11:
	movq	%r14, %rdi
	callq	_ASIC_IS_DCE4
	testq	%rax, %rax
	je	LBB0_12
## %bb.16:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dce4_program_fmt               ## TAILCALL
LBB0_12:
	movq	%r14, %rdi
	callq	_ASIC_IS_DCE3
	testq	%rax, %rax
	je	LBB0_13
## %bb.17:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dce3_program_fmt               ## TAILCALL
LBB0_13:
	movq	%r14, %rdi
	callq	_ASIC_IS_AVIVO
	testq	%rax, %rax
	je	LBB0_14
## %bb.18:
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_avivo_program_fmt              ## TAILCALL
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATOM_DEVICE_DFP_SUPPORT,4,2    ## @ATOM_DEVICE_DFP_SUPPORT
	.comm	_ATOM_DEVICE_LCD_SUPPORT,4,2    ## @ATOM_DEVICE_LCD_SUPPORT
	.comm	_ENCODER_OBJECT_ID_NONE,8,3     ## @ENCODER_OBJECT_ID_NONE
	.comm	_CHIP_R600,8,3                  ## @CHIP_R600
	.comm	_DRM_MODE_CONNECTOR_eDP,8,3     ## @DRM_MODE_CONNECTOR_eDP
	.comm	_ATOM_TRANSMITTER_ACTION_POWER_ON,4,2 ## @ATOM_TRANSMITTER_ACTION_POWER_ON
	.no_dead_strip	_radeon_atom_encoder_prepare
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_atom_encoder_prepare
_radeon_atom_encoder_prepare:           ; @radeon_atom_encoder_prepare
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	x8, [x0]
	ldr	x20, [x8]
	bl	_to_radeon_encoder
	mov	x22, x0
	mov	x0, x19
	bl	_radeon_get_connector_for_encoder
	mov	x21, x0
	ldr	w8, [x22]
Lloh0:
	adrp	x23, _ATOM_DEVICE_DFP_SUPPORT@GOTPAGE
Lloh1:
	ldr	x23, [x23, _ATOM_DEVICE_DFP_SUPPORT@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh2:
	adrp	x10, _ATOM_DEVICE_LCD_SUPPORT@GOTPAGE
Lloh3:
	ldr	x10, [x10, _ATOM_DEVICE_LCD_SUPPORT@GOTPAGEOFF]
Lloh4:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.ne	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_radeon_encoder_get_dp_bridge_encoder_id
Lloh5:
	adrp	x8, _ENCODER_OBJECT_ID_NONE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENCODER_OBJECT_ID_NONE@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_5
LBB0_2:
	ldr	x24, [x22, #8]
	cbz	x24, LBB0_5
; %bb.3:
	ldr	x1, [x24]
	mov	x0, x20
	bl	_radeon_atom_release_dig_encoder
	mov	x0, x19
	mov	w1, #-1
	bl	_radeon_atom_pick_dig_encoder
	str	x0, [x24]
	ldr	w8, [x22]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh8:
	adrp	x8, _CHIP_R600@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CHIP_R600@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	ldp	x9, x10, [x20]
	cmp	x9, x8
	csel	x8, xzr, x0, lt
	ldr	w8, [x10, x8, lsl #2]
	str	w8, [x24, #8]
LBB0_5:
	mov	x0, x19
	mov	w1, #1
	bl	_radeon_atom_output_lock
	cbz	x21, LBB0_10
; %bb.6:
	mov	x0, x21
	bl	_to_radeon_connector
	ldr	x8, [x0]
	cbz	x8, LBB0_8
; %bb.7:
	bl	_radeon_router_select_cd_port
LBB0_8:
	ldr	x8, [x21]
Lloh11:
	adrp	x9, _DRM_MODE_CONNECTOR_eDP@GOTPAGE
Lloh12:
	ldr	x9, [x9, _DRM_MODE_CONNECTOR_eDP@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
Lloh14:
	adrp	x8, _ATOM_TRANSMITTER_ACTION_POWER_ON@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ATOM_TRANSMITTER_ACTION_POWER_ON@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_atombios_set_edp_panel_power
LBB0_10:
	mov	x0, x19
	bl	_atombios_set_encoder_crtc_source
	mov	x0, x20
	bl	_ASIC_IS_DCE8
	cbz	x0, LBB0_12
; %bb.11:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_dce8_program_fmt
LBB0_12:
	mov	x0, x20
	bl	_ASIC_IS_DCE4
	cbz	x0, LBB0_14
; %bb.13:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_dce4_program_fmt
LBB0_14:
	mov	x0, x20
	bl	_ASIC_IS_DCE3
	cbz	x0, LBB0_16
; %bb.15:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_dce3_program_fmt
LBB0_16:
	mov	x0, x20
	bl	_ASIC_IS_AVIVO
	cbz	x0, LBB0_18
; %bb.17:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_avivo_program_fmt
LBB0_18:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_ATOM_DEVICE_DFP_SUPPORT,4,2    ; @ATOM_DEVICE_DFP_SUPPORT
	.comm	_ATOM_DEVICE_LCD_SUPPORT,4,2    ; @ATOM_DEVICE_LCD_SUPPORT
	.comm	_ENCODER_OBJECT_ID_NONE,8,3     ; @ENCODER_OBJECT_ID_NONE
	.comm	_CHIP_R600,8,3                  ; @CHIP_R600
	.comm	_DRM_MODE_CONNECTOR_eDP,8,3     ; @DRM_MODE_CONNECTOR_eDP
	.comm	_ATOM_TRANSMITTER_ACTION_POWER_ON,4,2 ; @ATOM_TRANSMITTER_ACTION_POWER_ON
	.no_dead_strip	_radeon_atom_encoder_prepare
.subsections_via_symbols
