	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nd_bus_remove
_nd_bus_remove:                         ## @nd_bus_remove
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	callq	_to_nvdimm_bus
	movq	%rax, %rbx
	movq	_nvdimm_bus_list_mutex@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	leaq	20(%rbx), %rdi
	callq	_list_del_init
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	16(%rbx), %r14d
	leaq	12(%rbx), %rdi
	callq	_atomic_read
	xorl	%esi, %esi
	testq	%rax, %rax
	sete	%sil
	movl	%r14d, %edi
	callq	_wait_event
	xorl	%eax, %eax
	callq	_nd_synchronize
	leaq	8(%rbx), %rdi
	movq	_child_unregister@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_device_for_each_child
	movq	%rbx, %rdi
	callq	_spin_lock
	leaq	4(%rbx), %rdi
	callq	_free_badrange_list
	movq	%rbx, %rdi
	callq	_spin_unlock
	movq	%rbx, %rdi
	callq	_nvdimm_bus_destroy_ndctl
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_nvdimm_bus_list_mutex,4,2      ## @nvdimm_bus_list_mutex
	.comm	_child_unregister,4,2           ## @child_unregister
	.no_dead_strip	_nd_bus_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nd_bus_remove
_nd_bus_remove:                         ; @nd_bus_remove
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_to_nvdimm_bus
	mov	x19, x0
Lloh0:
	adrp	x20, _nvdimm_bus_list_mutex@GOTPAGE
Lloh1:
	ldr	x20, [x20, _nvdimm_bus_list_mutex@GOTPAGEOFF]
	mov	x0, x20
	bl	_mutex_lock
	add	x0, x19, #20
	bl	_list_del_init
	mov	x0, x20
	bl	_mutex_unlock
	ldr	w20, [x19, #16]
	add	x0, x19, #12
	bl	_atomic_read
	cmp	x0, #0
	cset	w1, eq
	mov	x0, x20
	bl	_wait_event
	bl	_nd_synchronize
	add	x0, x19, #8
Lloh2:
	adrp	x8, _child_unregister@GOTPAGE
Lloh3:
	ldr	x8, [x8, _child_unregister@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x1, #0
	bl	_device_for_each_child
	mov	x0, x19
	bl	_spin_lock
	add	x0, x19, #4
	bl	_free_badrange_list
	mov	x0, x19
	bl	_spin_unlock
	mov	x0, x19
	bl	_nvdimm_bus_destroy_ndctl
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_nvdimm_bus_list_mutex,4,2      ; @nvdimm_bus_list_mutex
	.comm	_child_unregister,4,2           ; @child_unregister
	.no_dead_strip	_nd_bus_remove
.subsections_via_symbols
