	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atombios_tv_setup
_atombios_tv_setup:                     ## @atombios_tv_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	(%rdi), %rax
	movq	(%rax), %r12
	callq	_to_radeon_encoder
	movq	%rax, %rbx
	movq	8(%rax), %r13
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_TVEncoderControl@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_GetIndexIntoMasterTable
	movl	%eax, %r14d
	movl	%r15d, -56(%rbp)
	movq	_ATOM_DEVICE_CV_SUPPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_2
## %bb.1:
	movq	_ATOM_TV_CV@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_2:
	movl	(%r13), %eax
	addl	$-128, %eax
	cmpl	$6, %eax
	ja	LBB0_3
## %bb.4:
	cltq
	leaq	l_switch.table.atombios_tv_setup(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	jmp	LBB0_5
LBB0_3:
	movq	_ATOM_TV_NTSC@GOTPCREL(%rip), %rax
LBB0_5:
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movslq	4(%rbx), %rax
	imulq	$1717986919, %rax, %rdi         ## imm = 0x66666667
	movq	%rdi, %rax
	shrq	$63, %rax
	sarq	$34, %rdi
	addl	%eax, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_cpu_to_le16
	movl	%eax, -52(%rbp)
	movl	(%r12), %edi
	leaq	-56(%rbp), %rdx
	movl	%r14d, %esi
	callq	_atom_execute_table
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_COMMAND,4,2                    ## @COMMAND
	.comm	_TVEncoderControl,4,2           ## @TVEncoderControl
	.comm	_ATOM_DEVICE_CV_SUPPORT,4,2     ## @ATOM_DEVICE_CV_SUPPORT
	.comm	_ATOM_TV_CV,8,3                 ## @ATOM_TV_CV
	.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
	.no_dead_strip	_atombios_tv_setup
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.atombios_tv_setup
l_switch.table.atombios_tv_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_tv_setup
_atombios_tv_setup:                     ; @atombios_tv_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x1
	ldr	x8, [x0]
	ldr	x22, [x8]
	bl	_to_radeon_encoder
	mov	x19, x0
	ldr	x23, [x0, #8]
	mov	x0, sp
	mov	w1, #0
	mov	w2, #16
	bl	_memset
Lloh0:
	adrp	x8, _COMMAND@GOTPAGE
Lloh1:
	ldr	x8, [x8, _COMMAND@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _TVEncoderControl@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TVEncoderControl@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_GetIndexIntoMasterTable
	mov	x20, x0
	str	w21, [sp]
	ldr	w8, [x19]
Lloh6:
	adrp	x9, _ATOM_DEVICE_CV_SUPPORT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ATOM_DEVICE_CV_SUPPORT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh9:
	adrp	x8, _ATOM_TV_CV@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATOM_TV_CV@GOTPAGEOFF]
	b	LBB0_5
LBB0_2:
	ldr	w8, [x23]
	sub	w8, w8, #128
	cmp	w8, #6
	b.hi	LBB0_4
; %bb.3:
Lloh11:
	adrp	x9, l_switch.table.atombios_tv_setup@PAGE
Lloh12:
	add	x9, x9, l_switch.table.atombios_tv_setup@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	b	LBB0_5
LBB0_4:
Lloh13:
	adrp	x8, _ATOM_TV_NTSC@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ATOM_TV_NTSC@GOTPAGEOFF]
LBB0_5:
	ldr	x8, [x8]
	str	x8, [sp, #8]
	ldrsw	x8, [x19, #4]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w0, w8, w9
	bl	_cpu_to_le16
	str	w0, [sp, #4]
	ldr	w0, [x22]
	mov	x2, sp
	mov	x1, x20
	bl	_atom_execute_table
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_COMMAND,4,2                    ; @COMMAND
	.comm	_TVEncoderControl,4,2           ; @TVEncoderControl
	.comm	_ATOM_DEVICE_CV_SUPPORT,4,2     ; @ATOM_DEVICE_CV_SUPPORT
	.comm	_ATOM_TV_CV,8,3                 ; @ATOM_TV_CV
	.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
	.no_dead_strip	_atombios_tv_setup
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.atombios_tv_setup
l_switch.table.atombios_tv_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
