	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mambodisk_detach
_mambodisk_detach:                      ## @mambodisk_detach
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_MBODISK_LOCK
	movl	$0, (%rbx)
	movq	%rbx, %rdi
	callq	_wakeup
	movq	%rbx, %rdi
	callq	_MBODISK_UNLOCK
	movq	%rbx, %rdi
	callq	_MBODISK_LOCK
	cmpl	$-1, (%rbx)
	je	LBB0_3
## %bb.1:
	movq	%rbx, %r14
	addq	$8, %r14
	movq	_PRIBIO@GOTPCREL(%rip), %r12
	leaq	L_.str(%rip), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_msleep
	cmpl	$-1, (%rbx)
	jne	LBB0_2
LBB0_3:
	movq	%rbx, %rdi
	callq	_MBODISK_UNLOCK
	movl	4(%rbx), %edi
	callq	_disk_destroy
	movq	%rbx, %rdi
	callq	_MBODISK_LOCK_DESTROY
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PRIBIO,4,2                     ## @PRIBIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"detach"

	.no_dead_strip	_mambodisk_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mambodisk_detach
_mambodisk_detach:                      ; @mambodisk_detach
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	bl	_device_get_softc
	mov	x19, x0
	bl	_MBODISK_LOCK
	str	wzr, [x19]
	mov	x0, x19
	bl	_wakeup
	mov	x0, x19
	bl	_MBODISK_UNLOCK
	mov	x0, x19
	bl	_MBODISK_LOCK
	ldr	w8, [x19]
	cmn	w8, #1
	b.eq	LBB0_3
; %bb.1:
	add	x20, x19, #8
Lloh0:
	adrp	x22, _PRIBIO@GOTPAGE
Lloh1:
	ldr	x22, [x22, _PRIBIO@GOTPAGEOFF]
Lloh2:
	adrp	x21, l_.str@PAGE
Lloh3:
	add	x21, x21, l_.str@PAGEOFF
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x22]
	mov	x0, x19
	mov	x1, x20
	mov	x3, x21
	mov	w4, #0
	bl	_msleep
	ldr	w8, [x19]
	cmn	w8, #1
	b.ne	LBB0_2
LBB0_3:
	mov	x0, x19
	bl	_MBODISK_UNLOCK
	ldr	w0, [x19, #4]
	bl	_disk_destroy
	mov	x0, x19
	bl	_MBODISK_LOCK_DESTROY
	mov	w0, #0
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_PRIBIO,4,2                     ; @PRIBIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"detach"

	.no_dead_strip	_mambodisk_detach
.subsections_via_symbols
