	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atombios_dac_setup
_atombios_dac_setup:                    ## @atombios_dac_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	16(%rax), %r13
	leaq	-56(%rbp), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	movl	$12, %edx
	callq	_memset
	movl	$-136, %eax
	addl	(%rbx), %eax
	cmpl	$3, %eax
	ja	LBB0_2
## %bb.1:
	cltq
	leaq	l_switch.table.atombios_dac_setup(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movq	_COMMAND@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movl	(%rax), %esi
	callq	_GetIndexIntoMasterTable
	movl	%eax, %r14d
LBB0_2:
	movl	%r15d, -56(%rbp)
	movl	4(%rbx), %eax
	movq	_ATOM_DEVICE_CRT_SUPPORT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_4
## %bb.3:
	movq	_ATOM_DAC1_PS2@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_4:
	movq	_ATOM_DEVICE_CV_SUPPORT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movq	_ATOM_DAC1_CV@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_6:
	movl	(%r13), %eax
	addl	$-128, %eax
	cmpl	$5, %eax
	ja	LBB0_7
## %bb.8:
	cltq
	leaq	l_switch.table.atombios_dac_setup.1(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_ATOM_DAC1_NTSC@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movslq	8(%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	_DAC1EncoderControl,4,2         ## @DAC1EncoderControl
	.comm	_DAC2EncoderControl,4,2         ## @DAC2EncoderControl
	.comm	_ATOM_DEVICE_CRT_SUPPORT,4,2    ## @ATOM_DEVICE_CRT_SUPPORT
	.comm	_ATOM_DAC1_PS2,4,2              ## @ATOM_DAC1_PS2
	.comm	_ATOM_DEVICE_CV_SUPPORT,4,2     ## @ATOM_DEVICE_CV_SUPPORT
	.comm	_ATOM_DAC1_CV,4,2               ## @ATOM_DAC1_CV
	.comm	_ATOM_DAC1_PAL,4,2              ## @ATOM_DAC1_PAL
	.comm	_ATOM_DAC1_NTSC,4,2             ## @ATOM_DAC1_NTSC
	.no_dead_strip	_atombios_dac_setup
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.atombios_dac_setup
l_switch.table.atombios_dac_setup:
	.quad	_DAC2EncoderControl
	.quad	_DAC1EncoderControl
	.quad	_DAC2EncoderControl
	.quad	_DAC1EncoderControl

	.p2align	3                               ## @switch.table.atombios_dac_setup.1
l_switch.table.atombios_dac_setup.1:
	.quad	_ATOM_DAC1_PAL
	.quad	_ATOM_DAC1_PAL
	.quad	_ATOM_DAC1_PAL
	.quad	_ATOM_DAC1_PAL
	.quad	_ATOM_DAC1_NTSC
	.quad	_ATOM_DAC1_PAL

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function atombios_dac_setup
_atombios_dac_setup:                    ; @atombios_dac_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, #16]
	mov	x0, sp
	mov	w1, #0
	mov	w2, #12
	bl	_memset
	mov	w20, #0
	ldr	w8, [x19]
	sub	w8, w8, #136
	cmp	w8, #3
	b.hi	LBB0_2
; %bb.1:
Lloh0:
	adrp	x9, l_switch.table.atombios_dac_setup@PAGE
Lloh1:
	add	x9, x9, l_switch.table.atombios_dac_setup@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
Lloh2:
	adrp	x9, _COMMAND@GOTPAGE
Lloh3:
	ldr	x9, [x9, _COMMAND@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x9]
	ldr	w1, [x8]
	bl	_GetIndexIntoMasterTable
	mov	x20, x0
LBB0_2:
	str	w21, [sp]
	ldr	w8, [x19, #4]
Lloh5:
	adrp	x9, _ATOM_DEVICE_CRT_SUPPORT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ATOM_DEVICE_CRT_SUPPORT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
Lloh8:
	adrp	x8, _ATOM_DAC1_PS2@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ATOM_DAC1_PS2@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
Lloh10:
	adrp	x9, _ATOM_DEVICE_CV_SUPPORT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _ATOM_DEVICE_CV_SUPPORT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
Lloh13:
	adrp	x8, _ATOM_DAC1_CV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ATOM_DAC1_CV@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
	ldr	w8, [x23]
	sub	w8, w8, #128
	cmp	w8, #5
	b.hi	LBB0_8
; %bb.7:
Lloh15:
	adrp	x9, l_switch.table.atombios_dac_setup.1@PAGE
Lloh16:
	add	x9, x9, l_switch.table.atombios_dac_setup.1@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	b	LBB0_9
LBB0_8:
Lloh17:
	adrp	x8, _ATOM_DAC1_NTSC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ATOM_DAC1_NTSC@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	str	w8, [sp, #8]
	ldrsw	x8, [x19, #8]
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_COMMAND,4,2                    ; @COMMAND
	.comm	_DAC1EncoderControl,4,2         ; @DAC1EncoderControl
	.comm	_DAC2EncoderControl,4,2         ; @DAC2EncoderControl
	.comm	_ATOM_DEVICE_CRT_SUPPORT,4,2    ; @ATOM_DEVICE_CRT_SUPPORT
	.comm	_ATOM_DAC1_PS2,4,2              ; @ATOM_DAC1_PS2
	.comm	_ATOM_DEVICE_CV_SUPPORT,4,2     ; @ATOM_DEVICE_CV_SUPPORT
	.comm	_ATOM_DAC1_CV,4,2               ; @ATOM_DAC1_CV
	.comm	_ATOM_DAC1_PAL,4,2              ; @ATOM_DAC1_PAL
	.comm	_ATOM_DAC1_NTSC,4,2             ; @ATOM_DAC1_NTSC
	.no_dead_strip	_atombios_dac_setup
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.atombios_dac_setup
l_switch.table.atombios_dac_setup:
	.quad	_DAC2EncoderControl
	.quad	_DAC1EncoderControl
	.quad	_DAC2EncoderControl
	.quad	_DAC1EncoderControl

	.p2align	3                               ; @switch.table.atombios_dac_setup.1
l_switch.table.atombios_dac_setup.1:
	.quad	_ATOM_DAC1_PAL
	.quad	_ATOM_DAC1_PAL
	.quad	_ATOM_DAC1_PAL
	.quad	_ATOM_DAC1_PAL
	.quad	_ATOM_DAC1_NTSC
	.quad	_ATOM_DAC1_PAL

.subsections_via_symbols
