	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_atom_encoder_mode_set
_radeon_atom_encoder_mode_set:          ## @radeon_atom_encoder_mode_set
	.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	%rdx, %r14
	movq	%rdi, %r13
	movq	(%rdi), %rax
	movq	(%rax), %rbx
	callq	_to_radeon_encoder
	movq	%rax, %r12
	movq	%r13, %rdi
	callq	_radeon_get_connector_for_encoder
	movq	%rax, %r15
	movl	(%r14), %eax
	movl	%eax, 12(%r12)
	movq	_DRM_MODE_DPMS_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_radeon_atom_encoder_dpms
	movq	%rbx, %rdi
	callq	_ASIC_IS_AVIVO
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_ASIC_IS_DCE4
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	_ATOM_DEVICE_CV_SUPPORT@GOTPCREL(%rip), %rax
	movq	_ATOM_DEVICE_TV_SUPPORT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	xorl	%esi, %esi
	andl	(%r12), %ecx
	setne	%sil
	movq	%r13, %rdi
	callq	_atombios_yuv_setup
LBB0_3:
	movl	$-132, %eax
	addl	4(%r12), %eax
	cmpl	$11, %eax
	ja	LBB0_13
## %bb.4:
	movl	$15, %ecx
	btl	%eax, %ecx
	jb	LBB0_18
## %bb.5:
	movl	$3264, %ecx                     ## imm = 0xCC0
	btl	%eax, %ecx
	jae	LBB0_6
## %bb.8:
	movq	_ATOM_ENABLE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_atombios_dac_setup
	movq	_ATOM_DEVICE_TV_SUPPORT@GOTPCREL(%rip), %rcx
	movq	_ATOM_DEVICE_CV_SUPPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	testl	%eax, 8(%r12)
	je	LBB0_13
## %bb.9:
	testl	%eax, (%r12)
	je	LBB0_11
## %bb.10:
	movl	(%rbx), %esi
	jmp	LBB0_12
LBB0_18:
	movq	_PANEL_ENCODER_ACTION_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_atombios_digital_setup
	jmp	LBB0_13
LBB0_6:
	movl	$800, %ecx                      ## imm = 0x320
	btl	%eax, %ecx
	jae	LBB0_13
## %bb.7:
	movq	_ATOM_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_atombios_dvo_setup
	jmp	LBB0_13
LBB0_11:
	movq	_ATOM_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
LBB0_12:
	movq	%r13, %rdi
	callq	_atombios_tv_setup
LBB0_13:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_atombios_apply_encoder_quirks
	movq	%r13, %rdi
	callq	_atombios_get_encoder_mode
	testq	%r15, %r15
	je	LBB0_17
## %bb.14:
	movq	_radeon_audio@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	je	LBB0_17
## %bb.15:
	movq	_ATOM_ENCODER_MODE_HDMI@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	je	LBB0_19
## %bb.16:
	movl	%eax, %edi
	callq	_ENCODER_MODE_IS_DP
	testq	%rax, %rax
	je	LBB0_17
LBB0_19:
	movq	%r13, %rdi
	movq	%r14, %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_radeon_audio_mode_set          ## TAILCALL
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_DPMS_OFF,4,2          ## @DRM_MODE_DPMS_OFF
	.comm	_ATOM_DEVICE_CV_SUPPORT,4,2     ## @ATOM_DEVICE_CV_SUPPORT
	.comm	_ATOM_DEVICE_TV_SUPPORT,4,2     ## @ATOM_DEVICE_TV_SUPPORT
	.comm	_PANEL_ENCODER_ACTION_ENABLE,4,2 ## @PANEL_ENCODER_ACTION_ENABLE
	.comm	_ATOM_ENABLE,4,2                ## @ATOM_ENABLE
	.comm	_ATOM_DISABLE,4,2               ## @ATOM_DISABLE
	.comm	_radeon_audio,8,3               ## @radeon_audio
	.comm	_ATOM_ENCODER_MODE_HDMI,4,2     ## @ATOM_ENCODER_MODE_HDMI
	.no_dead_strip	_radeon_atom_encoder_mode_set
.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_mode_set
_radeon_atom_encoder_mode_set:          ; @radeon_atom_encoder_mode_set
	.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, x2
	mov	x20, x0
	ldr	x8, [x0]
	ldr	x23, [x8]
	bl	_to_radeon_encoder
	mov	x22, x0
	mov	x0, x20
	bl	_radeon_get_connector_for_encoder
	mov	x21, x0
	ldr	w8, [x19]
	str	w8, [x22, #12]
Lloh0:
	adrp	x8, _DRM_MODE_DPMS_OFF@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DRM_MODE_DPMS_OFF@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_radeon_atom_encoder_dpms
	mov	x0, x23
	bl	_ASIC_IS_AVIVO
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x23
	bl	_ASIC_IS_DCE4
	cbnz	w0, LBB0_3
; %bb.2:
	ldr	w8, [x22]
Lloh3:
	adrp	x9, _ATOM_DEVICE_CV_SUPPORT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATOM_DEVICE_CV_SUPPORT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
Lloh6:
	adrp	x10, _ATOM_DEVICE_TV_SUPPORT@GOTPAGE
Lloh7:
	ldr	x10, [x10, _ATOM_DEVICE_TV_SUPPORT@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	cset	w1, ne
	mov	x0, x20
	bl	_atombios_yuv_setup
LBB0_3:
	ldr	w8, [x22, #4]
	sub	w8, w8, #132
	cmp	w8, #11
	b.hi	LBB0_14
; %bb.4:
	mov	w9, #1
	lsl	w9, w9, w8
	tst	w9, #0xf
	b.ne	LBB0_9
; %bb.5:
	mov	w10, #3264
	tst	w9, w10
	b.eq	LBB0_10
; %bb.6:
Lloh9:
	adrp	x23, _ATOM_ENABLE@GOTPAGE
Lloh10:
	ldr	x23, [x23, _ATOM_ENABLE@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x20
	bl	_atombios_dac_setup
	ldr	w9, [x22, #8]
Lloh11:
	adrp	x8, _ATOM_DEVICE_TV_SUPPORT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ATOM_DEVICE_TV_SUPPORT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x10, _ATOM_DEVICE_CV_SUPPORT@GOTPAGE
Lloh15:
	ldr	x10, [x10, _ATOM_DEVICE_CV_SUPPORT@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	orr	w8, w10, w8
	tst	w8, w9
	b.eq	LBB0_14
; %bb.7:
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.8:
	ldr	w1, [x23]
	b	LBB0_13
LBB0_9:
Lloh17:
	adrp	x8, _PANEL_ENCODER_ACTION_ENABLE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _PANEL_ENCODER_ACTION_ENABLE@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_atombios_digital_setup
	b	LBB0_14
LBB0_10:
	mov	w9, #1
	lsl	w8, w9, w8
	mov	w9, #800
	tst	w8, w9
	b.eq	LBB0_14
; %bb.11:
Lloh20:
	adrp	x8, _ATOM_ENABLE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ATOM_ENABLE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_atombios_dvo_setup
	b	LBB0_14
LBB0_12:
Lloh23:
	adrp	x8, _ATOM_DISABLE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ATOM_DISABLE@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
LBB0_13:
	mov	x0, x20
	bl	_atombios_tv_setup
LBB0_14:
	mov	x0, x20
	mov	x1, x19
	bl	_atombios_apply_encoder_quirks
	mov	x0, x20
	bl	_atombios_get_encoder_mode
	cbz	x21, LBB0_19
; %bb.15:
Lloh26:
	adrp	x8, _radeon_audio@GOTPAGE
Lloh27:
	ldr	x8, [x8, _radeon_audio@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	cbz	x8, LBB0_19
; %bb.16:
Lloh29:
	adrp	x8, _ATOM_ENCODER_MODE_HDMI@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ATOM_ENCODER_MODE_HDMI@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	cmp	w0, w8
	b.eq	LBB0_18
; %bb.17:
	bl	_ENCODER_MODE_IS_DP
	cbz	x0, LBB0_19
LBB0_18:
	mov	x0, x20
	mov	x1, 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	_radeon_audio_mode_set
LBB0_19:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_DPMS_OFF,4,2          ; @DRM_MODE_DPMS_OFF
	.comm	_ATOM_DEVICE_CV_SUPPORT,4,2     ; @ATOM_DEVICE_CV_SUPPORT
	.comm	_ATOM_DEVICE_TV_SUPPORT,4,2     ; @ATOM_DEVICE_TV_SUPPORT
	.comm	_PANEL_ENCODER_ACTION_ENABLE,4,2 ; @PANEL_ENCODER_ACTION_ENABLE
	.comm	_ATOM_ENABLE,4,2                ; @ATOM_ENABLE
	.comm	_ATOM_DISABLE,4,2               ; @ATOM_DISABLE
	.comm	_radeon_audio,8,3               ; @radeon_audio
	.comm	_ATOM_ENCODER_MODE_HDMI,4,2     ; @ATOM_ENCODER_MODE_HDMI
	.no_dead_strip	_radeon_atom_encoder_mode_set
.subsections_via_symbols
