	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bsg_unregister_queue           ## -- Begin function bsg_unregister_queue
	.p2align	4, 0x90
_bsg_unregister_queue:                  ## @bsg_unregister_queue
	.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
	cmpq	$0, 16(%rdi)
	je	LBB0_1
## %bb.2:
	movq	%rdi, %rbx
	movq	_bsg_mutex@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	leaq	8(%rbx), %r15
	movl	24(%rbx), %esi
	movq	_bsg_minor_idr@GOTPCREL(%rip), %rdi
	callq	_idr_remove
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_sysfs_remove_link
	movq	16(%rbx), %rdi
	callq	_device_unregister
	movq	$0, 16(%rbx)
	movq	_bsg_kref_release_function@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_kref_put
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_1:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bsg_mutex,4,2                  ## @bsg_mutex
	.comm	_bsg_minor_idr,4,2              ## @bsg_minor_idr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bsg"

	.comm	_bsg_kref_release_function,4,2  ## @bsg_kref_release_function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bsg_unregister_queue           ; -- Begin function bsg_unregister_queue
	.p2align	2
_bsg_unregister_queue:                  ; @bsg_unregister_queue
	.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
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x20, _bsg_mutex@GOTPAGE
Lloh1:
	ldr	x20, [x20, _bsg_mutex@GOTPAGEOFF]
	mov	x0, x20
	bl	_mutex_lock
	add	x21, x19, #8
	ldr	w1, [x19, #24]
Lloh2:
	adrp	x0, _bsg_minor_idr@GOTPAGE
Lloh3:
	ldr	x0, [x0, _bsg_minor_idr@GOTPAGEOFF]
	bl	_idr_remove
Lloh4:
	adrp	x1, l_.str@PAGE
Lloh5:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_sysfs_remove_link
	ldr	x0, [x19, #16]
	bl	_device_unregister
	str	xzr, [x19, #16]
Lloh6:
	adrp	x8, _bsg_kref_release_function@GOTPAGE
Lloh7:
	ldr	x8, [x8, _bsg_kref_release_function@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_kref_put
	mov	x0, x20
	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
	b	_mutex_unlock
LBB0_2:
	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 AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_bsg_mutex,4,2                  ; @bsg_mutex
	.comm	_bsg_minor_idr,4,2              ; @bsg_minor_idr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bsg"

	.comm	_bsg_kref_release_function,4,2  ; @bsg_kref_release_function
.subsections_via_symbols
