	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ast_get_dram_info
_ast_get_dram_info:                     ## @ast_get_dram_info
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	(%rdi), %rbx
	movl	(%rbx), %eax
	cmpl	$128, %eax
	je	LBB0_8
## %bb.1:
	cmpl	$129, %eax
	jne	LBB0_15
## %bb.2:
	movq	8(%rdi), %rax
	movq	(%rax), %r14
	leaq	L_.str(%rip), %rsi
	leaq	-28(%rbp), %rdx
	movq	%r14, %rdi
	callq	_of_property_read_u32
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:
	movl	$1399, -28(%rbp)                ## imm = 0x577
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
	leaq	-24(%rbp), %rdx
	movq	%r14, %rdi
	callq	_of_property_read_u32
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	$20672, -24(%rbp)               ## imm = 0x50C0
LBB0_6:
	leaq	L_.str.2(%rip), %rsi
	leaq	-20(%rbp), %rdx
	movq	%r14, %rdi
	callq	_of_property_read_u32
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movl	$0, -20(%rbp)
	jmp	LBB0_9
LBB0_8:
	movq	%rbx, %rdi
	movl	$61444, %esi                    ## imm = 0xF004
	movl	$510525440, %edx                ## imm = 0x1E6E0000
	callq	_ast_write32
	movq	%rbx, %rdi
	movl	$61440, %esi                    ## imm = 0xF000
	movl	$1, %edx
	callq	_ast_write32
	movq	%rbx, %rdi
	movl	$65540, %esi                    ## imm = 0x10004
	callq	_ast_read32
	movl	%eax, -28(%rbp)
	movq	%rbx, %rdi
	movl	$65824, %esi                    ## imm = 0x10120
	callq	_ast_read32
	movl	%eax, -24(%rbp)
	movq	%rbx, %rdi
	movl	$65904, %esi                    ## imm = 0x10170
	callq	_ast_read32
	movl	%eax, -20(%rbp)
LBB0_9:
	movl	-28(%rbp), %eax
	xorl	%ecx, %ecx
	testb	$64, %al
	sete	%cl
	shll	$4, %ecx
	addl	$16, %ecx
	movl	%ecx, 4(%rbx)
	movq	8(%rbx), %rcx
	movq	_AST2500@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_11
## %bb.10:
	andl	$3, %eax
	leaq	l_switch.table.ast_get_dram_info(%rip), %rcx
	jmp	LBB0_18
LBB0_11:
	movq	_AST2300@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_17
## %bb.12:
	movq	_AST2400@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	je	LBB0_17
## %bb.13:
	movl	%eax, %ecx
	shrl	$2, %ecx
	andl	$3, %ecx
	cmpl	$2, %ecx
	jae	LBB0_24
## %bb.14:
	movq	_AST_DRAM_512Mx16@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_15:
	movl	$16, 4(%rbx)
	movq	_AST_DRAM_1Gx16@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 24(%rbx)
	movq	8(%rbx), %rax
	movq	_AST2500@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_23
## %bb.16:
	movl	$800, 16(%rbx)                  ## imm = 0x320
	jmp	LBB0_22
LBB0_17:
	andl	$3, %eax
	leaq	l_switch.table.ast_get_dram_info.3(%rip), %rcx
LBB0_18:
	movq	(%rcx,%rax,8), %rax
LBB0_19:
	movq	(%rax), %rax
	movq	%rax, 24(%rbx)
	testb	$32, -19(%rbp)
	movl	$12000, %eax                    ## imm = 0x2EE0
	movl	$14318, %edx                    ## imm = 0x37EE
	cmovel	%eax, %edx
	movl	-24(%rbp), %esi
	movl	%esi, %ecx
	andl	$31, %ecx
	movl	%esi, %eax
	shrl	$5, %eax
	andl	$511, %eax                      ## imm = 0x1FF
	shrl	$14, %esi
	andl	$3, %esi
	decl	%esi
	movl	$1000, %edi                     ## imm = 0x3E8
	cmpl	$2, %esi
	ja	LBB0_21
## %bb.20:
	movslq	%esi, %rsi
	leaq	l_switch.table.ast_get_dram_info.4(%rip), %rdi
	movl	(%rdi,%rsi,4), %edi
LBB0_21:
	addl	$2, %eax
	imull	%edx, %eax
	addl	$2, %ecx
	imull	%edi, %ecx
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, 16(%rbx)
LBB0_22:
	xorl	%eax, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_23:
	movl	$396, 16(%rbx)                  ## imm = 0x18C
	jmp	LBB0_22
LBB0_24:
	cmpl	$3, %ecx
	jne	LBB0_26
## %bb.25:
	movq	_AST_DRAM_1Gx32@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_26:
	testb	$64, %al
	jne	LBB0_28
## %bb.27:
	movq	_AST_DRAM_512Mx32@GOTPCREL(%rip), %rax
	jmp	LBB0_19
LBB0_28:
	movq	_AST_DRAM_1Gx16@GOTPCREL(%rip), %rax
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"aspeed,mcr-configuration"

L_.str.1:                               ## @.str.1
	.asciz	"aspeed,mcr-scu-mpll"

L_.str.2:                               ## @.str.2
	.asciz	"aspeed,mcr-scu-strap"

	.comm	_AST_DRAM_1Gx16,8,3             ## @AST_DRAM_1Gx16
	.comm	_AST2500,8,3                    ## @AST2500
	.comm	_AST_DRAM_2Gx16,8,3             ## @AST_DRAM_2Gx16
	.comm	_AST_DRAM_4Gx16,8,3             ## @AST_DRAM_4Gx16
	.comm	_AST_DRAM_8Gx16,8,3             ## @AST_DRAM_8Gx16
	.comm	_AST2300,8,3                    ## @AST2300
	.comm	_AST2400,8,3                    ## @AST2400
	.comm	_AST_DRAM_512Mx16,8,3           ## @AST_DRAM_512Mx16
	.comm	_AST_DRAM_512Mx32,8,3           ## @AST_DRAM_512Mx32
	.comm	_AST_DRAM_1Gx32,8,3             ## @AST_DRAM_1Gx32
	.no_dead_strip	_ast_get_dram_info
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.ast_get_dram_info
l_switch.table.ast_get_dram_info:
	.quad	_AST_DRAM_1Gx16
	.quad	_AST_DRAM_2Gx16
	.quad	_AST_DRAM_4Gx16
	.quad	_AST_DRAM_8Gx16

	.p2align	3                               ## @switch.table.ast_get_dram_info.3
l_switch.table.ast_get_dram_info.3:
	.quad	_AST_DRAM_512Mx16
	.quad	_AST_DRAM_1Gx16
	.quad	_AST_DRAM_2Gx16
	.quad	_AST_DRAM_4Gx16

	.section	__TEXT,__const
	.p2align	2                               ## @switch.table.ast_get_dram_info.4
l_switch.table.ast_get_dram_info.4:
	.long	2000                            ## 0x7d0
	.long	2000                            ## 0x7d0
	.long	4000                            ## 0xfa0

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ast_get_dram_info
_ast_get_dram_info:                     ; @ast_get_dram_info
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	ldr	x19, [x0]
	ldr	w8, [x19]
	cmp	w8, #128
	b.eq	LBB0_8
; %bb.1:
	cmp	w8, #129
	b.ne	LBB0_11
; %bb.2:
	ldr	x8, [x0, #8]
	ldr	x20, [x8]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #12
	mov	x0, x20
	bl	_of_property_read_u32
	cbz	w0, LBB0_4
; %bb.3:
	mov	w8, #1399
	str	w8, [sp, #12]
LBB0_4:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #8
	mov	x0, x20
	bl	_of_property_read_u32
	cbz	w0, LBB0_6
; %bb.5:
	mov	w8, #20672
	str	w8, [sp, #8]
LBB0_6:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #4
	mov	x0, x20
	bl	_of_property_read_u32
	cbz	w0, LBB0_9
; %bb.7:
	str	wzr, [sp, #4]
	b	LBB0_9
LBB0_8:
	mov	x0, x19
	mov	w1, #61444
	mov	w2, #510525440
	bl	_ast_write32
	mov	x0, x19
	mov	w1, #61440
	mov	w2, #1
	bl	_ast_write32
	mov	w20, #4
	movk	w20, #1, lsl #16
	mov	x0, x19
	mov	w1, #4
	movk	w1, #1, lsl #16
	bl	_ast_read32
	str	w0, [sp, #12]
	add	w1, w20, #284
	mov	x0, x19
	bl	_ast_read32
	str	w0, [sp, #8]
	add	w1, w20, #364
	mov	x0, x19
	bl	_ast_read32
	str	w0, [sp, #4]
LBB0_9:
	ldr	w8, [sp, #12]
	tst	w8, #0x40
	mov	w9, #16
	mov	w10, #32
	csel	w9, w10, w9, eq
	str	w9, [x19, #4]
	ldr	x9, [x19, #8]
Lloh6:
	adrp	x10, _AST2500@GOTPAGE
Lloh7:
	ldr	x10, [x10, _AST2500@GOTPAGEOFF]
Lloh8:
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_13
; %bb.10:
	and	x8, x8, #0x3
Lloh9:
	adrp	x9, l_switch.table.ast_get_dram_info@PAGE
Lloh10:
	add	x9, x9, l_switch.table.ast_get_dram_info@PAGEOFF
	ldr	x8, [x9, x8, lsl #3]
	b	LBB0_21
LBB0_11:
	mov	w8, #16
	str	w8, [x19, #4]
Lloh11:
	adrp	x8, _AST_DRAM_1Gx16@GOTPAGE
Lloh12:
	ldr	x8, [x8, _AST_DRAM_1Gx16@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	str	x8, [x19, #24]
	ldr	x8, [x19, #8]
Lloh14:
	adrp	x9, _AST2500@GOTPAGE
Lloh15:
	ldr	x9, [x9, _AST2500@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_15
; %bb.12:
	mov	w8, #800
	b	LBB0_25
LBB0_13:
Lloh17:
	adrp	x10, _AST2300@GOTPAGE
Lloh18:
	ldr	x10, [x10, _AST2300@GOTPAGEOFF]
Lloh19:
	ldr	x10, [x10]
Lloh20:
	adrp	x11, _AST2400@GOTPAGE
Lloh21:
	ldr	x11, [x11, _AST2400@GOTPAGEOFF]
Lloh22:
	ldr	x11, [x11]
	cmp	x9, x10
	ccmp	x9, x11, #4, ne
	b.ne	LBB0_16
; %bb.14:
	and	x8, x8, #0x3
Lloh23:
	adrp	x9, l_switch.table.ast_get_dram_info.3@PAGE
Lloh24:
	add	x9, x9, l_switch.table.ast_get_dram_info.3@PAGEOFF
	ldr	x8, [x9, x8, lsl #3]
	b	LBB0_21
LBB0_15:
	mov	w8, #396
	b	LBB0_25
LBB0_16:
	ubfx	w9, w8, #2, #2
	cmp	w9, #2
	b.hs	LBB0_18
; %bb.17:
Lloh25:
	adrp	x8, _AST_DRAM_512Mx16@GOTPAGE
Lloh26:
	ldr	x8, [x8, _AST_DRAM_512Mx16@GOTPAGEOFF]
	b	LBB0_21
LBB0_18:
	cmp	w9, #3
	b.ne	LBB0_20
; %bb.19:
Lloh27:
	adrp	x8, _AST_DRAM_1Gx32@GOTPAGE
Lloh28:
	ldr	x8, [x8, _AST_DRAM_1Gx32@GOTPAGEOFF]
	b	LBB0_21
LBB0_20:
Lloh29:
	adrp	x9, _AST_DRAM_1Gx16@GOTPAGE
Lloh30:
	ldr	x9, [x9, _AST_DRAM_1Gx16@GOTPAGEOFF]
Lloh31:
	adrp	x10, _AST_DRAM_512Mx32@GOTPAGE
Lloh32:
	ldr	x10, [x10, _AST_DRAM_512Mx32@GOTPAGEOFF]
	tst	w8, #0x40
	csel	x8, x10, x9, eq
LBB0_21:
	ldr	x8, [x8]
	str	x8, [x19, #24]
	ldrb	w8, [sp, #5]
	tst	w8, #0x20
	mov	w8, #14318
	mov	w9, #12000
	csel	w8, w9, w8, eq
	ldr	w11, [sp, #8]
	and	w9, w11, #0x1f
	ubfx	w10, w11, #5, #9
	ubfx	x11, x11, #14, #2
	sub	x11, x11, #1
	cmp	w11, #2
	b.hi	LBB0_23
; %bb.22:
Lloh33:
	adrp	x12, l_switch.table.ast_get_dram_info.4@PAGE
Lloh34:
	add	x12, x12, l_switch.table.ast_get_dram_info.4@PAGEOFF
	ldr	w11, [x12, x11, lsl #2]
	b	LBB0_24
LBB0_23:
	mov	w11, #1000
LBB0_24:
	add	w10, w10, #2
	mul	w8, w10, w8
	add	w9, w9, #2
	mul	w9, w11, w9
	udiv	w8, w8, w9
LBB0_25:
	str	w8, [x19, #16]
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"aspeed,mcr-configuration"

l_.str.1:                               ; @.str.1
	.asciz	"aspeed,mcr-scu-mpll"

l_.str.2:                               ; @.str.2
	.asciz	"aspeed,mcr-scu-strap"

	.comm	_AST_DRAM_1Gx16,8,3             ; @AST_DRAM_1Gx16
	.comm	_AST2500,8,3                    ; @AST2500
	.comm	_AST_DRAM_2Gx16,8,3             ; @AST_DRAM_2Gx16
	.comm	_AST_DRAM_4Gx16,8,3             ; @AST_DRAM_4Gx16
	.comm	_AST_DRAM_8Gx16,8,3             ; @AST_DRAM_8Gx16
	.comm	_AST2300,8,3                    ; @AST2300
	.comm	_AST2400,8,3                    ; @AST2400
	.comm	_AST_DRAM_512Mx16,8,3           ; @AST_DRAM_512Mx16
	.comm	_AST_DRAM_512Mx32,8,3           ; @AST_DRAM_512Mx32
	.comm	_AST_DRAM_1Gx32,8,3             ; @AST_DRAM_1Gx32
	.no_dead_strip	_ast_get_dram_info
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.ast_get_dram_info
l_switch.table.ast_get_dram_info:
	.quad	_AST_DRAM_1Gx16
	.quad	_AST_DRAM_2Gx16
	.quad	_AST_DRAM_4Gx16
	.quad	_AST_DRAM_8Gx16

	.p2align	3                               ; @switch.table.ast_get_dram_info.3
l_switch.table.ast_get_dram_info.3:
	.quad	_AST_DRAM_512Mx16
	.quad	_AST_DRAM_1Gx16
	.quad	_AST_DRAM_2Gx16
	.quad	_AST_DRAM_4Gx16

	.section	__TEXT,__const
	.p2align	2                               ; @switch.table.ast_get_dram_info.4
l_switch.table.ast_get_dram_info.4:
	.long	2000                            ; 0x7d0
	.long	2000                            ; 0x7d0
	.long	4000                            ; 0xfa0

.subsections_via_symbols
