	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function k8_map_sysaddr_to_csrow
_k8_map_sysaddr_to_csrow:               ## @k8_map_sysaddr_to_csrow
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	(%rdi), %r12
	movl	%esi, %edi
	movq	%rdx, %rsi
	callq	_error_address_to_page_and_offset
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_find_mc_by_sys_addr
	movl	%eax, 20(%r14)
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	%eax, %edi
	movl	%ebx, %esi
	callq	_sys_addr_to_csrow
	movq	%rax, (%r14)
	testq	%rax, %rax
	js	LBB0_3
## %bb.5:
	movq	_NBCFG_CHIPKILL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_8
## %bb.6:
	movl	16(%r14), %esi
	movq	%r15, %rdi
	callq	_get_channel_from_ecc_syndrome
	movl	%eax, 8(%r14)
	testl	%eax, %eax
	jns	LBB0_9
## %bb.7:
	movl	16(%r14), %edx
	movl	20(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_amd64_mc_warn
	movq	_ERR_CHANNEL@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_1:
	movslq	%ebx, %rdx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	callq	_amd64_mc_err
	movq	_ERR_NODE@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_ERR_CSROW@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movl	%eax, 12(%r14)
LBB0_9:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	$3, %edi
	callq	_BIT
	xorl	%ecx, %ecx
	testl	%ebx, %eax
	setne	%cl
	movl	%ecx, 8(%r14)
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to map error addr 0x%lx to a node\n"

	.comm	_ERR_NODE,4,2                   ## @ERR_NODE
	.comm	_ERR_CSROW,4,2                  ## @ERR_CSROW
	.comm	_NBCFG_CHIPKILL,4,2             ## @NBCFG_CHIPKILL
L_.str.1:                               ## @.str.1
	.asciz	"unknown syndrome 0x%04x - possible error reporting race\n"

	.comm	_ERR_CHANNEL,4,2                ## @ERR_CHANNEL
	.no_dead_strip	_k8_map_sysaddr_to_csrow
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function k8_map_sysaddr_to_csrow
_k8_map_sysaddr_to_csrow:               ; @k8_map_sysaddr_to_csrow
	.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, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x22, [x0]
	mov	x0, x1
	mov	x1, x2
	bl	_error_address_to_page_and_offset
	mov	x0, x21
	mov	x1, x20
	bl	_find_mc_by_sys_addr
	str	w0, [x19, #20]
	cbz	w0, LBB0_5
; %bb.1:
	mov	x1, x20
	bl	_sys_addr_to_csrow
	str	x0, [x19]
	tbnz	x0, #63, LBB0_6
; %bb.2:
	ldr	w8, [x22]
Lloh0:
	adrp	x9, _NBCFG_CHIPKILL@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NBCFG_CHIPKILL@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.3:
	ldr	w1, [x19, #16]
	mov	x0, x21
	bl	_get_channel_from_ecc_syndrome
	str	w0, [x19, #8]
	tbz	w0, #31, LBB0_8
; %bb.4:
	ldp	w2, w0, [x19, #16]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_amd64_mc_warn
Lloh5:
	adrp	x8, _ERR_CHANNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ERR_CHANNEL@GOTPAGEOFF]
	b	LBB0_7
LBB0_5:
	sxtw	x2, w20
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_amd64_mc_err
Lloh9:
	adrp	x8, _ERR_NODE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ERR_NODE@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh11:
	adrp	x8, _ERR_CSROW@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ERR_CSROW@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	str	w8, [x19, #12]
LBB0_8:
	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
LBB0_9:
	mov	w0, #3
	bl	_BIT
	tst	w0, w20
	cset	w8, ne
	str	w8, [x19, #8]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to map error addr 0x%lx to a node\n"

	.comm	_ERR_NODE,4,2                   ; @ERR_NODE
	.comm	_ERR_CSROW,4,2                  ; @ERR_CSROW
	.comm	_NBCFG_CHIPKILL,4,2             ; @NBCFG_CHIPKILL
l_.str.1:                               ; @.str.1
	.asciz	"unknown syndrome 0x%04x - possible error reporting race\n"

	.comm	_ERR_CHANNEL,4,2                ; @ERR_CHANNEL
	.no_dead_strip	_k8_map_sysaddr_to_csrow
.subsections_via_symbols
