	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bsg_put_device
_bsg_put_device:                        ## @bsg_put_device
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %r14
	movq	_bsg_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_lock
	leaq	12(%rbx), %rdi
	callq	_atomic_dec_and_test
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	leaq	8(%rbx), %rdi
	callq	_hlist_del
	movq	_bsg_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movl	4(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_dprintk
	movq	_BSG_F_BLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_set_bit
	movq	%rbx, %rdi
	callq	_bsg_complete_all_commands
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_kfree
	movq	_bsg_kref_release_function@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_kref_put
	movq	%r14, %rdi
	callq	_blk_put_queue
	movl	%r15d, %eax
	jmp	LBB0_2
LBB0_1:
	movq	_bsg_mutex@GOTPCREL(%rip), %rdi
	callq	_mutex_unlock
	movq	_bsg_kref_release_function@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_kref_put
	xorl	%eax, %eax
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bsg_mutex,4,2                  ## @bsg_mutex
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: tearing down\n"

	.comm	_BSG_F_BLOCK,4,2                ## @BSG_F_BLOCK
	.comm	_bsg_kref_release_function,4,2  ## @bsg_kref_release_function
	.no_dead_strip	_bsg_put_device
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bsg_put_device
_bsg_put_device:                        ; @bsg_put_device
	.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
	mov	x20, x0
	ldr	x19, [x0, #16]
Lloh0:
	adrp	x0, _bsg_mutex@GOTPAGE
Lloh1:
	ldr	x0, [x0, _bsg_mutex@GOTPAGEOFF]
	bl	_mutex_lock
	add	x0, x20, #12
	bl	_atomic_dec_and_test
	cbz	w0, LBB0_2
; %bb.1:
	add	x0, x20, #8
	bl	_hlist_del
Lloh2:
	adrp	x0, _bsg_mutex@GOTPAGE
Lloh3:
	ldr	x0, [x0, _bsg_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
	ldr	w1, [x20, #4]
Lloh4:
	adrp	x0, l_.str@PAGE
Lloh5:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
Lloh6:
	adrp	x8, _BSG_F_BLOCK@GOTPAGE
Lloh7:
	ldr	x8, [x8, _BSG_F_BLOCK@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
	mov	x0, x20
	bl	_bsg_complete_all_commands
	mov	x21, x0
	mov	x0, x20
	bl	_kfree
Lloh9:
	adrp	x8, _bsg_kref_release_function@GOTPAGE
Lloh10:
	ldr	x8, [x8, _bsg_kref_release_function@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_kref_put
	mov	x0, x19
	bl	_blk_put_queue
	mov	x0, x21
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x0, _bsg_mutex@GOTPAGE
Lloh13:
	ldr	x0, [x0, _bsg_mutex@GOTPAGEOFF]
	bl	_mutex_unlock
Lloh14:
	adrp	x8, _bsg_kref_release_function@GOTPAGE
Lloh15:
	ldr	x8, [x8, _bsg_kref_release_function@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_kref_put
	mov	w0, #0
LBB0_3:
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_bsg_mutex,4,2                  ; @bsg_mutex
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: tearing down\n"

	.comm	_BSG_F_BLOCK,4,2                ; @BSG_F_BLOCK
	.comm	_bsg_kref_release_function,4,2  ; @bsg_kref_release_function
	.no_dead_strip	_bsg_put_device
.subsections_via_symbols
