	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nvmet_p2pmem_ns_add_p2p
_nvmet_p2pmem_ns_add_p2p:               ## @nvmet_p2pmem_ns_add_p2p
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	8(%rdi), %rsi
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.1:
	cmpl	$0, 16(%r14)
	je	LBB0_10
## %bb.2:
	movq	%rdi, %rbx
	movq	8(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.3:
	movl	$1, %edx
	callq	_pci_p2pdma_distance
	testl	%eax, %eax
	js	LBB0_10
## %bb.4:
	movq	8(%r14), %rdi
	callq	_pci_dev_get
	movq	%rax, %r15
	jmp	LBB0_5
LBB0_8:
	movq	%rsi, -48(%rbp)
	movq	%r14, %rdi
	callq	_nvmet_ns_dev
	movq	%rax, -40(%rbp)
	leaq	-48(%rbp), %r15
	movq	%r15, %rdi
	callq	_ARRAY_SIZE
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_pci_p2pmem_find_many
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_9
LBB0_5:
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	callq	_radix_tree_insert
	testl	%eax, %eax
	jns	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	_pci_dev_put
LBB0_7:
	movq	%r15, %rdi
	callq	_pci_name
	movl	(%r14), %edx
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_info
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	8(%rbx), %rdi
	callq	_dev_name
	movl	4(%r14), %edx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_err
	jmp	LBB0_10
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no peer-to-peer memory is available that's supported by %s and %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"using p2pmem on %s for nsid %d\n"

	.no_dead_strip	_nvmet_p2pmem_ns_add_p2p
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nvmet_p2pmem_ns_add_p2p
_nvmet_p2pmem_ns_add_p2p:               ; @nvmet_p2pmem_ns_add_p2p
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	x1, [x0, #8]
	cbz	x1, LBB0_9
; %bb.1:
	ldr	w8, [x19, #16]
	cbz	w8, LBB0_9
; %bb.2:
	mov	x20, x0
	ldr	x0, [x19, #8]
	cbz	x0, LBB0_5
; %bb.3:
	mov	w2, #1
	bl	_pci_p2pdma_distance
	tbnz	w0, #31, LBB0_9
; %bb.4:
	ldr	x0, [x19, #8]
	bl	_pci_dev_get
	mov	x21, x0
	b	LBB0_6
LBB0_5:
	str	x1, [sp, #8]
	mov	x0, x19
	bl	_nvmet_ns_dev
	str	x0, [sp, #16]
	add	x0, sp, #8
	bl	_ARRAY_SIZE
	mov	x1, x0
	add	x0, sp, #8
	bl	_pci_p2pmem_find_many
	mov	x21, x0
	cbz	x0, LBB0_11
LBB0_6:
	ldr	w1, [x19]
	mov	x0, x20
	mov	x2, x21
	bl	_radix_tree_insert
	tbz	w0, #31, LBB0_8
; %bb.7:
	mov	x0, x21
	bl	_pci_dev_put
LBB0_8:
	mov	x0, x21
	bl	_pci_name
	mov	x1, x0
	ldr	w2, [x19]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_info
LBB0_9:
	ldr	x8, [sp, #24]
Lloh5:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh6:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.10:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_11:
	ldr	x0, [x20, #8]
	bl	_dev_name
	mov	x1, x0
	ldr	w2, [x19, #4]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	b	LBB0_9
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no peer-to-peer memory is available that's supported by %s and %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"using p2pmem on %s for nsid %d\n"

	.no_dead_strip	_nvmet_p2pmem_ns_add_p2p
.subsections_via_symbols
