	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nd_pfn_clear_memmap_errors
_nd_pfn_clear_memmap_errors:            ## @nd_pfn_clear_memmap_errors
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	8(%rdi), %edi
	callq	_to_nd_region
	movq	%rax, %r12
	movq	24(%rbx), %r13
	xorl	%r14d, %r14d
	xorl	%edi, %edi
	callq	_ZERO_PAGE
	movl	%eax, %edi
	callq	_page_address
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	(%rbx), %rax
	movq	_PFN_MODE_PMEM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.1:
	movq	16(%rbx), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%r13, -104(%rbp)                ## 8-byte Spill
	movq	%r13, %rdi
	callq	_to_nd_namespace_io
	movq	%rax, %r13
	movq	_SZ_4K@GOTPCREL(%rip), %rax
	movslq	(%rax), %r15
	addq	$4, %r15
	shrq	$9, %r15
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_le64_to_cpu
	sarl	$9, %eax
	subl	%r15d, %eax
	leaq	8(%r12), %rdi
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movl	%r15d, %esi
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movl	%eax, %edx
	callq	_badblocks_check
	testl	%eax, %eax
	je	LBB0_8
## %bb.2:
	addq	$8, %rbx
	leaq	L_.str(%rip), %rsi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %ecx
	movq	%rbx, %rdi
	callq	_dev_dbg
	movq	(%r12), %rdi
	movl	-44(%rbp), %eax
	shll	$9, %eax
	cltq
	subq	(%r13), %rdi
	addq	%rax, %rdi
	movl	(%r15), %esi
	callq	_ALIGN_DOWN
	movq	%rax, %r13
	movl	-48(%rbp), %edi
	shll	$9, %edi
	movl	(%r15), %esi
	callq	_ALIGN
	movq	%rax, %r15
	movq	-104(%rbp), %rbx                ## 8-byte Reload
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	testq	%r15, %r15
	je	LBB0_3
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_min
	movq	%rax, %r12
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	-112(%rbp), %rdx                ## 8-byte Reload
	movq	%rax, %rcx
	xorl	%r8d, %r8d
	callq	_nvdimm_write_bytes
	subq	%r12, %r15
	addq	%r12, %r13
	testl	%eax, %eax
	je	LBB0_5
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	movl	-60(%rbp), %edx                 ## 4-byte Reload
	leaq	-44(%rbp), %rcx
	leaq	-48(%rbp), %r8
	callq	_badblocks_check
	xorl	%r14d, %r14d
	testl	%eax, %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	leaq	L_.str(%rip), %rsi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	jne	LBB0_4
	jmp	LBB0_8
LBB0_7:
	movl	%eax, %r14d
	movl	-48(%rbp), %edx
	movl	-44(%rbp), %ecx
	leaq	L_.str.1(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_dev_err
LBB0_8:
	movl	%r14d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PFN_MODE_PMEM,8,3              ## @PFN_MODE_PMEM
	.comm	_SZ_4K,4,2                      ## @SZ_4K
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"meta: %x badblocks at %llx\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"error clearing %x badblocks at %llx\n"

	.no_dead_strip	_nd_pfn_clear_memmap_errors
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nd_pfn_clear_memmap_errors
_nd_pfn_clear_memmap_errors:            ; @nd_pfn_clear_memmap_errors
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x23, x0
	mov	x19, x0
	ldr	w0, [x19, #8]!
	bl	_to_nd_region
	mov	x20, x0
	ldr	x21, [x23, #24]
	mov	w0, #0
	bl	_ZERO_PAGE
	bl	_page_address
	mov	w27, #0
	ldr	x8, [x23]
Lloh0:
	adrp	x9, _PFN_MODE_PMEM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PFN_MODE_PMEM@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.1:
	mov	x22, x0
	ldr	x23, [x23, #16]
	mov	x0, x21
	bl	_to_nd_namespace_io
	mov	x25, x0
Lloh3:
	adrp	x8, _SZ_4K@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SZ_4K@GOTPAGEOFF]
Lloh5:
	ldrsw	x8, [x8]
	add	x8, x8, #4
	lsr	x24, x8, #9
	ldr	w0, [x23]
	bl	_le64_to_cpu
	asr	w8, w0, #9
	sub	w2, w8, w24
	add	x0, x20, #8
	add	x3, sp, #24
	add	x4, sp, #28
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	mov	x1, x24
	str	w2, [sp, #20]                   ; 4-byte Folded Spill
	bl	_badblocks_check
	cbz	w0, LBB0_8
; %bb.2:
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
Lloh8:
	adrp	x26, _PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x26, [x26, _PAGE_SIZE@GOTPAGEOFF]
	str	x25, [sp]                       ; 8-byte Folded Spill
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
	ldp	w3, w2, [sp, #24]
	mov	x0, x19
	bl	_dev_dbg
	ldr	x8, [x20]
	ldr	w9, [sp, #24]
	lsl	w9, w9, #9
	ldr	x10, [x25]
	sub	x8, x8, x10
	add	x0, x8, w9, sxtw
	ldr	w1, [x26]
	bl	_ALIGN_DOWN
	mov	x28, x0
	ldr	w8, [sp, #28]
	lsl	w0, w8, #9
	ldr	w1, [x26]
	bl	_ALIGN
	mov	x23, x0
LBB0_4:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cbz	x23, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	ldr	w1, [x26]
	mov	x0, x23
	bl	_min
	mov	x25, x0
	mov	x0, x21
	mov	x1, x28
	mov	x2, x22
	mov	x3, x25
	mov	w4, #0
	bl	_nvdimm_write_bytes
	sub	x23, x23, x25
	add	x28, x25, x28
	cbz	w0, LBB0_4
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x3, sp, #24
	add	x4, sp, #28
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	x1, x24
	ldr	w2, [sp, #20]                   ; 4-byte Folded Reload
	bl	_badblocks_check
	mov	w27, #0
	ldr	x25, [sp]                       ; 8-byte Folded Reload
Lloh10:
	adrp	x1, l_.str@PAGE
Lloh11:
	add	x1, x1, l_.str@PAGEOFF
	cbnz	w0, LBB0_3
	b	LBB0_9
LBB0_7:
	mov	x27, x0
	ldp	w3, w2, [sp, #24]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_9
LBB0_8:
	mov	w27, #0
LBB0_9:
	mov	x0, x27
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_PFN_MODE_PMEM,8,3              ; @PFN_MODE_PMEM
	.comm	_SZ_4K,4,2                      ; @SZ_4K
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"meta: %x badblocks at %llx\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"error clearing %x badblocks at %llx\n"

	.no_dead_strip	_nd_pfn_clear_memmap_errors
.subsections_via_symbols
