	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function si_mc_init
_si_mc_init:                            ## @si_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	$1, (%rdi)
	movq	_MC_ARB_RAMCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %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, %ebx
	cmovel	%esi, %ebx
	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	$7, %eax
	ja	LBB0_2
## %bb.1:
	cltq
	leaq	l_switch.table.si_mc_init(%rip), %rcx
	movl	(%rcx,%rax,4), %ecx
LBB0_2:
	imull	%ebx, %ecx
	movl	%ecx, 4(%r14)
	movl	28(%r14), %edi
	xorl	%esi, %esi
	callq	_pci_resource_start
	movl	%eax, 24(%r14)
	movl	28(%r14), %edi
	xorl	%esi, %esi
	callq	_pci_resource_len
	movl	%eax, 16(%r14)
	movq	_CONFIG_MEMSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_RREG32
	movl	%eax, %ebx
	cmpl	$65536, %eax                    ## imm = 0x10000
	jb	LBB0_4
## %bb.3:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_DRM_INFO
	movzwl	%bx, %eax
	testl	%eax, %eax
	cmovnel	%eax, %ebx
LBB0_4:
	shll	$20, %ebx
	movl	%ebx, 8(%r14)
	movl	%ebx, 12(%r14)
	movl	16(%r14), %eax
	movl	%eax, 20(%r14)
	movq	%r14, %rdi
	movq	%r14, %rsi
	callq	_si_vram_gtt_location
	movq	%r14, %rdi
	callq	_radeon_update_bandwidth_info
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.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,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Probable bad vram size: 0x%08x\n"

	.no_dead_strip	_si_mc_init
	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.si_mc_init
l_switch.table.si_mc_init:
	.long	2                               ## 0x2
	.long	4                               ## 0x4
	.long	8                               ## 0x8
	.long	3                               ## 0x3
	.long	6                               ## 0x6
	.long	10                              ## 0xa
	.long	12                              ## 0xc
	.long	16                              ## 0x10

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function si_mc_init
_si_mc_init:                            ; @si_mc_init
	.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, x0
	mov	w20, #1
	str	w20, [x0]
Lloh0:
	adrp	x8, _MC_ARB_RAMCFG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MC_ARB_RAMCFG@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_RREG32
Lloh3:
	adrp	x8, _CHANSIZE_OVERRIDE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CHANSIZE_OVERRIDE@GOTPAGEOFF]
Lloh5:
	adrp	x9, _CHANSIZE_MASK@GOTPAGE
Lloh6:
	ldr	x9, [x9, _CHANSIZE_MASK@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w0
	mov	w9, #64
	mov	w10, #32
	csel	w9, w10, w9, eq
	tst	w8, w0
	mov	w8, #16
	csel	w21, w9, w8, eq
Lloh9:
	adrp	x8, _MC_SHARED_CHMAP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MC_SHARED_CHMAP@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	bl	_RREG32
Lloh12:
	adrp	x8, _NOOFCHAN_MASK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NOOFCHAN_MASK@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh15:
	adrp	x9, _NOOFCHAN_SHIFT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _NOOFCHAN_SHIFT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	asr	w8, w8, w9
	sub	w8, w8, #1
	cmp	w8, #7
	b.hi	LBB0_2
; %bb.1:
Lloh18:
	adrp	x9, l_switch.table.si_mc_init@PAGE
Lloh19:
	add	x9, x9, l_switch.table.si_mc_init@PAGEOFF
	ldr	w20, [x9, w8, sxtw #2]
LBB0_2:
	mul	w8, w20, w21
	str	w8, [x19, #4]
	ldr	w0, [x19, #28]
	mov	w1, #0
	bl	_pci_resource_start
	str	w0, [x19, #24]
	ldr	w0, [x19, #28]
	mov	w1, #0
	bl	_pci_resource_len
	str	w0, [x19, #16]
Lloh20:
	adrp	x8, _CONFIG_MEMSIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _CONFIG_MEMSIZE@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_RREG32
	mov	x20, x0
	cmp	w0, #16, lsl #12                ; =65536
	b.lo	LBB0_4
; %bb.3:
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_DRM_INFO
	ands	w8, w20, #0xffff
	csel	w20, w20, w8, eq
LBB0_4:
	lsl	w8, w20, #20
	stp	w8, w8, [x19, #8]
	ldr	w8, [x19, #16]
	str	w8, [x19, #20]
	mov	x0, x19
	mov	x1, x19
	bl	_si_vram_gtt_location
	mov	x0, x19
	bl	_radeon_update_bandwidth_info
	mov	w0, #0
	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	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.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,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Probable bad vram size: 0x%08x\n"

	.no_dead_strip	_si_mc_init
	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.si_mc_init
l_switch.table.si_mc_init:
	.long	2                               ; 0x2
	.long	4                               ; 0x4
	.long	8                               ; 0x8
	.long	3                               ; 0x3
	.long	6                               ; 0x6
	.long	10                              ; 0xa
	.long	12                              ; 0xc
	.long	16                              ; 0x10

.subsections_via_symbols
