	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_atom_mode_fixup
_radeon_atom_mode_fixup:                ## @radeon_atom_mode_fixup
	.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	%rsi, %rbx
	movq	%rdi, %r13
	callq	_to_radeon_encoder
	movq	%rax, %r15
	movq	(%r13), %rax
	movq	(%rax), %r12
	movq	%r13, %rdi
	callq	_radeon_encoder_set_active_device
	movq	%r14, %rdi
	xorl	%esi, %esi
	callq	_drm_mode_set_crtcinfo
	movq	_DRM_MODE_FLAG_INTERLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_3
## %bb.1:
	movq	16(%rbx), %rax
	addq	$2, %rax
	cmpq	%rax, 8(%rbx)
	jge	LBB0_3
## %bb.2:
	movq	16(%r14), %rax
	addq	$2, %rax
	movq	%rax, 8(%r14)
LBB0_3:
	movl	(%r15), %eax
	movq	_ATOM_DEVICE_LCD_SUPPORT@GOTPCREL(%rip), %rbx
	testl	%eax, (%rbx)
	je	LBB0_5
## %bb.4:
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_radeon_panel_mode_fixup
	movl	(%r15), %eax
LBB0_5:
	movq	_ATOM_DEVICE_TV_SUPPORT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_8
## %bb.6:
	movq	8(%r15), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	(%rax), %rax
	movq	_TV_STD_NTSC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%cl
	movq	_TV_STD_NTSC_J@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rax
	setne	%dl
	andb	%cl, %dl
	movq	_TV_STD_PAL_M@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	setne	%al
	andb	%dl, %al
	movzbl	%al, %esi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_radeon_atom_get_tv_timings
LBB0_8:
	movq	%r12, %rdi
	callq	_ASIC_IS_DCE3
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movq	_ATOM_DEVICE_DFP_SUPPORT@GOTPCREL(%rip), %rax
	movl	(%rbx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, (%r15)
	jne	LBB0_11
## %bb.10:
	movq	%r13, %rdi
	callq	_radeon_encoder_get_dp_bridge_encoder_id
	movq	_ENCODER_OBJECT_ID_NONE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_12
LBB0_11:
	movq	%r13, %rdi
	callq	_radeon_get_connector_for_encoder
	movq	%rax, %rdi
	movq	%r14, %rsi
	callq	_radeon_dp_set_link_config
LBB0_12:
	movl	$1, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ## @DRM_MODE_FLAG_INTERLACE
	.comm	_ATOM_DEVICE_LCD_SUPPORT,4,2    ## @ATOM_DEVICE_LCD_SUPPORT
	.comm	_ATOM_DEVICE_TV_SUPPORT,4,2     ## @ATOM_DEVICE_TV_SUPPORT
	.comm	_TV_STD_NTSC,8,3                ## @TV_STD_NTSC
	.comm	_TV_STD_NTSC_J,8,3              ## @TV_STD_NTSC_J
	.comm	_TV_STD_PAL_M,8,3               ## @TV_STD_PAL_M
	.comm	_ATOM_DEVICE_DFP_SUPPORT,4,2    ## @ATOM_DEVICE_DFP_SUPPORT
	.comm	_ENCODER_OBJECT_ID_NONE,8,3     ## @ENCODER_OBJECT_ID_NONE
	.no_dead_strip	_radeon_atom_mode_fixup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_atom_mode_fixup
_radeon_atom_mode_fixup:                ; @radeon_atom_mode_fixup
	.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	x23, x1
	mov	x20, x0
	bl	_to_radeon_encoder
	mov	x21, x0
	ldr	x8, [x20]
	ldr	x22, [x8]
	mov	x0, x20
	bl	_radeon_encoder_set_active_device
	mov	x0, x19
	mov	w1, #0
	bl	_drm_mode_set_crtcinfo
	ldr	w8, [x23]
Lloh0:
	adrp	x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_MODE_FLAG_INTERLACE@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.1:
	ldp	x8, x9, [x23, #8]
	add	x9, x9, #2
	cmp	x8, x9
	b.ge	LBB0_3
; %bb.2:
	ldr	x8, [x19, #16]
	add	x8, x8, #2
	str	x8, [x19, #8]
LBB0_3:
	ldr	w8, [x21]
Lloh3:
	adrp	x23, _ATOM_DEVICE_LCD_SUPPORT@GOTPAGE
Lloh4:
	ldr	x23, [x23, _ATOM_DEVICE_LCD_SUPPORT@GOTPAGEOFF]
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x20
	mov	x1, x19
	bl	_radeon_panel_mode_fixup
	ldr	w8, [x21]
LBB0_5:
Lloh5:
	adrp	x9, _ATOM_DEVICE_TV_SUPPORT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ATOM_DEVICE_TV_SUPPORT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.6:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_8
; %bb.7:
Lloh8:
	adrp	x9, _TV_STD_NTSC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TV_STD_NTSC@GOTPAGEOFF]
	ldr	x8, [x8]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
Lloh11:
	adrp	x9, _TV_STD_NTSC_J@GOTPAGE
Lloh12:
	ldr	x9, [x9, _TV_STD_NTSC_J@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	ccmp	x8, x9, #4, ne
Lloh14:
	adrp	x9, _TV_STD_PAL_M@GOTPAGE
Lloh15:
	ldr	x9, [x9, _TV_STD_PAL_M@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	ccmp	x8, x9, #4, ne
	cset	w1, ne
	mov	x0, x22
	mov	x2, x19
	bl	_radeon_atom_get_tv_timings
LBB0_8:
	mov	x0, x22
	bl	_ASIC_IS_DCE3
	cbz	x0, LBB0_12
; %bb.9:
	ldr	w8, [x21]
Lloh17:
	adrp	x9, _ATOM_DEVICE_DFP_SUPPORT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _ATOM_DEVICE_DFP_SUPPORT@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	ldr	w10, [x23]
	orr	w9, w10, w9
	tst	w9, w8
	b.ne	LBB0_11
; %bb.10:
	mov	x0, x20
	bl	_radeon_encoder_get_dp_bridge_encoder_id
Lloh20:
	adrp	x8, _ENCODER_OBJECT_ID_NONE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENCODER_OBJECT_ID_NONE@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_12
LBB0_11:
	mov	x0, x20
	bl	_radeon_get_connector_for_encoder
	mov	x1, x19
	bl	_radeon_dp_set_link_config
LBB0_12:
	mov	w0, #1
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_MODE_FLAG_INTERLACE,4,2    ; @DRM_MODE_FLAG_INTERLACE
	.comm	_ATOM_DEVICE_LCD_SUPPORT,4,2    ; @ATOM_DEVICE_LCD_SUPPORT
	.comm	_ATOM_DEVICE_TV_SUPPORT,4,2     ; @ATOM_DEVICE_TV_SUPPORT
	.comm	_TV_STD_NTSC,8,3                ; @TV_STD_NTSC
	.comm	_TV_STD_NTSC_J,8,3              ; @TV_STD_NTSC_J
	.comm	_TV_STD_PAL_M,8,3               ; @TV_STD_PAL_M
	.comm	_ATOM_DEVICE_DFP_SUPPORT,4,2    ; @ATOM_DEVICE_DFP_SUPPORT
	.comm	_ENCODER_OBJECT_ID_NONE,8,3     ; @ENCODER_OBJECT_ID_NONE
	.no_dead_strip	_radeon_atom_mode_fixup
.subsections_via_symbols
