	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function radeon_legacy_tv_get_std_mode
_radeon_legacy_tv_get_std_mode:         ## @radeon_legacy_tv_get_std_mode
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	8(%rdi), %rax
	movq	(%rax), %rbx
	movq	16(%rdi), %r14
	movl	(%rdi), %edi
	callq	_to_radeon_crtc
	cmpl	$1, (%rax)
	leaq	4(%rbx), %rax
	cmovneq	%rbx, %rax
	testq	%r15, %r15
	je	LBB0_2
## %bb.1:
	movl	(%rax), %ecx
	movl	%ecx, (%r15)
LBB0_2:
	movq	(%r14), %rcx
	movq	_TV_STD_NTSC@GOTPCREL(%rip), %rdx
	movq	_TV_STD_NTSC_J@GOTPCREL(%rip), %rsi
	xorl	%edi, %edi
	cmpl	$2700, (%rax)                   ## imm = 0xA8C
	movq	_TV_STD_PAL_M@GOTPCREL(%rip), %rax
	setne	%dil
	cmpq	(%rax), %rcx
	leaq	(%rdi,%rdi), %rbx
	leaq	1(%rdi,%rdi), %rax
	cmoveq	%rbx, %rax
	cmpq	(%rsi), %rcx
	cmoveq	%rbx, %rax
	cmpq	(%rdx), %rcx
	cmoveq	%rbx, %rax
	movq	_available_tv_modes@GOTPCREL(%rip), %rcx
	shlq	$2, %rax
	addq	(%rcx), %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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	_available_tv_modes,8,3         ## @available_tv_modes
	.no_dead_strip	_radeon_legacy_tv_get_std_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function radeon_legacy_tv_get_std_mode
_radeon_legacy_tv_get_std_mode:         ; @radeon_legacy_tv_get_std_mode
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	ldp	x8, x20, [x0, #8]
	ldr	x21, [x8]
	ldr	w0, [x0]
	bl	_to_radeon_crtc
	ldr	w8, [x0]
	add	x9, x21, #4
	cmp	w8, #1
	csel	x8, x9, x21, eq
	cbz	x19, LBB0_2
; %bb.1:
	ldr	w9, [x8]
	str	w9, [x19]
LBB0_2:
	ldr	x9, [x20]
Lloh0:
	adrp	x10, _TV_STD_NTSC@GOTPAGE
Lloh1:
	ldr	x10, [x10, _TV_STD_NTSC@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
Lloh3:
	adrp	x11, _TV_STD_NTSC_J@GOTPAGE
Lloh4:
	ldr	x11, [x11, _TV_STD_NTSC_J@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
Lloh6:
	adrp	x12, _TV_STD_PAL_M@GOTPAGE
Lloh7:
	ldr	x12, [x12, _TV_STD_PAL_M@GOTPAGEOFF]
Lloh8:
	ldr	x12, [x12]
	ldr	w8, [x8]
	cmp	w8, #2700
	cset	w8, ne
	mov	w13, #3
	csinc	x13, x13, xzr, ne
	cmp	x9, x12
	ccmp	x9, x11, #4, ne
Lloh9:
	adrp	x11, _available_tv_modes@GOTPAGE
Lloh10:
	ldr	x11, [x11, _available_tv_modes@GOTPAGEOFF]
	ccmp	x9, x10, #4, ne
Lloh11:
	ldr	x9, [x11]
	lsl	x8, x8, #1
	csel	x8, x8, x13, eq
	add	x0, x9, x8, lsl #2
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.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	_available_tv_modes,8,3         ; @available_tv_modes
	.no_dead_strip	_radeon_legacy_tv_get_std_mode
.subsections_via_symbols
