	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_cached_dev_detach          ## -- Begin function bch_cached_dev_detach
	.p2align	4, 0x90
_bch_cached_dev_detach:                 ## @bch_cached_dev_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	_bch_register_lock@GOTPCREL(%rip), %rdi
	callq	_lockdep_assert_held
	movq	_BCACHE_DEV_CLOSING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	4(%r14), %rbx
	movq	%rbx, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	movq	_BCACHE_DEV_DETACHING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_test_and_set_bit
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_3:
	movq	%r14, %rdi
	callq	_closure_get
	movq	%r14, %rdi
	callq	_bch_writeback_queue
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_cached_dev_put                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_bch_register_lock,4,2          ## @bch_register_lock
	.comm	_BCACHE_DEV_CLOSING,4,2         ## @BCACHE_DEV_CLOSING
	.comm	_BCACHE_DEV_DETACHING,4,2       ## @BCACHE_DEV_DETACHING
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bch_cached_dev_detach          ; -- Begin function bch_cached_dev_detach
	.p2align	2
_bch_cached_dev_detach:                 ; @bch_cached_dev_detach
	.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	x19, x0
Lloh0:
	adrp	x0, _bch_register_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _bch_register_lock@GOTPAGEOFF]
	bl	_lockdep_assert_held
Lloh2:
	adrp	x8, _BCACHE_DEV_CLOSING@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BCACHE_DEV_CLOSING@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	add	x20, x19, #4
	mov	x1, x20
	bl	_test_bit
	cbnz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _BCACHE_DEV_DETACHING@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BCACHE_DEV_DETACHING@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_and_set_bit
	cbz	x0, LBB0_3
LBB0_2:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_3:
	mov	x0, x19
	bl	_closure_get
	mov	x0, x19
	bl	_bch_writeback_queue
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_cached_dev_put
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_bch_register_lock,4,2          ; @bch_register_lock
	.comm	_BCACHE_DEV_CLOSING,4,2         ; @BCACHE_DEV_CLOSING
	.comm	_BCACHE_DEV_DETACHING,4,2       ; @BCACHE_DEV_DETACHING
.subsections_via_symbols
