	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atombios_scaler_setup
_atombios_scaler_setup:                 ## @atombios_scaler_setup
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	(%rax), %r15
	callq	_to_radeon_crtc
	movq	%rax, %r12
	movq	_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_EnableScaler@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_GetIndexIntoMasterTable
	movl	%eax, %r14d
	movl	16(%r12), %edi
	callq	_to_radeon_encoder
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_ASIC_IS_AVIVO
	testq	%rax, %rax
	je	LBB0_1
LBB0_2:
	movq	_ATOM_DEVICE_TV_SUPPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_5
## %bb.3:
	movq	8(%rbx), %rax
	movl	(%rax), %ebx
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	8(%r12), %rax
	movq	%rax, -40(%rbp)
	addl	$-128, %ebx
	cmpl	$7, %ebx
	jae	LBB0_4
## %bb.13:
	movslq	%ebx, %rax
	leaq	l_switch.table.atombios_scaler_setup(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	jmp	LBB0_14
LBB0_1:
	cmpq	$0, 8(%r12)
	jne	LBB0_17
	jmp	LBB0_2
LBB0_5:
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$24, %edx
	callq	_memset
	movq	8(%r12), %rax
	movq	%rax, -40(%rbp)
	movl	(%r12), %eax
	cmpl	$138, %eax
	je	LBB0_8
## %bb.6:
	cmpl	$137, %eax
	je	LBB0_11
## %bb.7:
	cmpl	$136, %eax
	jne	LBB0_9
LBB0_8:
	movq	_ATOM_SCALER_EXPANSION@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_4:
	movq	_ATOM_TV_NTSC@GOTPCREL(%rip), %rax
LBB0_14:
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_SCALER_ENABLE_MULTITAP_MODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)
	movl	8(%r15), %edi
	leaq	-56(%rbp), %rdx
	movl	%r14d, %esi
	callq	_atom_execute_table
	movq	(%r15), %rax
	movq	_CHIP_RV515@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jl	LBB0_17
## %bb.15:
	movq	_CHIP_R580@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jg	LBB0_17
## %bb.16:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_atom_rv515_force_tv_scaler
	jmp	LBB0_17
LBB0_9:
	movq	%r15, %rdi
	callq	_ASIC_IS_AVIVO
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_ATOM_SCALER_DISABLE@GOTPCREL(%rip), %rax
	jmp	LBB0_12
LBB0_11:
	movq	_ATOM_SCALER_CENTER@GOTPCREL(%rip), %rax
LBB0_12:
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)
	movl	8(%r15), %edi
	leaq	-56(%rbp), %rdx
	movl	%r14d, %esi
	callq	_atom_execute_table
LBB0_17:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COMMAND,4,2                    ## @COMMAND
	.comm	_EnableScaler,4,2               ## @EnableScaler
	.comm	_ATOM_DEVICE_TV_SUPPORT,4,2     ## @ATOM_DEVICE_TV_SUPPORT
	.comm	_ATOM_TV_NTSC,8,3               ## @ATOM_TV_NTSC
	.comm	_ATOM_TV_PAL,8,3                ## @ATOM_TV_PAL
	.comm	_ATOM_TV_PALM,8,3               ## @ATOM_TV_PALM
	.comm	_ATOM_TV_PAL60,8,3              ## @ATOM_TV_PAL60
	.comm	_ATOM_TV_NTSCJ,8,3              ## @ATOM_TV_NTSCJ
	.comm	_ATOM_TV_SECAM,8,3              ## @ATOM_TV_SECAM
	.comm	_ATOM_TV_PALCN,8,3              ## @ATOM_TV_PALCN
	.comm	_SCALER_ENABLE_MULTITAP_MODE,8,3 ## @SCALER_ENABLE_MULTITAP_MODE
	.comm	_ATOM_TV_CV,8,3                 ## @ATOM_TV_CV
	.comm	_ATOM_SCALER_EXPANSION,8,3      ## @ATOM_SCALER_EXPANSION
	.comm	_ATOM_SCALER_CENTER,8,3         ## @ATOM_SCALER_CENTER
	.comm	_ATOM_SCALER_DISABLE,8,3        ## @ATOM_SCALER_DISABLE
	.comm	_CHIP_RV515,8,3                 ## @CHIP_RV515
	.comm	_CHIP_R580,8,3                  ## @CHIP_R580
	.no_dead_strip	_atombios_scaler_setup
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.atombios_scaler_setup
l_switch.table.atombios_scaler_setup:
	.quad	_ATOM_TV_SECAM
	.quad	_ATOM_TV_PAL
	.quad	_ATOM_TV_PALM
	.quad	_ATOM_TV_PALCN
	.quad	_ATOM_TV_PAL60
	.quad	_ATOM_TV_PAL
	.quad	_ATOM_TV_NTSCJ

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atombios_scaler_setup
_atombios_scaler_setup:                 ; @atombios_scaler_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	ldr	x8, [x0]
	ldr	x19, [x8]
	bl	_to_radeon_crtc
	mov	x21, x0
Lloh0:
	adrp	x8, _COMMAND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _COMMAND@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _EnableScaler@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EnableScaler@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_GetIndexIntoMasterTable
	mov	x20, x0
	ldr	w0, [x21, #16]
	bl	_to_radeon_encoder
	mov	x22, x0
	mov	x0, x19
	bl	_ASIC_IS_AVIVO
	cbz	x0, LBB0_4
LBB0_1:
	ldr	w8, [x22]
Lloh6:
	adrp	x9, _ATOM_DEVICE_TV_SUPPORT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ATOM_DEVICE_TV_SUPPORT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.2:
	ldr	x8, [x22, #8]
	ldr	w22, [x8]
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	x8, [x21, #8]
	str	x8, [sp, #24]
	sub	w8, w22, #128
	cmp	w8, #7
	b.hs	LBB0_9
; %bb.3:
Lloh9:
	adrp	x9, l_switch.table.atombios_scaler_setup@PAGE
Lloh10:
	add	x9, x9, l_switch.table.atombios_scaler_setup@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	b	LBB0_10
LBB0_4:
	ldr	x8, [x21, #8]
	cbnz	x8, LBB0_16
	b	LBB0_1
LBB0_5:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #24
	bl	_memset
	ldr	x8, [x21, #8]
	str	x8, [sp, #24]
	ldr	w8, [x21]
	cmp	w8, #138
	b.eq	LBB0_8
; %bb.6:
	cmp	w8, #137
	b.eq	LBB0_14
; %bb.7:
	cmp	w8, #136
	b.ne	LBB0_12
LBB0_8:
Lloh11:
	adrp	x8, _ATOM_SCALER_EXPANSION@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ATOM_SCALER_EXPANSION@GOTPAGEOFF]
	b	LBB0_15
LBB0_9:
Lloh13:
	adrp	x8, _ATOM_TV_NTSC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ATOM_TV_NTSC@GOTPAGEOFF]
LBB0_10:
	ldr	x8, [x8]
Lloh15:
	adrp	x9, _SCALER_ENABLE_MULTITAP_MODE@GOTPAGE
Lloh16:
	ldr	x9, [x9, _SCALER_ENABLE_MULTITAP_MODE@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	stp	x9, x8, [sp, #8]
	ldr	w0, [x19, #8]
	add	x2, sp, #8
	mov	x1, x20
	bl	_atom_execute_table
	ldr	x8, [x19]
Lloh18:
	adrp	x9, _CHIP_RV515@GOTPAGE
Lloh19:
	ldr	x9, [x9, _CHIP_RV515@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
Lloh21:
	adrp	x10, _CHIP_R580@GOTPAGE
Lloh22:
	ldr	x10, [x10, _CHIP_R580@GOTPAGEOFF]
Lloh23:
	ldr	x10, [x10]
	cmp	x8, x9
	ccmp	x8, x10, #0, ge
	b.gt	LBB0_16
; %bb.11:
	mov	x0, x19
	mov	x1, x21
	bl	_atom_rv515_force_tv_scaler
	b	LBB0_16
LBB0_12:
	mov	x0, x19
	bl	_ASIC_IS_AVIVO
	cbz	x0, LBB0_14
; %bb.13:
Lloh24:
	adrp	x8, _ATOM_SCALER_DISABLE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ATOM_SCALER_DISABLE@GOTPAGEOFF]
	b	LBB0_15
LBB0_14:
Lloh26:
	adrp	x8, _ATOM_SCALER_CENTER@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ATOM_SCALER_CENTER@GOTPAGEOFF]
LBB0_15:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldr	w0, [x19, #8]
	add	x2, sp, #8
	mov	x1, x20
	bl	_atom_execute_table
LBB0_16:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_COMMAND,4,2                    ; @COMMAND
	.comm	_EnableScaler,4,2               ; @EnableScaler
	.comm	_ATOM_DEVICE_TV_SUPPORT,4,2     ; @ATOM_DEVICE_TV_SUPPORT
	.comm	_ATOM_TV_NTSC,8,3               ; @ATOM_TV_NTSC
	.comm	_ATOM_TV_PAL,8,3                ; @ATOM_TV_PAL
	.comm	_ATOM_TV_PALM,8,3               ; @ATOM_TV_PALM
	.comm	_ATOM_TV_PAL60,8,3              ; @ATOM_TV_PAL60
	.comm	_ATOM_TV_NTSCJ,8,3              ; @ATOM_TV_NTSCJ
	.comm	_ATOM_TV_SECAM,8,3              ; @ATOM_TV_SECAM
	.comm	_ATOM_TV_PALCN,8,3              ; @ATOM_TV_PALCN
	.comm	_SCALER_ENABLE_MULTITAP_MODE,8,3 ; @SCALER_ENABLE_MULTITAP_MODE
	.comm	_ATOM_TV_CV,8,3                 ; @ATOM_TV_CV
	.comm	_ATOM_SCALER_EXPANSION,8,3      ; @ATOM_SCALER_EXPANSION
	.comm	_ATOM_SCALER_CENTER,8,3         ; @ATOM_SCALER_CENTER
	.comm	_ATOM_SCALER_DISABLE,8,3        ; @ATOM_SCALER_DISABLE
	.comm	_CHIP_RV515,8,3                 ; @CHIP_RV515
	.comm	_CHIP_R580,8,3                  ; @CHIP_R580
	.no_dead_strip	_atombios_scaler_setup
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.atombios_scaler_setup
l_switch.table.atombios_scaler_setup:
	.quad	_ATOM_TV_SECAM
	.quad	_ATOM_TV_PAL
	.quad	_ATOM_TV_PALM
	.quad	_ATOM_TV_PALCN
	.quad	_ATOM_TV_PAL60
	.quad	_ATOM_TV_PAL
	.quad	_ATOM_TV_NTSCJ

.subsections_via_symbols
