	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mode_store
_mode_store:                            ## @mode_store
	.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	%rcx, %r14
	movq	%rdx, %r15
	movq	%rdi, %r13
	callq	_to_nd_pfn_safe
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_nd_device_lock
	movq	%r13, %rdi
	callq	_nvdimm_bus_lock
	cmpq	$0, (%r13)
	je	LBB0_2
## %bb.1:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	-1(%r14), %r12
	jmp	LBB0_13
LBB0_2:
	leaq	-1(%r14), %r12
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_4
## %bb.6:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	leaq	L_.str.5(%rip), %rsi
	movq	%r15, %rdi
	movq	%r12, %rdx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_4:
	movq	_PFN_MODE_PMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_8:
	movq	_PFN_MODE_RAM@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_11:
	movq	_PFN_MODE_NONE@GOTPCREL(%rip), %rax
LBB0_5:
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	xorl	%ebx, %ebx
LBB0_13:
	cmpb	$10, (%r15,%r12)
	leaq	L_.str.7(%rip), %rax
	leaq	L_.str.8(%rip), %r8
	cmoveq	%rax, %r8
	leaq	L_.str.6(%rip), %rsi
	movq	%r13, %rdi
	movl	%ebx, %edx
	movq	%r15, %rcx
	callq	_dev_dbg
	movq	%r13, %rdi
	callq	_nvdimm_bus_unlock
	movq	%r13, %rdi
	callq	_nd_device_unlock
	testl	%ebx, %ebx
	cmovnel	%ebx, %r14d
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pmem\n"

L_.str.1:                               ## @.str.1
	.asciz	"pmem"

	.comm	_PFN_MODE_PMEM,4,2              ## @PFN_MODE_PMEM
L_.str.2:                               ## @.str.2
	.asciz	"ram\n"

L_.str.3:                               ## @.str.3
	.asciz	"ram"

	.comm	_PFN_MODE_RAM,4,2               ## @PFN_MODE_RAM
L_.str.4:                               ## @.str.4
	.asciz	"none\n"

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

	.comm	_PFN_MODE_NONE,4,2              ## @PFN_MODE_NONE
	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.6:                               ## @.str.6
	.asciz	"result: %zd wrote: %s%s"

L_.str.7:                               ## @.str.7
	.space	1

L_.str.8:                               ## @.str.8
	.asciz	"\n"

	.no_dead_strip	_mode_store
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mode_store
_mode_store:                            ; @mode_store
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x3
	mov	x21, x2
	mov	x20, x0
	bl	_to_nd_pfn_safe
	mov	x23, x0
	mov	x0, x20
	bl	_nd_device_lock
	mov	x0, x20
	bl	_nvdimm_bus_lock
	ldr	x8, [x20]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w24, w8
	sub	x22, x19, #1
	b	LBB0_13
LBB0_2:
	sub	x22, x19, #1
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_strncmp
	cbz	x0, LBB0_9
; %bb.3:
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_strncmp
	cbz	x0, LBB0_9
; %bb.4:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_strncmp
	cbz	x0, LBB0_10
; %bb.5:
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_strncmp
	cbz	x0, LBB0_10
; %bb.6:
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_strncmp
	cbz	x0, LBB0_11
; %bb.7:
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	mov	x2, x22
	bl	_strncmp
	cbz	x0, LBB0_11
; %bb.8:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_13
LBB0_9:
	mov	w24, #0
Lloh18:
	adrp	x8, _PFN_MODE_PMEM@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PFN_MODE_PMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
	mov	w24, #0
Lloh20:
	adrp	x8, _PFN_MODE_RAM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PFN_MODE_RAM@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
	mov	w24, #0
Lloh22:
	adrp	x8, _PFN_MODE_NONE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _PFN_MODE_NONE@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	str	w8, [x23]
LBB0_13:
	ldrb	w8, [x21, x22]
Lloh24:
	adrp	x9, l_.str.8@PAGE
Lloh25:
	add	x9, x9, l_.str.8@PAGEOFF
Lloh26:
	adrp	x10, l_.str.7@PAGE
Lloh27:
	add	x10, x10, l_.str.7@PAGEOFF
	cmp	w8, #10
	csel	x4, x10, x9, eq
Lloh28:
	adrp	x1, l_.str.6@PAGE
Lloh29:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x20
	mov	x2, x24
	mov	x3, x21
	bl	_dev_dbg
	mov	x0, x20
	bl	_nvdimm_bus_unlock
	mov	x0, x20
	bl	_nd_device_unlock
	cmp	w24, #0
	csel	w0, w19, w24, eq
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pmem\n"

l_.str.1:                               ; @.str.1
	.asciz	"pmem"

	.comm	_PFN_MODE_PMEM,4,2              ; @PFN_MODE_PMEM
l_.str.2:                               ; @.str.2
	.asciz	"ram\n"

l_.str.3:                               ; @.str.3
	.asciz	"ram"

	.comm	_PFN_MODE_RAM,4,2               ; @PFN_MODE_RAM
l_.str.4:                               ; @.str.4
	.asciz	"none\n"

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

	.comm	_PFN_MODE_NONE,4,2              ; @PFN_MODE_NONE
	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.6:                               ; @.str.6
	.asciz	"result: %zd wrote: %s%s"

l_.str.7:                               ; @.str.7
	.space	1

l_.str.8:                               ; @.str.8
	.asciz	"\n"

	.no_dead_strip	_mode_store
.subsections_via_symbols
