	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function read_mc_regs
_read_mc_regs:                          ## @read_mc_regs
	.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, %r12
	movq	_MSR_K8_TOP_MEM1@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r12), %esi
	callq	_rdmsrl
	movl	(%r12), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_debugf0
	movq	_MSR_K8_SYSCFG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rdmsrl
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_debugf0
	movl	28(%r12), %edi
	movq	_NBCAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	8(%r12), %rdx
	callq	_amd64_read_pci_cfg
	movq	%r12, %rdi
	callq	_read_dram_ctl_register
	movq	_DRAM_RANGES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_5
## %bb.1:
	xorl	%ebx, %ebx
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	incl	%ebx
	movq	_DRAM_RANGES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jae	LBB0_5
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_read_dram_base_limit_regs
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_dram_rw
	testl	%eax, %eax
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%eax, %r13d
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_get_dram_base
	movl	%eax, %r14d
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_get_dram_limit
	leaq	L_.str.3(%rip), %rdi
	movl	%ebx, %esi
	movl	%r14d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_debugf1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_dram_intlv_en
	testq	%rax, %rax
	leaq	L_.str.5(%rip), %r14
	leaq	L_.str.6(%rip), %rax
	cmoveq	%rax, %r14
	testb	$1, %r13b
	leaq	L_.str.7(%rip), %r15
	leaq	L_.str.8(%rip), %rax
	cmoveq	%rax, %r15
	testb	$2, %r13b
	leaq	L_.str.9(%rip), %r13
	cmoveq	%rax, %r13
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_dram_intlv_sel
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_dram_dst_node
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	movq	%r13, %rcx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	movl	%eax, %r9d
	xorl	%eax, %eax
	callq	_debugf1
	jmp	LBB0_4
LBB0_5:
	movq	%r12, %rdi
	callq	_read_dct_base_mask
	movl	52(%r12), %edi
	movq	_DHAR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	12(%r12), %rdx
	callq	_amd64_read_pci_cfg
	movq	_DBAM0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	48(%r12), %rdx
	movq	%r12, %rdi
	callq	_amd64_read_dct_pci_cfg
	movl	28(%r12), %edi
	movq	_F10_ONLINE_SPARE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	16(%r12), %rdx
	callq	_amd64_read_pci_cfg
	movq	_DCLR0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	44(%r12), %rdx
	movq	%r12, %rdi
	callq	_amd64_read_dct_pci_cfg
	movq	_DCHR0@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	40(%r12), %rdx
	movq	%r12, %rdi
	callq	_amd64_read_dct_pci_cfg
	movq	%r12, %rdi
	callq	_dct_ganging_enabled
	testl	%eax, %eax
	jne	LBB0_7
## %bb.6:
	movq	_DCLR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	36(%r12), %rdx
	movq	%r12, %rdi
	callq	_amd64_read_dct_pci_cfg
	movq	_DCHR1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	32(%r12), %rdx
	movq	%r12, %rdi
	callq	_amd64_read_dct_pci_cfg
LBB0_7:
	movl	$4, 20(%r12)
	movq	_boot_cpu_data@GOTPCREL(%rip), %rbx
	cmpl	$16, (%rbx)
	jl	LBB0_13
## %bb.8:
	movl	28(%r12), %edi
	movq	_EXT_NB_MCA_CFG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	callq	_amd64_read_pci_cfg
	cmpl	$22, (%rbx)
	jne	LBB0_9
LBB0_11:
	movl	-48(%rbp), %ebx
	movl	$25, %edi
	callq	_BIT
	testl	%ebx, %eax
	je	LBB0_13
## %bb.12:
	movl	$8, 20(%r12)
	jmp	LBB0_13
LBB0_9:
	movq	_DBAM1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	24(%r12), %rdx
	movq	%r12, %rdi
	callq	_amd64_read_dct_pci_cfg
	cmpl	$16, (%rbx)
	jg	LBB0_11
## %bb.10:
	cmpl	$8, 4(%rbx)
	jge	LBB0_11
LBB0_13:
	movq	%r12, %rdi
	callq	_dump_misc_regs
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_boot_cpu_data,8,2              ## @boot_cpu_data
	.comm	_MSR_K8_TOP_MEM1,4,2            ## @MSR_K8_TOP_MEM1
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"  TOP_MEM:  0x%016llx\n"

	.comm	_MSR_K8_SYSCFG,4,2              ## @MSR_K8_SYSCFG
	.comm	_MSR_K8_TOP_MEM2,4,2            ## @MSR_K8_TOP_MEM2
L_.str.2:                               ## @.str.2
	.asciz	"  TOP_MEM2 disabled.\n"

	.comm	_NBCAP,4,2                      ## @NBCAP
	.comm	_DRAM_RANGES,4,2                ## @DRAM_RANGES
L_.str.3:                               ## @.str.3
	.asciz	"  DRAM range[%d], base: 0x%016llx; limit: 0x%016llx\n"

L_.str.4:                               ## @.str.4
	.asciz	"   IntlvEn=%s; Range access: %s%s IntlvSel=%d DstNode=%d\n"

L_.str.5:                               ## @.str.5
	.asciz	"Enabled"

L_.str.6:                               ## @.str.6
	.asciz	"Disabled"

L_.str.7:                               ## @.str.7
	.asciz	"R"

L_.str.8:                               ## @.str.8
	.asciz	"-"

L_.str.9:                               ## @.str.9
	.asciz	"W"

	.comm	_DHAR,4,2                       ## @DHAR
	.comm	_DBAM0,4,2                      ## @DBAM0
	.comm	_F10_ONLINE_SPARE,4,2           ## @F10_ONLINE_SPARE
	.comm	_DCLR0,4,2                      ## @DCLR0
	.comm	_DCHR0,4,2                      ## @DCHR0
	.comm	_DCLR1,4,2                      ## @DCLR1
	.comm	_DCHR1,4,2                      ## @DCHR1
	.comm	_EXT_NB_MCA_CFG,4,2             ## @EXT_NB_MCA_CFG
	.comm	_DBAM1,4,2                      ## @DBAM1
	.no_dead_strip	_read_mc_regs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function read_mc_regs
_read_mc_regs:                          ; @read_mc_regs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x8, _MSR_K8_TOP_MEM1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MSR_K8_TOP_MEM1@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	ldr	w1, [x19]
	bl	_rdmsrl
	ldr	w8, [x19]
	str	x8, [sp]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debugf0
Lloh5:
	adrp	x8, _MSR_K8_SYSCFG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _MSR_K8_SYSCFG@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_rdmsrl
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_debugf0
	ldr	w0, [x19, #28]
Lloh10:
	adrp	x8, _NBCAP@GOTPAGE
Lloh11:
	ldr	x8, [x8, _NBCAP@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	add	x2, x19, #8
	bl	_amd64_read_pci_cfg
	mov	x0, x19
	bl	_read_dram_ctl_register
Lloh13:
	adrp	x25, _DRAM_RANGES@GOTPAGE
Lloh14:
	ldr	x25, [x25, _DRAM_RANGES@GOTPAGEOFF]
	ldr	w8, [x25]
	cbz	w8, LBB0_5
; %bb.1:
	mov	w20, #0
Lloh15:
	adrp	x26, l_.str.8@PAGE
Lloh16:
	add	x26, x26, l_.str.8@PAGEOFF
Lloh17:
	adrp	x21, l_.str.9@PAGE
Lloh18:
	add	x21, x21, l_.str.9@PAGEOFF
Lloh19:
	adrp	x22, l_.str.4@PAGE
Lloh20:
	add	x22, x22, l_.str.4@PAGEOFF
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w20, w20, #1
	ldr	w8, [x25]
	cmp	w20, w8
	b.hs	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_read_dram_base_limit_regs
	mov	x0, x19
	mov	x1, x20
	bl	_dram_rw
	cbz	w0, LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x23, x0
	mov	x0, x19
	mov	x1, x20
	bl	_get_dram_base
	mov	x24, x0
	mov	x0, x19
	mov	x1, x20
	bl	_get_dram_limit
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x24, x0, [sp, #8]
	str	x20, [sp]
Lloh21:
	adrp	x0, l_.str.3@PAGE
Lloh22:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_debugf1
	mov	x0, x19
	mov	x1, x20
	bl	_dram_intlv_en
	cmp	x0, #0
Lloh23:
	adrp	x8, l_.str.5@PAGE
Lloh24:
	add	x8, x8, l_.str.5@PAGEOFF
Lloh25:
	adrp	x9, l_.str.6@PAGE
Lloh26:
	add	x9, x9, l_.str.6@PAGEOFF
	csel	x24, x9, x8, eq
	tst	w23, #0x1
Lloh27:
	adrp	x8, l_.str.7@PAGE
Lloh28:
	add	x8, x8, l_.str.7@PAGEOFF
	csel	x27, x26, x8, eq
	tst	w23, #0x2
	csel	x28, x26, x21, eq
	mov	x0, x19
	mov	x1, x20
	bl	_dram_intlv_sel
	mov	x23, x0
	mov	x0, x19
	mov	x1, x20
	bl	_dram_dst_node
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x23, x0, [sp, #24]
	stp	x27, x28, [sp, #8]
	str	x24, [sp]
	mov	x0, x22
	bl	_debugf1
	b	LBB0_2
LBB0_5:
	mov	x0, x19
	bl	_read_dct_base_mask
	ldr	w0, [x19, #52]
Lloh29:
	adrp	x8, _DHAR@GOTPAGE
Lloh30:
	ldr	x8, [x8, _DHAR@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	add	x2, x19, #12
	bl	_amd64_read_pci_cfg
Lloh32:
	adrp	x8, _DBAM0@GOTPAGE
Lloh33:
	ldr	x8, [x8, _DBAM0@GOTPAGEOFF]
Lloh34:
	ldr	w1, [x8]
	add	x2, x19, #48
	mov	x0, x19
	bl	_amd64_read_dct_pci_cfg
	ldr	w0, [x19, #28]
Lloh35:
	adrp	x8, _F10_ONLINE_SPARE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _F10_ONLINE_SPARE@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
	add	x2, x19, #16
	bl	_amd64_read_pci_cfg
Lloh38:
	adrp	x8, _DCLR0@GOTPAGE
Lloh39:
	ldr	x8, [x8, _DCLR0@GOTPAGEOFF]
Lloh40:
	ldr	w1, [x8]
	add	x2, x19, #44
	mov	x0, x19
	bl	_amd64_read_dct_pci_cfg
Lloh41:
	adrp	x8, _DCHR0@GOTPAGE
Lloh42:
	ldr	x8, [x8, _DCHR0@GOTPAGEOFF]
Lloh43:
	ldr	w1, [x8]
	add	x2, x19, #40
	mov	x0, x19
	bl	_amd64_read_dct_pci_cfg
	mov	x0, x19
	bl	_dct_ganging_enabled
	cbnz	w0, LBB0_7
; %bb.6:
Lloh44:
	adrp	x8, _DCLR1@GOTPAGE
Lloh45:
	ldr	x8, [x8, _DCLR1@GOTPAGEOFF]
Lloh46:
	ldr	w1, [x8]
	add	x2, x19, #36
	mov	x0, x19
	bl	_amd64_read_dct_pci_cfg
Lloh47:
	adrp	x8, _DCHR1@GOTPAGE
Lloh48:
	ldr	x8, [x8, _DCHR1@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
	add	x2, x19, #32
	mov	x0, x19
	bl	_amd64_read_dct_pci_cfg
LBB0_7:
	mov	w8, #4
	str	w8, [x19, #20]
Lloh50:
	adrp	x20, _boot_cpu_data@GOTPAGE
Lloh51:
	ldr	x20, [x20, _boot_cpu_data@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #16
	b.lt	LBB0_13
; %bb.8:
	ldr	w0, [x19, #28]
Lloh52:
	adrp	x8, _EXT_NB_MCA_CFG@GOTPAGE
Lloh53:
	ldr	x8, [x8, _EXT_NB_MCA_CFG@GOTPAGEOFF]
Lloh54:
	ldr	w1, [x8]
	add	x2, sp, #44
	bl	_amd64_read_pci_cfg
	ldr	w8, [x20]
	cmp	w8, #22
	b.ne	LBB0_11
LBB0_9:
	ldr	w20, [sp, #44]
	mov	w0, #25
	bl	_BIT
	tst	w0, w20
	b.eq	LBB0_13
; %bb.10:
	mov	w8, #8
	str	w8, [x19, #20]
	b	LBB0_13
LBB0_11:
Lloh55:
	adrp	x8, _DBAM1@GOTPAGE
Lloh56:
	ldr	x8, [x8, _DBAM1@GOTPAGEOFF]
Lloh57:
	ldr	w1, [x8]
	add	x2, x19, #24
	mov	x0, x19
	bl	_amd64_read_dct_pci_cfg
	ldr	w8, [x20]
	cmp	w8, #16
	b.gt	LBB0_9
; %bb.12:
	ldr	w8, [x20, #4]
	cmp	w8, #8
	b.ge	LBB0_9
LBB0_13:
	mov	x0, x19
	bl	_dump_misc_regs
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_boot_cpu_data,8,2              ; @boot_cpu_data
	.comm	_MSR_K8_TOP_MEM1,4,2            ; @MSR_K8_TOP_MEM1
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"  TOP_MEM:  0x%016llx\n"

	.comm	_MSR_K8_SYSCFG,4,2              ; @MSR_K8_SYSCFG
	.comm	_MSR_K8_TOP_MEM2,4,2            ; @MSR_K8_TOP_MEM2
l_.str.2:                               ; @.str.2
	.asciz	"  TOP_MEM2 disabled.\n"

	.comm	_NBCAP,4,2                      ; @NBCAP
	.comm	_DRAM_RANGES,4,2                ; @DRAM_RANGES
l_.str.3:                               ; @.str.3
	.asciz	"  DRAM range[%d], base: 0x%016llx; limit: 0x%016llx\n"

l_.str.4:                               ; @.str.4
	.asciz	"   IntlvEn=%s; Range access: %s%s IntlvSel=%d DstNode=%d\n"

l_.str.5:                               ; @.str.5
	.asciz	"Enabled"

l_.str.6:                               ; @.str.6
	.asciz	"Disabled"

l_.str.7:                               ; @.str.7
	.asciz	"R"

l_.str.8:                               ; @.str.8
	.asciz	"-"

l_.str.9:                               ; @.str.9
	.asciz	"W"

	.comm	_DHAR,4,2                       ; @DHAR
	.comm	_DBAM0,4,2                      ; @DBAM0
	.comm	_F10_ONLINE_SPARE,4,2           ; @F10_ONLINE_SPARE
	.comm	_DCLR0,4,2                      ; @DCLR0
	.comm	_DCHR0,4,2                      ; @DCHR0
	.comm	_DCLR1,4,2                      ; @DCLR1
	.comm	_DCHR1,4,2                      ; @DCHR1
	.comm	_EXT_NB_MCA_CFG,4,2             ; @EXT_NB_MCA_CFG
	.comm	_DBAM1,4,2                      ; @DBAM1
	.no_dead_strip	_read_mc_regs
.subsections_via_symbols
