	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cosm_driver_remove
_cosm_driver_remove:                    ## @cosm_driver_remove
	.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, %rbx
	callq	_cosm_delete_debug_dir
	movl	24(%rbx), %edi
	callq	_sysfs_put
	movq	_g_cosm_class@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	20(%rbx), %esi
	xorl	%edi, %edi
	callq	_MKDEV
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_device_destroy
	leaq	16(%rbx), %rdi
	callq	_flush_work
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_cosm_stop
	movq	_g_num_dev@GOTPCREL(%rip), %rdi
	callq	_atomic_dec_and_test
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_cosm_scif_exit
LBB0_2:
	movl	12(%rbx), %edi
	callq	_kfree
	movl	8(%rbx), %edi
	callq	_kfree
	movl	4(%rbx), %edi
	callq	_kfree
	movl	(%rbx), %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_g_cosm_class,4,2               ## @g_cosm_class
	.comm	_g_num_dev,4,2                  ## @g_num_dev
	.no_dead_strip	_cosm_driver_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cosm_driver_remove
_cosm_driver_remove:                    ; @cosm_driver_remove
	.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
	bl	_cosm_delete_debug_dir
	ldr	w0, [x19, #24]
	bl	_sysfs_put
Lloh0:
	adrp	x8, _g_cosm_class@GOTPAGE
Lloh1:
	ldr	x8, [x8, _g_cosm_class@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
	ldr	w1, [x19, #20]
	mov	w0, #0
	bl	_MKDEV
	mov	x1, x0
	mov	x0, x20
	bl	_device_destroy
	add	x0, x19, #16
	bl	_flush_work
	mov	x0, x19
	mov	w1, #0
	bl	_cosm_stop
Lloh3:
	adrp	x0, _g_num_dev@GOTPAGE
Lloh4:
	ldr	x0, [x0, _g_num_dev@GOTPAGEOFF]
	bl	_atomic_dec_and_test
	cbz	x0, LBB0_2
; %bb.1:
	bl	_cosm_scif_exit
LBB0_2:
	ldr	w0, [x19, #12]
	bl	_kfree
	ldr	w0, [x19, #8]
	bl	_kfree
	ldr	w0, [x19, #4]
	bl	_kfree
	ldr	w0, [x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_kfree
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_g_cosm_class,4,2               ; @g_cosm_class
	.comm	_g_num_dev,4,2                  ; @g_num_dev
	.no_dead_strip	_cosm_driver_remove
.subsections_via_symbols
