	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evergreen_mc_init              ## -- Begin function evergreen_mc_init
	.p2align	4, 0x90
_evergreen_mc_init:                     ## @evergreen_mc_init
	.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	%rdi, %rbx
	movl	$1, 8(%rdi)
	movq	(%rdi), %rax
	movq	_CHIP_PALM@GOTPCREL(%rip), %r15
	movq	_CHIP_SUMO@GOTPCREL(%rip), %rsi
	movq	_CHIP_SUMO2@GOTPCREL(%rip), %r13
	movq	_FUS_MC_ARB_RAMCFG@GOTPCREL(%rip), %rcx
	movq	%rcx, %rdx
	cmpq	(%r13), %rax
	je	LBB0_2
## %bb.1:
	movq	_MC_ARB_RAMCFG@GOTPCREL(%rip), %rdx
LBB0_2:
	cmpq	(%rsi), %rax
	cmoveq	%rcx, %rdx
	cmpq	(%r15), %rax
	cmoveq	%rcx, %rdx
	movl	(%rdx), %edi
	callq	_RREG32
	movq	_CHANSIZE_OVERRIDE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	%eax, %ecx
	movq	_CHANSIZE_MASK@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	andl	(%rdx), %eax
	setne	%sil
	shll	$5, %esi
	addl	$32, %esi
	testl	%ecx, %ecx
	movl	$16, %r14d
	cmovel	%esi, %r14d
	movq	_MC_SHARED_CHMAP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movq	_NOOFCHAN_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_NOOFCHAN_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	decl	%eax
	movl	$1, %ecx
	cmpl	$2, %eax
	ja	LBB0_4
## %bb.3:
	cltq
	leaq	l_switch.table.evergreen_mc_init(%rip), %rcx
	movl	(%rcx,%rax,4), %ecx
LBB0_4:
	imull	%r14d, %ecx
	leaq	8(%rbx), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movl	%ecx, 12(%rbx)
	movl	48(%rbx), %edi
	xorl	%esi, %esi
	callq	_pci_resource_start
	movl	%eax, 40(%rbx)
	movl	48(%rbx), %edi
	xorl	%esi, %esi
	callq	_pci_resource_len
	movl	%eax, 32(%rbx)
	movq	(%rbx), %r12
	movq	(%r15), %r15
	movq	_CHIP_SUMO@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
	movq	(%r13), %r13
	movq	_CONFIG_MEMSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	cmpq	%r15, %r12
	je	LBB0_7
## %bb.5:
	cmpq	%r14, %r12
	je	LBB0_7
## %bb.6:
	cmpq	%r13, %r12
	je	LBB0_7
## %bb.8:
	shlq	$20, %rax
	movq	%rax, 16(%rbx)
	movq	_CONFIG_MEMSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	shlq	$20, %rax
	jmp	LBB0_9
LBB0_7:
	movq	%rax, 16(%rbx)
	movq	_CONFIG_MEMSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
LBB0_9:
	movq	%rax, 24(%rbx)
	movl	32(%rbx), %eax
	movl	%eax, 36(%rbx)
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	callq	_r700_vram_gtt_location
	movq	%rbx, %rdi
	callq	_radeon_update_bandwidth_info
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CHIP_PALM,8,3                  ## @CHIP_PALM
	.comm	_CHIP_SUMO,8,3                  ## @CHIP_SUMO
	.comm	_CHIP_SUMO2,8,3                 ## @CHIP_SUMO2
	.comm	_FUS_MC_ARB_RAMCFG,4,2          ## @FUS_MC_ARB_RAMCFG
	.comm	_MC_ARB_RAMCFG,4,2              ## @MC_ARB_RAMCFG
	.comm	_CHANSIZE_OVERRIDE,4,2          ## @CHANSIZE_OVERRIDE
	.comm	_CHANSIZE_MASK,4,2              ## @CHANSIZE_MASK
	.comm	_MC_SHARED_CHMAP,4,2            ## @MC_SHARED_CHMAP
	.comm	_NOOFCHAN_MASK,4,2              ## @NOOFCHAN_MASK
	.comm	_NOOFCHAN_SHIFT,4,2             ## @NOOFCHAN_SHIFT
	.comm	_CONFIG_MEMSIZE,4,2             ## @CONFIG_MEMSIZE
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.evergreen_mc_init
l_switch.table.evergreen_mc_init:
	.long	2                               ## 0x2
	.long	4                               ## 0x4
	.long	8                               ## 0x8

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_evergreen_mc_init              ; -- Begin function evergreen_mc_init
	.p2align	2
_evergreen_mc_init:                     ; @evergreen_mc_init
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	mov	w24, #1
	mov	x20, x0
	str	w24, [x20, #8]!
	ldr	x8, [x0]
Lloh0:
	adrp	x21, _CHIP_PALM@GOTPAGE
Lloh1:
	ldr	x21, [x21, _CHIP_PALM@GOTPAGEOFF]
	ldr	x9, [x21]
Lloh2:
	adrp	x22, _CHIP_SUMO@GOTPAGE
Lloh3:
	ldr	x22, [x22, _CHIP_SUMO@GOTPAGEOFF]
	ldr	x10, [x22]
Lloh4:
	adrp	x23, _CHIP_SUMO2@GOTPAGE
Lloh5:
	ldr	x23, [x23, _CHIP_SUMO2@GOTPAGEOFF]
	ldr	x11, [x23]
	cmp	x8, x11
	ccmp	x8, x10, #4, ne
	ccmp	x8, x9, #4, ne
Lloh6:
	adrp	x8, _FUS_MC_ARB_RAMCFG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FUS_MC_ARB_RAMCFG@GOTPAGEOFF]
Lloh8:
	adrp	x9, _MC_ARB_RAMCFG@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MC_ARB_RAMCFG@GOTPAGEOFF]
	csel	x8, x8, x9, eq
	ldr	w0, [x8]
	bl	_RREG32
Lloh10:
	adrp	x8, _CHANSIZE_OVERRIDE@GOTPAGE
Lloh11:
	ldr	x8, [x8, _CHANSIZE_OVERRIDE@GOTPAGEOFF]
Lloh12:
	adrp	x9, _CHANSIZE_MASK@GOTPAGE
Lloh13:
	ldr	x9, [x9, _CHANSIZE_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	ldr	w9, [x9]
	tst	w9, w0
	mov	w9, #64
	mov	w10, #32
	csel	w9, w10, w9, eq
	tst	w8, w0
	mov	w8, #16
	csel	w25, w9, w8, eq
Lloh16:
	adrp	x8, _MC_SHARED_CHMAP@GOTPAGE
Lloh17:
	ldr	x8, [x8, _MC_SHARED_CHMAP@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_RREG32
Lloh19:
	adrp	x8, _NOOFCHAN_MASK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _NOOFCHAN_MASK@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh22:
	adrp	x9, _NOOFCHAN_SHIFT@GOTPAGE
Lloh23:
	ldr	x9, [x9, _NOOFCHAN_SHIFT@GOTPAGEOFF]
Lloh24:
	ldr	w9, [x9]
	asr	w8, w8, w9
	sub	w8, w8, #1
	cmp	w8, #2
	b.hi	LBB0_2
; %bb.1:
Lloh25:
	adrp	x9, l_switch.table.evergreen_mc_init@PAGE
Lloh26:
	add	x9, x9, l_switch.table.evergreen_mc_init@PAGEOFF
	ldr	w24, [x9, w8, sxtw #2]
LBB0_2:
	mul	w8, w24, w25
	str	w8, [x19, #12]
	ldr	w0, [x19, #48]
	mov	w1, #0
	bl	_pci_resource_start
	str	w0, [x19, #40]
	ldr	w0, [x19, #48]
	mov	w1, #0
	bl	_pci_resource_len
	str	w0, [x19, #32]
	ldr	x24, [x19]
	ldr	x26, [x21]
	ldr	x25, [x22]
	ldr	x22, [x23]
Lloh27:
	adrp	x21, _CONFIG_MEMSIZE@GOTPAGE
Lloh28:
	ldr	x21, [x21, _CONFIG_MEMSIZE@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_RREG32
	cmp	x24, x26
	b.eq	LBB0_6
; %bb.3:
	cmp	x24, x25
	b.eq	LBB0_6
; %bb.4:
	cmp	x24, x22
	b.eq	LBB0_6
; %bb.5:
	lsl	x8, x0, #20
	str	x8, [x19, #16]
	ldr	w0, [x21]
	bl	_RREG32
	lsl	x0, x0, #20
	b	LBB0_7
LBB0_6:
	str	x0, [x19, #16]
	ldr	w0, [x21]
	bl	_RREG32
LBB0_7:
	str	x0, [x19, #24]
	ldr	w8, [x19, #32]
	str	w8, [x19, #36]
	mov	x0, x19
	mov	x1, x20
	bl	_r700_vram_gtt_location
	mov	x0, x19
	bl	_radeon_update_bandwidth_info
	mov	w0, #0
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh14
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_CHIP_PALM,8,3                  ; @CHIP_PALM
	.comm	_CHIP_SUMO,8,3                  ; @CHIP_SUMO
	.comm	_CHIP_SUMO2,8,3                 ; @CHIP_SUMO2
	.comm	_FUS_MC_ARB_RAMCFG,4,2          ; @FUS_MC_ARB_RAMCFG
	.comm	_MC_ARB_RAMCFG,4,2              ; @MC_ARB_RAMCFG
	.comm	_CHANSIZE_OVERRIDE,4,2          ; @CHANSIZE_OVERRIDE
	.comm	_CHANSIZE_MASK,4,2              ; @CHANSIZE_MASK
	.comm	_MC_SHARED_CHMAP,4,2            ; @MC_SHARED_CHMAP
	.comm	_NOOFCHAN_MASK,4,2              ; @NOOFCHAN_MASK
	.comm	_NOOFCHAN_SHIFT,4,2             ; @NOOFCHAN_SHIFT
	.comm	_CONFIG_MEMSIZE,4,2             ; @CONFIG_MEMSIZE
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.evergreen_mc_init
l_switch.table.evergreen_mc_init:
	.long	2                               ; 0x2
	.long	4                               ; 0x4
	.long	8                               ; 0x8

.subsections_via_symbols
