	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scif_peer_add_device
_scif_peer_add_device:                  ## @scif_peer_add_device
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movl	(%rdi), %edi
	callq	_rcu_dereference
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_device_add
	movl	%eax, %r14d
	movq	%r15, %rdi
	callq	_put_device
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.1:
	movq	8(%rbx), %rdi
	movl	4(%rbx), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
LBB0_4:
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_RCU_INIT_POINTER
	xorl	%eax, %eax
	callq	_synchronize_rcu
	movq	%r15, %rdi
	callq	_put_device
	movq	_scif_info@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	decl	4(%rbx)
	movq	%rbx, %rdi
	callq	_mutex_unlock
	jmp	LBB0_5
LBB0_2:
	movl	4(%r15), %ecx
	leaq	L_.str.1(%rip), %rdx
	leaq	-64(%rbp), %r12
	movq	%r12, %rdi
	movl	$16, %esi
	callq	_scnprintf
	movq	8(%rbx), %rsi
	xorl	%r14d, %r14d
	movq	%r12, %rdi
	movl	$4, %edx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_dmam_pool_create
	movl	%eax, 16(%rbx)
	testl	%eax, %eax
	je	LBB0_3
## %bb.7:
	movl	4(%r15), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_dbg
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_8
## %bb.6:
	movl	%r14d, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	8(%rbx), %rdi
	movl	4(%rbx), %edx
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movq	%r15, %rdi
	callq	_device_del
	jmp	LBB0_4
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"dnode %d: peer device_add failed\n"

L_.str.1:                               ## @.str.1
	.asciz	"scif-%d"

L_.str.2:                               ## @.str.2
	.asciz	"dnode %d: dmam_pool_create failed\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.3:                               ## @.str.3
	.asciz	"Added peer dnode %d\n"

	.comm	_scif_info,8,2                  ## @scif_info
	.no_dead_strip	_scif_peer_add_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scif_peer_add_device
_scif_peer_add_device:                  ; @scif_peer_add_device
	.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	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	ldr	w0, [x0]
	bl	_rcu_dereference
	mov	x19, x0
	bl	_device_add
	mov	x21, x0
	mov	x0, x19
	bl	_put_device
	cbz	w21, LBB0_3
; %bb.1:
	ldr	x0, [x20, #8]
	ldr	w2, [x20, #4]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_2:
	ldr	w0, [x20]
	mov	x1, #0
	bl	_RCU_INIT_POINTER
	bl	_synchronize_rcu
	mov	x0, x19
	bl	_put_device
Lloh5:
	adrp	x19, _scif_info@GOTPAGE
Lloh6:
	ldr	x19, [x19, _scif_info@GOTPAGEOFF]
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x19, #4]
	sub	w8, w8, #1
	str	w8, [x19, #4]
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_5
LBB0_3:
	ldr	w3, [x19, #4]
Lloh7:
	adrp	x2, l_.str.1@PAGE
Lloh8:
	add	x2, x2, l_.str.1@PAGEOFF
	add	x0, sp, #8
	mov	w1, #16
	bl	_scnprintf
	ldr	x1, [x20, #8]
	add	x0, sp, #8
	mov	w2, #4
	mov	w3, #1
	mov	w4, #0
	bl	_dmam_pool_create
	str	w0, [x20, #16]
	cbz	w0, LBB0_7
; %bb.4:
	ldr	w2, [x19, #4]
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
	mov	w21, #0
LBB0_5:
	ldr	x8, [sp, #24]
Lloh11:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh12:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.6:
	mov	x0, x21
	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_7:
	ldr	x0, [x20, #8]
	ldr	w2, [x20, #4]
Lloh14:
	adrp	x1, l_.str.2@PAGE
Lloh15:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w21, w8
	mov	x0, x19
	bl	_device_del
	b	LBB0_2
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"dnode %d: peer device_add failed\n"

l_.str.1:                               ; @.str.1
	.asciz	"scif-%d"

l_.str.2:                               ; @.str.2
	.asciz	"dnode %d: dmam_pool_create failed\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.3:                               ; @.str.3
	.asciz	"Added peer dnode %d\n"

	.comm	_scif_info,8,2                  ; @scif_info
	.no_dead_strip	_scif_peer_add_device
.subsections_via_symbols
