	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fv_detach
_fv_detach:                             ## @fv_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
	movl	%edi, %r12d
	callq	_device_get_softc
	movq	%rax, %rbx
	movq	56(%rax), %r15
	leaq	4(%rax), %r14
	movq	%r14, %rdi
	callq	_mtx_initialized
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edi
	callq	_KASSERT
	movl	%r12d, %edi
	callq	_device_is_attached
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_FV_LOCK
	movl	$1, (%rbx)
	movq	%rbx, %rdi
	callq	_fv_stop
	movq	%rbx, %rdi
	callq	_FV_UNLOCK
	movq	_taskqueue_swi@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	addq	$48, %rsi
	callq	_taskqueue_drain
	movq	%r15, %rdi
	callq	_ether_ifdetach
LBB0_2:
	movl	%r12d, %edi
	callq	_bus_generic_detach
	movq	32(%rbx), %rdx
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.3:
	movq	24(%rbx), %rsi
	movl	%r12d, %edi
	callq	_bus_teardown_intr
LBB0_4:
	movq	24(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_6
## %bb.5:
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r12d, %edi
	xorl	%edx, %edx
	callq	_bus_release_resource
LBB0_6:
	movq	8(%rbx), %rcx
	testq	%rcx, %rcx
	je	LBB0_8
## %bb.7:
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%rbx), %edx
	movl	%r12d, %edi
	callq	_bus_release_resource
LBB0_8:
	testq	%r15, %r15
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	callq	_if_free
LBB0_10:
	movq	%rbx, %rdi
	callq	_fv_dma_free
	movq	%r14, %rdi
	callq	_mtx_destroy
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"vr mutex not initialized"

	.comm	_taskqueue_swi,4,2              ## @taskqueue_swi
	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.no_dead_strip	_fv_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fv_detach
_fv_detach:                             ; @fv_detach
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x0
	bl	_device_get_softc
	mov	x20, x0
	ldr	x21, [x0, #56]
	add	x19, x0, #4
	mov	x0, x19
	bl	_mtx_initialized
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_KASSERT
	mov	x0, x22
	bl	_device_is_attached
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_FV_LOCK
	mov	w8, #1
	mov	x23, x20
	str	w8, [x23], #48
	mov	x0, x20
	bl	_fv_stop
	mov	x0, x20
	bl	_FV_UNLOCK
Lloh2:
	adrp	x8, _taskqueue_swi@GOTPAGE
Lloh3:
	ldr	x8, [x8, _taskqueue_swi@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_taskqueue_drain
	mov	x0, x21
	bl	_ether_ifdetach
LBB0_2:
	mov	x0, x22
	bl	_bus_generic_detach
	ldr	x2, [x20, #32]
	cbz	x2, LBB0_4
; %bb.3:
	ldr	x1, [x20, #24]
	mov	x0, x22
	bl	_bus_teardown_intr
LBB0_4:
	ldr	x3, [x20, #24]
	cbz	x3, LBB0_6
; %bb.5:
Lloh5:
	adrp	x8, _SYS_RES_IRQ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SYS_RES_IRQ@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x22
	mov	w2, #0
	bl	_bus_release_resource
LBB0_6:
	ldr	x3, [x20, #8]
	cbz	x3, LBB0_8
; %bb.7:
Lloh8:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldr	w2, [x20, #16]
	mov	x0, x22
	bl	_bus_release_resource
LBB0_8:
	cbz	x21, LBB0_10
; %bb.9:
	mov	x0, x21
	bl	_if_free
LBB0_10:
	mov	x0, x20
	bl	_fv_dma_free
	mov	x0, x19
	bl	_mtx_destroy
	mov	w0, #0
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"vr mutex not initialized"

	.comm	_taskqueue_swi,4,2              ; @taskqueue_swi
	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.no_dead_strip	_fv_detach
.subsections_via_symbols
