	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function restore_ecc_error_reporting
_restore_ecc_error_reporting:           ## @restore_ecc_error_reporting
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, 8(%rdi)
	je	LBB0_5
## %bb.1:
	movq	%rdx, %r15
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	_NBCTL@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	_amd64_read_pci_cfg
	movl	-36(%rbp), %edx
	andl	$-4, %edx
	orl	(%rbx), %edx
	movl	%edx, -36(%rbp)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_amd64_write_pci_cfg
	cmpl	$0, 4(%rbx)
	jne	LBB0_3
## %bb.2:
	movq	_NBCFG@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	leaq	-36(%rbp), %rdx
	movq	%r15, %rdi
	callq	_amd64_read_pci_cfg
	movq	_NBCFG_ECC_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	-36(%rbp), %edx
	movl	%edx, -36(%rbp)
	movl	(%r12), %esi
	movq	%r15, %rdi
	callq	_amd64_write_pci_cfg
LBB0_3:
	movq	_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_toggle_ecc_err_reporting
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_amd64_warn
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NBCTL,4,2                      ## @NBCTL
	.comm	_NBCFG,4,2                      ## @NBCFG
	.comm	_NBCFG_ECC_ENABLE,4,2           ## @NBCFG_ECC_ENABLE
	.comm	_OFF,4,2                        ## @OFF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error restoring NB MCGCTL settings!\n"

	.no_dead_strip	_restore_ecc_error_reporting
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function restore_ecc_error_reporting
_restore_ecc_error_reporting:           ; @restore_ecc_error_reporting
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x0, #8]
	cbz	w8, LBB0_5
; %bb.1:
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _NBCTL@GOTPAGE
Lloh1:
	ldr	x22, [x22, _NBCTL@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x21
	bl	_amd64_read_pci_cfg
	ldr	w8, [sp, #12]
	and	w8, w8, #0xfffffffc
	ldr	w9, [x20]
	orr	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_amd64_write_pci_cfg
	ldr	w8, [x20, #4]
	cbnz	w8, LBB0_3
; %bb.2:
Lloh2:
	adrp	x22, _NBCFG@GOTPAGE
Lloh3:
	ldr	x22, [x22, _NBCFG@GOTPAGEOFF]
	ldr	w1, [x22]
	add	x2, sp, #12
	mov	x0, x21
	bl	_amd64_read_pci_cfg
Lloh4:
	adrp	x8, _NBCFG_ECC_ENABLE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _NBCFG_ECC_ENABLE@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w9, [sp, #12]
	bic	w2, w9, w8
	str	w2, [sp, #12]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_amd64_write_pci_cfg
LBB0_3:
Lloh7:
	adrp	x8, _OFF@GOTPAGE
Lloh8:
	ldr	x8, [x8, _OFF@GOTPAGEOFF]
Lloh9:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x19
	bl	_toggle_ecc_err_reporting
	cbz	x0, LBB0_5
; %bb.4:
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	bl	_amd64_warn
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_NBCTL,4,2                      ; @NBCTL
	.comm	_NBCFG,4,2                      ; @NBCFG
	.comm	_NBCFG_ECC_ENABLE,4,2           ; @NBCFG_ECC_ENABLE
	.comm	_OFF,4,2                        ; @OFF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error restoring NB MCGCTL settings!\n"

	.no_dead_strip	_restore_ecc_error_reporting
.subsections_via_symbols
