	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nd_detach_and_reset
_nd_detach_and_reset:                   ## @nd_detach_and_reset
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r14
	callq	___nd_detach_ndns
	movq	(%rbx), %rsi
	movq	%r14, %rdi
	callq	_is_idle
	testq	%rax, %rax
	je	LBB0_1
## %bb.7:
	movq	_ND_ASYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_nd_device_unregister           ## TAILCALL
LBB0_1:
	movq	%r14, %rdi
	callq	_is_nd_btt
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_to_nd_btt
	movq	%rax, %rbx
	movq	$0, 8(%rax)
	movq	(%rax), %rdi
	callq	_kfree
	movq	$0, (%rbx)
	jmp	LBB0_6
LBB0_3:
	movq	%r14, %rdi
	callq	_is_nd_pfn
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	callq	_is_nd_dax
	testq	%rax, %rax
	je	LBB0_6
LBB0_5:
	movq	%r14, %rdi
	callq	_to_nd_pfn_safe
	movq	%rax, %rbx
	movq	8(%rax), %rdi
	callq	_kfree
	movq	$0, 8(%rbx)
	movq	_PFN_MODE_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
LBB0_6:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ND_ASYNC,4,2                   ## @ND_ASYNC
	.comm	_PFN_MODE_NONE,4,2              ## @PFN_MODE_NONE
	.no_dead_strip	_nd_detach_and_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nd_detach_and_reset
_nd_detach_and_reset:                   ; @nd_detach_and_reset
	.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
	mov	x20, x1
	mov	x19, x0
	bl	___nd_detach_ndns
	ldr	x1, [x20]
	mov	x0, x19
	bl	_is_idle
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ND_ASYNC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ND_ASYNC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_nd_device_unregister
LBB0_2:
	mov	x0, x19
	bl	_is_nd_btt
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_to_nd_btt
	mov	x19, x0
	str	xzr, [x0, #8]
	ldr	x0, [x0]
	bl	_kfree
	str	xzr, [x19]
	b	LBB0_7
LBB0_4:
	mov	x0, x19
	bl	_is_nd_pfn
	cbnz	x0, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_is_nd_dax
	cbz	x0, LBB0_7
LBB0_6:
	mov	x0, x19
	bl	_to_nd_pfn_safe
	mov	x19, x0
	ldr	x0, [x0, #8]
	bl	_kfree
	str	xzr, [x19, #8]
Lloh3:
	adrp	x8, _PFN_MODE_NONE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PFN_MODE_NONE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ND_ASYNC,4,2                   ; @ND_ASYNC
	.comm	_PFN_MODE_NONE,4,2              ; @PFN_MODE_NONE
	.no_dead_strip	_nd_detach_and_reset
.subsections_via_symbols
